/*! For license information please see main.0643208c.js.LICENSE.txt */ (()=>{var e={86860:(e,t,n)=>{"use strict";n.d(t,{A:()=>h,D:()=>f});var r=n(9950),a=n(44414);const o=(0,r.createContext)(),s=()=>{const e=(0,r.useContext)(o);if(!e)throw new Error("AccordionItem-related components must be wrapped by ");return e},l=e=>{let{id:t,children:n,className:r,styles:s={}}=e;return(0,a.jsx)(o.Provider,{value:t,children:(0,a.jsx)("li",{className:r,style:s,children:n})})},i=e=>{let{className:t,children:n,styles:r={}}=e;const{toggleItem:o}=f(),l=s();return(0,a.jsx)("h3",{className:t,onClick:()=>o(l),style:r,children:n})};var u=n(24110);const c=e=>{let{className:t,children:n}=e;const r=s(),{openItemId:o}=f(),l=o===r;return(0,a.jsx)("div",{className:l?`${null!==t&&void 0!==t?t:""} ${u.A.open}`:`${null!==t&&void 0!==t?t:""} ${u.A.close}`,children:n})},d=(0,r.createContext)();function f(){const e=(0,r.useContext)(d);if(!e)throw new Error("Accordion-related components must be wrapped by .");return e}const p=e=>{let{children:t,className:n,styles:o={}}=e;const[s,l]=(0,r.useState)(null),i={openItemId:s,toggleItem:e=>{l((t=>t===e?null:e))}};return(0,a.jsx)(d.Provider,{value:i,children:(0,a.jsx)("ul",{className:n,style:o,children:t})})};p.Item=l,p.Title=i,p.Content=c;const h=p},16267:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});n(9950);const r="Button_btn__na4pL";var a=n(44414);const o=e=>{let{value:t,func:n,styles:o,isDisable:s,type:l=""}=e;return(0,a.jsx)("button",{className:r,onClick:n,style:{...o},disabled:s,type:l,children:t})}},44851:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});n(9950);const r="LoadingSpinner_loadingSpinner__ukjM2",a="LoadingSpinner_spinner__J2pPz";var o=n(44414);const s=()=>(0,o.jsxs)("div",{className:r,children:[(0,o.jsx)("div",{className:a}),(0,o.jsx)("p",{children:"Loading..."})]})},23784:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(17119);const a="Modal_modalOverlay__k+i8r",o="Modal_modalContainer__q7wpo";var s=n(9950),l=n(44414);const i=e=>{let{isOpen:t,onClose:n,children:i,escKey:u=!0}=e;return(0,s.useEffect)((()=>{if(!t||!u)return;const e=e=>{"Escape"===e.key&&n()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)}),[t,u,n]),t?(0,r.createPortal)((0,l.jsx)("div",{className:a,onClick:n,children:(0,l.jsx)("div",{className:o,onClick:e=>e.stopPropagation(),children:i})}),document.getElementById("modal-root")):null}},47380:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(9950),a=n(42074),o=n(35192);function s(e){return(0,o.k5)({tag:"svg",attr:{viewBox:"0 0 256 256",fill:"currentColor"},child:[{tag:"path",attr:{d:"M222,128a6,6,0,0,1-3.43,5.42l-152,72a6,6,0,1,1-5.14-10.84L202,128,61.43,61.42a6,6,0,1,1,5.14-10.84l152,72A6,6,0,0,1,222,128Z"},child:[]}]})(e)}var l=n(44304);const i="NormalBreadCrumbs_breadcrumb__tfK2F",u="NormalBreadCrumbs_active__xF+bo",c="NormalBreadCrumbs_crumbText__FSXsg";var d=n(44414);const f=e=>{let{crumbs:t}=e;const n=e=>e.replace(/-/g," ").split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ");return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:i,children:t.map(((e,o)=>{const l=o===t.length-1?`${u} ${c}`:c;return(0,d.jsxs)(r.Fragment,{children:[o>0&&(0,d.jsx)(s,{}),e.to?(0,d.jsx)(a.N_,{to:e.to,className:l,"data-tooltip-id":"breadcrumb-tooltip","data-tooltip-content":n(e.label),children:n(e.label)}):(0,d.jsx)("span",{className:l,"data-tooltip-id":"breadcrumb-tooltip","data-tooltip-content":n(e.label),children:n(e.label)})]},o)}))}),(0,d.jsx)(l.m_,{id:"breadcrumb-tooltip"})]})}},27744:(e,t,n)=>{"use strict";n.d(t,{A:()=>s});n(9950);const r="UserAvatar_avatarImage__NMhcf",a="UserAvatar_fallbackAvatar__WefPr";var o=n(44414);const s=e=>{let{imageURL:t,name:n}=e;return(0,o.jsx)(o.Fragment,{children:t?(0,o.jsx)("img",{className:r,src:t,alt:"user profile"}):(0,o.jsx)("div",{className:a,children:(e=>e?e.charAt(0).toUpperCase():"")(n)})})}},38845:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9950),a=n(63310);const o=e=>{const[t,n]=(0,r.useState)(null),[o,s]=(0,r.useState)(!1),[l,i]=(0,r.useState)(null),u=(0,a.d)();return{data:t,isLoading:o,error:l,execute:(0,r.useCallback)((async function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];s(!0),i(null);try{const r=await e(t);return n(null===r||void 0===r?void 0:r.data),{data:null===r||void 0===r?void 0:r.data,error:null}}catch(d){var a,o,l,c;const e=(null===(a=d.response)||void 0===a||null===(o=a.data)||void 0===o?void 0:o.message)||d.message;return i((null===(l=d.response)||void 0===l||null===(c=l.data)||void 0===c?void 0:c.error)||d.message),r&&u.open({type:"error",message:e,duration:1500}),{data:null,error:e}}finally{s(!1)}}),[e,u])}}},93138:(e,t,n)=>{"use strict";n.d(t,{G3:()=>l,Qh:()=>c,Zy:()=>o,aG:()=>i,bU:()=>s,gc:()=>a,rS:()=>u,tj:()=>d});var r=n(79080);const a=e=>{let{courseId:t,page:n,limit:a,search:o,sort:s}=e;return r.A.get(`/courses/${t}/assessments?page=${n}&limit=${a}&search=${o}&sort=${s||"ascending"}`)},o=e=>{let{assessmentId:t}=e;return r.A.get(`/assessments/${t}`)},s=e=>{let{courseId:t,assessmentData:n}=e;return r.A.post(`/courses/${t}/assessments`,n)},l=e=>{let{assessmentId:t,assessmentData:n}=e;return r.A.put(`/assessments/${t}`,n)},i=e=>{let{assessmentId:t}=e;return r.A.delete(`/assessments/${t}`)},u=e=>{let{assessmentId:t}=e;return r.A.patch(`/assessments/${t}/toggle-visibility`)},c=e=>{let{learnerId:t}=e;return r.A.get(`/assessments/learners/${t}/by-course`)},d=e=>{let{assessmentId:t}=e;return r.A.get(`/assessments/${t}/dashboard`)}},54335:(e,t,n)=>{"use strict";n.d(t,{Am:()=>i,D8:()=>h,ER:()=>o,FH:()=>l,On:()=>f,R2:()=>d,WC:()=>u,iD:()=>a,mY:()=>p,nm:()=>m,ri:()=>s,rp:()=>g,vJ:()=>c});var r=n(79080);const a=e=>{let{user:t}=e;return r.A.post("/auth/login",t)},o=()=>r.A.post("/auth/guest-login"),s=()=>r.A.get("/auth/logout"),l=()=>r.A.get("/auth/verify"),i=e=>{let{email:t,role:n}=e;return r.A.put("/auth/switch",{email:t,role:n})},u=e=>{let{email:t,issecondaryEmail:n,secondaryEmail:a}=e;return r.A.post("/auth/reset-password-request",{email:t,issecondaryEmail:n,secondaryEmail:a})},c=e=>{let{email:t,userOtp:n,issecondaryEmail:a,secondaryEmail:o}=e;return r.A.post("/auth/verify-otp",{email:t,userOtp:n,issecondaryEmail:a,secondaryEmail:o})},d=e=>{let{email:t,newPassword:n,confirmPassword:a,issecondaryEmail:o,secondaryEmail:s}=e;return r.A.post("/auth/reset-password",{email:t,newPassword:n,confirmPassword:a,secondaryEmail:s,issecondaryEmail:o})},f=e=>{let{email:t,userOtp:n}=e;return r.A.post("/auth/verify-login-otp",{email:t,userOtp:n})},p=e=>{let{secondaryEmail:t}=e;return r.A.post("/auth/request-secondary-login",{secondaryEmail:t})},h=e=>{let{email:t}=e;return r.A.post("/auth/request-login",{email:t})},m=e=>{let{email:t,issecondaryEmail:n,secondaryEmail:a,isPassword:o}=e;return r.A.post("/auth/profile-update-request",{email:t,issecondaryEmail:n,secondaryEmail:a,isPassword:o})},g=e=>{let{email:t,userOtp:n,issecondaryEmail:a,secondaryEmail:o,isPassword:s}=e;return r.A.post("/auth/profile-update-verify-otp",{email:t,userOtp:n,issecondaryEmail:a,secondaryEmail:o,isPassword:s})}},2877:(e,t,n)=>{"use strict";n.d(t,{K7:()=>u,OF:()=>a,d6:()=>s,kc:()=>o,st:()=>i,zZ:()=>l});var r=n(79080);const a=()=>r.A.get("/categories"),o=e=>r.A.get(`/categories/${e}/subcategories`),s=e=>r.A.get(`/categories/${e}`),l=e=>{let{data:t}=e;return r.A.post("/categories",t)},i=e=>{let{slug:t,data:n}=e;return r.A.put(`/categories/${t}`,n)},u=e=>{let{slug:t}=e;return r.A.delete(`/categories/${t}`)}},22300:(e,t,n)=>{"use strict";n.d(t,{BG:()=>i,CH:()=>c,D0:()=>v,DN:()=>m,DQ:()=>y,En:()=>l,J7:()=>p,N7:()=>f,Ok:()=>h,V6:()=>g,h7:()=>d,kE:()=>a,tH:()=>s,to:()=>u,yL:()=>b,yy:()=>o});var r=n(79080);const a=e=>{let{problemId:t,isLearner:n,courseId:a,assessmentId:o,problemsetId:s,type:l}=e;const i=new URLSearchParams({islearner:n});return a&&i.append("courseId",a),o&&i.append("assessmentId",o),s&&i.append("problemSetId",s),r.A.get(`/problems/${t}?${i.toString()}`)},o=e=>{let{problemId:t,courseId:n,assessmentId:a,problemSetId:o}=e;const s=new URLSearchParams;n&&s.append("courseId",n),a&&s.append("assessmentId",a),o&&s.append("problemSetId",o);const l=s.toString();return r.A.get(`/problems/${t}/breadcrumbs${l?`?${l}`:""}`)},s=e=>{let{problemId:t,details:n}=e;return r.A.put(`/problems/${t}`,n)},l=e=>{let{problemId:t}=e;return r.A.get(`/problems/${t}/testcases`)},i=e=>{let{details:t}=e;return r.A.post("/testcases",t)},u=e=>{let{testcaseId:t,details:n}=e;return r.A.put(`/testcases/${t}`,n)},c=e=>{let{testcaseId:t}=e;return r.A.delete(`/testcases/${t}`)},d=e=>{let{data:t}=e;return r.A.post("/autosave",t)},f=e=>{let{data:t}=e;return r.A.post("/autosave/toggle",t)},p=e=>{let{problemId:t,data:n}=e;const a=new URLSearchParams({courseId:n.courseId});return n.assessmentId&&a.append("assessmentId",n.assessmentId),r.A.post(`/problems/${t}/solve?${a.toString()}`,n)},h=e=>{let{problemId:t,data:n}=e,a=new URLSearchParams;n.problemSetId&&a.append("problemSetId",n.problemSetId),n.problemSetId&&a.append("courseId",n.courseId),n.attemptNumber&&a.append("attemptNumber",n.attemptNumber),n.problemSetSubmissionId&&a.append("problemSetSubmissionId",n.problemSetSubmissionId);const o=a.toString();return r.A.post(`/problems/${t}/submit${o?`?${o}`:""}`,n)},m=e=>{let{submissionId:t}=e;return r.A.get(`/problems/submissions/${t}/status`)},g=e=>{let{formData:t}=e;return r.A.post("/proctoring/upload-image",t,{headers:{"Content-Type":"multipart/form-data"}})},v=e=>{let{problemId:t,data:n}=e;return r.A.post(`/problems/${t}/starterCode`,n)},y=e=>{let{problemId:t}=e;return r.A.get(`/problems/${t}/starterCode`)},b=e=>{let{problemId:t}=e;return r.A.get(`/problems/${t}/export`,{responseType:"blob"})}},62851:(e,t,n)=>{"use strict";n.d(t,{CQ:()=>y,C_:()=>s,HX:()=>u,KU:()=>i,MO:()=>m,OM:()=>a,Ve:()=>c,YG:()=>l,Yl:()=>f,cW:()=>b,hC:()=>d,tF:()=>v,uc:()=>p,vc:()=>o,ve:()=>h,wS:()=>w,zs:()=>g});var r=n(79080);const a=e=>{let{search:t,page:n,limit:a}=e;return r.A.get(`/courses?search=${t}&page=${n}&limit=${a}`)},o=e=>{let{search:t}=e;return r.A.get(`/courses/published?search=${t}`)},s=e=>{let{title:t}=e;return r.A.post("/courses/",{title:t})},l=e=>r.A.get(`/courses/id/${Number(e)}`),i=async e=>{let{courseId:t,page:n=1,limit:a=10,type:o="all",download:s=!1,search:l="",sort:i="ascending",detailed:u=!1}=e;const c=new URLSearchParams({page:n,limit:a,type:o,search:l,sort:i});s&&c.set("download","csv");return(await r.A.get(`/courses/${t}/report?${c}`,{responseType:s?"blob":"json"})).data},u=e=>{let{slug:t}=e;return r.A.patch(`/courses/${t}/publish`)},c=e=>{let{id:t,data:n}=e;return r.A.put(`/courses/id/${t}`,n,{headers:{"Content-Type":"multipart/form-data"}})},d=e=>{let{id:t,learnerIds:n}=e;return r.A.post(`/courses/${t}/enrollments/remove`,{learnerIds:n})},f=e=>{let{id:t,learnerIds:n}=e;return r.A.post(`/courses/${t}/enrollments`,{learnerIds:n})},p=e=>{let{id:t,learnerEmails:n,expirationDate:a}=e;return r.A.post(`/courses/${t}/enrollments/bulk`,{learnerEmails:n,expirationDate:a})},h=e=>{let{id:t,instructorId:n}=e;return r.A.post(`/courses/${t}/instructors`,{instructorId:n})},m=e=>{let{id:t,instructorId:n}=e;return r.A.delete(`/courses/${t}/instructors/${n}`)},g=e=>{let{slug:t}=e;return r.A.delete(`/courses/${t}`)},v=e=>{let{id:t,isWithEnrollments:n}=e;return r.A.post(`/courses/${t}/clone`,{isWithEnrollments:n})},y=e=>{let{id:t,page:n,limit:a,search:o,learnersBasedOn:s}=e;return r.A.get(`/courses/${t}/enrollments?limit=${a}&page=${n}&search=${o}&learnersBasedOn=${s}`)},b=e=>{let{courseId:t}=e;return r.A.get(`/courses/${t}/dashboard`)},w=e=>{let{slug:t}=e;return r.A.patch(`courses/${t}/toggle-visible`)}},79080:(e,t,n)=>{"use strict";n.d(t,{A:()=>wt});var r={};function a(e,t){return function(){return e.apply(t,arguments)}}n.r(r),n.d(r,{hasBrowserEnv:()=>ue,hasStandardBrowserEnv:()=>de,hasStandardBrowserWebWorkerEnv:()=>fe,navigator:()=>ce,origin:()=>pe});const{toString:o}=Object.prototype,{getPrototypeOf:s}=Object,l=(i=Object.create(null),e=>{const t=o.call(e);return i[t]||(i[t]=t.slice(8,-1).toLowerCase())});var i;const u=e=>(e=e.toLowerCase(),t=>l(t)===e),c=e=>t=>typeof t===e,{isArray:d}=Array,f=c("undefined");const p=u("ArrayBuffer");const h=c("string"),m=c("function"),g=c("number"),v=e=>null!==e&&"object"===typeof e,y=e=>{if("object"!==l(e))return!1;const t=s(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},b=u("Date"),w=u("File"),x=u("Blob"),_=u("FileList"),S=u("URLSearchParams"),[k,C,j,E]=["ReadableStream","Request","Response","Headers"].map(u);function A(e,t){let n,r,{allOwnKeys:a=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),d(e))for(n=0,r=e.length;n0;)if(r=n[a],t===r.toLowerCase())return r;return null}const R="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:"undefined"!==typeof window?window:global,I=e=>!f(e)&&e!==R;const z=(N="undefined"!==typeof Uint8Array&&s(Uint8Array),e=>N&&e instanceof N);var N;const P=u("HTMLFormElement"),T=(e=>{let{hasOwnProperty:t}=e;return(e,n)=>t.call(e,n)})(Object.prototype),O=u("RegExp"),M=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,a)=>{let o;!1!==(o=t(n,a,e))&&(r[a]=o||n)})),Object.defineProperties(e,r)},$="abcdefghijklmnopqrstuvwxyz",D="0123456789",B={DIGIT:D,ALPHA:$,ALPHA_DIGIT:$+$.toUpperCase()+D};const U=u("AsyncFunction"),F=((e,t)=>{return e?setImmediate:t?(n=`axios@${Math.random()}`,r=[],R.addEventListener("message",(e=>{let{source:t,data:a}=e;t===R&&a===n&&r.length&&r.shift()()}),!1),e=>{r.push(e),R.postMessage(n,"*")}):e=>setTimeout(e);var n,r})("function"===typeof setImmediate,m(R.postMessage)),H="undefined"!==typeof queueMicrotask?queueMicrotask.bind(R):"undefined"!==typeof process&&process.nextTick||F,q={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!f(e)&&null!==e.constructor&&!f(e.constructor)&&m(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"===typeof FormData&&e instanceof FormData||m(e.append)&&("formdata"===(t=l(e))||"object"===t&&m(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:g,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:y,isReadableStream:k,isRequest:C,isResponse:j,isHeaders:E,isUndefined:f,isDate:b,isFile:w,isBlob:x,isRegExp:O,isFunction:m,isStream:e=>v(e)&&m(e.pipe),isURLSearchParams:S,isTypedArray:z,isFileList:_,forEach:A,merge:function e(){const{caseless:t}=I(this)&&this||{},n={},r=(r,a)=>{const o=t&&L(n,a)||a;y(n[o])&&y(r)?n[o]=e(n[o],r):y(r)?n[o]=e({},r):d(r)?n[o]=r.slice():n[o]=r};for(let a=0,o=arguments.length;a3&&void 0!==arguments[3]?arguments[3]:{};return A(t,((t,r)=>{n&&m(t)?e[r]=a(t,n):e[r]=t}),{allOwnKeys:r}),e},trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let a,o,l;const i={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)l=a[o],r&&!r(l,e,t)||i[l]||(t[l]=e[l],i[l]=!0);e=!1!==n&&s(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:l,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!g(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:P,hasOwnProperty:T,hasOwnProp:T,reduceDescriptors:M,freezeMethods:e=>{M(e,((t,n)=>{if(m(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];m(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:L,global:R,isContextDefined:I,ALPHABET:B,generateString:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:16,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:B.ALPHA_DIGIT,n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&m(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const a=d(e)?[]:{};return A(e,((e,t)=>{const o=n(e,r+1);!f(o)&&(a[t]=o)})),t[r]=void 0,a}}return e};return n(e,0)},isAsyncFn:U,isThenable:e=>e&&(v(e)||m(e))&&m(e.then)&&m(e.catch),setImmediate:F,asap:H};function V(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}q.inherits(V,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:q.toJSONObject(this.config),code:this.code,status:this.status}}});const W=V.prototype,Q={};["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","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{Q[e]={value:e}})),Object.defineProperties(V,Q),Object.defineProperty(W,"isAxiosError",{value:!0}),V.from=(e,t,n,r,a,o)=>{const s=Object.create(W);return q.toFlatObject(e,s,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),V.call(s,e.message,t,n,r,a),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const K=V;function G(e){return q.isPlainObject(e)||q.isArray(e)}function Y(e){return q.endsWith(e,"[]")?e.slice(0,-2):e}function Z(e,t,n){return e?e.concat(t).map((function(e,t){return e=Y(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const J=q.toFlatObject(q,{},null,(function(e){return/^is[A-Z]/.test(e)}));const X=function(e,t,n){if(!q.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=q.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!q.isUndefined(t[e])}))).metaTokens,a=n.visitor||u,o=n.dots,s=n.indexes,l=(n.Blob||"undefined"!==typeof Blob&&Blob)&&q.isSpecCompliantForm(t);if(!q.isFunction(a))throw new TypeError("visitor must be a function");function i(e){if(null===e)return"";if(q.isDate(e))return e.toISOString();if(!l&&q.isBlob(e))throw new K("Blob is not supported. Use a Buffer instead.");return q.isArrayBuffer(e)||q.isTypedArray(e)?l&&"function"===typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,a){let l=e;if(e&&!a&&"object"===typeof e)if(q.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(q.isArray(e)&&function(e){return q.isArray(e)&&!e.some(G)}(e)||(q.isFileList(e)||q.endsWith(n,"[]"))&&(l=q.toArray(e)))return n=Y(n),l.forEach((function(e,r){!q.isUndefined(e)&&null!==e&&t.append(!0===s?Z([n],r,o):null===s?n:n+"[]",i(e))})),!1;return!!G(e)||(t.append(Z(a,n,o),i(e)),!1)}const c=[],d=Object.assign(J,{defaultVisitor:u,convertValue:i,isVisitable:G});if(!q.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!q.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),q.forEach(n,(function(n,o){!0===(!(q.isUndefined(n)||null===n)&&a.call(t,n,q.isString(o)?o.trim():o,r,d))&&e(n,r?r.concat(o):[o])})),c.pop()}}(e),t};function ee(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function te(e,t){this._pairs=[],e&&X(e,this,t)}const ne=te.prototype;ne.append=function(e,t){this._pairs.push([e,t])},ne.toString=function(e){const t=e?function(t){return e.call(this,t,ee)}:ee;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};const re=te;function ae(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function oe(e,t,n){if(!t)return e;const r=n&&n.encode||ae,a=n&&n.serialize;let o;if(o=a?a(t,n):q.isURLSearchParams(t)?t.toString():new re(t,n).toString(r),o){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+o}return e}const se=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){q.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},le={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},ie={isBrowser:!0,classes:{URLSearchParams:"undefined"!==typeof URLSearchParams?URLSearchParams:re,FormData:"undefined"!==typeof FormData?FormData:null,Blob:"undefined"!==typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},ue="undefined"!==typeof window&&"undefined"!==typeof document,ce="object"===typeof navigator&&navigator||void 0,de=ue&&(!ce||["ReactNative","NativeScript","NS"].indexOf(ce.product)<0),fe="undefined"!==typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"===typeof self.importScripts,pe=ue&&window.location.href||"http://localhost",he={...r,...ie};const me=function(e){function t(e,n,r,a){let o=e[a++];if("__proto__"===o)return!0;const s=Number.isFinite(+o),l=a>=e.length;if(o=!o&&q.isArray(r)?r.length:o,l)return q.hasOwnProp(r,o)?r[o]=[r[o],n]:r[o]=n,!s;r[o]&&q.isObject(r[o])||(r[o]=[]);return t(e,n,r[o],a)&&q.isArray(r[o])&&(r[o]=function(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r{t(function(e){return q.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null};const ge={transitional:le,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,a=q.isObject(e);a&&q.isHTMLForm(e)&&(e=new FormData(e));if(q.isFormData(e))return r?JSON.stringify(me(e)):e;if(q.isArrayBuffer(e)||q.isBuffer(e)||q.isStream(e)||q.isFile(e)||q.isBlob(e)||q.isReadableStream(e))return e;if(q.isArrayBufferView(e))return e.buffer;if(q.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let o;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return X(e,new he.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return he.isNode&&q.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((o=q.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return X(o?{"files[]":e}:e,t&&new t,this.formSerializer)}}return a||r?(t.setContentType("application/json",!1),function(e,t,n){if(q.isString(e))try{return(t||JSON.parse)(e),q.trim(e)}catch(r){if("SyntaxError"!==r.name)throw r}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ge.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(q.isResponse(e)||q.isReadableStream(e))return e;if(e&&q.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(a){if(n){if("SyntaxError"===a.name)throw K.from(a,K.ERR_BAD_RESPONSE,this,null,this.response);throw a}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:he.classes.FormData,Blob:he.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};q.forEach(["delete","get","head","post","put","patch"],(e=>{ge.headers[e]={}}));const ve=ge,ye=q.toObjectSet(["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"]),be=Symbol("internals");function we(e){return e&&String(e).trim().toLowerCase()}function xe(e){return!1===e||null==e?e:q.isArray(e)?e.map(xe):String(e)}function _e(e,t,n,r,a){return q.isFunction(r)?r.call(this,t,n):(a&&(t=n),q.isString(t)?q.isString(r)?-1!==t.indexOf(r):q.isRegExp(r)?r.test(t):void 0:void 0)}class Se{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function a(e,t,n){const a=we(t);if(!a)throw new Error("header name must be a non-empty string");const o=q.findKey(r,a);(!o||void 0===r[o]||!0===n||void 0===n&&!1!==r[o])&&(r[o||t]=xe(e))}const o=(e,t)=>q.forEach(e,((e,n)=>a(e,n,t)));if(q.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(q.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))o((e=>{const t={};let n,r,a;return e&&e.split("\n").forEach((function(e){a=e.indexOf(":"),n=e.substring(0,a).trim().toLowerCase(),r=e.substring(a+1).trim(),!n||t[n]&&ye[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t);else if(q.isHeaders(e))for(const[s,l]of e.entries())a(l,s,n);else null!=e&&a(t,e,n);return this}get(e,t){if(e=we(e)){const n=q.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(q.isFunction(t))return t.call(this,e,n);if(q.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=we(e)){const n=q.findKey(this,e);return!(!n||void 0===this[n]||t&&!_e(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function a(e){if(e=we(e)){const a=q.findKey(n,e);!a||t&&!_e(0,n[a],a,t)||(delete n[a],r=!0)}}return q.isArray(e)?e.forEach(a):a(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const a=t[n];e&&!_e(0,this[a],a,e,!0)||(delete this[a],r=!0)}return r}normalize(e){const t=this,n={};return q.forEach(this,((r,a)=>{const o=q.findKey(n,a);if(o)return t[o]=xe(r),void delete t[a];const s=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(a):String(a).trim();s!==a&&delete t[a],t[s]=xe(r),n[s]=!0})),this}concat(){for(var e=arguments.length,t=new Array(e),n=0;n{null!=n&&!1!==n&&(t[r]=e&&q.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((e=>{let[t,n]=e;return t+": "+n})).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e){const t=new this(e);for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;at.set(e))),t}static accessor(e){const t=(this[be]=this[be]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=we(e);t[r]||(!function(e,t){const n=q.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,a){return this[r].call(this,t,e,n,a)},configurable:!0})}))}(n,e),t[r]=!0)}return q.isArray(e)?e.forEach(r):r(e),this}}Se.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),q.reduceDescriptors(Se.prototype,((e,t)=>{let{value:n}=e,r=t[0].toUpperCase()+t.slice(1);return{get:()=>n,set(e){this[r]=e}}})),q.freezeMethods(Se);const ke=Se;function Ce(e,t){const n=this||ve,r=t||n,a=ke.from(r.headers);let o=r.data;return q.forEach(e,(function(e){o=e.call(n,o,a.normalize(),t?t.status:void 0)})),a.normalize(),o}function je(e){return!(!e||!e.__CANCEL__)}function Ee(e,t,n){K.call(this,null==e?"canceled":e,K.ERR_CANCELED,t,n),this.name="CanceledError"}q.inherits(Ee,K,{__CANCEL__:!0});const Ae=Ee;function Le(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new K("Request failed with status code "+n.status,[K.ERR_BAD_REQUEST,K.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}const Re=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a,o=0,s=0;return t=void 0!==t?t:1e3,function(l){const i=Date.now(),u=r[s];a||(a=i),n[o]=l,r[o]=i;let c=s,d=0;for(;c!==o;)d+=n[c++],c%=e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),i-a1&&void 0!==arguments[1]?arguments[1]:Date.now();a=o,n=null,r&&(clearTimeout(r),r=null),e.apply(null,t)};return[function(){const e=Date.now(),t=e-a;for(var l=arguments.length,i=new Array(l),u=0;u=o?s(i,e):(n=i,r||(r=setTimeout((()=>{r=null,s(n)}),o-t)))},()=>n&&s(n)]},ze=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3,r=0;const a=Re(50,250);return Ie((n=>{const o=n.loaded,s=n.lengthComputable?n.total:void 0,l=o-r,i=a(l);r=o;e({loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:i||void 0,estimated:i&&s&&o<=s?(s-o)/i:void 0,event:n,lengthComputable:null!=s,[t?"download":"upload"]:!0})}),n)},Ne=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Pe=e=>function(){for(var t=arguments.length,n=new Array(t),r=0;re(...n)))},Te=he.hasStandardBrowserEnv?function(){const e=he.navigator&&/(msie|trident)/i.test(he.navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=q.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0},Oe=he.hasStandardBrowserEnv?{write(e,t,n,r,a,o){const s=[e+"="+encodeURIComponent(t)];q.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),q.isString(r)&&s.push("path="+r),q.isString(a)&&s.push("domain="+a),!0===o&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const $e=e=>e instanceof ke?{...e}:e;function De(e,t){t=t||{};const n={};function r(e,t,n){return q.isPlainObject(e)&&q.isPlainObject(t)?q.merge.call({caseless:n},e,t):q.isPlainObject(t)?q.merge({},t):q.isArray(t)?t.slice():t}function a(e,t,n){return q.isUndefined(t)?q.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function o(e,t){if(!q.isUndefined(t))return r(void 0,t)}function s(e,t){return q.isUndefined(t)?q.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function l(n,a,o){return o in t?r(n,a):o in e?r(void 0,n):void 0}const i={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(e,t)=>a($e(e),$e(t),!0)};return q.forEach(Object.keys(Object.assign({},e,t)),(function(r){const o=i[r]||a,s=o(e[r],t[r],r);q.isUndefined(s)&&o!==l||(n[r]=s)})),n}const Be=e=>{const t=De({},e);let n,{data:r,withXSRFToken:a,xsrfHeaderName:o,xsrfCookieName:s,headers:l,auth:i}=t;if(t.headers=l=ke.from(l),t.url=oe(Me(t.baseURL,t.url),e.params,e.paramsSerializer),i&&l.set("Authorization","Basic "+btoa((i.username||"")+":"+(i.password?unescape(encodeURIComponent(i.password)):""))),q.isFormData(r))if(he.hasStandardBrowserEnv||he.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(!1!==(n=l.getContentType())){const[e,...t]=n?n.split(";").map((e=>e.trim())).filter(Boolean):[];l.setContentType([e||"multipart/form-data",...t].join("; "))}if(he.hasStandardBrowserEnv&&(a&&q.isFunction(a)&&(a=a(t)),a||!1!==a&&Te(t.url))){const e=o&&s&&Oe.read(s);e&&l.set(o,e)}return t},Ue="undefined"!==typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){const r=Be(e);let a=r.data;const o=ke.from(r.headers).normalize();let s,l,i,u,c,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),c&&c(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=ke.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Le((function(e){t(e),h()}),(function(e){n(e),h()}),{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new K("Request aborted",K.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new K("Network Error",K.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const a=r.transitional||le;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new K(t,a.clarifyTimeoutError?K.ETIMEDOUT:K.ECONNABORTED,e,m)),m=null},void 0===a&&o.setContentType(null),"setRequestHeader"in m&&q.forEach(o.toJSON(),(function(e,t){m.setRequestHeader(t,e)})),q.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([i,c]=ze(p,!0),m.addEventListener("progress",i)),f&&m.upload&&([l,u]=ze(f),m.upload.addEventListener("progress",l),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(s=t=>{m&&(n(!t||t.type?new Ae(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const v=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);v&&-1===he.protocols.indexOf(v)?n(new K("Unsupported protocol "+v+":",K.ERR_BAD_REQUEST,e)):m.send(a||null)}))},Fe=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const a=function(e){if(!n){n=!0,s();const t=e instanceof Error?e:this.reason;r.abort(t instanceof K?t:new Ae(t instanceof Error?t.message:t))}};let o=t&&setTimeout((()=>{o=null,a(new K(`timeout ${t} of ms exceeded`,K.ETIMEDOUT))}),t);const s=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach((e=>{e.unsubscribe?e.unsubscribe(a):e.removeEventListener("abort",a)})),e=null)};e.forEach((e=>e.addEventListener("abort",a)));const{signal:l}=r;return l.unsubscribe=()=>q.asap(s),l}},He=function*(e,t){let n=e.byteLength;if(!t||n{const a=async function*(e,t){for await(const n of qe(e))yield*He(n,t)}(e,t);let o,s=0,l=e=>{o||(o=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await a.next();if(t)return l(),void e.close();let o=r.byteLength;if(n){let e=s+=o;n(e)}e.enqueue(new Uint8Array(r))}catch(t){throw l(t),t}},cancel:e=>(l(e),a.return())},{highWaterMark:2})},We="function"===typeof fetch&&"function"===typeof Request&&"function"===typeof Response,Qe=We&&"function"===typeof ReadableStream,Ke=We&&("function"===typeof TextEncoder?(Ge=new TextEncoder,e=>Ge.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var Ge;const Ye=function(e){try{for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{let e=!1;const t=new Request(he.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t})),Je=Qe&&Ye((()=>q.isReadableStream(new Response("").body))),Xe={stream:Je&&(e=>e.body)};var et;We&&(et=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((e=>{!Xe[e]&&(Xe[e]=q.isFunction(et[e])?t=>t[e]():(t,n)=>{throw new K(`Response type '${e}' is not supported`,K.ERR_NOT_SUPPORT,n)})})));const tt=async(e,t)=>{const n=q.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(q.isBlob(e))return e.size;if(q.isSpecCompliantForm(e)){const t=new Request(he.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return q.isArrayBufferView(e)||q.isArrayBuffer(e)?e.byteLength:(q.isURLSearchParams(e)&&(e+=""),q.isString(e)?(await Ke(e)).byteLength:void 0)})(t):n},nt={http:null,xhr:Ue,fetch:We&&(async e=>{let{url:t,method:n,data:r,signal:a,cancelToken:o,timeout:s,onDownloadProgress:l,onUploadProgress:i,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=Be(e);u=u?(u+"").toLowerCase():"text";let p,h=Fe([a,o&&o.toAbortSignal()],s);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(i&&Ze&&"get"!==n&&"head"!==n&&0!==(g=await tt(c,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(q.isFormData(r)&&(e=n.headers.get("content-type"))&&c.setContentType(e),n.body){const[e,t]=Ne(g,ze(Pe(i)));r=Ve(n.body,65536,e,t)}}q.isString(d)||(d=d?"include":"omit");const a="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:a?d:void 0});let o=await fetch(p);const s=Je&&("stream"===u||"response"===u);if(Je&&(l||s&&m)){const e={};["status","statusText","headers"].forEach((t=>{e[t]=o[t]}));const t=q.toFiniteNumber(o.headers.get("content-length")),[n,r]=l&&Ne(t,ze(Pe(l),!0))||[];o=new Response(Ve(o.body,65536,n,(()=>{r&&r(),m&&m()})),e)}u=u||"text";let v=await Xe[q.findKey(Xe,u)||"text"](o,e);return!s&&m&&m(),await new Promise(((t,n)=>{Le(t,n,{data:v,headers:ke.from(o.headers),status:o.status,statusText:o.statusText,config:e,request:p})}))}catch(v){if(m&&m(),v&&"TypeError"===v.name&&/fetch/i.test(v.message))throw Object.assign(new K("Network Error",K.ERR_NETWORK,e,p),{cause:v.cause||v});throw K.from(v,v&&v.code,e,p)}})};q.forEach(nt,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(n){}Object.defineProperty(e,"adapterName",{value:t})}}));const rt=e=>`- ${e}`,at=e=>q.isFunction(e)||null===e||!1===e,ot=e=>{e=q.isArray(e)?e:[e];const{length:t}=e;let n,r;const a={};for(let o=0;o{let[t,n]=e;return`adapter ${t} `+(!1===n?"is not supported by the environment":"is not available in the build")}));let n=t?e.length>1?"since :\n"+e.map(rt).join("\n"):" "+rt(e[0]):"as no adapter specified";throw new K("There is no suitable adapter to dispatch the request "+n,"ERR_NOT_SUPPORT")}return r};function st(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ae(null,e)}function lt(e){st(e),e.headers=ke.from(e.headers),e.data=Ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ot(e.adapter||ve.adapter)(e).then((function(t){return st(e),t.data=Ce.call(e,e.transformResponse,t),t.headers=ke.from(t.headers),t}),(function(t){return je(t)||(st(e),t&&t.response&&(t.response.data=Ce.call(e,e.transformResponse,t.response),t.response.headers=ke.from(t.response.headers))),Promise.reject(t)}))}const it="1.7.7",ut={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ut[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const ct={};ut.transitional=function(e,t,n){function r(e,t){return"[Axios v1.7.7] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,a,o)=>{if(!1===e)throw new K(r(a," has been removed"+(t?" in "+t:"")),K.ERR_DEPRECATED);return t&&!ct[a]&&(ct[a]=!0,console.warn(r(a," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,a,o)}};const dt={assertOptions:function(e,t,n){if("object"!==typeof e)throw new K("options must be an object",K.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],s=t[o];if(s){const t=e[o],n=void 0===t||s(t,o,e);if(!0!==n)throw new K("option "+o+" must be "+n,K.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new K("Unknown option "+o,K.ERR_BAD_OPTION)}},validators:ut},ft=dt.validators;class pt{constructor(e){this.defaults=e,this.interceptors={request:new se,response:new se}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let e;Error.captureStackTrace?Error.captureStackTrace(e={}):e=new Error;const t=e.stack?e.stack.replace(/^.+\n/,""):"";try{n.stack?t&&!String(n.stack).endsWith(t.replace(/^.+\n.+\n/,""))&&(n.stack+="\n"+t):n.stack=t}catch(r){}}throw n}}_request(e,t){"string"===typeof e?(t=t||{}).url=e:t=e||{},t=De(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:a}=t;void 0!==n&&dt.assertOptions(n,{silentJSONParsing:ft.transitional(ft.boolean),forcedJSONParsing:ft.transitional(ft.boolean),clarifyTimeoutError:ft.transitional(ft.boolean)},!1),null!=r&&(q.isFunction(r)?t.paramsSerializer={serialize:r}:dt.assertOptions(r,{encode:ft.function,serialize:ft.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&q.merge(a.common,a[t.method]);a&&q.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete a[e]})),t.headers=ke.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(l=l&&e.synchronous,s.unshift(e.fulfilled,e.rejected))}));const i=[];let u;this.interceptors.response.forEach((function(e){i.push(e.fulfilled,e.rejected)}));let c,d=0;if(!l){const e=[lt.bind(this),void 0];for(e.unshift.apply(e,s),e.push.apply(e,i),c=e.length,u=Promise.resolve(t);d{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,a){n.reason||(n.reason=new Ae(e,r,a),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new mt((function(t){e=t})),cancel:e}}}const gt=mt;const vt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(vt).forEach((e=>{let[t,n]=e;vt[n]=t}));const yt=vt;const bt=function e(t){const n=new ht(t),r=a(ht.prototype.request,n);return q.extend(r,ht.prototype,n,{allOwnKeys:!0}),q.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(De(t,n))},r}(ve);bt.Axios=ht,bt.CanceledError=Ae,bt.CancelToken=gt,bt.isCancel=je,bt.VERSION=it,bt.toFormData=X,bt.AxiosError=K,bt.Cancel=bt.CanceledError,bt.all=function(e){return Promise.all(e)},bt.spread=function(e){return function(t){return e.apply(null,t)}},bt.isAxiosError=function(e){return q.isObject(e)&&!0===e.isAxiosError},bt.mergeConfig=De,bt.AxiosHeaders=ke,bt.formToJSON=e=>me(q.isHTMLForm(e)?new FormData(e):e),bt.getAdapter=ot,bt.HttpStatusCode=yt,bt.default=bt;const wt=bt.create({baseURL:"https://bd3xlszezk.execute-api.ap-south-1.amazonaws.com/api",headers:{"Content-Type":"application/json"},withCredentials:!0})},10131:(e,t,n)=>{"use strict";n.d(t,{Ag:()=>l,B2:()=>j,BJ:()=>u,DU:()=>y,FS:()=>A,GO:()=>x,Jx:()=>w,LW:()=>a,O7:()=>h,QH:()=>k,V6:()=>v,VK:()=>C,Vy:()=>g,aZ:()=>_,bC:()=>R,cZ:()=>L,dg:()=>c,ew:()=>m,hG:()=>f,ph:()=>b,pk:()=>p,tN:()=>S,vM:()=>s,xA:()=>d,yu:()=>i,zu:()=>o,zx:()=>E});var r=n(79080);const a=e=>{let{data:t}=e;return r.A.post("/lsrw",t)},o=e=>{let{exerciseId:t,page:n,limit:a}=e;return r.A.get(`/lsrw/${t}/questions`,{params:{page:n,limit:a}})},s=e=>{let{exerciseId:t,questionId:n}=e;r.A.delete(`/lsrw/${t}/questions/${n}`)},l=e=>{let{exerciseId:t,questionId:n}=e;return r.A.get(`/lsrw/${t}/questions/${n}`)},i=e=>{let{exerciseId:t,questionId:n,data:a}=e;return r.A.put(`/lsrw/${t}/questions/${n}`,a)},u=e=>{let{exerciseId:t,data:n}=e;return r.A.post(`/lsrw/${t}/bulk`,n,{headers:{"Content-Type":"multipart/form-data"}})},c=e=>{let{exerciseId:t,courseId:n,assessmentId:a}=e;const o=new URLSearchParams;n&&o.append("courseId",n),a&&o.append("assessmentId",a);const s=o.toString();return r.A.get(`/lsrw/${t}${s?`?${s}`:""}`)},d=e=>{let{exerciseId:t,courseId:n,assessmentId:a}=e;const o=new URLSearchParams;n&&o.append("courseId",n),a&&o.append("assessmentId",a);const s=o.toString();return r.A.get(`/lsrw/${t}/breadcrumbs${s?`?${s}`:""}`)},f=e=>{let{exerciseId:t,data:n}=e;return r.A.post(`/lsrw/${t}/questions`,n)},p=e=>{let{exerciseId:t}=e;return r.A.post(`lsrw/${t}/start`)},h=e=>{let{exerciseId:t,updatedData:n}=e;return r.A.put(`/lsrw/${t}`,n)},m=e=>{let{exerciseId:t,attemptNumber:n,courseId:a}=e;return r.A.post(`/lsrw/${t}/attempts/${n}/details`,{courseId:a})},g=e=>{let{exerciseId:t,attemptNumber:n,warning_count:a}=e;return r.A.post(`/lsrw/${t}/attempts/${n}/warning`,{warning_count:a})},v=e=>{let{formData:t}=e;return r.A.post("/proctoring/upload-image",t,{headers:{"Content-Type":"multipart/form-data"}})},y=e=>{let{exerciseId:t,attemptNumber:n,courseId:a}=e;return r.A.post(`/lsrw/${t}/attempts/${n}/submit`,{courseId:a})},b=e=>{let{exerciseId:t,questionNumber:n,attemptNumber:a}=e;return r.A.get(`/lsrw/${t}/attempts/${a}/question/${n}`)},w=e=>{let{exerciseId:t,attemptNumber:n,questionId:a,answerIds:o}=e;return r.A.post(`/lsrw/${t}/attempts/${n}/question/${a}/answer`,{answerIds:o})},x=e=>{let{exerciseId:t,attemptNumber:n}=e;return r.A.get(`/lsrw/${t}/resume?attemptNumber=${n}`)},_=e=>{let{exerciseId:t,historyId:n,page:a=1,limit:o=10,learnerId:s=null}=e;return r.A.get(`/lsrw/${t}/summary/${n}?page=${a}&limit=${o}&learnerId=${s}`)},S=e=>{let{courseId:t,exerciseId:n,statusFilter:a=[],page:o=1,limit:s=10,download:l=!1,detailed:i=!1}=e;const u=new URLSearchParams({page:o,limit:s,download:l,detailed:i,...a.length&&{status:a.join(",")}});return r.A.get(`/courses/${t}/lsrw/${n}/report?${u}`)},k=e=>{let{courseId:t,exerciseId:n,userId:a,statusFilter:o=[],page:s=1,limit:l=10}=e;const i=new URLSearchParams({page:s,limit:l,...o.length&&{status:o.join(",")}});return r.A.get(`/courses/${t}/lsrw/${n}/report/${a}?${i}`)},C=e=>{let{exerciseId:t,userId:n}=e;return r.A.delete(`/lsrw/${t}/report/${n}`)},j=e=>{let{search:t,courseId:n,exerciseId:a,statusFilter:o=[],page:s=1,limit:l=50,download:i=!1,sort:u="ascending",type:c="all"}=e;const d=new URLSearchParams({page:s,limit:l,download:i,search:t,sort:u,...o.length&&{status:o.join(",")}});return r.A.get(`/courses/${n}/lsrw/${a}/attempts-report?${d}`)},E=e=>{let{exerciseId:t,questionId:n,historyId:a}=e;return r.A.get(`/lsrw/${t}/questions/${n}/summary/${a}`)},A=e=>{let{exerciseId:t}=e;return r.A.get(`/lsrw/${t}/questions?sample=true`,{responseType:"blob"})},L=e=>{let{exerciseId:t}=e;return r.A.get(`/lsrw/${t}/export_questions`,{responseType:"blob"})},R=e=>{let{exerciseId:t,questionsState:n}=e;return r.A.put(`/lsrw/${t}/questions`,n)}},65844:(e,t,n)=>{"use strict";n.d(t,{$S:()=>o,$w:()=>p,BF:()=>s,G8:()=>k,Gm:()=>y,JO:()=>g,KA:()=>f,LD:()=>h,QP:()=>_,TO:()=>S,Uh:()=>d,YB:()=>c,ZC:()=>C,aH:()=>b,hm:()=>l,o8:()=>v,pm:()=>u,rh:()=>x,s:()=>i,te:()=>w,uk:()=>m,vn:()=>a});var r=n(79080);const a=e=>{let{id:t,title:n,order:a}=e;return r.A.post("/modules/",{courseId:t,title:n,order:a})},o=e=>{let{id:t}=e;return r.A.get(`/courses/${t}/modules/`)},s=e=>{let{assessmentId:t,title:n,order:a}=e;return r.A.post("/modules/",{assessmentId:t,title:n,order:a})},l=e=>{let{assessmentId:t}=e;return r.A.get(`/assessments/${t}/modules/`)},i=e=>{let{id:t}=e;return r.A.delete(`modules/${t}`)},u=e=>{let{data:t}=e;return r.A.put("modules/",{modules:t})},c=e=>{let{id:t,data:n}=e;return r.A.put(`modules/${t}`,{title:n.title,order:n.order,isVisible:n.isVisible})},d=e=>{let{moduleId:t,resourceId:n,data:a}=e;return r.A.put(`/modules/${t}/resources/${n}`,a)},f=e=>{let{data:t}=e;return r.A.post("/quizzes",t)},p=e=>{let{id:t,data:n}=e;return r.A.put(`/moduleItem/${t}`,n)},h=e=>{let{id:t}=e;return r.A.delete(`/moduleItem/${t}`)},m=e=>{let{id:t,data:n}=e;return r.A.post(`modules/${t}/resources`,n,{headers:{"Content-Type":"multipart/form-data"}})},g=e=>r.A.get(`/modules/1/export?sample=true&file=${e}`,{responseType:"blob"}),v=e=>{let{id:t}=e;return r.A.delete(`modules/resources/${t}`)},y=e=>{let{data:t}=e;return r.A.post("/problems/module",t)},b=e=>{let{id:t}=e;return r.A.post(`modules/${t}/clone`)},w=e=>{let{id:t,moduleId:n}=e;return r.A.post(`modules/${n}/moduleItem/${t}/clone`)},x=e=>{let{moduleId:t,order:n,formData:a}=e;const o=new URLSearchParams({moduleId:t,order:n});return r.A.post(`/problems/module/upload?${o}`,a,{headers:{"Content-Type":"multipart/form-data"}})},_=e=>{let{moduleId:t,order:n,formData:a}=e;const o=new URLSearchParams({moduleId:t,order:n});return r.A.post(`/problems/module/upload/zip?${o}`,a,{headers:{"Content-Type":"multipart/form-data"}})},S=e=>{let{id:t}=e;return r.A.get(`/modules/${t}/export`,{responseType:"blob"})},k=e=>{let{moduleIds:t}=e;return r.A.post("/modules/export",{moduleIds:t},{responseType:"blob"})},C=e=>{let{courseId:t,order:n,formData:a}=e;const o=new URLSearchParams({courseId:t,startingOrder:n});return r.A.post(`/modules/bulk/import?${o}`,a,{headers:{"Content-Type":"multipart/form-data"}})}},12819:(e,t,n)=>{"use strict";n.d(t,{A$:()=>o,F6:()=>i,Gs:()=>g,R8:()=>s,Rh:()=>d,Sd:()=>l,Sy:()=>f,T_:()=>y,Zc:()=>v,ag:()=>a,cG:()=>c,gr:()=>m,mx:()=>p,oj:()=>h,ov:()=>u});var r=n(79080);const a=e=>r.A.post("/problemsets/",e),o=e=>r.A.get(`/problemsets/${e}`),s=e=>{let{problemSetId:t,data:n}=e;return r.A.put(`/problemsets/${t}`,n)},l=e=>{let{problemSetId:t,data:n}=e;return r.A.post(`/problemsets/${t}/problems/create`,n)},i=e=>{let{problemSetId:t,problemId:n}=e;return r.A.delete(`/problemsets/${t}/problems/${n}`)},u=e=>{let{problemSetId:t,problems:n}=e;return r.A.put(`/problemsets/${t}/problems/reorder`,{problems:n})},c=e=>{let{problemSetId:t,problemId:n,grade_weight:a}=e;return r.A.put(`/problemsets/${t}/problems/${n}/grade-weight`,{grade_weight:a})},d=(e,t)=>r.A.get(`/problemsets/${e}/submissions`,{params:t}),f=async e=>{let{problemSetId:t,page:n=1,limit:a=10,download:o=!1,search:s="",sort:l="ascending"}=e;const i=new URLSearchParams({page:n,limit:a,search:s,sort:l});o&&i.set("download","csv");return(await r.A.get(`/problemsets/${t}/report?${i.toString()}`,{responseType:o?"blob":"json"})).data},p=e=>{let{problemsetId:t,attemptNumber:n}=e;return r.A.get(`/problemsets/${t}/attempts/${n}`)},h=e=>{let{problemSetId:t}=e;return r.A.post(`/problemsets/${t}/start`)},m=e=>{let{id:t,warning_count:n}=e;return r.A.post(`/problemsets/submissions/${t}/warning`,{warning_count:n})},g=e=>{let{submissionId:t}=e;return r.A.post(`/problemsets/submissions/${t}/submit`)},v=e=>{let{submissionId:t,elapsedTime:n}=e;return r.A.post(`/problemsets/submissions/${t}/update-time`,{elapsedTime:n})},y=e=>r.A.get(`/problemsets/submissions/${e}/details`)},50820:(e,t,n)=>{"use strict";n.d(t,{E1:()=>c,F4:()=>m,IG:()=>f,Jx:()=>i,KI:()=>S,NT:()=>C,Vy:()=>u,aV:()=>v,ap:()=>k,cZ:()=>y,fe:()=>b,gi:()=>s,hG:()=>h,iQ:()=>o,ph:()=>l,pm:()=>p,qf:()=>x,r0:()=>j,s8:()=>E,sr:()=>w,ul:()=>_,yZ:()=>a,z5:()=>d,zu:()=>g});var r=n(79080);const a=e=>{let{quizId:t,courseId:n,assessmentId:a}=e;const o=new URLSearchParams;n&&o.append("courseId",n),a&&o.append("assessmentId",a);const s=o.toString();return r.A.get(`/quizzes/${t}${s?`?${s}`:""}`)},o=e=>{let{quizId:t,courseId:n,assessmentId:a}=e;const o=new URLSearchParams;n&&o.append("courseId",n),a&&o.append("assessmentId",a);const s=o.toString();return r.A.get(`/quizzes/${t}/breadcrumbs${s?`?${s}`:""}`)},s=e=>{let{quizId:t}=e;return r.A.post(`/quizzes/${t}/start`)},l=e=>{let{quizId:t,questionNumber:n,attemptNumber:a}=e;return r.A.get(`/quizzes/${t}/attempts/${a}/question/${n}`)},i=e=>{let{quizId:t,attemptNumber:n,questionId:a,answerIds:o}=e;return r.A.post(`/quizzes/${t}/attempts/${n}/question/${a}/answer`,{answerIds:o})},u=e=>{let{quizId:t,attemptNumber:n,warning_count:a}=e;return r.A.post(`/quizzes/${t}/attempts/${n}/warning`,{warning_count:a})},c=e=>{let{quizId:t,attemptNumber:n,courseId:a}=e;return r.A.post(`/quizzes/${t}/attempts/${n}/submit`,{courseId:a})},d=e=>{let{quizId:t,attemptNumber:n,courseId:a,assessmentId:o}=e;return r.A.post(`/quizzes/${t}/attempts/${n}`,{courseId:a,assessmentId:o})},f=e=>{let{quizId:t,historyId:n,page:a=1,limit:o=10,learnerId:s=null}=e;return r.A.get(`/quizzes/${t}/summary/${n}?page=${a}&limit=${o}&learnerId=${s}`)},p=e=>{let{quizId:t,updatedData:n}=e;return r.A.put(`/quizzes/${t}`,n)},h=e=>{let{quizId:t,question:n}=e;return r.A.post(`/quizzes/${t}`,n)},m=e=>{let{quizId:t,formData:n}=e;return r.A.post(`/quizzes/${t}/bulk`,n,{headers:{"Content-Type":"multipart/form-data"}})},g=e=>{let{quizId:t,page:n,limit:a}=e;return r.A.get(`/quizzes/${t}/questions`,{params:{page:n,limit:a}})},v=e=>{let{quizId:t}=e;return r.A.get(`/quizzes/${t}/questions?sample=true`,{responseType:"blob"})},y=e=>{let{quizId:t}=e;return r.A.get(`/quizzes/${t}/export_questions`,{responseType:"blob"})},b=e=>{let{questionId:t,quizId:n}=e;return r.A.get(`/quizzes/${n}/questions/${t}`)},w=e=>{let{quizId:t,questionId:n,question:a}=e;return r.A.put(`/quizzes/${t}/questions/${n}`,a)},x=e=>{let{quizId:t,questionsState:n}=e;return r.A.put(`/quizzes/${t}/questions`,n)},_=e=>{let{questionId:t,quizId:n}=e;return r.A.delete(`/quizzes/${n}/questions/${t}`)},S=e=>{let{courseId:t,quizId:n,statusFilter:a=[],page:o=1,limit:s=10,download:l=!1,detailed:i=!1}=e;const u=new URLSearchParams({page:o,limit:s,download:l,detailed:i,...a.length&&{status:a.join(",")}});return r.A.get(`/courses/${t}/quiz/${n}/report?${u}`)},k=e=>{let{search:t,courseId:n,quizId:a,statusFilter:o=[],page:s=1,limit:l=50,download:i=!1,sort:u="ascending",type:c="all"}=e;const d=new URLSearchParams({page:s,limit:l,download:i,search:t,sort:u,...o.length&&{status:o.join(",")}});return r.A.get(`/courses/${n}/quiz/${a}/attempts-report?${d}`)},C=e=>{let{quizId:t,questionId:n,historyId:a}=e;return r.A.get(`/quizzes/${t}/questions/${n}/summary/${a}`)},j=e=>{let{courseId:t,quizId:n,userId:a,statusFilter:o=[],page:s=1,limit:l=10}=e;const i=new URLSearchParams({page:s,limit:l,...o.length&&{status:o.join(",")}});return r.A.get(`/courses/${t}/quiz/${n}/report/${a}?${i}`)},E=e=>{let{quizId:t,userId:n}=e;return r.A.delete(`/quizzes/${t}/report/${n}`)}},35628:(e,t,n)=>{"use strict";n.d(t,{S4:()=>o,T9:()=>l,UA:()=>a,jQ:()=>i,tZ:()=>s});var r=n(79080);const a=e=>r.A.post("/sessions/course/start",{courseId:e}),o=e=>r.A.post("/sessions/course/exit",{courseId:e}),s=e=>r.A.post("/sessions/assessment/start",{assessmentId:e}),l=e=>r.A.post("/sessions/assessment/exit",{assessmentId:e}),i=e=>r.A.post("/sessions/heartbeat",e)},27029:(e,t,n)=>{"use strict";n.d(t,{AA:()=>f,AC:()=>j,AH:()=>h,Bp:()=>S,CD:()=>d,CF:()=>a,CL:()=>I,DO:()=>v,Dx:()=>g,H4:()=>x,Ik:()=>$,KC:()=>p,LD:()=>b,Lb:()=>P,MH:()=>L,On:()=>D,Pl:()=>w,Qc:()=>O,Tv:()=>N,UC:()=>i,Wd:()=>m,Wz:()=>z,Yy:()=>A,__:()=>M,aK:()=>o,g9:()=>l,gW:()=>C,hA:()=>R,hW:()=>_,jW:()=>T,kg:()=>k,kl:()=>u,mY:()=>s,mt:()=>E,v2:()=>y,yI:()=>c});var r=n(79080);const a=e=>{let{search:t,list:n,page:a,limit:o,role:s}=e;return r.A.get(`/users?role=${s}&page=${a}&limit=${o}&search=${t}&list=${n}`)},o=e=>{let{id:t}=e;return r.A.get(`/learners/${t}`)},s=async e=>{let{id:t}=e;return r.A.get(`/users/${t}/dashboard`)},l=e=>{let{id:t}=e;return r.A.get(`/instructors/${t}`)},i=e=>{let{id:t}=e;return r.A.get(`/admins/${t}`)},u=e=>{let{id:t}=e;return r.A.get(`/users/${t}`)},c=e=>{let{id:t,data:n}=e;return r.A.put(`/admins/${t}/status`,n)},d=e=>{let{id:t,data:n}=e;return r.A.put(`/learners/${t}/status`,n)},f=e=>{let{id:t,data:n}=e;return r.A.put(`/instructors/${t}/status`,n)},p=e=>{let{id:t,data:n}=e;return r.A.put(`/admins/${t}`,n)},h=e=>{let{id:t,data:n}=e;return r.A.put(`/instructors/${t}`,n)},m=e=>{let{id:t,data:n}=e;return r.A.put(`/learners/${t}`,n,{headers:{"Content-Type":"multipart/form-data"}})},g=e=>{let{id:t,data:n}=e;return r.A.put(`/admins/${t}/password`,n)},v=e=>{let{id:t,data:n}=e;return r.A.put(`/instructors/${t}/password`,n)},y=e=>{let{id:t,data:n}=e;return r.A.put(`/learners/${t}/password`,n)},b=e=>{let{id:t,data:n}=e;return r.A.put(`/users/${t}`,n)},w=e=>{let{id:t}=e;return r.A.delete(`/admins/${t}`)},x=e=>{let{id:t}=e;return r.A.delete(`/learners/${t}`)},_=e=>{let{id:t}=e;return r.A.delete(`/instructors/${t}`)},S=()=>r.A.delete("/users/guests-remove"),k=e=>{let{data:t}=e;return r.A.post("/users",{userData:t.userData,useDefaultPassword:t.useDefaultPassword})},C=e=>{let{data:t}=e;return r.A.post("/users/bulk",t,{headers:{"Content-Type":"multipart/form-data"}})},j=e=>{let{data:t}=e;return r.A.put("/settings",t)},E=()=>r.A.get("/settings"),A=e=>{let{id:t,data:n}=e;return r.A.put(`/users/${t}/super-admin`,n)},L=e=>{let{id:t,data:n,forceToChange:a}=e;return r.A.put(`/users/${t}/update-password?forceToChange=${a}`,n)},R=()=>r.A.delete("/admins/settings/session-images"),I=e=>{let{id:t,courseId:n,expiryDate:a}=e;return r.A.put(`/users/${t}/course/${n}/expiry`,{expiryDate:a,isPerUserExpiry:!0})},z=e=>{let{ids:t}=e;return r.A.post("/users/export/selected",{ids:t},{responseType:"blob",headers:{Accept:"text/csv"}})},N=e=>{let{ids:t}=e;return r.A.post("/users/delete/selected",{ids:t})},P=()=>r.A.get("/users/sample-users",{responseType:"blob",headers:{Accept:"text/csv"}}),T=async e=>{let{learnerId:t,filter:n,page:a,limit:o}=e;return r.A.get(`/learners/${t}/logs`,{params:{filter:n,page:a,limit:o}})},O=async e=>{let{learnerId:t}=e;return r.A.get(`/learners/${t}/recentActivities`)},M=async e=>{let{learnerId:t}=e;return r.A.get(`/learners/${t}/badges`)},$=async e=>{let{learnerId:t,year:n,period:a=3,quarter:o=1}=e;return r.A.get(`/learners/${t}/submission-calendar`,{params:{year:n,period:a,quarter:o}})},D=async e=>{let{learnerId:t}=e;return r.A.get(`/learners/${t}/submission-years`)}},33390:(e,t,n)=>{"use strict";n.d(t,{A:()=>m,M:()=>h});var r=n(9950),a=n(28429),o=n(38845),s=n(93138),l=n(44851),i=n(63310),u=n(65844),c=n(44414);const d=(0,r.createContext)(),f=(e,t)=>{switch(t.type){case"FETCH_SUCCESS":return{...e,...t.payload};case"COMMON_UPDATE":return{...e,[t.payload.field]:t.payload.value};default:return e}},p={title:"",start_time:null,end_time:null,start_time_enabled:!1,end_time_enabled:!1,isVisible:!1,notification_schedules:[],courseId:null,course:null,enableSaveBtn:!1},h=e=>{let{children:t}=e;const{id:n,assessmentId:h}=(0,a.g)(),m=(0,i.d)(),{data:g,isLoading:v,execute:y}=(0,o.A)(s.Zy),b=(0,o.A)(s.G3),[w,x]=(0,r.useState)(!1),[_,S]=(0,r.useReducer)(f,p),[k,C]=(0,r.useState)(!1),{isLoading:j,execute:E}=(0,o.A)(u.hm),[A,L]=(0,r.useState)([]),[R,I]=(0,r.useState)(0),[z,N]=(0,r.useState)(null),{execute:P,isLoading:T}=(0,o.A)(u.pm),[O,M]=(0,r.useState)(null),[$,D]=(0,r.useState)(null),[B,U]=(0,r.useState)([]),[F,H]=(0,r.useState)([]),[q,V]=(0,r.useState)(null),[W,Q]=(0,r.useState)(null),{execute:K,isLoading:G}=(0,o.A)(u.$w);(0,r.useEffect)((()=>{(async()=>{var e;const t=await E({assessmentId:h});(null===(e=t.data)||void 0===e?void 0:e.length)>0&&L(t.data)})()}),[E,h,R]);const Y=(0,r.useCallback)(((e,t,n)=>{L((r=>r.map((r=>r.id===e?{...r,[t]:n}:r)))),C(!0)}),[]),Z=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;if((null===e||void 0===e?void 0:e.length)>0){(await P({data:e})).error||I((e=>e+1))}};(0,r.useEffect)((()=>{y({assessmentId:h})}),[y,h]),(0,r.useEffect)((()=>{S({type:"FETCH_SUCCESS",payload:g})}),[g]);const J=(0,r.useCallback)(((e,t)=>{_[e]!==t&&(S({type:"COMMON_UPDATE",payload:{field:e,value:t}}),S({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!0}}))}),[_]);return v||j?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh"},children:(0,c.jsx)(l.A,{})}):g&&A&&(0,c.jsx)(d.Provider,{value:{assessmentId:h,courseId:n,data:_,modules:A,updateItemIsLoading:G,handleChanges:J,updateData:async()=>{const e=["title"];for(let r of e)if(!_[r]||typeof _[r]===String&&""===_[r].trim())return void m.open({type:"error",message:`${r} is required`,duration:1500});const t={title:_.title,start_time:new Date(_.start_time).toISOString(),end_time:new Date(_.end_time).toISOString(),start_time_enabled:_.start_time_enabled,end_time_enabled:_.end_time_enabled,isVisible:_.isVisible,allowCopyPaste:_.allowCopyPaste,proctoring:_.proctoring,safe_browser:_.safe_browser,proctoringInterval:_.proctoringInterval,screenCaptureEnabled:_.screenCaptureEnabled,screenCaptureInterval:_.screenCaptureInterval,notification_schedules:_.notification_schedules.map((e=>({...e,datetime:e.datetime?new Date(e.datetime).toISOString():e.datetime})))},n=await b.execute({assessmentId:h,assessmentData:t});n.error||(m.open({type:"success",message:"Saved successfully!",duration:1500}),Object.keys(p).forEach((e=>{void 0!==n.data[e]&&S({type:"COMMON_UPDATE",payload:{field:e,value:n.data[e]}})})),S({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!1}}),x(!0))},updateAssessmentQuery:b,reFetchAssessment:()=>{y({assessmentId:h})},updateOrder:async e=>{const t=A.filter((t=>t.id!==e)).map(((e,t)=>({...e,order:t+1})));L(t),await Z(t)},disableSave:z,editingModuleId:O,moduleListKey:R,setModuleListKey:I,modulesLoading:j,setEditingModuleId:M,saveModuleUpdates:async()=>{(await P({data:A})).error||(m.open({type:"success",message:"Saved successfully!",duration:1500}),C(!1)),I((e=>e+1))},isValidTitle:e=>/[a-zA-Z]/.test(e.trim()),order:$,setOrder:D,updateExecute:P,handleModuleChanges:Y,updateDropOrder:e=>{C(!0),L(e)},setDisableSave:N,updated:w,updateItemExecute:K,createModulesUpdate:e=>{L(e),Z()},itemOrder:B,handleItemChanges:(e,t,n,r)=>{L((a=>a.map((a=>a.id===e?{...a,items:a.items.map((e=>e.id===t?{...e,[n]:r}:e))}:a)))),C(!0)},setItemOrder:U,updateOrderDelete:async(e,t)=>{const n=A.find((t=>t.id===e)).items.filter((e=>e.id!==t));for(const[r,a]of n.entries())await K({id:a.id,data:{title:a.title,order:r+1}});I((e=>e+1))},updateDropOrderItem:(e,t)=>{C(!0),L((n=>n.map((n=>n.id===e?{...n,items:[...t]}:n))))},reFetchModules:async()=>{var e;const t=await E({assessmentId:h});(null===(e=t.data)||void 0===e?void 0:e.length)>0&&L(t.data)},selectedModules:F,setSelectedModules:H,moduleOrderChange:k,handleSaveBtnEnable:()=>{S({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!0}})},updateIsLoading:T,handleGlobalDrop:e=>{let{sourceModuleId:t,targetModuleId:n,movedItem:r,targetItems:a}=e;L((e=>e.map((e=>{return e.id===n?{...e,items:Array.isArray(a)?a:[]}:e.id===t?{...e,items:null!==(o=null===(s=e.items)||void 0===s?void 0:s.filter((e=>e.id!==r.id)))&&void 0!==o?o:[]}:e;var o,s}))))},draggedItem:q,setDraggedItem:V,sourceModuleId:W,setSourceModuleId:Q,reorderItems:(e,t,n)=>{const r=e.filter((e=>e.id!==t.id));return r.splice(n,0,t),r},handleModulesUpdate:async e=>{L(e),C(!0);try{(await P({data:e})).error?m.open({type:"error",message:"Failed to reorder modules.",duration:1500}):(m.open({type:"success",message:"Modules reordered successfully!",duration:1500}),C(!1),I((e=>e+1)))}catch(t){m.open({type:"error",message:"Network error while saving modules order.",duration:1500})}}},children:t})},m=d},86097:(e,t,n)=>{"use strict";n.d(t,{B:()=>h,A:()=>m});var r=n(9950),a=n(38845),o=n(27029),s=n(63310),l=n(44851),i=n(54335),u=n(79080);const c=()=>u.A.post("/presence/offline");var d=n(35628);var f=n(44414);const p=(0,r.createContext)(),h=e=>{let{children:t}=e;const{data:n,execute:h,isLoading:m}=(0,a.A)(o.kl),{execute:g}=(0,a.A)(o.Dx),{execute:v}=(0,a.A)(o.DO),{execute:y}=(0,a.A)(o.v2),{execute:b,isLoading:w}=(0,a.A)(o.KC),{execute:x,isLoading:_}=(0,a.A)(o.AH),{execute:S,isLoading:k}=(0,a.A)(o.Wd),{execute:C,isLoading:j}=(0,a.A)(o.Yy),{execute:E}=(0,a.A)(o.MH),{execute:A,isLoading:L}=(0,a.A)(i.FH),{execute:R}=(0,a.A)(i.Am),{data:I,execute:z}=(0,a.A)(o.mt),[N,P]=(0,r.useState)(!1),[T,O]=(0,r.useState)({}),[M,$]=(0,r.useState)(null),[D,B]=(0,r.useState)(null),[U,F]=(0,r.useState)(null),[H,q]=(0,r.useState)(!1),[V,W]=(0,r.useState)(null),[Q,K]=(0,r.useState)(!0),[G,Y]=(0,r.useState)(!1),[Z,J]=(0,r.useState)(!0),[X,ee]=(0,r.useState)(0),[te,ne]=(0,r.useState)({}),[re,ae]=(0,r.useState)(null),[oe,se]=(0,r.useState)(null),[le,ie]=(0,r.useState)(null),[ue,ce]=(0,r.useState)(null),[de,fe]=(0,r.useState)(null),[pe,he]=(0,r.useState)([]),[me,ge]=(0,r.useState)(!1),[ve,ye]=(0,r.useState)(!1),[be,we]=(0,r.useState)(!1),[xe,_e]=(0,r.useState)(null),[Se,ke]=(0,r.useState)(null),[Ce,je]=(0,r.useState)({email:{check:!1,verified:!1},secondaryEmail:{check:!1,verified:!1},password:{check:!1,verified:!1}}),[Ee,Ae]=(0,r.useState)(null),Le=(0,r.useRef)({}),Re=(0,r.useCallback)((e=>{Le.current={...Le.current,...e},(0,d.jQ)({status:"active",...Le.current}).catch(console.error)}),[]),Ie=(0,r.useCallback)((e=>{const t={...Le.current};e.forEach((e=>delete t[e])),Le.current=t}),[]),[ze,Ne]=(0,r.useState)({password:"",newPassword:"",confirmPassword:""}),Pe=(0,s.d)(),[Te,Oe]=(0,r.useState)(!1),Me=()=>{Ne({password:"",newPassword:"",confirmPassword:""})},$e=(0,r.useCallback)((()=>Oe(!0)),[]),De=(0,r.useCallback)((()=>{Oe(!1),Me()}),[]),Be=(0,r.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];he((r=>{let a;a=r.find((t=>t.id===e.senderId||t.id===e.receiverId))?r.map((t=>t.id===e.senderId||t.id===e.receiverId?{...t,lastMessage:e.message,time:e.time,starred:"boolean"===typeof e.starred?e.starred:t.starred}:t)):n?[{id:e.senderId,lastMessage:e.message,...e,senderId:M},...r]:[{id:e.senderId,lastMessage:e.message,firstname:e.firstname,lastname:e.lastname,time:e.time,starred:e.starred,senderId:M},...r];const o=e=>{const[t,n]=e.split(" ");let[r,a]=t.split(":").map(Number);if(n)return"pm"===n.toLowerCase()&&12!==r&&(r+=12),"am"===n.toLowerCase()&&12===r&&(r=0),60*r+a};return t?a.sort(((e,t)=>e.starred===t.starred?o(t.time)-o(e.time):t.starred-e.starred)):a}))}),[he,M]);(0,r.useEffect)((()=>{if(!M||!Te)return void(M&&!Te&&c().catch(console.error));let e,t="active";const n=e=>{t!==e&&(t=e)};(0,d.jQ)({status:"active",...Le.current}).catch(console.error);const r=setInterval((()=>{(0,d.jQ)({status:t,...Le.current}).catch(console.error)}),12e4);function a(){clearTimeout(e),n("active"),e=setTimeout((()=>n("idle")),18e4)}["mousemove","keydown","mousedown","scroll","touchstart"].forEach((e=>window.addEventListener(e,a))),a();const o=()=>navigator.sendBeacon("https://bd3xlszezk.execute-api.ap-south-1.amazonaws.com/api/presence/offline");return window.addEventListener("pagehide",o),()=>{clearInterval(r),clearTimeout(e),["mousemove","keydown","mousedown","scroll","touchstart"].forEach((e=>window.removeEventListener(e,a))),window.removeEventListener("pagehide",o),c().catch(console.error)}}),[M,Te]),(0,r.useEffect)((()=>{if(!M||!Te||"learner"===D||"guest"===D)return;const e=async()=>{try{var e;const t=await u.A.get("/presence/online"),n={};((null===(e=t.data)||void 0===e?void 0:e.users)||[]).forEach((e=>{n[e.userId]=e.status})),ie(n)}catch(t){console.error("Online users poll error:",t)}};e();const t=setInterval(e,3e4);return()=>clearInterval(t)}),[M,Te,D]);const Ue=(0,r.useCallback)((e=>{Ae(e)}),[Ae]),Fe=(0,r.useCallback)(((e,t)=>{switch(e){case"firstname":if(!t.trim())return"First name is required";break;case"lastname":if(!t.trim())return"Last name is required";break;case"email":if(!t.trim())return"Email is required";if(!/^[\w-.]+@([\w-]+\.)+[\w-]{2,4}$/.test(t))return"Invalid email address";break;case"mobile":if(t&&!/^[6-9]\d{9}$/.test(t))return"Please enter a valid Indian mobile number";break;default:return""}return""}),[]),He=(0,r.useCallback)(((e,t)=>{switch(e){case"password":if(!t.trim())return"Password is required";if(!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&.])[A-Za-z\d@$!%*?&.]{8,}$/.test(t))return"Invalid Password";break;case"newPassword":if(!t.trim())return"New Password is required";if(!/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&.])[A-Za-z\d@$!%*?&.]{8,}$/.test(t))return"Invalid Password";break;case"confirmPassword":if(!t.trim())return"Confirm Password is required";break;default:return""}return""}),[]),qe=(0,r.useCallback)(((e,t,n)=>{$e(),$(e),B(t),F(n)}),[$e]),Ve=(0,r.useCallback)(((e,t,n)=>{$e(),$(e),B(t),F(n)}),[$e]),We=(0,r.useCallback)(((e,t)=>{"email"===e&&"super_admin"===V.role?je((e=>({...e,email:{check:!0,verified:!1}}))):"secondaryEmail"===e&&"super_admin"===V.role&&je((e=>({...e,secondaryEmail:{check:!0,verified:!1}}))),"email"===e&&"super_admin"===V.role&&n.user.email.trim()===t.trim()?je((e=>({...e,email:{check:!1,verified:!1}}))):"secondaryEmail"===e&&"super_admin"===V.role&&n.user.secondaryEmail&&n.user.secondaryEmail.trim()===t.trim()&&je((e=>({...e,secondaryEmail:{check:!1,verified:!1}}))),K(!1),W((n=>({...n,[e]:t})))}),[V,n]),Qe=(0,r.useCallback)(((e,t)=>{"newpassword"!==e&&"confirmPassword"!==e||"super_admin"!==V.role||je((e=>({...e,password:{check:!0,verified:!1}}))),Ne((n=>({...n,[e]:t})))}),[V]),Ke=(0,r.useCallback)((async()=>{Y(!0),O({});const e={};if(Object.keys(ze).forEach((t=>{if("password"!==t){const n=He(t,ze[t]);n&&(e[t]=n)}})),ze.confirmPassword.length>0&&ze.newPassword!==ze.confirmPassword&&(e.confirmPassword="Password not match"),O(e),Ce.password.check&&!Ce.password.verified&&n.user.password!==ze.newPassword)return Pe.open({type:"error",message:"Need to verify",duration:1500}),void Y(!1);if(0===Object.keys(e).length){let e;"admin"===D?e=await g({id:M,data:ze}):"instructor"===D?e=await v({id:M,data:ze}):"learner"===D?e=await y({id:M,data:ze}):"super_admin"===D&&(e=await E({id:M,data:ze})),e.error||(Pe.open({type:"success",message:"Changed successfully!",duration:1500}),Ne({password:"",newPassword:"",confirmPassword:""}))}Y(!1)}),[ze,D,M,g,v,y,Pe,He,Ce,n,E]),Ge=(0,r.useCallback)((async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.preventDefault(),K(!0),O({});const r={};if(Object.keys(V).forEach((e=>{const t=Fe(e,V[e]);t&&(r[e]=t)})),O(r),!Ce.email.check||Ce.email.verified||n.user.email===V.email){if(Ce.secondaryEmail.check&&!Ce.secondaryEmail.verified&&n.user.secondaryEmail!==V.secondaryEmail)return Pe.open({type:"error",message:"Need to verify",duration:1500}),void K(!1);if(0===Object.keys(r).length){var a;let e;if("admin"===D)e=await b({id:M,data:V});else if("instructor"===D)e=await x({id:M,data:V});else if("learner"===D){const n=new FormData;Object.keys(V).forEach((e=>{"image"===e?xe&&n.append("image",xe):n.append(e,V[e])})),t&&n.append("deleteImage",!0),e=await S({id:M,data:n})}else"super_admin"===D&&(e=await C({id:M,data:V}));null!==(a=e)&&void 0!==a&&a.error||Pe.open({type:"success",message:"Saved successfully!",duration:1500}),h({id:M})}K(!0)}else Pe.open({type:"error",message:"Need to verify",duration:1500})}),[V,D,M,b,x,S,Pe,Fe,C,Ce,n,h]),Ye=(0,r.useCallback)((async e=>{je((t=>({...t,[e]:{check:!0,verified:!0}})))}),[]),Ze=(0,r.useCallback)((async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];J(!0);const n=await A(e,t);null!==n&&void 0!==n&&n.error||null===n||void 0===n||!n.data||($(n.data.userId),B(n.data.role),F(n.data.currentRole),q(n.data.forcePasswordChange),$e(),await h({id:n.data.userId})),J(!1)}),[A,$e,h]),Je=(0,r.useCallback)((async(e,t)=>{P(!0);const n=await R({email:t,role:e});null!==n&&void 0!==n&&n.error||(Ze(),Pe.open({type:"success",message:"Role switched successfully!",duration:1500})),P(!1),Me()}),[R,Pe,Ze]);(0,r.useEffect)((()=>{Ze({},!1)}),[Ze]),(0,r.useEffect)((()=>{M&&D&&("admin"!==D&&"super_admin"!==D||z(),h({id:M}))}),[M,D,h,z]),(0,r.useEffect)((()=>{if("super_admin"===U)we(!0);else if("admin"===U){var e,t;we(null!==(e=null===I||void 0===I||null===(t=I.settings)||void 0===t?void 0:t.allowAdminToAccessSettings)&&void 0!==e&&e)}else we(!1)}),[U,I,we]),(0,r.useEffect)((()=>{I&&(Ae(I.settings.compilerServiceUrl),void 0!==I.settings.categoryEnabled&&ye(I.settings.categoryEnabled),void 0!==I.settings.adminAccessToGlobalSettings&&we(I.settings.adminAccessToGlobalSettings))}),[I]),(0,r.useEffect)((()=>{n&&(W(n.user),ee(n.user.chatNotificationCount||0))}),[n]),(0,r.useEffect)((()=>{var e,t;e=u.A,t=De,e.interceptors.response.use((e=>e),(e=>{var n;return 401===(null===(n=e.response)||void 0===n?void 0:n.status)&&t(),Promise.reject(e)}))}),[De]);const Xe=(0,r.useCallback)(((e,t,n)=>{he((r=>r.map((r=>r.id===e?{...r,[t]:n}:r))))}),[]),et=(0,r.useMemo)((()=>({handleUserLogin:qe,handleGuestLogin:Ve,userId:M,userData:V,handleSave:Ge,updateAdminIsLoading:w,updateInstIsLoading:_,updateLearnerIsLoading:k,updateSupAdminIsLoading:j,disableBtn:Q,formErrors:T,disableChange:G,updatePassword:Ke,handleChangesinPassword:Qe,isAuth:Te,handleLoginAuth:$e,handleLogoutAuth:De,userRole:D,handleSwitchRole:Je,disableBtnSwitch:N,userCurrRole:U,verifyFunc:Ze,totalUnreadCount:X,setTotalUnreadCount:ee,chatList:pe,setChatList:he,incomingChat:re,incomingMessageData:oe,setIncomingChat:ae,updateChatList:Be,setUnreadMessages:ne,unreadMessages:te,handleChanges:We,handleChatList:Xe,getUserData:n,updateVerify:Ce,setUpdateVerify:je,verifiedFieldChangesRequest:Ye,passwordData:ze,compilerUrl:Ee,onlineUsersList:le,activeChatUserId:ue,setActiveChatUserId:ce,handleCompilerUrl:Ue,receiverData:de,setReceiverData:fe,chatPageActive:me,setChatPageActive:ge,forceToChangePassword:H,categoryEnabled:ve,setCategoryEnabled:ye,adminAccessEnabled:be,setAdminAccessEnabled:we,selectedFile:xe,setSelectedFile:_e,previewUrl:Se,setPreviewUrl:ke,registerHeartbeatContext:Re,unregisterHeartbeatContext:Ie})),[qe,Ve,M,V,We,Ge,w,_,k,j,Q,T,G,Ke,Qe,Te,$e,De,D,Je,N,U,Ze,X,ee,pe,he,re,oe,ae,Be,ne,te,Xe,n,Ce,je,Ye,ze,Ee,ue,le,Ue,de,me,ge,H,ve,ye,be,we,xe,_e,Se,ke,Re,Ie]);return L||Z||m||M&&!V?(0,f.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh"},children:(0,f.jsx)(l.A,{})}):(0,f.jsx)(p.Provider,{value:et,children:t})},m=p},42083:(e,t,n)=>{"use strict";n.d(t,{A:()=>m,e:()=>h});var r=n(9950),a=n(28429),o=n(38845),s=n(62851),l=n(44851),i=n(63310),u=n(65844),c=n(44414);const d=(0,r.createContext)(),f=(e,t)=>{switch(t.type){case"FETCH_SUCCESS":return{...e,...t.payload};case"COMMON_UPDATE":return{...e,[t.payload.field]:t.payload.value};case"CATEGORY_UPDATE":return{...e,category:{...e.category,id:t.payload.id,name:t.payload.name,slug:t.payload.slug}};case"PARENTCATEGORY_UPDATE":return{...e,categoryId:null,category:{id:null,name:null,slug:null,parentCategory:{id:t.payload.id,name:t.payload.name,slug:t.payload.slug}}};case"ARRAY_UPDATE":return{...e,[t.payload.field]:t.payload.value};default:return e}},p={category:"",categoryId:"",duration:"",enrolledLearners:"",enrollmentCount:"",imageURL:"",instructors:"",isPopular:"",isPublished:"",joinableUsers:"",level:"",long_description:"",outcomes:"",price:"",promotion_URL:"",rating:"",requirements:"",review_count:"",short_description:"",skills:"",title:"",enableSaveBtn:!1,expiry_date:""},h=e=>{let{children:t}=e;const{id:n}=(0,a.g)(),h=(0,i.d)(),{data:m,isLoading:g,execute:v}=(0,o.A)(s.YG),y=(0,o.A)(s.Ve),[b,w]=(0,r.useState)(!1),[x,_]=(0,r.useReducer)(f,p),[S,k]=(0,r.useState)(null),[C,j]=(0,r.useState)(!1),{isLoading:E,execute:A}=(0,o.A)(u.$S),[L,R]=(0,r.useState)([]),[I,z]=(0,r.useState)(0),[N,P]=(0,r.useState)(null),{execute:T,isLoading:O}=(0,o.A)(u.pm),[M,$]=(0,r.useState)(null),[D,B]=(0,r.useState)(null),[U,F]=(0,r.useState)([]),[H,q]=(0,r.useState)([]),[V,W]=(0,r.useState)(null),[Q,K]=(0,r.useState)(null),{execute:G,isLoading:Y}=(0,o.A)(u.$w);(0,r.useEffect)((()=>{(async()=>{var e;const t=await A({id:n});(null===(e=t.data)||void 0===e?void 0:e.length)>0&&R(t.data)})()}),[A,n,I]);const[Z,J]=(0,r.useState)(!1),X=(0,r.useCallback)(((e,t,n)=>{R((r=>r.map((r=>r.id===e?{...r,[t]:n}:r)))),j(!0)}),[]),ee=async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:L;if((null===e||void 0===e?void 0:e.length)>0){(await T({data:e})).error||z((e=>e+1))}};(0,r.useEffect)((()=>{v(n)}),[v,n]),(0,r.useEffect)((()=>{_({type:"FETCH_SUCCESS",payload:m})}),[m]);const te=(0,r.useCallback)(((e,t)=>{x[e]!==t&&(_({type:"COMMON_UPDATE",payload:{field:e,value:t}}),_({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!0}}))}),[x]),ne=(0,r.useCallback)(((e,t)=>{t=t.filter((e=>e.trim().length>0)),_({type:"ARRAY_UPDATE",payload:{field:e,value:t}}),te("enableSaveBtn",!0)}),[te]),re=(0,r.useCallback)(((e,t)=>{t=t.filter((e=>e.trim().length>0)),_({type:"ARRAY_UPDATE",payload:{field:e,value:t}})}),[]);return g||E?(0,c.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh"},children:(0,c.jsx)(l.A,{})}):m&&L&&(0,c.jsx)(d.Provider,{value:{id:n,data:x,modules:L,updateItemIsLoading:Y,deleteImage:Z,setDeleteImage:J,handleChanges:te,handleParentCategory:e=>{_({type:"PARENTCATEGORY_UPDATE",payload:{id:e.id,name:e.name,slug:e.slug}}),te("enableSaveBtn",!0)},handleCategeory:e=>{_({type:"CATEGORY_UPDATE",payload:{id:e.id,name:e.name,slug:e.slug}}),te("enableSaveBtn",!0)},updateData:async()=>{const e=["title","categoryId","short_description"];for(let n of e)if(!x[n]||typeof x[n]===String&&""===x[n].trim())return void h.open({type:"error",message:`${"categoryId"===n?"Category and subcategory":"imageURL"===n?"Course Image":n} is required `,duration:1500});const t=new FormData;S&&t.append("file",S),t.append("deleteImage",Z);for(let n in x)"enrolledLearners"!==n&&"enrollmentCount"!==n&&"instructors"!==n&&"modules"!==n&&t.append(n,x[n]);const r=await y.execute({id:n,data:t});r.error||(h.open({type:"success",message:"Saved successfully!",duration:1500}),Object.keys(p).forEach((e=>{void 0!==r.data.course[e]&&_({type:"COMMON_UPDATE",payload:{field:e,value:r.data.course[e]}})})),_({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!1}}),w(!0),J(!1))},updateCourse:y,reFetchCourse:()=>{v(n)},handleArray:ne,handleArrayOld:re,updateOrder:async e=>{const t=L.filter((t=>t.id!==e)).map(((e,t)=>({...e,order:t+1})));R(t),await ee(t)},disableSave:N,editingModuleId:M,moduleListKey:I,setModuleListKey:z,modulesLoading:E,setEditingModuleId:$,saveModuleUpdates:async()=>{(await T({data:L})).error||(h.open({type:"success",message:"Saved successfully!",duration:1500}),j(!1)),z((e=>e+1))},isValidTitle:e=>/[a-zA-Z]/.test(e.trim()),order:D,setOrder:B,updateExecute:T,handleModuleChanges:X,updateDropOrder:e=>{j(!0),R(e)},setDisableSave:P,updated:b,updateItemExecute:G,createModulesUpdate:e=>{R(e),ee()},itemOrder:U,handleItemChanges:(e,t,n,r)=>{R((a=>a.map((a=>a.id===e?{...a,items:a.items.map((e=>e.id===t?{...e,[n]:r}:e))}:a)))),j(!0)},setItemOrder:F,updateOrderDelete:async(e,t)=>{const n=L.find((t=>t.id===e)).items.filter((e=>e.id!==t));for(const[r,a]of n.entries())await G({id:a.id,data:{title:a.title,order:r+1}});z((e=>e+1))},updateDropOrderItem:(e,t)=>{j(!0),R((n=>n.map((n=>n.id===e?{...n,items:[...t]}:n))))},reFetchModules:async()=>{var e;const t=await A({id:n});(null===(e=t.data)||void 0===e?void 0:e.length)>0&&R(t.data)},handleResourceChanges:(e,t,n,r)=>{R((a=>a.map((a=>a.id===e?{...a,resources:a.resources.map((e=>e.id===t?{...e,[n]:r}:e))}:a)))),j(!0)},setSelectedImage:k,selectedImage:S,selectedModules:H,setSelectedModules:q,moduleOrderChange:C,handleSaveBtnEnable:()=>{_({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!0}})},updateIsLoading:O,handleGlobalDrop:e=>{let{sourceModuleId:t,targetModuleId:n,movedItem:r,targetItems:a}=e;R((e=>e.map((e=>{return e.id===n?{...e,items:Array.isArray(a)?a:[]}:e.id===t?{...e,items:null!==(o=null===(s=e.items)||void 0===s?void 0:s.filter((e=>e.id!==r.id)))&&void 0!==o?o:[]}:e;var o,s}))))},draggedItem:V,setDraggedItem:W,sourceModuleId:Q,setSourceModuleId:K,reorderItems:(e,t,n)=>{const r=e.filter((e=>e.id!==t.id));return r.splice(n,0,t),r},handleModulesUpdate:async e=>{R(e),j(!0);try{(await T({data:e})).error?h.open({type:"error",message:"Failed to reorder modules.",duration:1500}):(h.open({type:"success",message:"Modules reordered successfully!",duration:1500}),j(!1),z((e=>e+1)))}catch(t){h.open({type:"error",message:"Network error while saving modules order.",duration:1500})}}},children:t})},m=d},83643:(e,t,n)=>{"use strict";n.d(t,{A:()=>h,b:()=>p});var r=n(9950),a=n(28429),o=n(38845),s=n(44851),l=n(63310),i=n(12819),u=n(44414);const c=(0,r.createContext)(),d=(e,t)=>{switch(t.type){case"FETCH_SUCCESS":return{...e,...t.payload};case"COMMON_UPDATE":return{...e,[t.payload.field]:t.payload.value};default:return e}},f={title:"",instructions:"",start_time:null,end_time:null,start_time_enabled:!1,end_time_enabled:!1,duration:null,duration_enabled:!1,total_grade:0,passing_grade:0,max_attempts:null,safe_browser:!1,proctoring:!1,warnings:0,proctoringInterval:10,screenCaptureEnabled:!1,screenCaptureInterval:15e3,shuffle_problems:!1,review_enable:!1,problems:[],enableSaveBtn:!1},p=e=>{let{children:t}=e;const{id:n,assessmentId:p,problemSetId:h}=(0,a.g)(),m=(0,l.d)(),{data:g,isLoading:v,execute:y}=(0,o.A)(i.A$),b=(0,o.A)(i.R8),[w,x]=(0,r.useState)(!1),[_,S]=(0,r.useReducer)(d,f),[k,C]=(0,r.useState)([]),[j,E]=(0,r.useState)(!1),{execute:A,isLoading:L}=(0,o.A)(i.ov);(0,r.useEffect)((()=>{y(h)}),[y,h]),(0,r.useEffect)((()=>{if(g&&(S({type:"FETCH_SUCCESS",payload:g}),g.problems)){const e=[...g.problems].sort(((e,t)=>{var n,r;return(null===(n=e.ProblemSetProblem)||void 0===n?void 0:n.order)-(null===(r=t.ProblemSetProblem)||void 0===r?void 0:r.order)}));C(e)}}),[g]);const R=(0,r.useCallback)(((e,t)=>{_[e]!==t&&(S({type:"COMMON_UPDATE",payload:{field:e,value:t}}),S({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!0}}))}),[_]),I=()=>{y(h)};return v?(0,u.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100vh"},children:(0,u.jsx)(s.A,{})}):g&&(0,u.jsx)(c.Provider,{value:{problemSetId:h,courseId:n,assessmentId:p,data:_,problems:k,setProblemsState:C,handleChanges:R,updateData:async()=>{const e=["title"];for(let a of e)if(!_[a]||"string"===typeof _[a]&&""===_[a].trim())return void m.open({type:"error",message:`${a} is required`,duration:1500});const t=_.start_time?new Date(_.start_time).toISOString():null,n=_.end_time?new Date(_.end_time).toISOString():null,r={title:_.title,instructions:_.instructions,start_time:t,end_time:n,start_time_enabled:_.start_time_enabled,end_time_enabled:_.end_time_enabled,duration:_.duration,duration_enabled:_.duration_enabled,total_grade:_.total_grade,passing_grade:_.passing_grade,max_attempts:_.max_attempts,safe_browser:_.safe_browser,proctoring:_.proctoring,warnings:_.warnings,proctoringInterval:_.proctoringInterval,screenCaptureEnabled:_.screenCaptureEnabled,screenCaptureInterval:_.screenCaptureInterval,shuffle_problems:_.shuffle_problems,review_enable:_.review_enable};(await b.execute({problemSetId:h,data:r})).error||(m.open({type:"success",message:"Saved successfully!",duration:1500}),S({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!1}}),x(!0))},updateProblemSetQuery:b,reFetchProblemSet:I,isValidTitle:e=>/[a-zA-Z]/.test(e.trim()),updated:w,saveProblemOrder:async()=>{const e=k.map(((e,t)=>({problemId:e.id,order:t+1})));(await A({problemSetId:h,problems:e})).error||(m.open({type:"success",message:"Problem order saved successfully!",duration:1500}),E(!1),I())},updateProblemOrder:e=>{E(!0),C(e)},problemOrderChange:j,handleSaveBtnEnable:()=>{S({type:"COMMON_UPDATE",payload:{field:"enableSaveBtn",value:!0}})},reorderIsLoading:L},children:t})},h=c},63310:(e,t,n)=>{"use strict";n.d(t,{A:()=>v,d:()=>m});var r=n(9950),a=n(22875),o=n(44414);const s={display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"space-between",borderRadius:"8px",minWidth:"250px",maxWidth:"400px",boxShadow:"0 4px 8px rgba(0, 0, 0, 0.1)",backgroundColor:"#fff",color:"#000"},l={success:{color:"#155724",borderColor:"#28a745"},error:{color:"#721c24",borderColor:"#dc3545"},warning:{color:"#856404",borderColor:"#ffc107"},info:{color:"#0c5460",borderColor:"#17a2b8"}},i={width:"100%",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 10px"},u={flex:1},c={background:"none",border:"none",color:"inherit",fontSize:"16px",cursor:"pointer",display:"flex",alignItems:"center"},d={width:"100%",height:"4px",borderRadius:"4px",overflow:"hidden"},f={height:"100%",transition:"width 0.1s linear"},p=e=>{let{id:t,type:n,message:p,duration:h,onClose:m}=e;const[g,v]=(0,r.useState)(100);return(0,r.useEffect)((()=>{const e=setInterval((()=>{v((e=>Math.max(e-100/(h/100),0)))}),100),t=setTimeout((()=>{m()}),h);return()=>{clearInterval(e),clearTimeout(t)}}),[h,m]),(0,o.jsxs)("div",{style:{...s,...l[n]},children:[(0,o.jsxs)("div",{style:i,children:[(0,o.jsxs)("div",{style:u,children:[(0,o.jsxs)("strong",{children:[n.charAt(0).toUpperCase()+n.slice(1),"!"]}),(0,o.jsx)("p",{children:p})]}),(0,o.jsx)("button",{onClick:m,style:c,children:(0,o.jsx)(a.QCr,{})})]}),(0,o.jsx)("div",{style:{...d},children:(0,o.jsx)("div",{style:{...f,width:`${g}%`,backgroundColor:l[n].borderColor}})})]})},h=(0,r.createContext)(),m=()=>(0,r.useContext)(h),g={position:"fixed",top:"20px",right:"20px",display:"flex",flexDirection:"column",gap:"10px",zIndex:1e3},v=e=>{let{children:t}=e;const[n,a]=(0,r.useState)([]),s=(0,r.useCallback)((e=>{a((t=>t.filter((t=>t.id!==e))))}),[]),l=(0,r.useCallback)((e=>{let{type:t="info",message:n,duration:r=3e3}=e;const o=Math.random().toString(36).substring(2,9);a((e=>[...e,{id:o,type:t,message:n,duration:r}])),setTimeout((()=>s(o)),r)}),[s]),i=(0,r.useMemo)((()=>({open:l,close:s})),[l,s]);return(0,o.jsxs)(h.Provider,{value:i,children:[t,(0,o.jsx)("div",{style:g,children:n.map((e=>(0,o.jsx)(p,{...e,onClose:()=>s(e.id)},e.id)))})]})}},1018:(e,t,n)=>{"use strict";function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;td,B6:()=>R,G3:()=>J,Gh:()=>O,HS:()=>M,Oi:()=>l,Rr:()=>f,VV:()=>F,aE:()=>ne,pX:()=>H,pb:()=>z,rc:()=>a,tH:()=>U,ue:()=>v,yD:()=>T,zR:()=>s}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(a||(a={}));const o="popstate";function s(e){return void 0===e&&(e={}),p((function(e,t){let{pathname:n,search:r,hash:a}=e.location;return c("",{pathname:n,search:r,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){return"string"===typeof t?t:d(t)}),null,e)}function l(e,t){if(!1===e||null===e||"undefined"===typeof e)throw new Error(t)}function i(e,t){if(!e){"undefined"!==typeof console&&console.warn(t);try{throw new Error(t)}catch(n){}}}function u(e,t){return{usr:e.state,key:e.key,idx:t}}function c(e,t,n,a){return void 0===n&&(n=null),r({pathname:"string"===typeof e?e:e.pathname,search:"",hash:""},"string"===typeof t?f(t):t,{state:n,key:t&&t.key||a||Math.random().toString(36).substr(2,8)})}function d(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function f(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function p(e,t,n,s){void 0===s&&(s={});let{window:i=document.defaultView,v5Compat:f=!1}=s,p=i.history,h=a.Pop,m=null,g=v();function v(){return(p.state||{idx:null}).idx}function y(){h=a.Pop;let e=v(),t=null==e?null:e-g;g=e,m&&m({action:h,location:w.location,delta:t})}function b(e){let t="null"!==i.location.origin?i.location.origin:i.location.href,n="string"===typeof e?e:d(e);return n=n.replace(/ $/,"%20"),l(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==g&&(g=0,p.replaceState(r({},p.state,{idx:g}),""));let w={get action(){return h},get location(){return e(i,p)},listen(e){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(o,y),m=e,()=>{i.removeEventListener(o,y),m=null}},createHref:e=>t(i,e),createURL:b,encodeLocation(e){let t=b(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){h=a.Push;let r=c(w.location,e,t);n&&n(r,e),g=v()+1;let o=u(r,g),s=w.createHref(r);try{p.pushState(o,"",s)}catch(l){if(l instanceof DOMException&&"DataCloneError"===l.name)throw l;i.location.assign(s)}f&&m&&m({action:h,location:w.location,delta:1})},replace:function(e,t){h=a.Replace;let r=c(w.location,e,t);n&&n(r,e),g=v();let o=u(r,g),s=w.createHref(r);p.replaceState(o,"",s),f&&m&&m({action:h,location:w.location,delta:0})},go:e=>p.go(e)};return w}var h;!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(h||(h={}));const m=new Set(["lazy","caseSensitive","path","id","index","children"]);function g(e,t,n,a){return void 0===n&&(n=[]),void 0===a&&(a={}),e.map(((e,o)=>{let s=[...n,String(o)],i="string"===typeof e.id?e.id:s.join("-");if(l(!0!==e.index||!e.children,"Cannot specify children on an index route"),l(!a[i],'Found a route id collision on id "'+i+"\". Route id's must be globally unique within Data Router usages"),function(e){return!0===e.index}(e)){let n=r({},e,t(e),{id:i});return a[i]=n,n}{let n=r({},e,t(e),{id:i,children:void 0});return a[i]=n,e.children&&(n.children=g(e.children,t,s,a)),n}}))}function v(e,t,n){return void 0===n&&(n="/"),y(e,t,n,!1)}function y(e,t,n,r){let a=z(("string"===typeof t?f(t):t).pathname||"/",n);if(null==a)return null;let o=b(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let s=null;for(let l=0;null==s&&l{let s={relativePath:void 0===o?e.path||"":o,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};s.relativePath.startsWith("/")&&(l(s.relativePath.startsWith(r),'Absolute route path "'+s.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),s.relativePath=s.relativePath.slice(r.length));let i=M([r,s.relativePath]),u=n.concat(s);e.children&&e.children.length>0&&(l(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+i+'".'),b(e.children,t,u,i)),(null!=e.path||e.index)&&t.push({path:i,score:A(i,e.index),routesMeta:u})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let r of w(e.path))a(e,t,r);else a(e,t)})),t}function w(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(0===r.length)return a?[o,""]:[o];let s=w(r.join("/")),l=[];return l.push(...s.map((e=>""===e?o:[o,e].join("/")))),a&&l.push(...s),l.map((t=>e.startsWith("/")&&""===t?"/":t))}const x=/^:[\w-]+$/,_=3,S=2,k=1,C=10,j=-2,E=e=>"*"===e;function A(e,t){let n=e.split("/"),r=n.length;return n.some(E)&&(r+=j),t&&(r+=S),n.filter((e=>!E(e))).reduce(((e,t)=>e+(x.test(t)?_:""===t?k:C)),r)}function L(e,t,n){void 0===n&&(n=!1);let{routesMeta:r}=e,a={},o="/",s=[];for(let l=0;l(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(r.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let o=new RegExp(a,t?void 0:"i");return[o,r]}(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],s=o.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:r.reduce(((e,t,n)=>{let{paramName:r,isOptional:a}=t;if("*"===r){let e=l[n]||"";s=o.slice(0,o.length-e.length).replace(/(.)\/+$/,"$1")}const i=l[n];return e[r]=a&&!i?void 0:(i||"").replace(/%2F/g,"/"),e}),{}),pathname:o,pathnameBase:s,pattern:e}}function I(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return i(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function z(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function N(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in and the router will parse it for you.'}function P(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}function T(e,t){let n=P(e);return t?n.map(((e,t)=>t===n.length-1?e.pathname:e.pathnameBase)):n.map((e=>e.pathnameBase))}function O(e,t,n,a){let o;void 0===a&&(a=!1),"string"===typeof e?o=f(e):(o=r({},e),l(!o.pathname||!o.pathname.includes("?"),N("?","pathname","search",o)),l(!o.pathname||!o.pathname.includes("#"),N("#","pathname","hash",o)),l(!o.search||!o.search.includes("#"),N("#","search","hash",o)));let s,i=""===e||""===o.pathname,u=i?"/":o.pathname;if(null==u)s=n;else{let e=t.length-1;if(!a&&u.startsWith("..")){let t=u.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}s=e>=0?t[e]:"/"}let c=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:a=""}="string"===typeof e?f(e):e,o=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:o,search:D(r),hash:B(a)}}(o,s),d=u&&"/"!==u&&u.endsWith("/"),p=(i||"."===u)&&n.endsWith("/");return c.pathname.endsWith("/")||!d&&!p||(c.pathname+="/"),c}const M=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),D=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",B=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";class U extends Error{}class F{constructor(e,t,n,r){void 0===r&&(r=!1),this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function H(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"boolean"===typeof e.internal&&"data"in e}const q=["post","put","patch","delete"],V=new Set(q),W=["get",...q],Q=new Set(W),K=new Set([301,302,303,307,308]),G=new Set([307,308]),Y={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Z={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},J={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},X=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ee=e=>({hasErrorBoundary:Boolean(e.hasErrorBoundary)}),te="remix-router-transitions";function ne(e){const t=e.window?e.window:"undefined"!==typeof window?window:void 0,n="undefined"!==typeof t&&"undefined"!==typeof t.document&&"undefined"!==typeof t.document.createElement,o=!n;let s;if(l(e.routes.length>0,"You must provide a non-empty routes array to createRouter"),e.mapRouteProperties)s=e.mapRouteProperties;else if(e.detectErrorBoundary){let t=e.detectErrorBoundary;s=e=>({hasErrorBoundary:t(e)})}else s=ee;let u,d,f,p={},m=g(e.routes,s,void 0,p),b=e.basename||"/",w=e.unstable_dataStrategy||de,x=e.unstable_patchRoutesOnNavigation,_=r({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),S=null,k=new Set,C=new Set,j=null,E=null,A=null,L=null!=e.hydrationData,R=v(m,e.history.location,b),I=null;if(null==R&&!x){let t=Ce(404,{pathname:e.history.location.pathname}),{matches:n,route:r}=ke(m);R=n,I={[r.id]:t}}if(R&&!e.hydrationData){dt(R,m,e.history.location.pathname).active&&(R=null)}if(R)if(R.some((e=>e.route.lazy)))d=!1;else if(R.some((e=>e.route.loader)))if(_.v7_partialHydration){let t=e.hydrationData?e.hydrationData.loaderData:null,n=e.hydrationData?e.hydrationData.errors:null,r=e=>!e.route.loader||("function"!==typeof e.route.loader||!0!==e.route.loader.hydrate)&&(t&&void 0!==t[e.route.id]||n&&void 0!==n[e.route.id]);if(n){let e=R.findIndex((e=>void 0!==n[e.route.id]));d=R.slice(0,e+1).every(r)}else d=R.every(r)}else d=null!=e.hydrationData;else d=!0;else if(d=!1,R=[],_.v7_partialHydration){let t=dt(null,m,e.history.location.pathname);t.active&&t.matches&&(R=t.matches)}let N,P,T={historyAction:e.history.action,location:e.history.location,matches:R,initialized:d,navigation:Y,restoreScrollPosition:null==e.hydrationData&&null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||I,fetchers:new Map,blockers:new Map},O=a.Pop,M=!1,$=!1,D=new Map,B=null,U=!1,F=!1,q=[],V=new Set,W=new Map,Q=0,K=-1,ne=new Map,oe=new Set,le=new Map,ie=new Map,ve=new Set,ye=new Map,be=new Map,Ee=new Map;function ze(e,t){void 0===t&&(t={}),T=r({},T,e);let n=[],a=[];_.v7_fetcherPersist&&T.fetchers.forEach(((e,t)=>{"idle"===e.state&&(ve.has(t)?a.push(t):n.push(t))})),[...k].forEach((e=>e(T,{deletedFetchers:a,unstable_viewTransitionOpts:t.viewTransitionOpts,unstable_flushSync:!0===t.flushSync}))),_.v7_fetcherPersist&&(n.forEach((e=>T.fetchers.delete(e))),a.forEach((e=>Je(e))))}function Ne(t,n,o){var s,l;let i,{flushSync:c}=void 0===o?{}:o,d=null!=T.actionData&&null!=T.navigation.formMethod&&Te(T.navigation.formMethod)&&"loading"===T.navigation.state&&!0!==(null==(s=t.state)?void 0:s._isRedirect);i=n.actionData?Object.keys(n.actionData).length>0?n.actionData:null:d?T.actionData:null;let f=n.loaderData?xe(T.loaderData,n.loaderData,n.matches||[],n.errors):T.loaderData,p=T.blockers;p.size>0&&(p=new Map(p),p.forEach(((e,t)=>p.set(t,J))));let h,g=!0===M||null!=T.navigation.formMethod&&Te(T.navigation.formMethod)&&!0!==(null==(l=t.state)?void 0:l._isRedirect);if(u&&(m=u,u=void 0),U||O===a.Pop||(O===a.Push?e.history.push(t,t.state):O===a.Replace&&e.history.replace(t,t.state)),O===a.Pop){let e=D.get(T.location.pathname);e&&e.has(t.pathname)?h={currentLocation:T.location,nextLocation:t}:D.has(t.pathname)&&(h={currentLocation:t,nextLocation:T.location})}else if($){let e=D.get(T.location.pathname);e?e.add(t.pathname):(e=new Set([t.pathname]),D.set(T.location.pathname,e)),h={currentLocation:T.location,nextLocation:t}}ze(r({},n,{actionData:i,loaderData:f,historyAction:O,location:t,initialized:!0,navigation:Y,revalidation:"idle",restoreScrollPosition:ct(t,n.matches||T.matches),preventScrollReset:g,blockers:p}),{viewTransitionOpts:h,flushSync:!0===c}),O=a.Pop,M=!1,$=!1,U=!1,F=!1,q=[]}async function Pe(t,n,o){N&&N.abort(),N=null,O=t,U=!0===(o&&o.startUninterruptedRevalidation),function(e,t){if(j&&A){let n=ut(e,t);j[n]=A()}}(T.location,T.matches),M=!0===(o&&o.preventScrollReset),$=!0===(o&&o.enableViewTransition);let s=u||m,l=o&&o.overrideNavigation,i=v(s,n,b),c=!0===(o&&o.flushSync),d=dt(i,s,n.pathname);if(d.active&&d.matches&&(i=d.matches),!i){let{error:e,notFoundMatches:t,route:r}=st(n.pathname);return void Ne(n,{matches:t,loaderData:{},errors:{[r.id]:e}},{flushSync:c})}if(T.initialized&&!F&&function(e,t){if(e.pathname!==t.pathname||e.search!==t.search)return!1;if(""===e.hash)return""!==t.hash;if(e.hash===t.hash)return!0;if(""!==t.hash)return!0;return!1}(T.location,n)&&!(o&&o.submission&&Te(o.submission.formMethod)))return void Ne(n,{matches:i},{flushSync:c});N=new AbortController;let f,p=ge(e.history,n,N.signal,o&&o.submission);if(o&&o.pendingError)f=[Se(i).route.id,{type:h.error,error:o.pendingError}];else if(o&&o.submission&&Te(o.submission.formMethod)){let t=await async function(e,t,n,r,o,s){void 0===s&&(s={});Ke();let l,i=function(e,t){let n={state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text};return n}(t,n);if(ze({navigation:i},{flushSync:!0===s.flushSync}),o){let n=await ft(r,t.pathname,e.signal);if("aborted"===n.type)return{shortCircuited:!0};if("error"===n.type){let{boundaryId:e,error:r}=lt(t.pathname,n);return{matches:n.partialMatches,pendingActionResult:[e,{type:h.error,error:r}]}}if(!n.matches){let{notFoundMatches:e,error:n,route:r}=st(t.pathname);return{matches:e,pendingActionResult:[r.id,{type:h.error,error:n}]}}r=n.matches}let u=Be(r,t);if(u.route.action||u.route.lazy){if(l=(await We("action",T,e,[u],r,null))[u.route.id],e.signal.aborted)return{shortCircuited:!0}}else l={type:h.error,error:Ce(405,{method:e.method,pathname:t.pathname,routeId:u.route.id})};if(Ie(l)){let t;if(s&&null!=s.replace)t=s.replace;else{t=me(l.response.headers.get("Location"),new URL(e.url),b)===T.location.pathname+T.location.search}return await Ve(e,l,!0,{submission:n,replace:t}),{shortCircuited:!0}}if(Le(l))throw Ce(400,{type:"defer-action"});if(Re(l)){let e=Se(r,u.route.id);return!0!==(s&&s.replace)&&(O=a.Push),{matches:r,pendingActionResult:[e.route.id,l]}}return{matches:r,pendingActionResult:[u.route.id,l]}}(p,n,o.submission,i,d.active,{replace:o.replace,flushSync:c});if(t.shortCircuited)return;if(t.pendingActionResult){let[e,r]=t.pendingActionResult;if(Re(r)&&H(r.error)&&404===r.error.status)return N=null,void Ne(n,{matches:t.matches,loaderData:{},errors:{[e]:r.error}})}i=t.matches||i,f=t.pendingActionResult,l=Fe(n,o.submission),c=!1,d.active=!1,p=ge(e.history,p.url,p.signal)}let{shortCircuited:g,matches:y,loaderData:w,errors:x}=await async function(t,n,a,o,s,l,i,c,d,f,p){let h=s||Fe(n,l),g=l||i||Ue(h),v=!U&&(!_.v7_partialHydration||!d);if(o){if(v){let e=De(p);ze(r({navigation:h},void 0!==e?{actionData:e}:{}),{flushSync:f})}let e=await ft(a,n.pathname,t.signal);if("aborted"===e.type)return{shortCircuited:!0};if("error"===e.type){let{boundaryId:t,error:r}=lt(n.pathname,e);return{matches:e.partialMatches,loaderData:{},errors:{[t]:r}}}if(!e.matches){let{error:e,notFoundMatches:t,route:r}=st(n.pathname);return{matches:t,loaderData:{},errors:{[r.id]:e}}}a=e.matches}let y=u||m,[w,x]=se(e.history,T,a,g,n,_.v7_partialHydration&&!0===d,_.v7_skipActionErrorRevalidation,F,q,V,ve,le,oe,y,b,p);if(it((e=>!(a&&a.some((t=>t.route.id===e)))||w&&w.some((t=>t.route.id===e)))),K=++Q,0===w.length&&0===x.length){let e=tt();return Ne(n,r({matches:a,loaderData:{},errors:p&&Re(p[1])?{[p[0]]:p[1].error}:null},_e(p),e?{fetchers:new Map(T.fetchers)}:{}),{flushSync:f}),{shortCircuited:!0}}if(v){let e={};if(!o){e.navigation=h;let t=De(p);void 0!==t&&(e.actionData=t)}x.length>0&&(e.fetchers=function(e){return e.forEach((e=>{let t=T.fetchers.get(e.key),n=He(void 0,t?t.data:void 0);T.fetchers.set(e.key,n)})),new Map(T.fetchers)}(x)),ze(e,{flushSync:f})}x.forEach((e=>{W.has(e.key)&&Xe(e.key),e.controller&&W.set(e.key,e.controller)}));let S=()=>x.forEach((e=>Xe(e.key)));N&&N.signal.addEventListener("abort",S);let{loaderResults:k,fetcherResults:C}=await Qe(T,a,w,x,t);if(t.signal.aborted)return{shortCircuited:!0};N&&N.signal.removeEventListener("abort",S);x.forEach((e=>W.delete(e.key)));let j=je(k);if(j)return await Ve(t,j.result,!0,{replace:c}),{shortCircuited:!0};if(j=je(C),j)return oe.add(j.key),await Ve(t,j.result,!0,{replace:c}),{shortCircuited:!0};let{loaderData:E,errors:A}=we(T,a,w,k,p,x,C,ye);ye.forEach(((e,t)=>{e.subscribe((n=>{(n||e.done)&&ye.delete(t)}))})),_.v7_partialHydration&&d&&T.errors&&Object.entries(T.errors).filter((e=>{let[t]=e;return!w.some((e=>e.route.id===t))})).forEach((e=>{let[t,n]=e;A=Object.assign(A||{},{[t]:n})}));let L=tt(),R=nt(K),I=L||R||x.length>0;return r({matches:a,loaderData:E,errors:A},I?{fetchers:new Map(T.fetchers)}:{})}(p,n,i,d.active,l,o&&o.submission,o&&o.fetcherSubmission,o&&o.replace,o&&!0===o.initialHydration,c,f);g||(N=null,Ne(n,r({matches:y||i},_e(f),{loaderData:w,errors:x})))}function De(e){return e&&!Re(e[1])?{[e[0]]:e[1].data}:T.actionData?0===Object.keys(T.actionData).length?null:T.actionData:void 0}async function Ve(o,s,i,u){let{submission:d,fetcherSubmission:f,replace:p}=void 0===u?{}:u;s.response.headers.has("X-Remix-Revalidate")&&(F=!0);let h=s.response.headers.get("Location");l(h,"Expected a Location header on the redirect Response"),h=me(h,new URL(o.url),b);let m=c(T.location,h,{_isRedirect:!0});if(n){let n=!1;if(s.response.headers.has("X-Remix-Reload-Document"))n=!0;else if(X.test(h)){const r=e.history.createURL(h);n=r.origin!==t.location.origin||null==z(r.pathname,b)}if(n)return void(p?t.location.replace(h):t.location.assign(h))}N=null;let g=!0===p||s.response.headers.has("X-Remix-Replace")?a.Replace:a.Push,{formMethod:v,formAction:y,formEncType:w}=T.navigation;!d&&!f&&v&&y&&w&&(d=Ue(T.navigation));let x=d||f;if(G.has(s.response.status)&&x&&Te(x.formMethod))await Pe(g,m,{submission:r({},x,{formAction:h}),preventScrollReset:M,enableViewTransition:i?$:void 0});else{let e=Fe(m,d);await Pe(g,m,{overrideNavigation:e,fetcherSubmission:f,preventScrollReset:M,enableViewTransition:i?$:void 0})}}async function We(e,t,n,r,a,o){let l,i={};try{l=await fe(w,e,t,n,r,a,o,p,s)}catch(u){return r.forEach((e=>{i[e.route.id]={type:h.error,error:u}})),i}for(let[s,c]of Object.entries(l))if(Ae(c)){let e=c.result;i[s]={type:h.redirect,response:he(e,n,s,a,b,_.v7_relativeSplatPath)}}else i[s]=await pe(c);return i}async function Qe(t,n,r,a,o){let s=t.matches,l=We("loader",t,o,r,n,null),i=Promise.all(a.map((async n=>{if(n.matches&&n.match&&n.controller){let r=(await We("loader",t,ge(e.history,n.path,n.controller.signal),[n.match],n.matches,n.key))[n.match.route.id];return{[n.key]:r}}return Promise.resolve({[n.key]:{type:h.error,error:Ce(404,{pathname:n.path})}})}))),u=await l,c=(await i).reduce(((e,t)=>Object.assign(e,t)),{});return await Promise.all([Oe(n,u,o.signal,s,t.loaderData),Me(n,c,a)]),{loaderResults:u,fetcherResults:c}}function Ke(){F=!0,q.push(...it()),le.forEach(((e,t)=>{W.has(t)&&(V.add(t),Xe(t))}))}function Ge(e,t,n){void 0===n&&(n={}),T.fetchers.set(e,t),ze({fetchers:new Map(T.fetchers)},{flushSync:!0===(n&&n.flushSync)})}function Ye(e,t,n,r){void 0===r&&(r={});let a=Se(T.matches,t);Je(e),ze({errors:{[a.route.id]:n},fetchers:new Map(T.fetchers)},{flushSync:!0===(r&&r.flushSync)})}function Ze(e){return _.v7_fetcherPersist&&(ie.set(e,(ie.get(e)||0)+1),ve.has(e)&&ve.delete(e)),T.fetchers.get(e)||Z}function Je(e){let t=T.fetchers.get(e);!W.has(e)||t&&"loading"===t.state&&ne.has(e)||Xe(e),le.delete(e),ne.delete(e),oe.delete(e),ve.delete(e),V.delete(e),T.fetchers.delete(e)}function Xe(e){let t=W.get(e);l(t,"Expected fetch controller: "+e),t.abort(),W.delete(e)}function et(e){for(let t of e){let e=qe(Ze(t).data);T.fetchers.set(t,e)}}function tt(){let e=[],t=!1;for(let n of oe){let r=T.fetchers.get(n);l(r,"Expected fetcher: "+n),"loading"===r.state&&(oe.delete(n),e.push(n),t=!0)}return et(e),t}function nt(e){let t=[];for(let[n,r]of ne)if(r0}function rt(e){T.blockers.delete(e),be.delete(e)}function at(e,t){let n=T.blockers.get(e)||J;l("unblocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"blocked"===t.state||"blocked"===n.state&&"proceeding"===t.state||"blocked"===n.state&&"unblocked"===t.state||"proceeding"===n.state&&"unblocked"===t.state,"Invalid blocker state transition: "+n.state+" -> "+t.state);let r=new Map(T.blockers);r.set(e,t),ze({blockers:r})}function ot(e){let{currentLocation:t,nextLocation:n,historyAction:r}=e;if(0===be.size)return;be.size>1&&i(!1,"A router only supports one blocker at a time");let a=Array.from(be.entries()),[o,s]=a[a.length-1],l=T.blockers.get(o);return l&&"proceeding"===l.state?void 0:s({currentLocation:t,nextLocation:n,historyAction:r})?o:void 0}function st(e){let t=Ce(404,{pathname:e}),n=u||m,{matches:r,route:a}=ke(n);return it(),{notFoundMatches:r,route:a,error:t}}function lt(e,t){return{boundaryId:Se(t.partialMatches).route.id,error:Ce(400,{type:"route-discovery",pathname:e,message:null!=t.error&&"message"in t.error?t.error:String(t.error)})}}function it(e){let t=[];return ye.forEach(((n,r)=>{e&&!e(r)||(n.cancel(),t.push(r),ye.delete(r))})),t}function ut(e,t){if(E){return E(e,t.map((e=>function(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],handle:n.handle}}(e,T.loaderData))))||e.key}return e.key}function ct(e,t){if(j){let n=ut(e,t),r=j[n];if("number"===typeof r)return r}return null}function dt(e,t,n){if(x){if(C.has(n))return{active:!1,matches:e};if(!e){return{active:!0,matches:y(t,n,b,!0)||[]}}if(Object.keys(e[0].params).length>0){return{active:!0,matches:y(t,n,b,!0)}}}return{active:!1,matches:null}}async function ft(e,t,n){let r=e;for(;;){let e=null==u,o=u||m;try{await ue(x,t,r,o,p,s,Ee,n)}catch(a){return{type:"error",error:a,partialMatches:r}}finally{e&&(m=[...m])}if(n.aborted)return{type:"aborted"};let l=v(o,t,b);if(l)return pt(t,C),{type:"success",matches:l};let i=y(o,t,b,!0);if(!i||r.length===i.length&&r.every(((e,t)=>e.route.id===i[t].route.id)))return pt(t,C),{type:"success",matches:null};r=i}}function pt(e,t){if(t.size>=1e3){let e=t.values().next().value;t.delete(e)}t.add(e)}return f={get basename(){return b},get future(){return _},get state(){return T},get routes(){return m},get window(){return t},initialize:function(){if(S=e.history.listen((t=>{let{action:n,location:r,delta:a}=t;if(P)return P(),void(P=void 0);i(0===be.size||null!=a,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let o=ot({currentLocation:T.location,nextLocation:r,historyAction:n});if(o&&null!=a){let t=new Promise((e=>{P=e}));return e.history.go(-1*a),void at(o,{state:"blocked",location:r,proceed(){at(o,{state:"proceeding",proceed:void 0,reset:void 0,location:r}),t.then((()=>e.history.go(a)))},reset(){let e=new Map(T.blockers);e.set(o,J),ze({blockers:e})}})}return Pe(n,r)})),n){!function(e,t){try{let n=e.sessionStorage.getItem(te);if(n){let e=JSON.parse(n);for(let[n,r]of Object.entries(e||{}))r&&Array.isArray(r)&&t.set(n,new Set(r||[]))}}catch(n){}}(t,D);let e=()=>function(e,t){if(t.size>0){let r={};for(let[e,n]of t)r[e]=[...n];try{e.sessionStorage.setItem(te,JSON.stringify(r))}catch(n){i(!1,"Failed to save applied view transitions in sessionStorage ("+n+").")}}}(t,D);t.addEventListener("pagehide",e),B=()=>t.removeEventListener("pagehide",e)}return T.initialized||Pe(a.Pop,T.location,{initialHydration:!0}),f},subscribe:function(e){return k.add(e),()=>k.delete(e)},enableScrollRestoration:function(e,t,n){if(j=e,A=t,E=n||null,!L&&T.navigation===Y){L=!0;let e=ct(T.location,T.matches);null!=e&&ze({restoreScrollPosition:e})}return()=>{j=null,A=null,E=null}},navigate:async function t(n,o){if("number"===typeof n)return void e.history.go(n);let s=re(T.location,T.matches,b,_.v7_prependBasename,n,_.v7_relativeSplatPath,null==o?void 0:o.fromRouteId,null==o?void 0:o.relative),{path:l,submission:i,error:u}=ae(_.v7_normalizeFormMethod,!1,s,o),d=T.location,f=c(T.location,l,o&&o.state);f=r({},f,e.history.encodeLocation(f));let p=o&&null!=o.replace?o.replace:void 0,h=a.Push;!0===p?h=a.Replace:!1===p||null!=i&&Te(i.formMethod)&&i.formAction===T.location.pathname+T.location.search&&(h=a.Replace);let m=o&&"preventScrollReset"in o?!0===o.preventScrollReset:void 0,g=!0===(o&&o.unstable_flushSync),v=ot({currentLocation:d,nextLocation:f,historyAction:h});if(!v)return await Pe(h,f,{submission:i,pendingError:u,preventScrollReset:m,replace:o&&o.replace,enableViewTransition:o&&o.unstable_viewTransition,flushSync:g});at(v,{state:"blocked",location:f,proceed(){at(v,{state:"proceeding",proceed:void 0,reset:void 0,location:f}),t(n,o)},reset(){let e=new Map(T.blockers);e.set(v,J),ze({blockers:e})}})},fetch:function(t,n,r,a){if(o)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");W.has(t)&&Xe(t);let s=!0===(a&&a.unstable_flushSync),i=u||m,c=re(T.location,T.matches,b,_.v7_prependBasename,r,_.v7_relativeSplatPath,n,null==a?void 0:a.relative),d=v(i,c,b),f=dt(d,i,c);if(f.active&&f.matches&&(d=f.matches),!d)return void Ye(t,n,Ce(404,{pathname:c}),{flushSync:s});let{path:p,submission:h,error:g}=ae(_.v7_normalizeFormMethod,!0,c,a);if(g)return void Ye(t,n,g,{flushSync:s});let y=Be(d,p);M=!0===(a&&a.preventScrollReset),h&&Te(h.formMethod)?async function(t,n,r,a,o,s,i,c){function d(e){if(!e.route.action&&!e.route.lazy){let e=Ce(405,{method:c.formMethod,pathname:r,routeId:n});return Ye(t,n,e,{flushSync:i}),!0}return!1}if(Ke(),le.delete(t),!s&&d(a))return;let f=T.fetchers.get(t);Ge(t,function(e,t){let n={state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0};return n}(c,f),{flushSync:i});let p=new AbortController,h=ge(e.history,r,p.signal,c);if(s){let e=await ft(o,r,h.signal);if("aborted"===e.type)return;if("error"===e.type){let{error:a}=lt(r,e);return void Ye(t,n,a,{flushSync:i})}if(!e.matches)return void Ye(t,n,Ce(404,{pathname:r}),{flushSync:i});if(d(a=Be(o=e.matches,r)))return}W.set(t,p);let g=Q,y=await We("action",T,h,[a],o,t),w=y[a.route.id];if(h.signal.aborted)return void(W.get(t)===p&&W.delete(t));if(_.v7_fetcherPersist&&ve.has(t)){if(Ie(w)||Re(w))return void Ge(t,qe(void 0))}else{if(Ie(w))return W.delete(t),K>g?void Ge(t,qe(void 0)):(oe.add(t),Ge(t,He(c)),Ve(h,w,!1,{fetcherSubmission:c}));if(Re(w))return void Ye(t,n,w.error)}if(Le(w))throw Ce(400,{type:"defer-action"});let x=T.navigation.location||T.location,S=ge(e.history,x,p.signal),k=u||m,C="idle"!==T.navigation.state?v(k,T.navigation.location,b):T.matches;l(C,"Didn't find any matches after fetcher action");let j=++Q;ne.set(t,j);let E=He(c,w.data);T.fetchers.set(t,E);let[A,L]=se(e.history,T,C,c,x,!1,_.v7_skipActionErrorRevalidation,F,q,V,ve,le,oe,k,b,[a.route.id,w]);L.filter((e=>e.key!==t)).forEach((e=>{let t=e.key,n=T.fetchers.get(t),r=He(void 0,n?n.data:void 0);T.fetchers.set(t,r),W.has(t)&&Xe(t),e.controller&&W.set(t,e.controller)})),ze({fetchers:new Map(T.fetchers)});let R=()=>L.forEach((e=>Xe(e.key)));p.signal.addEventListener("abort",R);let{loaderResults:I,fetcherResults:z}=await Qe(T,C,A,L,S);if(p.signal.aborted)return;p.signal.removeEventListener("abort",R),ne.delete(t),W.delete(t),L.forEach((e=>W.delete(e.key)));let P=je(I);if(P)return Ve(S,P.result,!1);if(P=je(z),P)return oe.add(P.key),Ve(S,P.result,!1);let{loaderData:M,errors:$}=we(T,C,A,I,void 0,L,z,ye);if(T.fetchers.has(t)){let e=qe(w.data);T.fetchers.set(t,e)}nt(j),"loading"===T.navigation.state&&j>K?(l(O,"Expected pending action"),N&&N.abort(),Ne(T.navigation.location,{matches:C,loaderData:M,errors:$,fetchers:new Map(T.fetchers)})):(ze({errors:$,loaderData:xe(T.loaderData,M,C,$),fetchers:new Map(T.fetchers)}),F=!1)}(t,n,p,y,d,f.active,s,h):(le.set(t,{routeId:n,path:p}),async function(t,n,r,a,o,s,i,u){let c=T.fetchers.get(t);Ge(t,He(u,c?c.data:void 0),{flushSync:i});let d=new AbortController,f=ge(e.history,r,d.signal);if(s){let e=await ft(o,r,f.signal);if("aborted"===e.type)return;if("error"===e.type){let{error:a}=lt(r,e);return void Ye(t,n,a,{flushSync:i})}if(!e.matches)return void Ye(t,n,Ce(404,{pathname:r}),{flushSync:i});a=Be(o=e.matches,r)}W.set(t,d);let p=Q,h=await We("loader",T,f,[a],o,t),m=h[a.route.id];Le(m)&&(m=await $e(m,f.signal,!0)||m);W.get(t)===d&&W.delete(t);if(f.signal.aborted)return;if(ve.has(t))return void Ge(t,qe(void 0));if(Ie(m))return K>p?void Ge(t,qe(void 0)):(oe.add(t),void await Ve(f,m,!1));if(Re(m))return void Ye(t,n,m.error);l(!Le(m),"Unhandled fetcher deferred data"),Ge(t,qe(m.data))}(t,n,p,y,d,f.active,s,h))},revalidate:function(){Ke(),ze({revalidation:"loading"}),"submitting"!==T.navigation.state&&("idle"!==T.navigation.state?Pe(O||T.historyAction,T.navigation.location,{overrideNavigation:T.navigation,enableViewTransition:!0===$}):Pe(T.historyAction,T.location,{startUninterruptedRevalidation:!0}))},createHref:t=>e.history.createHref(t),encodeLocation:t=>e.history.encodeLocation(t),getFetcher:Ze,deleteFetcher:function(e){if(_.v7_fetcherPersist){let t=(ie.get(e)||0)-1;t<=0?(ie.delete(e),ve.add(e)):ie.set(e,t)}else Je(e);ze({fetchers:new Map(T.fetchers)})},dispose:function(){S&&S(),B&&B(),k.clear(),N&&N.abort(),T.fetchers.forEach(((e,t)=>Je(t))),T.blockers.forEach(((e,t)=>rt(t)))},getBlocker:function(e,t){let n=T.blockers.get(e)||J;return be.get(e)!==t&&be.set(e,t),n},deleteBlocker:rt,patchRoutes:function(e,t){let n=null==u;ce(e,t,u||m,p,s),n&&(m=[...m],ze({}))},_internalFetchControllers:W,_internalActiveDeferreds:ye,_internalSetRoutes:function(e){p={},u=g(e,s,void 0,p)}},f}Symbol("deferred");function re(e,t,n,r,a,o,s,l){let i,u;if(s){i=[];for(let e of t)if(i.push(e),e.route.id===s){u=e;break}}else i=t,u=t[t.length-1];let c=O(a||".",T(i,o),z(e.pathname,n)||e.pathname,"path"===l);return null==a&&(c.search=e.search,c.hash=e.hash),null!=a&&""!==a&&"."!==a||!u||!u.route.index||De(c.search)||(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),r&&"/"!==n&&(c.pathname="/"===c.pathname?n:M([n,c.pathname])),d(c)}function ae(e,t,n,r){if(!r||!function(e){return null!=e&&("formData"in e&&null!=e.formData||"body"in e&&void 0!==e.body)}(r))return{path:n};if(r.formMethod&&!Pe(r.formMethod))return{path:n,error:Ce(405,{method:r.formMethod})};let a,o,s=()=>({path:n,error:Ce(400,{type:"invalid-body"})}),i=r.formMethod||"get",u=e?i.toUpperCase():i.toLowerCase(),c=Ee(n);if(void 0!==r.body){if("text/plain"===r.formEncType){if(!Te(u))return s();let e="string"===typeof r.body?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce(((e,t)=>{let[n,r]=t;return""+e+n+"="+r+"\n"}),""):String(r.body);return{path:n,submission:{formMethod:u,formAction:c,formEncType:r.formEncType,formData:void 0,json:void 0,text:e}}}if("application/json"===r.formEncType){if(!Te(u))return s();try{let e="string"===typeof r.body?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:u,formAction:c,formEncType:r.formEncType,formData:void 0,json:e,text:void 0}}}catch(m){return s()}}}if(l("function"===typeof FormData,"FormData is not available in this environment"),r.formData)a=ve(r.formData),o=r.formData;else if(r.body instanceof FormData)a=ve(r.body),o=r.body;else if(r.body instanceof URLSearchParams)a=r.body,o=ye(a);else if(null==r.body)a=new URLSearchParams,o=new FormData;else try{a=new URLSearchParams(r.body),o=ye(a)}catch(m){return s()}let p={formMethod:u,formAction:c,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:o,json:void 0,text:void 0};if(Te(p.formMethod))return{path:n,submission:p};let h=f(n);return t&&h.search&&De(h.search)&&a.append("index",""),h.search="?"+a,{path:d(h),submission:p}}function oe(e,t){let n=e;if(t){let r=e.findIndex((e=>e.route.id===t));r>=0&&(n=e.slice(0,r))}return n}function se(e,t,n,a,o,s,l,i,u,c,d,f,p,h,m,g){let y=g?Re(g[1])?g[1].error:g[1].data:void 0,b=e.createURL(t.location),w=e.createURL(o),x=g&&Re(g[1])?g[0]:void 0,_=x?oe(n,x):n,S=g?g[1].statusCode:void 0,k=l&&S&&S>=400,C=_.filter(((e,n)=>{let{route:o}=e;if(o.lazy)return!0;if(null==o.loader)return!1;if(s)return!("function"===typeof o.loader&&!o.loader.hydrate)||void 0===t.loaderData[o.id]&&(!t.errors||void 0===t.errors[o.id]);if(function(e,t,n){let r=!t||n.route.id!==t.route.id,a=void 0===e[n.route.id];return r||a}(t.loaderData,t.matches[n],e)||u.some((t=>t===e.route.id)))return!0;let l=t.matches[n],c=e;return ie(e,r({currentUrl:b,currentParams:l.params,nextUrl:w,nextParams:c.params},a,{actionResult:y,actionStatus:S,defaultShouldRevalidate:!k&&(i||b.pathname+b.search===w.pathname+w.search||b.search!==w.search||le(l,c))}))})),j=[];return f.forEach(((e,o)=>{if(s||!n.some((t=>t.route.id===e.routeId))||d.has(o))return;let l=v(h,e.path,m);if(!l)return void j.push({key:o,routeId:e.routeId,path:e.path,matches:null,match:null,controller:null});let u=t.fetchers.get(o),f=Be(l,e.path),g=!1;p.has(o)?g=!1:c.has(o)?(c.delete(o),g=!0):g=u&&"idle"!==u.state&&void 0===u.data?i:ie(f,r({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:n[n.length-1].params},a,{actionResult:y,actionStatus:S,defaultShouldRevalidate:!k&&i})),g&&j.push({key:o,routeId:e.routeId,path:e.path,matches:l,match:f,controller:new AbortController})})),[C,j]}function le(e,t){let n=e.route.path;return e.pathname!==t.pathname||null!=n&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ie(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if("boolean"===typeof n)return n}return t.defaultShouldRevalidate}async function ue(e,t,n,r,a,o,s,l){let i=[t,...n.map((e=>e.route.id))].join("-");try{let c=s.get(i);c||(c=e({path:t,matches:n,patch:(e,t)=>{l.aborted||ce(e,t,r,a,o)}}),s.set(i,c)),c&&("object"===typeof(u=c)&&null!=u&&"then"in u)&&await c}finally{s.delete(i)}var u}function ce(e,t,n,r,a){if(e){var o;let n=r[e];l(n,"No route found to patch children into: routeId = "+e);let s=g(t,a,[e,"patch",String((null==(o=n.children)?void 0:o.length)||"0")],r);n.children?n.children.push(...s):n.children=s}else{let e=g(t,a,["patch",String(n.length||"0")],r);n.push(...e)}}async function de(e){let{matches:t}=e,n=t.filter((e=>e.shouldLoad));return(await Promise.all(n.map((e=>e.resolve())))).reduce(((e,t,r)=>Object.assign(e,{[n[r].route.id]:t})),{})}async function fe(e,t,n,a,o,s,u,c,d,f){let p=s.map((e=>e.route.lazy?async function(e,t,n){if(!e.lazy)return;let a=await e.lazy();if(!e.lazy)return;let o=n[e.id];l(o,"No route found in manifest");let s={};for(let r in a){let e=void 0!==o[r]&&"hasErrorBoundary"!==r;i(!e,'Route "'+o.id+'" has a static property "'+r+'" defined but its lazy function is also returning a value for this property. The lazy route property "'+r+'" will be ignored.'),e||m.has(r)||(s[r]=a[r])}Object.assign(o,s),Object.assign(o,r({},t(o),{lazy:void 0}))}(e.route,d,c):void 0)),g=s.map(((e,n)=>{let s=p[n],i=o.some((t=>t.route.id===e.route.id));return r({},e,{shouldLoad:i,resolve:async n=>(n&&"GET"===a.method&&(e.route.lazy||e.route.loader)&&(i=!0),i?async function(e,t,n,r,a,o){let s,i,u=r=>{let s,l=new Promise(((e,t)=>s=t));i=()=>s(),t.signal.addEventListener("abort",i);let u=a=>"function"!==typeof r?Promise.reject(new Error('You cannot call the handler for a route which defines a boolean "'+e+'" [routeId: '+n.route.id+"]")):r({request:t,params:n.params,context:o},...void 0!==a?[a]:[]),c=(async()=>{try{return{type:"data",result:await(a?a((e=>u(e))):u())}}catch(e){return{type:"error",result:e}}})();return Promise.race([c,l])};try{let a=n.route[e];if(r)if(a){let e,[t]=await Promise.all([u(a).catch((t=>{e=t})),r]);if(void 0!==e)throw e;s=t}else{if(await r,a=n.route[e],!a){if("action"===e){let e=new URL(t.url),r=e.pathname+e.search;throw Ce(405,{method:t.method,pathname:r,routeId:n.route.id})}return{type:h.data,result:void 0}}s=await u(a)}else{if(!a){let e=new URL(t.url);throw Ce(404,{pathname:e.pathname+e.search})}s=await u(a)}l(void 0!==s.result,"You defined "+("action"===e?"an action":"a loader")+' for route "'+n.route.id+"\" but didn't return anything from your `"+e+"` function. Please return a value or `null`.")}catch(c){return{type:h.error,result:c}}finally{i&&t.signal.removeEventListener("abort",i)}return s}(t,a,e,s,n,f):Promise.resolve({type:h.data,result:void 0}))})})),v=await e({matches:g,request:a,params:s[0].params,fetcherKey:u,context:f});try{await Promise.all(p)}catch(y){}return v}async function pe(e){let{result:t,type:n}=e;if(Ne(t)){let e;try{let n=t.headers.get("Content-Type");e=n&&/\bapplication\/json\b/.test(n)?null==t.body?null:await t.json():await t.text()}catch(u){return{type:h.error,error:u}}return n===h.error?{type:h.error,error:new F(t.status,t.statusText,e),statusCode:t.status,headers:t.headers}:{type:h.data,data:e,statusCode:t.status,headers:t.headers}}if(n===h.error){if(ze(t)){var r,a;if(t.data instanceof Error)return{type:h.error,error:t.data,statusCode:null==(a=t.init)?void 0:a.status};t=new F((null==(r=t.init)?void 0:r.status)||500,void 0,t.data)}return{type:h.error,error:t,statusCode:H(t)?t.status:void 0}}var o,s,l,i;return function(e){let t=e;return t&&"object"===typeof t&&"object"===typeof t.data&&"function"===typeof t.subscribe&&"function"===typeof t.cancel&&"function"===typeof t.resolveData}(t)?{type:h.deferred,deferredData:t,statusCode:null==(o=t.init)?void 0:o.status,headers:(null==(s=t.init)?void 0:s.headers)&&new Headers(t.init.headers)}:ze(t)?{type:h.data,data:t.data,statusCode:null==(l=t.init)?void 0:l.status,headers:null!=(i=t.init)&&i.headers?new Headers(t.init.headers):void 0}:{type:h.data,data:t}}function he(e,t,n,r,a,o){let s=e.headers.get("Location");if(l(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!X.test(s)){let l=r.slice(0,r.findIndex((e=>e.route.id===n))+1);s=re(new URL(t.url),l,a,!0,s,o),e.headers.set("Location",s)}return e}function me(e,t,n){if(X.test(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=null!=z(a.pathname,n);if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function ge(e,t,n,r){let a=e.createURL(Ee(t)).toString(),o={signal:n};if(r&&Te(r.formMethod)){let{formMethod:e,formEncType:t}=r;o.method=e.toUpperCase(),"application/json"===t?(o.headers=new Headers({"Content-Type":t}),o.body=JSON.stringify(r.json)):"text/plain"===t?o.body=r.text:"application/x-www-form-urlencoded"===t&&r.formData?o.body=ve(r.formData):o.body=r.formData}return new Request(a,o)}function ve(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,"string"===typeof r?r:r.name);return t}function ye(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function be(e,t,n,r,a){let o,s={},i=null,u=!1,c={},d=n&&Re(n[1])?n[1].error:void 0;return e.forEach((n=>{if(!(n.route.id in t))return;let f=n.route.id,p=t[f];if(l(!Ie(p),"Cannot handle redirect results in processLoaderData"),Re(p)){let t=p.error;if(void 0!==d&&(t=d,d=void 0),i=i||{},a)i[f]=t;else{let n=Se(e,f);null==i[n.route.id]&&(i[n.route.id]=t)}s[f]=void 0,u||(u=!0,o=H(p.error)?p.error.status:500),p.headers&&(c[f]=p.headers)}else Le(p)?(r.set(f,p.deferredData),s[f]=p.deferredData.data,null==p.statusCode||200===p.statusCode||u||(o=p.statusCode),p.headers&&(c[f]=p.headers)):(s[f]=p.data,p.statusCode&&200!==p.statusCode&&!u&&(o=p.statusCode),p.headers&&(c[f]=p.headers))})),void 0!==d&&n&&(i={[n[0]]:d},s[n[0]]=void 0),{loaderData:s,errors:i,statusCode:o||200,loaderHeaders:c}}function we(e,t,n,a,o,s,i,u){let{loaderData:c,errors:d}=be(t,a,o,u,!1);return s.forEach((t=>{let{key:n,match:a,controller:o}=t,s=i[n];if(l(s,"Did not find corresponding fetcher result"),!o||!o.signal.aborted)if(Re(s)){let t=Se(e.matches,null==a?void 0:a.route.id);d&&d[t.route.id]||(d=r({},d,{[t.route.id]:s.error})),e.fetchers.delete(n)}else if(Ie(s))l(!1,"Unhandled fetcher revalidation redirect");else if(Le(s))l(!1,"Unhandled fetcher deferred data");else{let t=qe(s.data);e.fetchers.set(n,t)}})),{loaderData:c,errors:d}}function xe(e,t,n,a){let o=r({},t);for(let r of n){let n=r.route.id;if(t.hasOwnProperty(n)?void 0!==t[n]&&(o[n]=t[n]):void 0!==e[n]&&r.route.loader&&(o[n]=e[n]),a&&a.hasOwnProperty(n))break}return o}function _e(e){return e?Re(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Se(e,t){return(t?e.slice(0,e.findIndex((e=>e.route.id===t))+1):[...e]).reverse().find((e=>!0===e.route.hasErrorBoundary))||e[0]}function ke(e){let t=1===e.length?e[0]:e.find((e=>e.index||!e.path||"/"===e.path))||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Ce(e,t){let{pathname:n,routeId:r,method:a,type:o,message:s}=void 0===t?{}:t,l="Unknown Server Error",i="Unknown @remix-run/router error";return 400===e?(l="Bad Request","route-discovery"===o?i='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` function threw the following error:\n'+s:a&&n&&r?i="You made a "+a+' request to "'+n+'" but did not provide a `loader` for route "'+r+'", so there is no way to handle the request.':"defer-action"===o?i="defer() is not supported in actions":"invalid-body"===o&&(i="Unable to encode submission body")):403===e?(l="Forbidden",i='Route "'+r+'" does not match URL "'+n+'"'):404===e?(l="Not Found",i='No route matches URL "'+n+'"'):405===e&&(l="Method Not Allowed",a&&n&&r?i="You made a "+a.toUpperCase()+' request to "'+n+'" but did not provide an `action` for route "'+r+'", so there is no way to handle the request.':a&&(i='Invalid request method "'+a.toUpperCase()+'"')),new F(e||500,l,new Error(i),!0)}function je(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[e,r]=t[n];if(Ie(r))return{key:e,result:r}}}function Ee(e){return d(r({},"string"===typeof e?f(e):e,{hash:""}))}function Ae(e){return Ne(e.result)&&K.has(e.result.status)}function Le(e){return e.type===h.deferred}function Re(e){return e.type===h.error}function Ie(e){return(e&&e.type)===h.redirect}function ze(e){return"object"===typeof e&&null!=e&&"type"in e&&"data"in e&&"init"in e&&"DataWithResponseInit"===e.type}function Ne(e){return null!=e&&"number"===typeof e.status&&"string"===typeof e.statusText&&"object"===typeof e.headers&&"undefined"!==typeof e.body}function Pe(e){return Q.has(e.toLowerCase())}function Te(e){return V.has(e.toLowerCase())}async function Oe(e,t,n,r,a){let o=Object.entries(t);for(let s=0;s(null==e?void 0:e.route.id)===l));if(!u)continue;let c=r.find((e=>e.route.id===u.route.id)),d=null!=c&&!le(c,u)&&void 0!==(a&&a[u.route.id]);Le(i)&&d&&await $e(i,n,!1).then((e=>{e&&(t[l]=e)}))}}async function Me(e,t,n){for(let r=0;r(null==e?void 0:e.route.id)===o))&&(Le(i)&&(l(s,"Expected an AbortController for revalidating fetcher deferred result"),await $e(i,s.signal,!0).then((e=>{e&&(t[a]=e)}))))}}async function $e(e,t,n){if(void 0===n&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:h.data,data:e.deferredData.unwrappedData}}catch(r){return{type:h.error,error:r}}return{type:h.data,data:e.deferredData.data}}}function De(e){return new URLSearchParams(e).getAll("index").some((e=>""===e))}function Be(e,t){let n="string"===typeof t?f(t).search:t.search;if(e[e.length-1].route.index&&De(n||""))return e[e.length-1];let r=P(e);return r[r.length-1]}function Ue(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:s}=e;if(t&&n&&r)return null!=a?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a}:null!=o?{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0}:void 0!==s?{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}:void 0}function Fe(e,t){if(t){return{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}return{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function He(e,t){if(e){return{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}}return{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function qe(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}},38345:(e,t,n)=>{"use strict";var r=n(9950),a=n(75340);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n