From ba98c4d859a1644fc6b7c8788feb0e09792b6f7a Mon Sep 17 00:00:00 2001 From: VividTruthKeeper Date: Sat, 10 Sep 2022 16:36:10 +0500 Subject: [PATCH] build --- dist/assets/{index.7209a6f1.js => index.dbcaa95c.js} | 2 +- dist/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename dist/assets/{index.7209a6f1.js => index.dbcaa95c.js} (88%) diff --git a/dist/assets/index.7209a6f1.js b/dist/assets/index.dbcaa95c.js similarity index 88% rename from dist/assets/index.7209a6f1.js rename to dist/assets/index.dbcaa95c.js index fb9a39e..9630c26 100644 --- a/dist/assets/index.7209a6f1.js +++ b/dist/assets/index.dbcaa95c.js @@ -55,5 +55,5 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Sm=R.exports,_m=Symbol.for("react.element"),km=Symbol.for("react.fragment"),Em=Object.prototype.hasOwnProperty,xm=Sm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Cm={key:!0,ref:!0,__self:!0,__source:!0};function nd(e,t,n){var r,l={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Em.call(t,r)&&!Cm.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:_m,type:e,key:i,ref:o,props:l,_owner:xm.current}}Zl.Fragment=km;Zl.jsx=nd;Zl.jsxs=nd;(function(e){e.exports=Zl})(Ku);const v=Ku.exports.jsx,L=Ku.exports.jsxs,Nm=()=>{const[e,t]=R.exports.useState({username:"",password:"",remember:!1,check:!1,valid:!1}),{user:n,setUser:r}=R.exports.useContext(zn),l=eu();return R.exports.useEffect(()=>{e.username===ma.username&&e.password===ma.password?t({...e,valid:!0}):t({...e,valid:!1})},[e.username,e.password]),R.exports.useEffect(()=>{n.username&&l("/dashboard")},[n]),v("main",{className:"login",children:v("div",{className:"container",children:v("div",{className:"login inner",children:L("div",{className:"login__wrapper",children:[v("h1",{className:"login__header",children:"Login"}),L("form",{className:"login__form",onSubmit:i=>{i.preventDefault()},children:[L("div",{className:"login__form__block",children:[v("label",{htmlFor:"username",children:"Username"}),v("input",{required:!0,autoComplete:"true",type:"text",id:"username",placeholder:"username",onChange:i=>{t({...e,username:i.target.value})}})]}),L("div",{className:"login__form__block",children:[v("label",{htmlFor:"password",children:"Password"}),v("input",{required:!0,autoComplete:"true",type:"password",id:"password",placeholder:"password",onChange:i=>{t({...e,password:i.target.value})}})]}),v("div",{className:"login__form__block--check",children:L("label",{children:[v("input",{type:"checkbox",name:"remember",id:"remember",onChange:i=>{t({...e,remember:i.target.checked})}}),v("span",{children:"Remember me"})]})}),v("span",{className:e.check&&!e.valid?"login__form__error active":"login__form__error",children:"Invalid credentials"}),v("button",{className:"login__form__button login__form__button--violet",onClick:()=>{if(t({...e,check:!0}),e.valid&&r({username:e.username,accessLevel:"admin"}),e.remember){const i={username:e.username,accessLevel:"admin"};localStorage.setItem("userData",JSON.stringify(i))}},children:"Login"})]})]})})})})};var rd={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},va=al.createContext&&al.createContext(rd),Ct=globalThis&&globalThis.__assign||function(){return Ct=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{user:n,setUser:r}=R.exports.useContext(zn),[l,i]=R.exports.useState(!1);return v("nav",{className:"nav",children:v("div",{className:"container",children:L("div",{className:"nav inner",children:[L("div",{className:"nav__left",children:[v(nr,{to:"/dashboard",className:"nav__img",children:v(Lm,{})}),v(Tm,{type:"button",className:"nav__btn",onClick:()=>t(!e)})]}),v("div",{className:"nav__right",children:L("div",{className:"nav__right__user",onClick:()=>{i(!l)},children:[v(Mm,{className:"nav__right__user__img"}),v("span",{children:"Profile"}),v("div",{className:l?"nav__dropdown active":"nav__dropdown",children:L("ul",{className:"nav__dropdown__wrapper",children:[L("li",{children:[v("h2",{children:"Username:"}),v("p",{children:n.username})]}),L("li",{children:[v("h2",{children:"Access:"}),v("p",{children:n.accessLevel})]}),v("li",{children:v("button",{type:"button",onClick:()=>{localStorage.removeItem("userData"),r({username:"",accessLevel:""})},children:"Log out"})})]})})]})})]})})})};function id(e){return Qe({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zm-5-.5H7a.5.5 0 0 1 0 1H4.5a.5.5 0 0 1 0-1zm0 3h7a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-7a.5.5 0 0 1 .5-.5z"}}]})(e)}function Am(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01.1-.7.3-1.37.59-1.98-.22-.02-.44-.03-.67-.03-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zM10 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zM20.75 16c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}}]})(e)}function od(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M3 9C2.44772 9 2 9.44772 2 10C2 10.5523 2.44772 11 3 11H21C21.5523 11 22 10.5523 22 10C22 9.44772 21.5523 9 21 9H3Z",fill:"currentColor"}},{tag:"path",attr:{d:"M3 13C2.44772 13 2 13.4477 2 14C2 14.5523 2.44772 15 3 15H15C15.5523 15 16 14.5523 16 14C16 13.4477 15.5523 13 15 13H3Z",fill:"currentColor"}}]})(e)}function Qo(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m13 3 3.293 3.293-7 7 1.414 1.414 7-7L21 11V3z"}},{tag:"path",attr:{d:"M19 19H5V5h7l-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5l-2-2v7z"}}]})(e)}function Fm(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 13v-2H7V8l-5 4 5 4v-3z"}},{tag:"path",attr:{d:"M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z"}}]})(e)}const jm=({aside:e,setAside:t})=>{const{setUser:n}=R.exports.useContext(zn);return v("aside",{className:e?"aside active":"aside",children:L("ul",{className:"aside__list",children:[L("li",{className:"aside__list__element aside__list__element--title",children:[v(zm,{className:"aside__img"}),v("h2",{children:"Elements"})]}),v("li",{className:"aside__list__element",children:L(nr,{to:"/posts",children:[v(id,{className:"aside__list__element__img"}),v("span",{children:"Posts"})]})}),L("li",{className:"aside__list__element aside__list__element--title",children:[v(Am,{className:"aside__img"}),v("h2",{children:"Account"})]}),v("li",{className:"aside__list__element",children:L(nr,{to:"/user_details",children:[v(od,{className:"aside__list__element__img"}),v("span",{children:"Details"})]})}),v("li",{className:"aside__list__element",onClick:()=>{localStorage.removeItem("userData"),n({username:"",accessLevel:""})},children:L("div",{children:[v(Fm,{className:"aside__list__element__img"}),v("span",{children:"Log out"})]})})]})})},Hn=({child:e})=>{const t=eu(),{user:n,setUser:r}=R.exports.useContext(zn),[l,i]=R.exports.useState(!0);return R.exports.useEffect(()=>{n.username||t("/login")},[n]),L("main",{className:"main",children:[v("div",{className:"main__top",children:v(Im,{aside:l,setAside:i})}),L("div",{className:"main__mid",children:[v(jm,{aside:l,setAside:i}),v("div",{className:"main-inner",children:e})]})]})},qr=({color:e,topNumber:t,text:n})=>L("div",{className:`statcard ${e}`,children:[v("span",{children:t}),v("p",{children:n})]}),Um=()=>v("main",{className:"dashboard",children:v("div",{className:"container",children:L("div",{className:"dashboard inner",children:[L("div",{className:"dashboard__head",children:[v(Dm,{className:"dashboard__img"}),v("h1",{children:"Dashboard"})]}),L("div",{className:"dashboard__content__stats",children:[v(qr,{color:"yellow",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123}),v(qr,{color:"green",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123}),v(qr,{color:"violet",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123}),v(qr,{color:"black",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123})]})]})})});var Xr,Bm=new Uint8Array(16);function $m(){if(!Xr&&(Xr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Xr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xr(Bm)}const Hm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Vm(e){return typeof e=="string"&&Hm.test(e)}var re=[];for(var Ti=0;Ti<256;++Ti)re.push((Ti+256).toString(16).substr(1));function Wm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(re[e[t+0]]+re[e[t+1]]+re[e[t+2]]+re[e[t+3]]+"-"+re[e[t+4]]+re[e[t+5]]+"-"+re[e[t+6]]+re[e[t+7]]+"-"+re[e[t+8]]+re[e[t+9]]+"-"+re[e[t+10]]+re[e[t+11]]+re[e[t+12]]+re[e[t+13]]+re[e[t+14]]+re[e[t+15]]).toLowerCase();if(!Vm(n))throw TypeError("Stringified UUID is invalid");return n}function zi(e,t,n){e=e||{};var r=e.random||(e.rng||$m)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var l=0;l<16;++l)t[n+l]=r[l];return t}return Wm(r)}var ud={exports:{}},qu={exports:{}},sd=function(t,n){return function(){for(var l=new Array(arguments.length),i=0;i"u"}function Km(e){return e!==null&&!Il(e)&&e.constructor!==null&&!Il(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var ad=Gt("ArrayBuffer");function qm(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ad(e.buffer),t}function Xm(e){return typeof e=="string"}function Ym(e){return typeof e=="number"}function cd(e){return e!==null&&typeof e=="object"}function ul(e){if(Yu(e)!=="object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var Jm=Gt("Date"),Gm=Gt("File"),Zm=Gt("Blob"),bm=Gt("FileList");function Gu(e){return Xu.call(e)==="[object Function]"}function e0(e){return cd(e)&&Gu(e.pipe)}function t0(e){var t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Xu.call(e)===t||Gu(e.toString)&&e.toString()===t)}var n0=Gt("URLSearchParams");function r0(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function l0(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Zu(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),Ju(e))for(var n=0,r=e.length;n0;)i=r[l],o[i]||(t[i]=e[i],o[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t}function a0(e,t,n){e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return r!==-1&&r===n}function c0(e){if(!e)return null;var t=e.length;if(Il(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n}var f0=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),ue={isArray:Ju,isArrayBuffer:ad,isBuffer:Km,isFormData:t0,isArrayBufferView:qm,isString:Xm,isNumber:Ym,isObject:cd,isPlainObject:ul,isUndefined:Il,isDate:Jm,isFile:Gm,isBlob:Zm,isFunction:Gu,isStream:e0,isURLSearchParams:n0,isStandardBrowserEnv:l0,forEach:Zu,merge:Ko,extend:i0,trim:r0,stripBOM:o0,inherits:u0,toFlatObject:s0,kindOf:Yu,kindOfTest:Gt,endsWith:a0,toArray:c0,isTypedArray:f0,isFileList:bm},bt=ue;function ya(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var fd=function(t,n,r){if(!n)return t;var l;if(r)l=r(n);else if(bt.isURLSearchParams(n))l=n.toString();else{var i=[];bt.forEach(n,function(s,a){s===null||typeof s>"u"||(bt.isArray(s)?a=a+"[]":s=[s],bt.forEach(s,function(m){bt.isDate(m)?m=m.toISOString():bt.isObject(m)&&(m=JSON.stringify(m)),i.push(ya(a)+"="+ya(m))}))}),l=i.join("&")}if(l){var o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+l}return t},d0=ue;function bl(){this.handlers=[]}bl.prototype.use=function(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};bl.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};bl.prototype.forEach=function(t){d0.forEach(this.handlers,function(r){r!==null&&t(r)})};var p0=bl,h0=ue,m0=function(t,n){h0.forEach(t,function(l,i){i!==n&&i.toUpperCase()===n.toUpperCase()&&(t[n]=l,delete t[i])})},dd=ue;function Pn(e,t,n,r,l){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),l&&(this.response=l)}dd.inherits(Pn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var pd=Pn.prototype,hd={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){hd[e]={value:e}});Object.defineProperties(Pn,hd);Object.defineProperty(pd,"isAxiosError",{value:!0});Pn.from=function(e,t,n,r,l,i){var o=Object.create(pd);return dd.toFlatObject(e,o,function(s){return s!==Error.prototype}),Pn.call(o,e.message,t,n,r,l),o.name=e.name,i&&Object.assign(o,i),o};var Dn=Pn,md={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},je=ue;function v0(e,t){t=t||new FormData;var n=[];function r(i){return i===null?"":je.isDate(i)?i.toISOString():je.isArrayBuffer(i)||je.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function l(i,o){if(je.isPlainObject(i)||je.isArray(i)){if(n.indexOf(i)!==-1)throw Error("Circular reference detected in "+o);n.push(i),je.forEach(i,function(s,a){if(!je.isUndefined(s)){var h=o?o+"."+a:a,m;if(s&&!o&&typeof s=="object"){if(je.endsWith(a,"{}"))s=JSON.stringify(s);else if(je.endsWith(a,"[]")&&(m=je.toArray(s))){m.forEach(function(f){!je.isUndefined(f)&&t.append(h,r(f))});return}}l(s,h)}}),n.pop()}else t.append(o,r(i))}return l(e),t}var vd=v0,Di,ga;function y0(){if(ga)return Di;ga=1;var e=Dn;return Di=function(n,r,l){var i=l.config.validateStatus;!l.status||!i||i(l.status)?n(l):r(new e("Request failed with status code "+l.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))},Di}var Mi,wa;function g0(){if(wa)return Mi;wa=1;var e=ue;return Mi=e.isStandardBrowserEnv()?function(){return{write:function(r,l,i,o,u,s){var a=[];a.push(r+"="+encodeURIComponent(l)),e.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),e.isString(o)&&a.push("path="+o),e.isString(u)&&a.push("domain="+u),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(r){var l=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return l?decodeURIComponent(l[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Mi}var w0=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)},S0=function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t},_0=w0,k0=S0,yd=function(t,n){return t&&!_0(n)?k0(t,n):n},Ii,Sa;function E0(){if(Sa)return Ii;Sa=1;var e=ue,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Ii=function(r){var l={},i,o,u;return r&&e.forEach(r.split(` + */var Sm=R.exports,_m=Symbol.for("react.element"),km=Symbol.for("react.fragment"),Em=Object.prototype.hasOwnProperty,xm=Sm.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Cm={key:!0,ref:!0,__self:!0,__source:!0};function nd(e,t,n){var r,l={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Em.call(t,r)&&!Cm.hasOwnProperty(r)&&(l[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)l[r]===void 0&&(l[r]=t[r]);return{$$typeof:_m,type:e,key:i,ref:o,props:l,_owner:xm.current}}Zl.Fragment=km;Zl.jsx=nd;Zl.jsxs=nd;(function(e){e.exports=Zl})(Ku);const v=Ku.exports.jsx,L=Ku.exports.jsxs,Nm=()=>{const e=localStorage.getItem("lastLocation"),[t,n]=R.exports.useState({username:"",password:"",remember:!1,check:!1,valid:!1}),{user:r,setUser:l}=R.exports.useContext(zn),i=eu();return R.exports.useEffect(()=>{t.username===ma.username&&t.password===ma.password?n({...t,valid:!0}):n({...t,valid:!1})},[t.username,t.password]),R.exports.useEffect(()=>{r.username&&i(e||"/dashboard")},[r]),v("main",{className:"login",children:v("div",{className:"container",children:v("div",{className:"login inner",children:L("div",{className:"login__wrapper",children:[v("h1",{className:"login__header",children:"Login"}),L("form",{className:"login__form",onSubmit:o=>{o.preventDefault()},children:[L("div",{className:"login__form__block",children:[v("label",{htmlFor:"username",children:"Username"}),v("input",{required:!0,autoComplete:"true",type:"text",id:"username",placeholder:"username",onChange:o=>{n({...t,username:o.target.value})}})]}),L("div",{className:"login__form__block",children:[v("label",{htmlFor:"password",children:"Password"}),v("input",{required:!0,autoComplete:"true",type:"password",id:"password",placeholder:"password",onChange:o=>{n({...t,password:o.target.value})}})]}),v("div",{className:"login__form__block--check",children:L("label",{children:[v("input",{type:"checkbox",name:"remember",id:"remember",onChange:o=>{n({...t,remember:o.target.checked})}}),v("span",{children:"Remember me"})]})}),v("span",{className:t.check&&!t.valid?"login__form__error active":"login__form__error",children:"Invalid credentials"}),v("button",{className:"login__form__button login__form__button--violet",onClick:()=>{if(n({...t,check:!0}),t.valid&&l({username:t.username,accessLevel:"admin"}),t.remember){const o={username:t.username,accessLevel:"admin"};localStorage.setItem("userData",JSON.stringify(o))}},children:"Login"})]})]})})})})};var rd={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},va=al.createContext&&al.createContext(rd),Ct=globalThis&&globalThis.__assign||function(){return Ct=Object.assign||function(e){for(var t,n=1,r=arguments.length;n{const{user:n,setUser:r}=R.exports.useContext(zn),[l,i]=R.exports.useState(!1);return v("nav",{className:"nav",children:v("div",{className:"container",children:L("div",{className:"nav inner",children:[L("div",{className:"nav__left",children:[v(nr,{to:"/dashboard",className:"nav__img",onClick:()=>localStorage.setItem("lastLocation","/dashboard"),children:v(Lm,{})}),v(Tm,{type:"button",className:"nav__btn",onClick:()=>t(!e)})]}),v("div",{className:"nav__right",children:L("div",{className:"nav__right__user",onClick:()=>{i(!l)},children:[v(Mm,{className:"nav__right__user__img"}),v("span",{children:"Profile"}),v("div",{className:l?"nav__dropdown active":"nav__dropdown",children:L("ul",{className:"nav__dropdown__wrapper",children:[L("li",{children:[v("h2",{children:"Username:"}),v("p",{children:n.username})]}),L("li",{children:[v("h2",{children:"Access:"}),v("p",{children:n.accessLevel})]}),v("li",{children:v("button",{type:"button",onClick:()=>{localStorage.removeItem("userData"),r({username:"",accessLevel:""})},children:"Log out"})})]})})]})})]})})})};function id(e){return Qe({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M9.293 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V4.707A1 1 0 0 0 13.707 4L10 .293A1 1 0 0 0 9.293 0zM9.5 3.5v-2l3 3h-2a1 1 0 0 1-1-1zm-5-.5H7a.5.5 0 0 1 0 1H4.5a.5.5 0 0 1 0-1zm0 3h7a.5.5 0 0 1 .5.5v7a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-7a.5.5 0 0 1 .5-.5z"}}]})(e)}function Am(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"}},{tag:"path",attr:{d:"M4 18v-.65c0-.34.16-.66.41-.81C6.1 15.53 8.03 15 10 15c.03 0 .05 0 .08.01.1-.7.3-1.37.59-1.98-.22-.02-.44-.03-.67-.03-2.42 0-4.68.67-6.61 1.82-.88.52-1.39 1.5-1.39 2.53V20h9.26c-.42-.6-.75-1.28-.97-2H4zM10 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zM20.75 16c0-.22-.03-.42-.06-.63l1.14-1.01-1-1.73-1.45.49c-.32-.27-.68-.48-1.08-.63L18 11h-2l-.3 1.49c-.4.15-.76.36-1.08.63l-1.45-.49-1 1.73 1.14 1.01c-.03.21-.06.41-.06.63s.03.42.06.63l-1.14 1.01 1 1.73 1.45-.49c.32.27.68.48 1.08.63L16 21h2l.3-1.49c.4-.15.76-.36 1.08-.63l1.45.49 1-1.73-1.14-1.01c.03-.21.06-.41.06-.63zM17 18c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2z"}}]})(e)}function od(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{d:"M3 9C2.44772 9 2 9.44772 2 10C2 10.5523 2.44772 11 3 11H21C21.5523 11 22 10.5523 22 10C22 9.44772 21.5523 9 21 9H3Z",fill:"currentColor"}},{tag:"path",attr:{d:"M3 13C2.44772 13 2 13.4477 2 14C2 14.5523 2.44772 15 3 15H15C15.5523 15 16 14.5523 16 14C16 13.4477 15.5523 13 15 13H3Z",fill:"currentColor"}}]})(e)}function Qo(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m13 3 3.293 3.293-7 7 1.414 1.414 7-7L21 11V3z"}},{tag:"path",attr:{d:"M19 19H5V5h7l-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5l-2-2v7z"}}]})(e)}function Fm(e){return Qe({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16 13v-2H7V8l-5 4 5 4v-3z"}},{tag:"path",attr:{d:"M20 3h-9c-1.103 0-2 .897-2 2v4h2V5h9v14h-9v-4H9v4c0 1.103.897 2 2 2h9c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2z"}}]})(e)}const jm=({aside:e,setAside:t})=>{const{setUser:n}=R.exports.useContext(zn);return v("aside",{className:e?"aside active":"aside",children:L("ul",{className:"aside__list",children:[L("li",{className:"aside__list__element aside__list__element--title",children:[v(zm,{className:"aside__img"}),v("h2",{children:"Elements"})]}),v("li",{className:"aside__list__element",children:L(nr,{to:"/posts",onClick:()=>localStorage.setItem("lastLocation","/posts"),children:[v(id,{className:"aside__list__element__img"}),v("span",{children:"Posts"})]})}),L("li",{className:"aside__list__element aside__list__element--title",children:[v(Am,{className:"aside__img"}),v("h2",{children:"Account"})]}),v("li",{className:"aside__list__element",children:L(nr,{to:"/user_details",onClick:()=>localStorage.setItem("lastLocation","/user_details"),children:[v(od,{className:"aside__list__element__img"}),v("span",{children:"Details"})]})}),v("li",{className:"aside__list__element",onClick:()=>{localStorage.removeItem("userData"),n({username:"",accessLevel:""})},children:L("div",{children:[v(Fm,{className:"aside__list__element__img"}),v("span",{children:"Log out"})]})})]})})},Hn=({child:e})=>{const t=eu(),{user:n,setUser:r}=R.exports.useContext(zn),[l,i]=R.exports.useState(!0);return R.exports.useEffect(()=>{n.username||t("/login")},[n]),L("main",{className:"main",children:[v("div",{className:"main__top",children:v(Im,{aside:l,setAside:i})}),L("div",{className:"main__mid",children:[v(jm,{aside:l,setAside:i}),v("div",{className:"main-inner",children:e})]})]})},qr=({color:e,topNumber:t,text:n})=>L("div",{className:`statcard ${e}`,children:[v("span",{children:t}),v("p",{children:n})]}),Um=()=>v("main",{className:"dashboard",children:v("div",{className:"container",children:L("div",{className:"dashboard inner",children:[L("div",{className:"dashboard__head",children:[v(Dm,{className:"dashboard__img"}),v("h1",{children:"Dashboard"})]}),L("div",{className:"dashboard__content__stats",children:[v(qr,{color:"yellow",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123}),v(qr,{color:"green",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123}),v(qr,{color:"violet",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123}),v(qr,{color:"black",text:"Lorem, ipsum dolor sit amet consectetur adipisicing elit.",topNumber:123})]})]})})});var Xr,Bm=new Uint8Array(16);function $m(){if(!Xr&&(Xr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto<"u"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Xr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xr(Bm)}const Hm=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Vm(e){return typeof e=="string"&&Hm.test(e)}var re=[];for(var Ti=0;Ti<256;++Ti)re.push((Ti+256).toString(16).substr(1));function Wm(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(re[e[t+0]]+re[e[t+1]]+re[e[t+2]]+re[e[t+3]]+"-"+re[e[t+4]]+re[e[t+5]]+"-"+re[e[t+6]]+re[e[t+7]]+"-"+re[e[t+8]]+re[e[t+9]]+"-"+re[e[t+10]]+re[e[t+11]]+re[e[t+12]]+re[e[t+13]]+re[e[t+14]]+re[e[t+15]]).toLowerCase();if(!Vm(n))throw TypeError("Stringified UUID is invalid");return n}function zi(e,t,n){e=e||{};var r=e.random||(e.rng||$m)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){n=n||0;for(var l=0;l<16;++l)t[n+l]=r[l];return t}return Wm(r)}var ud={exports:{}},qu={exports:{}},sd=function(t,n){return function(){for(var l=new Array(arguments.length),i=0;i"u"}function Km(e){return e!==null&&!Il(e)&&e.constructor!==null&&!Il(e.constructor)&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var ad=Gt("ArrayBuffer");function qm(e){var t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ad(e.buffer),t}function Xm(e){return typeof e=="string"}function Ym(e){return typeof e=="number"}function cd(e){return e!==null&&typeof e=="object"}function ul(e){if(Yu(e)!=="object")return!1;var t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}var Jm=Gt("Date"),Gm=Gt("File"),Zm=Gt("Blob"),bm=Gt("FileList");function Gu(e){return Xu.call(e)==="[object Function]"}function e0(e){return cd(e)&&Gu(e.pipe)}function t0(e){var t="[object FormData]";return e&&(typeof FormData=="function"&&e instanceof FormData||Xu.call(e)===t||Gu(e.toString)&&e.toString()===t)}var n0=Gt("URLSearchParams");function r0(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function l0(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function Zu(e,t){if(!(e===null||typeof e>"u"))if(typeof e!="object"&&(e=[e]),Ju(e))for(var n=0,r=e.length;n0;)i=r[l],o[i]||(t[i]=e[i],o[i]=!0);e=Object.getPrototypeOf(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t}function a0(e,t,n){e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;var r=e.indexOf(t,n);return r!==-1&&r===n}function c0(e){if(!e)return null;var t=e.length;if(Il(t))return null;for(var n=new Array(t);t-- >0;)n[t]=e[t];return n}var f0=function(e){return function(t){return e&&t instanceof e}}(typeof Uint8Array<"u"&&Object.getPrototypeOf(Uint8Array)),ue={isArray:Ju,isArrayBuffer:ad,isBuffer:Km,isFormData:t0,isArrayBufferView:qm,isString:Xm,isNumber:Ym,isObject:cd,isPlainObject:ul,isUndefined:Il,isDate:Jm,isFile:Gm,isBlob:Zm,isFunction:Gu,isStream:e0,isURLSearchParams:n0,isStandardBrowserEnv:l0,forEach:Zu,merge:Ko,extend:i0,trim:r0,stripBOM:o0,inherits:u0,toFlatObject:s0,kindOf:Yu,kindOfTest:Gt,endsWith:a0,toArray:c0,isTypedArray:f0,isFileList:bm},bt=ue;function ya(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var fd=function(t,n,r){if(!n)return t;var l;if(r)l=r(n);else if(bt.isURLSearchParams(n))l=n.toString();else{var i=[];bt.forEach(n,function(s,a){s===null||typeof s>"u"||(bt.isArray(s)?a=a+"[]":s=[s],bt.forEach(s,function(m){bt.isDate(m)?m=m.toISOString():bt.isObject(m)&&(m=JSON.stringify(m)),i.push(ya(a)+"="+ya(m))}))}),l=i.join("&")}if(l){var o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+l}return t},d0=ue;function bl(){this.handlers=[]}bl.prototype.use=function(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1};bl.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)};bl.prototype.forEach=function(t){d0.forEach(this.handlers,function(r){r!==null&&t(r)})};var p0=bl,h0=ue,m0=function(t,n){h0.forEach(t,function(l,i){i!==n&&i.toUpperCase()===n.toUpperCase()&&(t[n]=l,delete t[i])})},dd=ue;function Pn(e,t,n,r,l){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),l&&(this.response=l)}dd.inherits(Pn,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var pd=Pn.prototype,hd={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(e){hd[e]={value:e}});Object.defineProperties(Pn,hd);Object.defineProperty(pd,"isAxiosError",{value:!0});Pn.from=function(e,t,n,r,l,i){var o=Object.create(pd);return dd.toFlatObject(e,o,function(s){return s!==Error.prototype}),Pn.call(o,e.message,t,n,r,l),o.name=e.name,i&&Object.assign(o,i),o};var Dn=Pn,md={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},je=ue;function v0(e,t){t=t||new FormData;var n=[];function r(i){return i===null?"":je.isDate(i)?i.toISOString():je.isArrayBuffer(i)||je.isTypedArray(i)?typeof Blob=="function"?new Blob([i]):Buffer.from(i):i}function l(i,o){if(je.isPlainObject(i)||je.isArray(i)){if(n.indexOf(i)!==-1)throw Error("Circular reference detected in "+o);n.push(i),je.forEach(i,function(s,a){if(!je.isUndefined(s)){var h=o?o+"."+a:a,m;if(s&&!o&&typeof s=="object"){if(je.endsWith(a,"{}"))s=JSON.stringify(s);else if(je.endsWith(a,"[]")&&(m=je.toArray(s))){m.forEach(function(f){!je.isUndefined(f)&&t.append(h,r(f))});return}}l(s,h)}}),n.pop()}else t.append(o,r(i))}return l(e),t}var vd=v0,Di,ga;function y0(){if(ga)return Di;ga=1;var e=Dn;return Di=function(n,r,l){var i=l.config.validateStatus;!l.status||!i||i(l.status)?n(l):r(new e("Request failed with status code "+l.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(l.status/100)-4],l.config,l.request,l))},Di}var Mi,wa;function g0(){if(wa)return Mi;wa=1;var e=ue;return Mi=e.isStandardBrowserEnv()?function(){return{write:function(r,l,i,o,u,s){var a=[];a.push(r+"="+encodeURIComponent(l)),e.isNumber(i)&&a.push("expires="+new Date(i).toGMTString()),e.isString(o)&&a.push("path="+o),e.isString(u)&&a.push("domain="+u),s===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(r){var l=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return l?decodeURIComponent(l[3]):null},remove:function(r){this.write(r,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),Mi}var w0=function(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)},S0=function(t,n){return n?t.replace(/\/+$/,"")+"/"+n.replace(/^\/+/,""):t},_0=w0,k0=S0,yd=function(t,n){return t&&!_0(n)?k0(t,n):n},Ii,Sa;function E0(){if(Sa)return Ii;Sa=1;var e=ue,t=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];return Ii=function(r){var l={},i,o,u;return r&&e.forEach(r.split(` `),function(a){if(u=a.indexOf(":"),i=e.trim(a.substr(0,u)).toLowerCase(),o=e.trim(a.substr(u+1)),i){if(l[i]&&t.indexOf(i)>=0)return;i==="set-cookie"?l[i]=(l[i]?l[i]:[]).concat([o]):l[i]=l[i]?l[i]+", "+o:o}}),l},Ii}var Ai,_a;function x0(){if(_a)return Ai;_a=1;var e=ue;return Ai=e.isStandardBrowserEnv()?function(){var n=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a"),l;function i(o){var u=o;return n&&(r.setAttribute("href",u),u=r.href),r.setAttribute("href",u),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:r.pathname.charAt(0)==="/"?r.pathname:"/"+r.pathname}}return l=i(window.location.href),function(u){var s=e.isString(u)?i(u):u;return s.protocol===l.protocol&&s.host===l.host}}():function(){return function(){return!0}}(),Ai}var Fi,ka;function ei(){if(ka)return Fi;ka=1;var e=Dn,t=ue;function n(r){e.call(this,r==null?"canceled":r,e.ERR_CANCELED),this.name="CanceledError"}return t.inherits(n,e,{__CANCEL__:!0}),Fi=n,Fi}var ji,Ea;function C0(){return Ea||(Ea=1,ji=function(t){var n=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return n&&n[1]||""}),ji}var Ui,xa;function Ca(){if(xa)return Ui;xa=1;var e=ue,t=y0(),n=g0(),r=fd,l=yd,i=E0(),o=x0(),u=md,s=Dn,a=ei(),h=C0();return Ui=function(f){return new Promise(function(x,E){var I=f.data,d=f.headers,c=f.responseType,p;function w(){f.cancelToken&&f.cancelToken.unsubscribe(p),f.signal&&f.signal.removeEventListener("abort",p)}e.isFormData(I)&&e.isStandardBrowserEnv()&&delete d["Content-Type"];var y=new XMLHttpRequest;if(f.auth){var P=f.auth.username||"",S=f.auth.password?unescape(encodeURIComponent(f.auth.password)):"";d.Authorization="Basic "+btoa(P+":"+S)}var k=l(f.baseURL,f.url);y.open(f.method.toUpperCase(),r(k,f.params,f.paramsSerializer),!0),y.timeout=f.timeout;function z(){if(!!y){var H="getAllResponseHeaders"in y?i(y.getAllResponseHeaders()):null,se=!c||c==="text"||c==="json"?y.responseText:y.response,pe={data:se,status:y.status,statusText:y.statusText,headers:H,config:f,request:y};t(function(Tt){x(Tt),w()},function(Tt){E(Tt),w()},pe),y=null}}if("onloadend"in y?y.onloadend=z:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.indexOf("file:")===0)||setTimeout(z)},y.onabort=function(){!y||(E(new s("Request aborted",s.ECONNABORTED,f,y)),y=null)},y.onerror=function(){E(new s("Network Error",s.ERR_NETWORK,f,y,y)),y=null},y.ontimeout=function(){var se=f.timeout?"timeout of "+f.timeout+"ms exceeded":"timeout exceeded",pe=f.transitional||u;f.timeoutErrorMessage&&(se=f.timeoutErrorMessage),E(new s(se,pe.clarifyTimeoutError?s.ETIMEDOUT:s.ECONNABORTED,f,y)),y=null},e.isStandardBrowserEnv()){var O=(f.withCredentials||o(k))&&f.xsrfCookieName?n.read(f.xsrfCookieName):void 0;O&&(d[f.xsrfHeaderName]=O)}"setRequestHeader"in y&&e.forEach(d,function(se,pe){typeof I>"u"&&pe.toLowerCase()==="content-type"?delete d[pe]:y.setRequestHeader(pe,se)}),e.isUndefined(f.withCredentials)||(y.withCredentials=!!f.withCredentials),c&&c!=="json"&&(y.responseType=f.responseType),typeof f.onDownloadProgress=="function"&&y.addEventListener("progress",f.onDownloadProgress),typeof f.onUploadProgress=="function"&&y.upload&&y.upload.addEventListener("progress",f.onUploadProgress),(f.cancelToken||f.signal)&&(p=function(H){!y||(E(!H||H&&H.type?new a:H),y.abort(),y=null)},f.cancelToken&&f.cancelToken.subscribe(p),f.signal&&(f.signal.aborted?p():f.signal.addEventListener("abort",p))),I||(I=null);var j=h(k);if(j&&["http","https","file"].indexOf(j)===-1){E(new s("Unsupported protocol "+j+":",s.ERR_BAD_REQUEST,f));return}y.send(I)})},Ui}var Bi,Na;function N0(){return Na||(Na=1,Bi=null),Bi}var ee=ue,Pa=m0,Ra=Dn,P0=md,R0=vd,O0={"Content-Type":"application/x-www-form-urlencoded"};function Oa(e,t){!ee.isUndefined(e)&&ee.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function L0(){var e;return(typeof XMLHttpRequest<"u"||typeof process<"u"&&Object.prototype.toString.call(process)==="[object process]")&&(e=Ca()),e}function T0(e,t,n){if(ee.isString(e))try{return(t||JSON.parse)(e),ee.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}var ti={transitional:P0,adapter:L0(),transformRequest:[function(t,n){if(Pa(n,"Accept"),Pa(n,"Content-Type"),ee.isFormData(t)||ee.isArrayBuffer(t)||ee.isBuffer(t)||ee.isStream(t)||ee.isFile(t)||ee.isBlob(t))return t;if(ee.isArrayBufferView(t))return t.buffer;if(ee.isURLSearchParams(t))return Oa(n,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r=ee.isObject(t),l=n&&n["Content-Type"],i;if((i=ee.isFileList(t))||r&&l==="multipart/form-data"){var o=this.env&&this.env.FormData;return R0(i?{"files[]":t}:t,o&&new o)}else if(r||l==="application/json")return Oa(n,"application/json"),T0(t);return t}],transformResponse:[function(t){var n=this.transitional||ti.transitional,r=n&&n.silentJSONParsing,l=n&&n.forcedJSONParsing,i=!r&&this.responseType==="json";if(i||l&&ee.isString(t)&&t.length)try{return JSON.parse(t)}catch(o){if(i)throw o.name==="SyntaxError"?Ra.from(o,Ra.ERR_BAD_RESPONSE,this,null,this.response):o}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:N0()},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};ee.forEach(["delete","get","head"],function(t){ti.headers[t]={}});ee.forEach(["post","put","patch"],function(t){ti.headers[t]=ee.merge(O0)});var bu=ti,z0=ue,D0=bu,M0=function(t,n,r){var l=this||D0;return z0.forEach(r,function(o){t=o.call(l,t,n)}),t},$i,La;function gd(){return La||(La=1,$i=function(t){return!!(t&&t.__CANCEL__)}),$i}var Ta=ue,Hi=M0,I0=gd(),A0=bu,F0=ei();function Vi(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new F0}var j0=function(t){Vi(t),t.headers=t.headers||{},t.data=Hi.call(t,t.data,t.headers,t.transformRequest),t.headers=Ta.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),Ta.forEach(["delete","get","head","post","put","patch","common"],function(l){delete t.headers[l]});var n=t.adapter||A0.adapter;return n(t).then(function(l){return Vi(t),l.data=Hi.call(t,l.data,l.headers,t.transformResponse),l},function(l){return I0(l)||(Vi(t),l&&l.response&&(l.response.data=Hi.call(t,l.response.data,l.response.headers,t.transformResponse))),Promise.reject(l)})},xe=ue,wd=function(t,n){n=n||{};var r={};function l(h,m){return xe.isPlainObject(h)&&xe.isPlainObject(m)?xe.merge(h,m):xe.isPlainObject(m)?xe.merge({},m):xe.isArray(m)?m.slice():m}function i(h){if(xe.isUndefined(n[h])){if(!xe.isUndefined(t[h]))return l(void 0,t[h])}else return l(t[h],n[h])}function o(h){if(!xe.isUndefined(n[h]))return l(void 0,n[h])}function u(h){if(xe.isUndefined(n[h])){if(!xe.isUndefined(t[h]))return l(void 0,t[h])}else return l(void 0,n[h])}function s(h){if(h in n)return l(t[h],n[h]);if(h in t)return l(void 0,t[h])}var a={url:o,method:o,data:o,baseURL:u,transformRequest:u,transformResponse:u,paramsSerializer:u,timeout:u,timeoutMessage:u,withCredentials:u,adapter:u,responseType:u,xsrfCookieName:u,xsrfHeaderName:u,onUploadProgress:u,onDownloadProgress:u,decompress:u,maxContentLength:u,maxBodyLength:u,beforeRedirect:u,transport:u,httpAgent:u,httpsAgent:u,cancelToken:u,socketPath:u,responseEncoding:u,validateStatus:s};return xe.forEach(Object.keys(t).concat(Object.keys(n)),function(m){var f=a[m]||i,g=f(m);xe.isUndefined(g)&&f!==s||(r[m]=g)}),r},Wi,za;function Sd(){return za||(za=1,Wi={version:"0.27.2"}),Wi}var U0=Sd().version,ft=Dn,es={};["object","boolean","number","function","string","symbol"].forEach(function(e,t){es[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var Da={};es.transitional=function(t,n,r){function l(i,o){return"[Axios v"+U0+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return function(i,o,u){if(t===!1)throw new ft(l(o," has been removed"+(n?" in "+n:"")),ft.ERR_DEPRECATED);return n&&!Da[o]&&(Da[o]=!0,console.warn(l(o," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,o,u):!0}};function B0(e,t,n){if(typeof e!="object")throw new ft("options must be an object",ft.ERR_BAD_OPTION_VALUE);for(var r=Object.keys(e),l=r.length;l-- >0;){var i=r[l],o=t[i];if(o){var u=e[i],s=u===void 0||o(u,i,e);if(s!==!0)throw new ft("option "+i+" must be "+s,ft.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new ft("Unknown option "+i,ft.ERR_BAD_OPTION)}}var $0={assertOptions:B0,validators:es},_d=ue,H0=fd,Ma=p0,Ia=j0,ni=wd,V0=yd,kd=$0,en=kd.validators;function Rn(e){this.defaults=e,this.interceptors={request:new Ma,response:new Ma}}Rn.prototype.request=function(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ni(this.defaults,n),n.method?n.method=n.method.toLowerCase():this.defaults.method?n.method=this.defaults.method.toLowerCase():n.method="get";var r=n.transitional;r!==void 0&&kd.assertOptions(r,{silentJSONParsing:en.transitional(en.boolean),forcedJSONParsing:en.transitional(en.boolean),clarifyTimeoutError:en.transitional(en.boolean)},!1);var l=[],i=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(i=i&&g.synchronous,l.unshift(g.fulfilled,g.rejected))});var o=[];this.interceptors.response.forEach(function(g){o.push(g.fulfilled,g.rejected)});var u;if(!i){var s=[Ia,void 0];for(Array.prototype.unshift.apply(s,l),s=s.concat(o),u=Promise.resolve(n);s.length;)u=u.then(s.shift(),s.shift());return u}for(var a=n;l.length;){var h=l.shift(),m=l.shift();try{a=h(a)}catch(f){m(f);break}}try{u=Ia(a)}catch(f){return Promise.reject(f)}for(;o.length;)u=u.then(o.shift(),o.shift());return u};Rn.prototype.getUri=function(t){t=ni(this.defaults,t);var n=V0(t.baseURL,t.url);return H0(n,t.params,t.paramsSerializer)};_d.forEach(["delete","get","head","options"],function(t){Rn.prototype[t]=function(n,r){return this.request(ni(r||{},{method:t,url:n,data:(r||{}).data}))}});_d.forEach(["post","put","patch"],function(t){function n(r){return function(i,o,u){return this.request(ni(u||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Rn.prototype[t]=n(),Rn.prototype[t+"Form"]=n(!0)});var W0=Rn,Qi,Aa;function Q0(){if(Aa)return Qi;Aa=1;var e=ei();function t(n){if(typeof n!="function")throw new TypeError("executor must be a function.");var r;this.promise=new Promise(function(o){r=o});var l=this;this.promise.then(function(i){if(!!l._listeners){var o,u=l._listeners.length;for(o=0;o{G0.get("http://95.85.124.41:8080/posts").then(t=>{e(t.data)}).catch(t=>{})},qo=e=>{const t=e.toString().split("T"),n=t[0],l=t[1].split(".")[0];return[n,l]},b0=["ID","Category","Title","Link","Date","Summary"],ev=()=>{const{posts:e,setPosts:t}=R.exports.useContext(Qu),[n,r]=R.exports.useState("All");return R.exports.useEffect(()=>{Z0(t)},[]),v("main",{className:"posts",children:v("div",{className:"container",children:L("div",{className:"posts inner",children:[L("div",{className:"dashboard__head",children:[v(id,{className:"dashboard__img"}),v("h1",{children:"Posts"})]}),v("div",{className:"posts_select",children:L("select",{value:n,onChange:l=>{r(l.target.value)},children:[v("option",{value:"All",defaultChecked:!0,children:"All"}),v("option",{value:"TurkmenPortal",children:"TurkmenPortal"}),v("option",{value:"Orient",children:"Orient"})]})}),v("table",{className:"posts__table",children:L("tbody",{children:[v("tr",{className:"posts__table__head",children:b0.map(l=>v("th",{children:l},zi()))}),e[0].id!==-1?n==="All"?e.map((l,i)=>v(nr,{className:"post-link",to:`/posts/${l.id}`,children:L("tr",{children:[v("td",{children:i+1}),v("td",{children:l.category}),v("td",{children:l.title}),v("td",{children:v("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",children:v(Qo,{})})}),v("td",{children:qo(l.date)[0]}),v("td",{children:l.summary})]})},zi())):e.map((l,i)=>l.category===n?v(nr,{className:"post-link",to:`/posts/${l.id}`,children:L("tr",{children:[v("td",{children:i+1}),v("td",{children:l.category}),v("td",{children:l.title}),v("td",{children:v("a",{href:l.link,target:"_blank",rel:"noopener noreferrer",children:v(Qo,{})})}),v("td",{children:qo(l.date)[0]}),v("td",{children:l.summary})]})},zi()):""):""]})})]})})})},tv=()=>{const{user:e}=R.exports.useContext(zn);return v("main",{className:"details",children:v("div",{className:"container",children:L("div",{className:"details inner",children:[L("div",{className:"dashboard__head",children:[v(od,{className:"dashboard__img"}),v("h1",{children:"Details"})]}),v("div",{className:"details__content",children:L("form",{className:"details__data",children:[L("div",{className:"details__data__block",children:[v("label",{htmlFor:"user",children:"Username"}),v("input",{type:"text",id:"user",value:e.username,readOnly:!0})]}),L("div",{className:"details__data__block",children:[v("label",{htmlFor:"access",children:"Access"}),v("input",{type:"text",id:"access",value:e.accessLevel,readOnly:!0})]})]})})]})})})},nv=()=>{const e=new Date("0.0.0000"),[t,n]=R.exports.useState({id:-1,category:"",title:"",link:"",date:e,summary:"",createdAt:e,updatedAt:e}),{posts:r}=R.exports.useContext(Qu),{id:l}=sp();return R.exports.useEffect(()=>{r[0].id!==-1&&r.map(i=>{i.id.toString()===l&&n(i)})},[r]),v("main",{className:"post",children:v("div",{className:"container",children:L("div",{className:"post inner",children:[L("div",{className:"dashboard__head post__head",children:[v(Om,{}),v("h1",{className:"post__head",children:t.id!==-1?t.title:""})]}),L("div",{className:"post__content",children:[L("div",{className:"post__content__block",children:[v("h4",{children:"ID"}),v("input",{type:"text",readOnly:!0,value:t.id!==-1?t.id:""})]}),L("div",{className:"post__content__block",children:[v("h4",{children:"Category"}),v("input",{type:"text",readOnly:!0,value:t.id!==-1?t.category:""})]}),L("div",{className:"post__content__block",children:[v("h4",{children:"Title"}),v("input",{type:"text",readOnly:!0,value:t.id!==-1?t.title:""})]}),L("div",{className:"post__content__block",children:[v("h4",{children:"Date"}),v("input",{type:"text",readOnly:!0,value:t.id!==-1?qo(t.date)[0]:""})]}),L("div",{className:"post__content__block",children:[v("h4",{children:"Summary"}),v("textarea",{readOnly:!0,rows:5,value:t.id!==-1?t.summary:""})]}),L("a",{className:"post__content__btn",href:t.id!==-1?t.link:"",children:[v(Qo,{}),v("span",{children:"Link"})]})]})]})})})},rv=()=>{const e=new Date("0.0.0000"),[t,n]=R.exports.useState([{id:-1,category:"",title:"",link:"",date:e,summary:"",createdAt:e,updatedAt:e}]),[r,l]=R.exports.useState({username:"",accessLevel:""});R.exports.useEffect(()=>{const u=localStorage.getItem("userData");u&&l(JSON.parse(u))},[]);const i=R.exports.useMemo(()=>({user:r,setUser:l}),[r,l]),o=R.exports.useMemo(()=>({posts:t,setPosts:n}),[t,n]);return v(Qu.Provider,{value:o,children:v(zn.Provider,{value:i,children:v("div",{className:"App",children:L(dp,{children:[v(Mt,{path:"/",element:v(Hn,{})}),v(Mt,{path:"/dashboard",element:v(Hn,{child:v(Um,{})})}),v(Mt,{path:"/posts",element:v(Hn,{child:v(ev,{})})}),v(Mt,{path:"/posts/:id",element:v(Hn,{child:v(nv,{})})}),v(Mt,{path:"/user_details",element:v(Hn,{child:v(tv,{})})}),v(Mt,{path:"/login",element:v(Nm,{})})]})})})})};Gi.createRoot(document.getElementById("root")).render(v(al.StrictMode,{children:v(mp,{children:v(rv,{})})})); diff --git a/dist/index.html b/dist/index.html index efbda5a..eefa800 100644 --- a/dist/index.html +++ b/dist/index.html @@ -5,7 +5,7 @@ Admin Panel - +