function JM(t,e){for(var n=0;no[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))o(a);new MutationObserver(a=>{for(const l of a)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&o(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const l={};return a.integrity&&(l.integrity=a.integrity),a.referrerPolicy&&(l.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?l.credentials="include":a.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function o(a){if(a.ep)return;a.ep=!0;const l=n(a);fetch(a.href,l)}})();function Bv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Bm={exports:{}},kc={};var MT;function ZM(){if(MT)return kc;MT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(o,a,l){var c=null;if(l!==void 0&&(c=""+l),a.key!==void 0&&(c=""+a.key),"key"in a){l={};for(var d in a)d!=="key"&&(l[d]=a[d])}else l=a;return a=l.ref,{$$typeof:t,type:o,key:c,ref:a!==void 0?a:null,props:l}}return kc.Fragment=e,kc.jsx=n,kc.jsxs=n,kc}var NT;function e2(){return NT||(NT=1,Bm.exports=ZM()),Bm.exports}var I=e2(),Hm={exports:{}},Ve={};var PT;function t2(){if(PT)return Ve;PT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),v=Symbol.iterator;function C(P){return P===null||typeof P!="object"?null:(P=v&&P[v]||P["@@iterator"],typeof P=="function"?P:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,w={};function _(P,V,oe){this.props=P,this.context=V,this.refs=w,this.updater=oe||b}_.prototype.isReactComponent={},_.prototype.setState=function(P,V){if(typeof P!="object"&&typeof P!="function"&&P!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,P,V,"setState")},_.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function k(){}k.prototype=_.prototype;function R(P,V,oe){this.props=P,this.context=V,this.refs=w,this.updater=oe||b}var N=R.prototype=new k;N.constructor=R,T(N,_.prototype),N.isPureReactComponent=!0;var M=Array.isArray;function U(){}var x={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function H(P,V,oe){var de=oe.ref;return{$$typeof:t,type:P,key:V,ref:de!==void 0?de:null,props:oe}}function A(P,V){return H(P.type,V,P.props)}function $(P){return typeof P=="object"&&P!==null&&P.$$typeof===t}function ee(P){var V={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(oe){return V[oe]})}var re=/\/+/g;function le(P,V){return typeof P=="object"&&P!==null&&P.key!=null?ee(""+P.key):V.toString(36)}function W(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(U,U):(P.status="pending",P.then(function(V){P.status==="pending"&&(P.status="fulfilled",P.value=V)},function(V){P.status==="pending"&&(P.status="rejected",P.reason=V)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function D(P,V,oe,de,ye){var we=typeof P;(we==="undefined"||we==="boolean")&&(P=null);var Me=!1;if(P===null)Me=!0;else switch(we){case"bigint":case"string":case"number":Me=!0;break;case"object":switch(P.$$typeof){case t:case e:Me=!0;break;case m:return Me=P._init,D(Me(P._payload),V,oe,de,ye)}}if(Me)return ye=ye(P),Me=de===""?"."+le(P,0):de,M(ye)?(oe="",Me!=null&&(oe=Me.replace(re,"$&/")+"/"),D(ye,V,oe,"",function(Fe){return Fe})):ye!=null&&($(ye)&&(ye=A(ye,oe+(ye.key==null||P&&P.key===ye.key?"":(""+ye.key).replace(re,"$&/")+"/")+Me)),V.push(ye)),1;Me=0;var Je=de===""?".":de+":";if(M(P))for(var $e=0;$e>>1,pe=D[X];if(0>>1;Xa(oe,q))dea(ye,oe)?(D[X]=ye,D[de]=q,X=de):(D[X]=oe,D[V]=q,X=V);else if(dea(ye,q))D[X]=ye,D[de]=q,X=de;else break e}}return J}function a(D,J){var q=D.sortIndex-J.sortIndex;return q!==0?q:D.id-J.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();t.unstable_now=function(){return c.now()-d}}var f=[],h=[],m=1,y=null,v=3,C=!1,b=!1,T=!1,w=!1,_=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function N(D){for(var J=n(h);J!==null;){if(J.callback===null)o(h);else if(J.startTime<=D)o(h),J.sortIndex=J.expirationTime,e(f,J);else break;J=n(h)}}function M(D){if(T=!1,N(D),!b)if(n(f)!==null)b=!0,U||(U=!0,ee());else{var J=n(h);J!==null&&W(M,J.startTime-D)}}var U=!1,x=-1,L=5,H=-1;function A(){return w?!0:!(t.unstable_now()-HD&&A());){var X=y.callback;if(typeof X=="function"){y.callback=null,v=y.priorityLevel;var pe=X(y.expirationTime<=D);if(D=t.unstable_now(),typeof pe=="function"){y.callback=pe,N(D),J=!0;break t}y===n(f)&&o(f),N(D)}else o(f);y=n(f)}if(y!==null)J=!0;else{var P=n(h);P!==null&&W(M,P.startTime-D),J=!1}}break e}finally{y=null,v=q,C=!1}J=void 0}}finally{J?ee():U=!1}}}var ee;if(typeof R=="function")ee=function(){R($)};else if(typeof MessageChannel<"u"){var re=new MessageChannel,le=re.port2;re.port1.onmessage=$,ee=function(){le.postMessage(null)}}else ee=function(){_($,0)};function W(D,J){x=_(function(){D(t.unstable_now())},J)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(D){D.callback=null},t.unstable_forceFrameRate=function(D){0>D||125X?(D.sortIndex=q,e(h,D),n(f)===null&&D===n(h)&&(T?(k(x),x=-1):T=!0,W(M,q-X))):(D.sortIndex=pe,e(f,D),b||C||(b=!0,U||(U=!0,ee()))),D},t.unstable_shouldYield=A,t.unstable_wrapCallback=function(D){var J=v;return function(){var q=v;v=J;try{return D.apply(this,arguments)}finally{v=q}}}})(Fm)),Fm}var UT;function r2(){return UT||(UT=1,$m.exports=n2()),$m.exports}var Km={exports:{}},jn={};var zT;function o2(){if(zT)return jn;zT=1;var t=Nh();function e(f){var h="https://react.dev/errors/"+f;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Km.exports=o2(),Km.exports}var HT;function i2(){if(HT)return Mc;HT=1;var t=r2(),e=Nh(),n=g1();function o(r){var i="https://react.dev/errors/"+r;if(1pe||(r.current=X[pe],X[pe]=null,pe--)}function oe(r,i){pe++,X[pe]=r.current,r.current=i}var de=P(null),ye=P(null),we=P(null),Me=P(null);function Je(r,i){switch(oe(we,i),oe(ye,r),oe(de,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?tT(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=tT(i),r=nT(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}V(de),oe(de,r)}function $e(){V(de),V(ye),V(we)}function Fe(r){r.memoizedState!==null&&oe(Me,r);var i=de.current,s=nT(i,r.type);i!==s&&(oe(ye,r),oe(de,s))}function We(r){ye.current===r&&(V(de),V(ye)),Me.current===r&&(V(Me),xc._currentValue=q)}var Ie,rt;function Re(r){if(Ie===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);Ie=i&&i[1]||"",rt=-1)":-1p||B[u]!==Y[p]){var ie=` `+B[u].replace(" at new "," at ");return r.displayName&&ie.includes("")&&(ie=ie.replace("",r.displayName)),ie}while(1<=u&&0<=p);break}}}finally{Rt=!1,Error.prepareStackTrace=s}return(s=r?r.displayName||r.name:"")?Re(s):""}function fn(r,i){switch(r.tag){case 26:case 27:case 5:return Re(r.type);case 16:return Re("Lazy");case 13:return r.child!==i&&i!==null?Re("Suspense Fallback"):Re("Suspense");case 19:return Re("SuspenseList");case 0:case 15:return Vt(r.type,!1);case 11:return Vt(r.type.render,!1);case 1:return Vt(r.type,!0);case 31:return Re("Activity");default:return""}}function gt(r){try{var i="",s=null;do i+=fn(r,s),s=r,r=r.return;while(r);return i}catch(u){return` Error generating stack: `+u.message+` `+u.stack}}var An=Object.prototype.hasOwnProperty,qt=t.unstable_scheduleCallback,Yt=t.unstable_cancelCallback,De=t.unstable_shouldYield,mr=t.unstable_requestPaint,He=t.unstable_now,Ot=t.unstable_getCurrentPriorityLevel,Wt=t.unstable_ImmediatePriority,rn=t.unstable_UserBlockingPriority,vt=t.unstable_NormalPriority,vn=t.unstable_LowPriority,yr=t.unstable_IdlePriority,Pt=t.log,Pr=t.unstable_setDisableYieldValue,vr=null,Ee=null;function ot(r){if(typeof Pt=="function"&&Pr(r),Ee&&typeof Ee.setStrictMode=="function")try{Ee.setStrictMode(vr,r)}catch{}}var mt=Math.clz32?Math.clz32:Yu,no=Math.log,bs=Math.LN2;function Yu(r){return r>>>=0,r===0?32:31-(no(r)/bs|0)|0}var Go=256,va=262144,Ri=4194304;function qo(r){var i=r&42;if(i!==0)return i;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ba(r,i,s){var u=r.pendingLanes;if(u===0)return 0;var p=0,g=r.suspendedLanes,S=r.pingedLanes;r=r.warmLanes;var O=u&134217727;return O!==0?(u=O&~g,u!==0?p=qo(u):(S&=O,S!==0?p=qo(S):s||(s=O&~r,s!==0&&(p=qo(s))))):(O=u&~g,O!==0?p=qo(O):S!==0?p=qo(S):s||(s=u&~r,s!==0&&(p=qo(s)))),p===0?0:i!==0&&i!==p&&(i&g)===0&&(g=p&-p,s=i&-i,g>=s||g===32&&(s&4194048)!==0)?i:p}function Sa(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Wu(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ca(){var r=Ri;return Ri<<=1,(Ri&62914560)===0&&(Ri=4194304),r}function xi(r){for(var i=[],s=0;31>s;s++)i.push(r);return i}function _i(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Mp(r,i,s,u,p,g){var S=r.pendingLanes;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=s,r.entangledLanes&=s,r.errorRecoveryDisabledLanes&=s,r.shellSuspendCounter=0;var O=r.entanglements,B=r.expirationTimes,Y=r.hiddenUpdates;for(s=S&~s;0"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var GI=/[\n"\\]/g;function Lr(r){return r.replace(GI,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Np(r,i,s,u,p,g,S,O){r.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?r.type=S:r.removeAttribute("type"),i!=null?S==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+ht(i)):r.value!==""+ht(i)&&(r.value=""+ht(i)):S!=="submit"&&S!=="reset"||r.removeAttribute("value"),i!=null?Pp(r,S,ht(i)):s!=null?Pp(r,S,ht(s)):u!=null&&r.removeAttribute("value"),p==null&&g!=null&&(r.defaultChecked=!!g),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?r.name=""+ht(O):r.removeAttribute("name")}function WS(r,i,s,u,p,g,S,O){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(r.type=g),i!=null||s!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){Fl(r);return}s=s!=null?""+ht(s):"",i=i!=null?""+ht(i):s,O||i===r.value||(r.value=i),r.defaultValue=i}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=O?r.checked:!!u,r.defaultChecked=!!u,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(r.name=S),Fl(r)}function Pp(r,i,s){i==="number"&&Ju(r.ownerDocument)===r||r.defaultValue===""+s||(r.defaultValue=""+s)}function Ss(r,i,s,u){if(r=r.options,i){i={};for(var p=0;p"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Bp=!1;if(Qo)try{var Vl={};Object.defineProperty(Vl,"passive",{get:function(){Bp=!0}}),window.addEventListener("test",Vl,Vl),window.removeEventListener("test",Vl,Vl)}catch{Bp=!1}var Oi=null,Hp=null,ed=null;function nC(){if(ed)return ed;var r,i=Hp,s=i.length,u,p="value"in Oi?Oi.value:Oi.textContent,g=p.length;for(r=0;r=Yl),lC=" ",cC=!1;function uC(r,i){switch(r){case"keyup":return Sk.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dC(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var ws=!1;function Ek(r,i){switch(r){case"compositionend":return dC(i);case"keypress":return i.which!==32?null:(cC=!0,lC);case"textInput":return r=i.data,r===lC&&cC?null:r;default:return null}}function Tk(r,i){if(ws)return r==="compositionend"||!Vp&&uC(r,i)?(r=nC(),ed=Hp=Oi=null,ws=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:s,offset:i-r};r=u}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=bC(s)}}function CC(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?CC(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function EC(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ju(r.document);i instanceof r.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)r=i.contentWindow;else break;i=Ju(r.document)}return i}function Yp(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var kk=Qo&&"documentMode"in document&&11>=document.documentMode,As=null,Wp=null,Jl=null,Qp=!1;function TC(r,i,s){var u=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Qp||As==null||As!==Ju(u)||(u=As,"selectionStart"in u&&Yp(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Jl&&Xl(Jl,u)||(Jl=u,u=qd(Wp,"onSelect"),0>=S,p-=S,Ro=1<<32-mt(i)+p|s<Xe?(lt=_e,_e=null):lt=_e.sibling;var Ct=Q(F,_e,G[Xe],ce);if(Ct===null){_e===null&&(_e=lt);break}r&&_e&&Ct.alternate===null&&i(F,_e),j=g(Ct,j,Xe),St===null?Le=Ct:St.sibling=Ct,St=Ct,_e=lt}if(Xe===G.length)return s(F,_e),pt&&Jo(F,Xe),Le;if(_e===null){for(;XeXe?(lt=_e,_e=null):lt=_e.sibling;var Xi=Q(F,_e,Ct.value,ce);if(Xi===null){_e===null&&(_e=lt);break}r&&_e&&Xi.alternate===null&&i(F,_e),j=g(Xi,j,Xe),St===null?Le=Xi:St.sibling=Xi,St=Xi,_e=lt}if(Ct.done)return s(F,_e),pt&&Jo(F,Xe),Le;if(_e===null){for(;!Ct.done;Xe++,Ct=G.next())Ct=ue(F,Ct.value,ce),Ct!==null&&(j=g(Ct,j,Xe),St===null?Le=Ct:St.sibling=Ct,St=Ct);return pt&&Jo(F,Xe),Le}for(_e=u(_e);!Ct.done;Xe++,Ct=G.next())Ct=te(_e,F,Xe,Ct.value,ce),Ct!==null&&(r&&Ct.alternate!==null&&_e.delete(Ct.key===null?Xe:Ct.key),j=g(Ct,j,Xe),St===null?Le=Ct:St.sibling=Ct,St=Ct);return r&&_e.forEach(function(XM){return i(F,XM)}),pt&&Jo(F,Xe),Le}function Ut(F,j,G,ce){if(typeof G=="object"&&G!==null&&G.type===T&&G.key===null&&(G=G.props.children),typeof G=="object"&&G!==null){switch(G.$$typeof){case C:e:{for(var Le=G.key;j!==null;){if(j.key===Le){if(Le=G.type,Le===T){if(j.tag===7){s(F,j.sibling),ce=p(j,G.props.children),ce.return=F,F=ce;break e}}else if(j.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===L&&Pa(Le)===j.type){s(F,j.sibling),ce=p(j,G.props),oc(ce,G),ce.return=F,F=ce;break e}s(F,j);break}else i(F,j);j=j.sibling}G.type===T?(ce=Oa(G.props.children,F.mode,ce,G.key),ce.return=F,F=ce):(ce=ud(G.type,G.key,G.props,null,F.mode,ce),oc(ce,G),ce.return=F,F=ce)}return S(F);case b:e:{for(Le=G.key;j!==null;){if(j.key===Le)if(j.tag===4&&j.stateNode.containerInfo===G.containerInfo&&j.stateNode.implementation===G.implementation){s(F,j.sibling),ce=p(j,G.children||[]),ce.return=F,F=ce;break e}else{s(F,j);break}else i(F,j);j=j.sibling}ce=rg(G,F.mode,ce),ce.return=F,F=ce}return S(F);case L:return G=Pa(G),Ut(F,j,G,ce)}if(W(G))return Ae(F,j,G,ce);if(ee(G)){if(Le=ee(G),typeof Le!="function")throw Error(o(150));return G=Le.call(G),Be(F,j,G,ce)}if(typeof G.then=="function")return Ut(F,j,yd(G),ce);if(G.$$typeof===R)return Ut(F,j,hd(F,G),ce);vd(F,G)}return typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint"?(G=""+G,j!==null&&j.tag===6?(s(F,j.sibling),ce=p(j,G),ce.return=F,F=ce):(s(F,j),ce=ng(G,F.mode,ce),ce.return=F,F=ce),S(F)):s(F,j)}return function(F,j,G,ce){try{rc=0;var Le=Ut(F,j,G,ce);return Ls=null,Le}catch(_e){if(_e===Ds||_e===gd)throw _e;var St=Cr(29,_e,null,F.mode);return St.lanes=ce,St.return=F,St}}}var La=GC(!0),qC=GC(!1),Pi=!1;function gg(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mg(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Di(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Li(r,i,s){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(Et&2)!==0){var p=u.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),u.pending=i,i=cd(r),IC(r,null,s),i}return ld(r,u,i,s),cd(r)}function ic(r,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var u=i.lanes;u&=r.pendingLanes,s|=u,i.lanes=s,z(r,s)}}function yg(r,i){var s=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,s===u)){var p=null,g=null;if(s=s.firstBaseUpdate,s!==null){do{var S={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};g===null?p=g=S:g=g.next=S,s=s.next}while(s!==null);g===null?p=g=i:g=g.next=i}else p=g=i;s={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:g,shared:u.shared,callbacks:u.callbacks},r.updateQueue=s;return}r=s.lastBaseUpdate,r===null?s.firstBaseUpdate=i:r.next=i,s.lastBaseUpdate=i}var vg=!1;function ac(){if(vg){var r=Ps;if(r!==null)throw r}}function sc(r,i,s,u){vg=!1;var p=r.updateQueue;Pi=!1;var g=p.firstBaseUpdate,S=p.lastBaseUpdate,O=p.shared.pending;if(O!==null){p.shared.pending=null;var B=O,Y=B.next;B.next=null,S===null?g=Y:S.next=Y,S=B;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,O=ie.lastBaseUpdate,O!==S&&(O===null?ie.firstBaseUpdate=Y:O.next=Y,ie.lastBaseUpdate=B))}if(g!==null){var ue=p.baseState;S=0,ie=Y=B=null,O=g;do{var Q=O.lane&-536870913,te=Q!==O.lane;if(te?(st&Q)===Q:(u&Q)===Q){Q!==0&&Q===Ns&&(vg=!0),ie!==null&&(ie=ie.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Ae=r,Be=O;Q=i;var Ut=s;switch(Be.tag){case 1:if(Ae=Be.payload,typeof Ae=="function"){ue=Ae.call(Ut,ue,Q);break e}ue=Ae;break e;case 3:Ae.flags=Ae.flags&-65537|128;case 0:if(Ae=Be.payload,Q=typeof Ae=="function"?Ae.call(Ut,ue,Q):Ae,Q==null)break e;ue=y({},ue,Q);break e;case 2:Pi=!0}}Q=O.callback,Q!==null&&(r.flags|=64,te&&(r.flags|=8192),te=p.callbacks,te===null?p.callbacks=[Q]:te.push(Q))}else te={lane:Q,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ie===null?(Y=ie=te,B=ue):ie=ie.next=te,S|=Q;if(O=O.next,O===null){if(O=p.shared.pending,O===null)break;te=O,O=te.next,te.next=null,p.lastBaseUpdate=te,p.shared.pending=null}}while(!0);ie===null&&(B=ue),p.baseState=B,p.firstBaseUpdate=Y,p.lastBaseUpdate=ie,g===null&&(p.shared.lanes=0),ji|=S,r.lanes=S,r.memoizedState=ue}}function YC(r,i){if(typeof r!="function")throw Error(o(191,r));r.call(i)}function WC(r,i){var s=r.callbacks;if(s!==null)for(r.callbacks=null,r=0;rg?g:8;var S=D.T,O={};D.T=O,Ug(r,!1,i,s);try{var B=p(),Y=D.S;if(Y!==null&&Y(O,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ie=Hk(B,u);uc(r,i,ie,Rr(r))}else uc(r,i,u,Rr(r))}catch(ue){uc(r,i,{then:function(){},status:"rejected",reason:ue},Rr())}finally{J.p=g,S!==null&&O.types!==null&&(S.types=O.types),D.T=S}}function Gk(){}function Dg(r,i,s,u){if(r.tag!==5)throw Error(o(476));var p=x0(r).queue;R0(r,p,i,q,s===null?Gk:function(){return _0(r),s(u)})}function x0(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ni,lastRenderedState:q},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ni,lastRenderedState:s},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function _0(r){var i=x0(r);i.next===null&&(i=r.alternate.memoizedState),uc(r,i.next.queue,{},Rr())}function Lg(){return Pn(xc)}function O0(){return gn().memoizedState}function I0(){return gn().memoizedState}function qk(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var s=Rr();r=Di(s);var u=Li(i,r,s);u!==null&&(ar(u,i,s),ic(u,i,s)),i={cache:dg()},r.payload=i;return}i=i.return}}function Yk(r,i,s){var u=Rr();s={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},_d(r)?M0(i,s):(s=eg(r,i,s,u),s!==null&&(ar(s,r,u),N0(s,i,u)))}function k0(r,i,s){var u=Rr();uc(r,i,s,u)}function uc(r,i,s,u){var p={lane:u,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(_d(r))M0(i,p);else{var g=r.alternate;if(r.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var S=i.lastRenderedState,O=g(S,s);if(p.hasEagerState=!0,p.eagerState=O,Sr(O,S))return ld(r,i,p,0),jt===null&&sd(),!1}catch{}if(s=eg(r,i,p,u),s!==null)return ar(s,r,u),N0(s,i,u),!0}return!1}function Ug(r,i,s,u){if(u={lane:2,revertLane:gm(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},_d(r)){if(i)throw Error(o(479))}else i=eg(r,s,u,2),i!==null&&ar(i,r,2)}function _d(r){var i=r.alternate;return r===Qe||i!==null&&i===Qe}function M0(r,i){zs=Cd=!0;var s=r.pending;s===null?i.next=i:(i.next=s.next,s.next=i),r.pending=i}function N0(r,i,s){if((s&4194048)!==0){var u=i.lanes;u&=r.pendingLanes,s|=u,i.lanes=s,z(r,s)}}var dc={readContext:Pn,use:wd,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};dc.useEffectEvent=ln;var P0={readContext:Pn,use:wd,useCallback:function(r,i){return Yn().memoizedState=[r,i===void 0?null:i],r},useContext:Pn,useEffect:y0,useImperativeHandle:function(r,i,s){s=s!=null?s.concat([r]):null,Rd(4194308,4,C0.bind(null,i,r),s)},useLayoutEffect:function(r,i){return Rd(4194308,4,r,i)},useInsertionEffect:function(r,i){Rd(4,2,r,i)},useMemo:function(r,i){var s=Yn();i=i===void 0?null:i;var u=r();if(Ua){ot(!0);try{r()}finally{ot(!1)}}return s.memoizedState=[u,i],u},useReducer:function(r,i,s){var u=Yn();if(s!==void 0){var p=s(i);if(Ua){ot(!0);try{s(i)}finally{ot(!1)}}}else p=i;return u.memoizedState=u.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},u.queue=r,r=r.dispatch=Yk.bind(null,Qe,r),[u.memoizedState,r]},useRef:function(r){var i=Yn();return r={current:r},i.memoizedState=r},useState:function(r){r=Ig(r);var i=r.queue,s=k0.bind(null,Qe,i);return i.dispatch=s,[r.memoizedState,s]},useDebugValue:Ng,useDeferredValue:function(r,i){var s=Yn();return Pg(s,r,i)},useTransition:function(){var r=Ig(!1);return r=R0.bind(null,Qe,r.queue,!0,!1),Yn().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,s){var u=Qe,p=Yn();if(pt){if(s===void 0)throw Error(o(407));s=s()}else{if(s=i(),jt===null)throw Error(o(349));(st&127)!==0||t0(u,i,s)}p.memoizedState=s;var g={value:s,getSnapshot:i};return p.queue=g,y0(r0.bind(null,u,g,r),[r]),u.flags|=2048,Hs(9,{destroy:void 0},n0.bind(null,u,g,s,i),null),s},useId:function(){var r=Yn(),i=jt.identifierPrefix;if(pt){var s=xo,u=Ro;s=(u&~(1<<32-mt(u)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Ed++,0<\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof u.is=="string"?S.createElement("select",{is:u.is}):S.createElement("select"),u.multiple?g.multiple=!0:u.size&&(g.size=u.size);break;default:g=typeof u.is=="string"?S.createElement(p,{is:u.is}):S.createElement(p)}}g[be]=i,g[Te]=u;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)g.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=g;e:switch(Ln(g,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&oi(i)}}return Xt(i),Xg(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,s),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==u&&oi(i);else{if(typeof u!="string"&&i.stateNode===null)throw Error(o(166));if(r=we.current,ks(i)){if(r=i.stateNode,s=i.memoizedProps,u=null,p=Nn,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}r[be]=i,r=!!(r.nodeValue===s||u!==null&&u.suppressHydrationWarning===!0||ZE(r.nodeValue,s)),r||Mi(i,!0)}else r=Yd(r).createTextNode(u),r[be]=i,i.stateNode=r}return Xt(i),null;case 31:if(s=i.memoizedState,r===null||r.memoizedState!==null){if(u=ks(i),s!==null){if(r===null){if(!u)throw Error(o(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(o(557));r[be]=i}else Ia(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),r=!1}else s=sg(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=s),r=!0;if(!r)return i.flags&256?(Tr(i),i):(Tr(i),null);if((i.flags&128)!==0)throw Error(o(558))}return Xt(i),null;case 13:if(u=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=ks(i),u!==null&&u.dehydrated!==null){if(r===null){if(!p)throw Error(o(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(o(317));p[be]=i}else Ia(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),p=!1}else p=sg(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Tr(i),i):(Tr(i),null)}return Tr(i),(i.flags&128)!==0?(i.lanes=s,i):(s=u!==null,r=r!==null&&r.memoizedState!==null,s&&(u=i.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),g=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),g!==p&&(u.flags|=2048)),s!==r&&s&&(i.child.flags|=8192),Nd(i,i.updateQueue),Xt(i),null);case 4:return $e(),r===null&&bm(i.stateNode.containerInfo),Xt(i),null;case 10:return ei(i.type),Xt(i),null;case 19:if(V(pn),u=i.memoizedState,u===null)return Xt(i),null;if(p=(i.flags&128)!==0,g=u.rendering,g===null)if(p)hc(u,!1);else{if(cn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(g=Sd(r),g!==null){for(i.flags|=128,hc(u,!1),r=g.updateQueue,i.updateQueue=r,Nd(i,r),i.subtreeFlags=0,r=s,s=i.child;s!==null;)kC(s,r),s=s.sibling;return oe(pn,pn.current&1|2),pt&&Jo(i,u.treeForkCount),i.child}r=r.sibling}u.tail!==null&&He()>zd&&(i.flags|=128,p=!0,hc(u,!1),i.lanes=4194304)}else{if(!p)if(r=Sd(g),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,Nd(i,r),hc(u,!0),u.tail===null&&u.tailMode==="hidden"&&!g.alternate&&!pt)return Xt(i),null}else 2*He()-u.renderingStartTime>zd&&s!==536870912&&(i.flags|=128,p=!0,hc(u,!1),i.lanes=4194304);u.isBackwards?(g.sibling=i.child,i.child=g):(r=u.last,r!==null?r.sibling=g:i.child=g,u.last=g)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=He(),r.sibling=null,s=pn.current,oe(pn,p?s&1|2:s&1),pt&&Jo(i,u.treeForkCount),r):(Xt(i),null);case 22:case 23:return Tr(i),Sg(),u=i.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(i.flags|=8192):u&&(i.flags|=8192),u?(s&536870912)!==0&&(i.flags&128)===0&&(Xt(i),i.subtreeFlags&6&&(i.flags|=8192)):Xt(i),s=i.updateQueue,s!==null&&Nd(i,s.retryQueue),s=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),u=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),u!==s&&(i.flags|=2048),r!==null&&V(Na),null;case 24:return s=null,r!==null&&(s=r.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),ei(bn),Xt(i),null;case 25:return null;case 30:return null}throw Error(o(156,i.tag))}function Zk(r,i){switch(ig(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return ei(bn),$e(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return We(i),null;case 31:if(i.memoizedState!==null){if(Tr(i),i.alternate===null)throw Error(o(340));Ia()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Tr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(o(340));Ia()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return V(pn),null;case 4:return $e(),null;case 10:return ei(i.type),null;case 22:case 23:return Tr(i),Sg(),r!==null&&V(Na),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return ei(bn),null;case 25:return null;default:return null}}function oE(r,i){switch(ig(i),i.tag){case 3:ei(bn),$e();break;case 26:case 27:case 5:We(i);break;case 4:$e();break;case 31:i.memoizedState!==null&&Tr(i);break;case 13:Tr(i);break;case 19:V(pn);break;case 10:ei(i.type);break;case 22:case 23:Tr(i),Sg(),r!==null&&V(Na);break;case 24:ei(bn)}}function pc(r,i){try{var s=i.updateQueue,u=s!==null?s.lastEffect:null;if(u!==null){var p=u.next;s=p;do{if((s.tag&r)===r){u=void 0;var g=s.create,S=s.inst;u=g(),S.destroy=u}s=s.next}while(s!==p)}}catch(O){kt(i,i.return,O)}}function Bi(r,i,s){try{var u=i.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var g=p.next;u=g;do{if((u.tag&r)===r){var S=u.inst,O=S.destroy;if(O!==void 0){S.destroy=void 0,p=i;var B=s,Y=O;try{Y()}catch(ie){kt(p,B,ie)}}}u=u.next}while(u!==g)}}catch(ie){kt(i,i.return,ie)}}function iE(r){var i=r.updateQueue;if(i!==null){var s=r.stateNode;try{WC(i,s)}catch(u){kt(r,r.return,u)}}}function aE(r,i,s){s.props=za(r.type,r.memoizedProps),s.state=r.memoizedState;try{s.componentWillUnmount()}catch(u){kt(r,i,u)}}function gc(r,i){try{var s=r.ref;if(s!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof s=="function"?r.refCleanup=s(u):s.current=u}}catch(p){kt(r,i,p)}}function _o(r,i){var s=r.ref,u=r.refCleanup;if(s!==null)if(typeof u=="function")try{u()}catch(p){kt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(p){kt(r,i,p)}else s.current=null}function sE(r){var i=r.type,s=r.memoizedProps,u=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&u.focus();break e;case"img":s.src?u.src=s.src:s.srcSet&&(u.srcset=s.srcSet)}}catch(p){kt(r,r.return,p)}}function Jg(r,i,s){try{var u=r.stateNode;CM(u,r.type,s,i),u[Te]=i}catch(p){kt(r,r.return,p)}}function lE(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Gi(r.type)||r.tag===4}function Zg(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||lE(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Gi(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function em(r,i,s){var u=r.tag;if(u===5||u===6)r=r.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(r,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(r),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Wo));else if(u!==4&&(u===27&&Gi(r.type)&&(s=r.stateNode,i=null),r=r.child,r!==null))for(em(r,i,s),r=r.sibling;r!==null;)em(r,i,s),r=r.sibling}function Pd(r,i,s){var u=r.tag;if(u===5||u===6)r=r.stateNode,i?s.insertBefore(r,i):s.appendChild(r);else if(u!==4&&(u===27&&Gi(r.type)&&(s=r.stateNode),r=r.child,r!==null))for(Pd(r,i,s),r=r.sibling;r!==null;)Pd(r,i,s),r=r.sibling}function cE(r){var i=r.stateNode,s=r.memoizedProps;try{for(var u=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Ln(i,u,s),i[be]=r,i[Te]=s}catch(g){kt(r,r.return,g)}}var ii=!1,En=!1,tm=!1,uE=typeof WeakSet=="function"?WeakSet:Set,_n=null;function eM(r,i){if(r=r.containerInfo,Em=tf,r=EC(r),Yp(r)){if("selectionStart"in r)var s={start:r.selectionStart,end:r.selectionEnd};else e:{s=(s=r.ownerDocument)&&s.defaultView||window;var u=s.getSelection&&s.getSelection();if(u&&u.rangeCount!==0){s=u.anchorNode;var p=u.anchorOffset,g=u.focusNode;u=u.focusOffset;try{s.nodeType,g.nodeType}catch{s=null;break e}var S=0,O=-1,B=-1,Y=0,ie=0,ue=r,Q=null;t:for(;;){for(var te;ue!==s||p!==0&&ue.nodeType!==3||(O=S+p),ue!==g||u!==0&&ue.nodeType!==3||(B=S+u),ue.nodeType===3&&(S+=ue.nodeValue.length),(te=ue.firstChild)!==null;)Q=ue,ue=te;for(;;){if(ue===r)break t;if(Q===s&&++Y===p&&(O=S),Q===g&&++ie===u&&(B=S),(te=ue.nextSibling)!==null)break;ue=Q,Q=ue.parentNode}ue=te}s=O===-1||B===-1?null:{start:O,end:B}}else s=null}s=s||{start:0,end:0}}else s=null;for(Tm={focusedElem:r,selectionRange:s},tf=!1,_n=i;_n!==null;)if(i=_n,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,_n=r;else for(;_n!==null;){switch(i=_n,g=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(s=0;s title"))),Ln(g,u,s),g[be]=r,Zt(g),u=g;break e;case"link":var S=mT("link","href",p).get(u+(s.href||""));if(S){for(var O=0;OUt&&(S=Ut,Ut=Be,Be=S);var F=SC(O,Be),j=SC(O,Ut);if(F&&j&&(te.rangeCount!==1||te.anchorNode!==F.node||te.anchorOffset!==F.offset||te.focusNode!==j.node||te.focusOffset!==j.offset)){var G=ue.createRange();G.setStart(F.node,F.offset),te.removeAllRanges(),Be>Ut?(te.addRange(G),te.extend(j.node,j.offset)):(G.setEnd(j.node,j.offset),te.addRange(G))}}}}for(ue=[],te=O;te=te.parentNode;)te.nodeType===1&&ue.push({element:te,left:te.scrollLeft,top:te.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;Os?32:s,D.T=null,s=lm,lm=null;var g=Fi,S=ui;if(Rn=0,Vs=Fi=null,ui=0,(Et&6)!==0)throw Error(o(331));var O=Et;if(Et|=4,CE(g.current),vE(g,g.current,S,s),Et=O,Cc(0,!1),Ee&&typeof Ee.onPostCommitFiberRoot=="function")try{Ee.onPostCommitFiberRoot(vr,g)}catch{}return!0}finally{J.p=p,D.T=u,BE(r,i)}}function jE(r,i,s){i=zr(s,i),i=jg(r.stateNode,i,2),r=Li(r,i,2),r!==null&&(_i(r,2),Oo(r))}function kt(r,i,s){if(r.tag===3)jE(r,r,s);else for(;i!==null;){if(i.tag===3){jE(i,r,s);break}else if(i.tag===1){var u=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&($i===null||!$i.has(u))){r=zr(s,r),s=$0(2),u=Li(i,s,2),u!==null&&(F0(s,u,i,r),_i(u,2),Oo(u));break}}i=i.return}}function fm(r,i,s){var u=r.pingCache;if(u===null){u=r.pingCache=new rM;var p=new Set;u.set(i,p)}else p=u.get(i),p===void 0&&(p=new Set,u.set(i,p));p.has(s)||(om=!0,p.add(s),r=lM.bind(null,r,i,s),i.then(r,r))}function lM(r,i,s){var u=r.pingCache;u!==null&&u.delete(i),r.pingedLanes|=r.suspendedLanes&s,r.warmLanes&=~s,jt===r&&(st&s)===s&&(cn===4||cn===3&&(st&62914560)===st&&300>He()-Ud?(Et&2)===0&&Gs(r,0):im|=s,Ks===st&&(Ks=0)),Oo(r)}function $E(r,i){i===0&&(i=Ca()),r=_a(r,i),r!==null&&(_i(r,i),Oo(r))}function cM(r){var i=r.memoizedState,s=0;i!==null&&(s=i.retryLane),$E(r,s)}function uM(r,i){var s=0;switch(r.tag){case 31:case 13:var u=r.stateNode,p=r.memoizedState;p!==null&&(s=p.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(o(314))}u!==null&&u.delete(i),$E(r,s)}function dM(r,i){return qt(r,i)}var Kd=null,Ys=null,hm=!1,Vd=!1,pm=!1,Vi=0;function Oo(r){r!==Ys&&r.next===null&&(Ys===null?Kd=Ys=r:Ys=Ys.next=r),Vd=!0,hm||(hm=!0,hM())}function Cc(r,i){if(!pm&&Vd){pm=!0;do for(var s=!1,u=Kd;u!==null;){if(r!==0){var p=u.pendingLanes;if(p===0)var g=0;else{var S=u.suspendedLanes,O=u.pingedLanes;g=(1<<31-mt(42|r)+1)-1,g&=p&~(S&~O),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(s=!0,GE(u,g))}else g=st,g=ba(u,u===jt?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(g&3)===0||Sa(u,g)||(s=!0,GE(u,g));u=u.next}while(s);pm=!1}}function fM(){FE()}function FE(){Vd=hm=!1;var r=0;Vi!==0&&TM()&&(r=Vi);for(var i=He(),s=null,u=Kd;u!==null;){var p=u.next,g=KE(u,i);g===0?(u.next=null,s===null?Kd=p:s.next=p,p===null&&(Ys=s)):(s=u,(r!==0||(g&3)!==0)&&(Vd=!0)),u=p}Rn!==0&&Rn!==5||Cc(r),Vi!==0&&(Vi=0)}function KE(r,i){for(var s=r.suspendedLanes,u=r.pingedLanes,p=r.expirationTimes,g=r.pendingLanes&-62914561;0O)break;var ie=B.transferSize,ue=B.initiatorType;ie&&eT(ue)&&(B=B.responseEnd,S+=ie*(B"u"?null:document;function fT(r,i,s){var u=Ws;if(u&&typeof i=="string"&&i){var p=Lr(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof s=="string"&&(p+='[crossorigin="'+s+'"]'),dT.has(p)||(dT.add(p),r={rel:r,crossOrigin:s,href:i},u.querySelector(p)===null&&(i=u.createElement("link"),Ln(i,"link",r),Zt(i),u.head.appendChild(i)))}}function MM(r){di.D(r),fT("dns-prefetch",r,null)}function NM(r,i){di.C(r,i),fT("preconnect",r,i)}function PM(r,i,s){di.L(r,i,s);var u=Ws;if(u&&r&&i){var p='link[rel="preload"][as="'+Lr(i)+'"]';i==="image"&&s&&s.imageSrcSet?(p+='[imagesrcset="'+Lr(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(p+='[imagesizes="'+Lr(s.imageSizes)+'"]')):p+='[href="'+Lr(r)+'"]';var g=p;switch(i){case"style":g=Qs(r);break;case"script":g=Xs(r)}Kr.has(g)||(r=y({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:r,as:i},s),Kr.set(g,r),u.querySelector(p)!==null||i==="style"&&u.querySelector(Ac(g))||i==="script"&&u.querySelector(Rc(g))||(i=u.createElement("link"),Ln(i,"link",r),Zt(i),u.head.appendChild(i)))}}function DM(r,i){di.m(r,i);var s=Ws;if(s&&r){var u=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+Lr(u)+'"][href="'+Lr(r)+'"]',g=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=Xs(r)}if(!Kr.has(g)&&(r=y({rel:"modulepreload",href:r},i),Kr.set(g,r),s.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Rc(g)))return}u=s.createElement("link"),Ln(u,"link",r),Zt(u),s.head.appendChild(u)}}}function LM(r,i,s){di.S(r,i,s);var u=Ws;if(u&&r){var p=er(u).hoistableStyles,g=Qs(r);i=i||"default";var S=p.get(g);if(!S){var O={loading:0,preload:null};if(S=u.querySelector(Ac(g)))O.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},s),(s=Kr.get(g))&&Im(r,s);var B=S=u.createElement("link");Zt(B),Ln(B,"link",r),B._p=new Promise(function(Y,ie){B.onload=Y,B.onerror=ie}),B.addEventListener("load",function(){O.loading|=1}),B.addEventListener("error",function(){O.loading|=2}),O.loading|=4,Qd(S,i,u)}S={type:"stylesheet",instance:S,count:1,state:O},p.set(g,S)}}}function UM(r,i){di.X(r,i);var s=Ws;if(s&&r){var u=er(s).hoistableScripts,p=Xs(r),g=u.get(p);g||(g=s.querySelector(Rc(p)),g||(r=y({src:r,async:!0},i),(i=Kr.get(p))&&km(r,i),g=s.createElement("script"),Zt(g),Ln(g,"link",r),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(p,g))}}function zM(r,i){di.M(r,i);var s=Ws;if(s&&r){var u=er(s).hoistableScripts,p=Xs(r),g=u.get(p);g||(g=s.querySelector(Rc(p)),g||(r=y({src:r,async:!0,type:"module"},i),(i=Kr.get(p))&&km(r,i),g=s.createElement("script"),Zt(g),Ln(g,"link",r),s.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},u.set(p,g))}}function hT(r,i,s,u){var p=(p=we.current)?Wd(p):null;if(!p)throw Error(o(446));switch(r){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Qs(s.href),s=er(p).hoistableStyles,u=s.get(i),u||(u={type:"style",instance:null,count:0,state:null},s.set(i,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){r=Qs(s.href);var g=er(p).hoistableStyles,S=g.get(r);if(S||(p=p.ownerDocument||p,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(r,S),(g=p.querySelector(Ac(r)))&&!g._p&&(S.instance=g,S.state.loading=5),Kr.has(r)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Kr.set(r,s),g||BM(p,r,s,S.state))),i&&u===null)throw Error(o(528,""));return S}if(i&&u!==null)throw Error(o(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Xs(s),s=er(p).hoistableScripts,u=s.get(i),u||(u={type:"script",instance:null,count:0,state:null},s.set(i,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,r))}}function Qs(r){return'href="'+Lr(r)+'"'}function Ac(r){return'link[rel="stylesheet"]['+r+"]"}function pT(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function BM(r,i,s,u){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?u.loading=1:(i=r.createElement("link"),u.preload=i,i.addEventListener("load",function(){return u.loading|=1}),i.addEventListener("error",function(){return u.loading|=2}),Ln(i,"link",s),Zt(i),r.head.appendChild(i))}function Xs(r){return'[src="'+Lr(r)+'"]'}function Rc(r){return"script[async]"+r}function gT(r,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var u=r.querySelector('style[data-href~="'+Lr(s.href)+'"]');if(u)return i.instance=u,Zt(u),u;var p=y({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),Zt(u),Ln(u,"style",p),Qd(u,s.precedence,r),i.instance=u;case"stylesheet":p=Qs(s.href);var g=r.querySelector(Ac(p));if(g)return i.state.loading|=4,i.instance=g,Zt(g),g;u=pT(s),(p=Kr.get(p))&&Im(u,p),g=(r.ownerDocument||r).createElement("link"),Zt(g);var S=g;return S._p=new Promise(function(O,B){S.onload=O,S.onerror=B}),Ln(g,"link",u),i.state.loading|=4,Qd(g,s.precedence,r),i.instance=g;case"script":return g=Xs(s.src),(p=r.querySelector(Rc(g)))?(i.instance=p,Zt(p),p):(u=s,(p=Kr.get(g))&&(u=y({},s),km(u,p)),r=r.ownerDocument||r,p=r.createElement("script"),Zt(p),Ln(p,"link",u),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(o(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(u=i.instance,i.state.loading|=4,Qd(u,s.precedence,r));return i.instance}function Qd(r,i,s){for(var u=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,g=p,S=0;S title"):null)}function HM(r,i,s){if(s===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(r=i.disabled,typeof i.precedence=="string"&&r==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function vT(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function jM(r,i,s,u){if(s.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var p=Qs(u.href),g=i.querySelector(Ac(p));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=Jd.bind(r),i.then(r,r)),s.state.loading|=4,s.instance=g,Zt(g);return}g=i.ownerDocument||i,u=pT(u),(p=Kr.get(p))&&Im(u,p),g=g.createElement("link"),Zt(g);var S=g;S._p=new Promise(function(O,B){S.onload=O,S.onerror=B}),Ln(g,"link",u),s.instance=g}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(r.count++,s=Jd.bind(r),i.addEventListener("load",s),i.addEventListener("error",s))}}var Mm=0;function $M(r,i){return r.stylesheets&&r.count===0&&ef(r,r.stylesheets),0Mm?50:800)+i);return r.unsuspend=s,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function Jd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ef(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Zd=null;function ef(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Zd=new Map,i.forEach(FM,r),Zd=null,Jd.call(r))}function FM(r,i){if(!(i.state.loading&4)){var s=Zd.get(r);if(s)var u=s.get(null);else{s=new Map,Zd.set(r,s);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),jm.exports=i2(),jm.exports}var s2=a2();const l2=Bv(s2);const c2="msal.js.common",m1="https://login.microsoftonline.com/common/",u2="login.microsoftonline.com",y1="common",d2="adfs",f2="dstsv2",h2=`${m1}discovery/instance?api-version=1.1&authorization_endpoint=`,$T=".ciamlogin.com",p2=".onmicrosoft.com",Uy="|",v1="openid",b1="profile",Hv="offline_access",g2="email",jv="S256",m2="application/x-www-form-urlencoded;charset=utf-8",Nc="Not Available",zy="/",FT="http://169.254.169.254/metadata/instance/compute/location",y2="2020-06-01",v2=2e3,b2="TryAutoDetect",S2="login.microsoft.com",C2=["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],KT=240,E2="invalid_instance",VT=200,T2=400,GT=400,w2=499,A2=500,R2=599,pl={GET:"GET",POST:"POST"},Pl=[v1,b1,Hv],qT=[...Pl,g2],Jn={CONTENT_TYPE:"Content-Type",CONTENT_LENGTH:"Content-Length",RETRY_AFTER:"Retry-After",CCS_HEADER:"X-AnchorMailbox",WWWAuthenticate:"WWW-Authenticate",AuthenticationInfo:"Authentication-Info",X_MS_REQUEST_ID:"x-ms-request-id",X_MS_HTTP_VERSION:"x-ms-httpver"},YT={ACTIVE_ACCOUNT_FILTERS:"active-account-filters"},ca={COMMON:"common",ORGANIZATIONS:"organizations",CONSUMERS:"consumers"},cf={ACCESS_TOKEN:"access_token",XMS_CC:"xms_cc"},lr={LOGIN:"login",SELECT_ACCOUNT:"select_account",CONSENT:"consent",NONE:"none",NO_SESSION:"no_session"},$v={CODE:"code",IDTOKEN_TOKEN_REFRESHTOKEN:"id_token token refresh_token"},Fv={QUERY:"query",FRAGMENT:"fragment"},S1={AUTHORIZATION_CODE_GRANT:"authorization_code",REFRESH_TOKEN_GRANT:"refresh_token"},x2="MSSTS",_2="ADFS",C1="Generic",E1="-",By=".",zn={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},Kv="appmetadata",O2="client_info",Jf="1",Hy="authority-metadata",I2=3600*24,co={CONFIG:"config",CACHE:"cache",NETWORK:"network",HARDCODED_VALUES:"hardcoded_values"},WT=5,k2=330,M2=50,T1="server-telemetry",QT="|",Zs=",",N2="1",P2="0",D2="unknown_error",Nt={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},L2=60,U2=3600,w1="throttling",z2="retry-after, h429",B2="invalid_grant",H2="client_mismatch",el={FAILED_AUTO_DETECTION:"1",INTERNAL_CACHE:"2",ENVIRONMENT_VARIABLE:"3",IMDS:"4"},Vm={CONFIGURED_NO_AUTO_DETECTION:"2",AUTO_DETECTION_REQUESTED_SUCCESSFUL:"4",AUTO_DETECTION_REQUESTED_FAILED:"5"},Fa={NOT_APPLICABLE:"0",FORCE_REFRESH_OR_CLAIMS:"1",NO_CACHED_ACCESS_TOKEN:"2",CACHED_ACCESS_TOKEN_EXPIRED:"3",PROACTIVELY_REFRESHED:"4"},j2={Pop:"pop"},A1=300;const ns="client_id",R1="redirect_uri",$2="response_type",F2="response_mode",K2="grant_type",V2="claims",G2="scope",q2="refresh_token",Y2="state",W2="nonce",Q2="prompt",X2="code",J2="code_challenge",Z2="code_challenge_method",eN="code_verifier",tN="client-request-id",nN="x-client-SKU",rN="x-client-VER",oN="x-client-OS",iN="x-client-CPU",aN="x-client-current-telemetry",sN="x-client-last-telemetry",lN="x-ms-lib-capability",cN="x-app-name",uN="x-app-ver",dN="post_logout_redirect_uri",fN="id_token_hint",hN="client_secret",pN="client_assertion",gN="client_assertion_type",x1="token_type",_1="req_cnf",XT="return_spa_code",mN="nativebroker",yN="logout_hint",vN="sid",bN="login_hint",SN="domain_hint",CN="x-client-xtra-sku",Zf="brk_client_id",eh="brk_redirect_uri",jy="instance_aware",EN="ear_jwk",TN="ear_jwe_crypto";function Vv(t){return`See https://aka.ms/msal.js.errors#${t} for details`}class Kt extends Error{constructor(e,n,o){const a=n||(e?Vv(e):""),l=a?`${e}: ${a}`:e;super(l),Object.setPrototypeOf(this,Kt.prototype),this.errorCode=e||"",this.errorMessage=a||"",this.subError=o||"",this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function $y(t,e){return new Kt(t,e||Vv(t))}class Gv extends Kt{constructor(e){super(e),this.name="ClientConfigurationError",Object.setPrototypeOf(this,Gv.prototype)}}function Gt(t){return new Gv(t)}class Jr{static isEmptyObj(e){if(e)try{const n=JSON.parse(e);return Object.keys(n).length===0}catch{}return!0}static startsWith(e,n){return e.indexOf(n)===0}static endsWith(e,n){return e.length>=n.length&&e.lastIndexOf(n)===e.length-n.length}static queryStringToObject(e){const n={},o=e.split("&"),a=l=>decodeURIComponent(l.replace(/\+/g," "));return o.forEach(l=>{if(l.trim()){const[c,d]=l.split(/=(.+)/g,2);c&&d&&(n[a(c)]=a(d))}}),n}static trimArrayEntries(e){return e.map(n=>n.trim())}static removeEmptyStringsFromArray(e){return e.filter(n=>!!n)}static jsonParseHelper(e){try{return JSON.parse(e)}catch{return null}}static matchPattern(e,n){return new RegExp(e.replace(/\\/g,"\\\\").replace(/\*/g,"[^ ]*").replace(/\?/g,"\\?")).test(n)}}class qv extends Kt{constructor(e,n){super(e,n),this.name="ClientAuthError",Object.setPrototypeOf(this,qv.prototype)}}function he(t,e){return new qv(t,e)}const wN="redirect_uri_empty",AN="authority_uri_insecure",uf="url_parse_error",RN="empty_url_error",xN="empty_input_scopes_error",O1="invalid_claims",_N="token_request_empty",ON="logout_request_empty",I1="pkce_params_missing",k1="invalid_cloud_discovery_metadata",IN="invalid_authority_metadata",kN="untrusted_authority",Yv="missing_ssh_jwk",MN="missing_ssh_kid",NN="cannot_set_OIDCOptions",PN="cannot_allow_platform_broker",DN="authority_mismatch",LN="invalid_request_method_for_EAR";const M1="client_info_decoding_error",UN="client_info_empty_error",N1="token_parsing_error",zN="null_or_empty_token",ea="endpoints_resolution_error",BN="network_error",HN="openid_config_error",jN="hash_not_deserialized",lu="invalid_state",$N="state_mismatch",JT="state_not_found",FN="nonce_mismatch",P1="auth_time_not_found",KN="max_age_transpired",VN="multiple_matching_appMetadata",GN="request_cannot_be_made",qN="cannot_remove_empty_scope",YN="cannot_append_scopeset",ZT="empty_input_scopeset",D1="no_account_in_silent_request",WN="invalid_cache_record",L1="invalid_cache_environment",ew="no_account_found",U1="no_crypto_object",Xa="token_refresh_required",QN="token_claims_cnf_required_for_signedjwt",XN="authorization_code_missing_from_server_response",JN="binding_key_not_removed",ZN="end_session_endpoint_not_supported",z1="key_id_missing",Ze="method_not_implemented";class qn{constructor(e){const n=e?Jr.trimArrayEntries([...e]):[],o=n?Jr.removeEmptyStringsFromArray(n):[];if(!o||!o.length)throw Gt(xN);this.scopes=new Set,o.forEach(a=>this.scopes.add(a))}static fromString(e){const o=(e||"").split(" ");return new qn(o)}static createSearchScopes(e){const n=e&&e.length>0?e:[...Pl],o=new qn(n);return o.containsOnlyOIDCScopes()?o.removeScope(Hv):o.removeOIDCScopes(),o}containsScope(e){const n=this.printScopesLowerCase().split(" "),o=new qn(n);return e?o.scopes.has(e.toLowerCase()):!1}containsScopeSet(e){return!e||e.scopes.size<=0?!1:this.scopes.size>=e.scopes.size&&e.asArray().every(n=>this.containsScope(n))}containsOnlyOIDCScopes(){let e=0;return qT.forEach(n=>{this.containsScope(n)&&(e+=1)}),this.scopes.size===e}appendScope(e){e&&this.scopes.add(e.trim())}appendScopes(e){try{e.forEach(n=>this.appendScope(n))}catch{throw he(YN)}}removeScope(e){if(!e)throw he(qN);this.scopes.delete(e.trim())}removeOIDCScopes(){qT.forEach(e=>{this.scopes.delete(e)})}unionScopeSets(e){if(!e)throw he(ZT);const n=new Set;return e.scopes.forEach(o=>n.add(o.toLowerCase())),this.scopes.forEach(o=>n.add(o.toLowerCase())),n}intersectingScopeSets(e){if(!e)throw he(ZT);e.containsOnlyOIDCScopes()||e.removeOIDCScopes();const n=this.unionScopeSets(e),o=e.getScopeCount(),a=this.getScopeCount();return n.sizee.push(n)),e}printScopes(){return this.scopes?this.asArray().join(" "):""}printScopesLowerCase(){return this.printScopes().toLowerCase()}}function Ph(t,e,n){if(!e)return;const o=t.get(ns);o&&t.has(Zf)&&n?.addFields({embeddedClientId:o,embeddedRedirectUri:t.get(R1)},e)}function Wv(t,e){t.set($2,e)}function eP(t,e){t.set(F2,e||Fv.QUERY)}function tP(t){t.set(mN,"1")}function Qv(t,e,n=!0,o=Pl){n&&!o.includes("openid")&&!e.includes("openid")&&o.push("openid");const a=n?[...e||[],...o]:e||[],l=new qn(a);t.set(G2,l.printScopes())}function Xv(t,e){t.set(ns,e)}function Jv(t,e){t.set(R1,e)}function nP(t,e){t.set(dN,e)}function rP(t,e){t.set(fN,e)}function oP(t,e){t.set(SN,e)}function df(t,e){t.set(bN,e)}function th(t,e){t.set(Jn.CCS_HEADER,`UPN:${e}`)}function eu(t,e){t.set(Jn.CCS_HEADER,`Oid:${e.uid}@${e.utid}`)}function tw(t,e){t.set(vN,e)}function Zv(t,e,n){const o=uP(e,n);try{JSON.parse(o)}catch{throw Gt(O1)}t.set(V2,o)}function wu(t,e){t.set(tN,e)}function eb(t,e){t.set(nN,e.sku),t.set(rN,e.version),e.os&&t.set(oN,e.os),e.cpu&&t.set(iN,e.cpu)}function tb(t,e){e?.appName&&t.set(cN,e.appName),e?.appVersion&&t.set(uN,e.appVersion)}function iP(t,e){t.set(Q2,e)}function B1(t,e){e&&t.set(Y2,e)}function aP(t,e){t.set(W2,e)}function nb(t,e,n){if(e&&n)t.set(J2,e),t.set(Z2,n);else throw Gt(I1)}function sP(t,e){t.set(X2,e)}function lP(t,e){t.set(q2,e)}function cP(t,e){t.set(eN,e)}function H1(t,e){t.set(hN,e)}function j1(t,e){e&&t.set(pN,e)}function $1(t,e){e&&t.set(gN,e)}function F1(t,e){t.set(K2,e)}function rb(t){t.set(O2,"1")}function K1(t){t.has(jy)||t.set(jy,"true")}function zo(t,e){Object.entries(e).forEach(([n,o])=>{!t.has(n)&&o&&t.set(n,o)})}function uP(t,e){let n;if(!t)n={};else try{n=JSON.parse(t)}catch{throw Gt(O1)}return e&&e.length>0&&(n.hasOwnProperty(cf.ACCESS_TOKEN)||(n[cf.ACCESS_TOKEN]={}),n[cf.ACCESS_TOKEN][cf.XMS_CC]={values:e}),JSON.stringify(n)}function ob(t,e){e&&(t.set(x1,Nt.POP),t.set(_1,e))}function V1(t,e){e&&(t.set(x1,Nt.SSH),t.set(_1,e))}function G1(t,e){t.set(aN,e.generateCurrentRequestHeaderValue()),t.set(sN,e.generateLastRequestHeaderValue())}function q1(t){t.set(lN,z2)}function dP(t,e){t.set(yN,e)}function Dh(t,e,n){t.has(Zf)||t.set(Zf,e),t.has(eh)||t.set(eh,n)}function fP(t,e){t.set(EN,encodeURIComponent(e)),t.set(TN,"eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0")}function nw(t){if(!t)return t;let e=t.toLowerCase();return Jr.endsWith(e,"?")?e=e.slice(0,-1):Jr.endsWith(e,"?/")&&(e=e.slice(0,-2)),Jr.endsWith(e,"/")||(e+="/"),e}function Y1(t){return t.startsWith("#/")?t.substring(2):t.startsWith("#")||t.startsWith("?")?t.substring(1):t}function nh(t){if(!t||t.indexOf("=")<0)return null;try{const e=Y1(t),n=Object.fromEntries(new URLSearchParams(e));if(n.code||n.ear_jwe||n.error||n.error_description||n.state)return n}catch{throw he(jN)}return null}function cu(t){const e=new Array;return t.forEach((n,o)=>{e.push(`${o}=${encodeURIComponent(n)}`)}),e.join("&")}function rw(t){if(!t)return t;const e=t.split("#")[0];try{const n=new URL(e),o=n.origin+n.pathname+n.search;return nw(o)}catch{return nw(e)}}const rh={createNewGuid:()=>{throw he(Ze)},base64Decode:()=>{throw he(Ze)},base64Encode:()=>{throw he(Ze)},base64UrlEncode:()=>{throw he(Ze)},encodeKid:()=>{throw he(Ze)},async getPublicKeyThumbprint(){throw he(Ze)},async removeTokenBindingKey(){throw he(Ze)},async clearKeystore(){throw he(Ze)},async signJwt(){throw he(Ze)},async hashString(){throw he(Ze)}};var Mt;(function(t){t[t.Error=0]="Error",t[t.Warning=1]="Warning",t[t.Info=2]="Info",t[t.Verbose=3]="Verbose",t[t.Trace=4]="Trace"})(Mt||(Mt={}));const hP=50,pP=500,Ga=new Map;function gP(t,e){Ga.delete(t),Ga.set(t,e)}function mP(t,e){const n=Date.now();let o=Ga.get(t);if(o)gP(t,o);else if(o={logs:[],firstEventTime:n},Ga.set(t,o),Ga.size>hP){const a=Ga.keys().next().value;a&&Ga.delete(a)}o.logs.push({...e,milliseconds:n-o.firstEventTime}),o.logs.length>pP&&o.logs.shift()}function yP(t){if(t.length!==6)return!1;for(let e=0;e="a"&&n<="z"||n>="A"&&n<="Z"||n>="0"&&n<="9"))return!1}return!0}class mo{constructor(e,n,o){this.level=Mt.Info;const a=()=>{},l=e||mo.createDefaultLoggerOptions();this.localCallback=l.loggerCallback||a,this.piiLoggingEnabled=l.piiLoggingEnabled||!1,this.level=typeof l.logLevel=="number"?l.logLevel:Mt.Info,this.packageName=n||"",this.packageVersion=o||""}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Mt.Info}}clone(e,n){return new mo({loggerCallback:this.localCallback,piiLoggingEnabled:this.piiLoggingEnabled,logLevel:this.level},e,n)}logMessage(e,n){const o=n.correlationId;if(yP(e)){const f={hash:e,level:n.logLevel,containsPii:n.containsPii||!1,milliseconds:0};mP(o,f)}if(n.logLevel>this.level||!this.piiLoggingEnabled&&n.containsPii)return;const d=`${`[${new Date().toUTCString()}] : [${o}]`} : ${this.packageName}@${this.packageVersion} : ${Mt[n.logLevel]} - ${e}`;this.executeCallback(n.logLevel,d,n.containsPii||!1)}executeCallback(e,n,o){this.localCallback&&this.localCallback(e,n,o)}error(e,n){this.logMessage(e,{logLevel:Mt.Error,containsPii:!1,correlationId:n})}errorPii(e,n){this.logMessage(e,{logLevel:Mt.Error,containsPii:!0,correlationId:n})}warning(e,n){this.logMessage(e,{logLevel:Mt.Warning,containsPii:!1,correlationId:n})}warningPii(e,n){this.logMessage(e,{logLevel:Mt.Warning,containsPii:!0,correlationId:n})}info(e,n){this.logMessage(e,{logLevel:Mt.Info,containsPii:!1,correlationId:n})}infoPii(e,n){this.logMessage(e,{logLevel:Mt.Info,containsPii:!0,correlationId:n})}verbose(e,n){this.logMessage(e,{logLevel:Mt.Verbose,containsPii:!1,correlationId:n})}verbosePii(e,n){this.logMessage(e,{logLevel:Mt.Verbose,containsPii:!0,correlationId:n})}trace(e,n){this.logMessage(e,{logLevel:Mt.Trace,containsPii:!1,correlationId:n})}tracePii(e,n){this.logMessage(e,{logLevel:Mt.Trace,containsPii:!0,correlationId:n})}isPiiLoggingEnabled(){return this.piiLoggingEnabled||!1}}const Lh="@azure/msal-common",Au="16.0.4";const ib={None:"none"};function ow(t,e){return!!t&&!!e&&t===e.split(".")[1]}function Dl(t,e,n,o){if(o){const{oid:a,sub:l,tid:c,name:d,tfp:f,acr:h,preferred_username:m,upn:y,login_hint:v}=o,C=c||f||h||"";return{tenantId:C,localAccountId:a||l||"",name:d,username:m||y||"",loginHint:v,isHomeTenant:ow(C,t)}}else return{tenantId:n,localAccountId:e,username:"",isHomeTenant:ow(n,t)}}function ab(t,e,n,o){let a=t;if(e){const{isHomeTenant:l,...c}=e;a={...t,...c}}if(n){const{isHomeTenant:l,...c}=Dl(t.homeAccountId,t.localAccountId,t.tenantId,n);return a={...a,...c,idTokenClaims:n,idToken:o},a}return a}function vi(t,e){const n=vP(t);try{const o=e(n);return JSON.parse(o)}catch{throw he(N1)}}function Ja(t){if(!t.signin_state)return!1;const e=["kmsi","dvc_dmjd"];return t.signin_state.some(n=>e.includes(n.trim().toLowerCase()))}function vP(t){if(!t)throw he(zN);const n=/^([^\.\s]*)\.([^\.\s]+)\.([^\.\s]*)$/.exec(t);if(!n||n.length<4)throw he(N1);return n[2]}function W1(t,e){if(e===0||Date.now()-3e5>t+e)throw he(KN)}class At{get urlString(){return this._urlString}constructor(e){if(this._urlString=e,!this._urlString)throw Gt(RN);e.includes("#")||(this._urlString=At.canonicalizeUri(e))}static canonicalizeUri(e){if(e){let n=e.toLowerCase();return Jr.endsWith(n,"?")?n=n.slice(0,-1):Jr.endsWith(n,"?/")&&(n=n.slice(0,-2)),Jr.endsWith(n,"/")||(n+="/"),n}return e}validateAsUri(){let e;try{e=this.getUrlComponents()}catch{throw Gt(uf)}if(!e.HostNameAndPort||!e.PathSegments)throw Gt(uf);if(!e.Protocol||e.Protocol.toLowerCase()!=="https:")throw Gt(AN)}static appendQueryString(e,n){return n?e.indexOf("?")<0?`${e}?${n}`:`${e}&${n}`:e}static removeHashFromUrl(e){return At.canonicalizeUri(e.split("#")[0])}replaceTenantPath(e){const n=this.getUrlComponents(),o=n.PathSegments;return e&&o.length!==0&&(o[0]===ca.COMMON||o[0]===ca.ORGANIZATIONS)&&(o[0]=e),At.constructAuthorityUriFromObject(n)}getUrlComponents(){const e=RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?"),n=this.urlString.match(e);if(!n)throw Gt(uf);const o={Protocol:n[1],HostNameAndPort:n[4],AbsolutePath:n[5],QueryString:n[7]};let a=o.AbsolutePath.split("/");return a=a.filter(l=>l&&l.length>0),o.PathSegments=a,o.QueryString&&o.QueryString.endsWith("/")&&(o.QueryString=o.QueryString.substring(0,o.QueryString.length-1)),o}static getDomainFromUrl(e){const n=RegExp("^([^:/?#]+://)?([^/?#]*)"),o=e.match(n);if(!o)throw Gt(uf);return o[2]}static getAbsoluteUrl(e,n){if(e[0]===zy){const a=new At(n).getUrlComponents();return a.Protocol+"//"+a.HostNameAndPort+e}return e}static constructAuthorityUriFromObject(e){return new At(e.Protocol+"//"+e.HostNameAndPort+"/"+e.PathSegments.join("/"))}}const bP=[{host:"login.microsoftonline.com"},{host:"login.chinacloudapi.cn",issuerHost:"login.partner.microsoftonline.cn"},{host:"login.microsoftonline.us"},{host:"login.sovcloud-identity.fr"},{host:"login.sovcloud-identity.de"},{host:"login.sovcloud-identity.sg"}];function SP(t,e){return{token_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/token`,jwks_uri:`https://${t}/{tenantid}/discovery/v2.0/keys`,issuer:`https://${e}/{tenantid}/v2.0`,authorization_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/authorize`,end_session_endpoint:`https://${t}/{tenantid}/oauth2/v2.0/logout`}}const CP=bP.reduce((t,{host:e,issuerHost:n})=>(t[e]=SP(e,n||e),t),{}),Q1={endpointMetadata:CP,instanceDiscoveryMetadata:{metadata:[{preferred_network:"login.microsoftonline.com",preferred_cache:"login.windows.net",aliases:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"]},{preferred_network:"login.partner.microsoftonline.cn",preferred_cache:"login.partner.microsoftonline.cn",aliases:["login.partner.microsoftonline.cn","login.chinacloudapi.cn"]},{preferred_network:"login.microsoftonline.de",preferred_cache:"login.microsoftonline.de",aliases:["login.microsoftonline.de"]},{preferred_network:"login.microsoftonline.us",preferred_cache:"login.microsoftonline.us",aliases:["login.microsoftonline.us","login.usgovcloudapi.net"]},{preferred_network:"login-us.microsoftonline.com",preferred_cache:"login-us.microsoftonline.com",aliases:["login-us.microsoftonline.com"]},{preferred_network:"login.sovcloud-identity.fr",preferred_cache:"login.sovcloud-identity.fr",aliases:["login.sovcloud-identity.fr"]},{preferred_network:"login.sovcloud-identity.de",preferred_cache:"login.sovcloud-identity.de",aliases:["login.sovcloud-identity.de"]},{preferred_network:"login.sovcloud-identity.sg",preferred_cache:"login.sovcloud-identity.sg",aliases:["login.sovcloud-identity.sg"]}]}},iw=Q1.endpointMetadata,sb=Q1.instanceDiscoveryMetadata,X1=new Set;sb.metadata.forEach(t=>{t.aliases.forEach(e=>{X1.add(e)})});function EP(t,e,n){let o;const a=t.canonicalAuthority;if(a){const l=new At(a).getUrlComponents().HostNameAndPort;o=aw(e,n,l,t.cloudDiscoveryMetadata?.metadata)||aw(e,n,l,sb.metadata)||t.knownAuthorities}return o||[]}function aw(t,e,n,o,a){if(t.trace("1bmquz",e),n&&o){const l=oh(o,n);if(l)return t.trace("1fotbt",e),l.aliases;t.trace("14avvj",e)}return null}function TP(t){return oh(sb.metadata,t)}function oh(t,e){for(let n=0;n[n.tenantId,n])),dataBoundary:t.dataBoundary}}function AP(t,e,n){let o;e.authorityType===fo.Adfs?o=_2:e.protocolMode===cr.OIDC?o=C1:o=x2;let a,l;t.clientInfo&&n&&(a=ih(t.clientInfo,n),a.xms_tdbr&&(l=a.xms_tdbr==="EU"?"EU":"None"));const c=t.environment||e&&e.getPreferredCache();if(!c)throw he(L1);const d=t.idTokenClaims?.preferred_username||t.idTokenClaims?.upn,f=t.idTokenClaims?.emails?t.idTokenClaims.emails[0]:null,h=d||f||"",m=t.idTokenClaims?.login_hint,y=a?.utid||lb(t.idTokenClaims)||"",v=a?.uid||t.idTokenClaims?.oid||t.idTokenClaims?.sub||"";let C;return t.tenantProfiles?C=t.tenantProfiles:C=[Dl(t.homeAccountId,v,y,t.idTokenClaims)],{homeAccountId:t.homeAccountId,environment:c,realm:y,localAccountId:v,username:h,authorityType:o,loginHint:m,clientInfo:t.clientInfo,name:t.idTokenClaims?.name||"",lastModificationTime:void 0,lastModificationApp:void 0,cloudGraphHostName:t.cloudGraphHostName,msGraphHost:t.msGraphHost,nativeAccountId:t.nativeAccountId,tenantProfiles:C,dataBoundary:l}}function RP(t,e,n){const o=Array.from(t.tenantProfiles?.values()||[]);return o.length===0&&t.tenantId&&t.localAccountId&&o.push(Dl(t.homeAccountId,t.localAccountId,t.tenantId,t.idTokenClaims)),{authorityType:t.authorityType||C1,homeAccountId:t.homeAccountId,localAccountId:t.localAccountId,nativeAccountId:t.nativeAccountId,realm:t.tenantId,environment:t.environment,username:t.username,loginHint:t.loginHint,name:t.name,cloudGraphHostName:e,msGraphHost:n,tenantProfiles:o,dataBoundary:t.dataBoundary}}function J1(t,e,n,o,a,l){if(!(e===fo.Adfs||e===fo.Dsts)){if(t)try{const c=ih(t,o.base64Decode);if(c.uid&&c.utid)return`${c.uid}.${c.utid}`}catch{}n.warning("1ub6wv",a)}return l?.sub||""}function xP(t){return t?t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("realm")&&t.hasOwnProperty("localAccountId")&&t.hasOwnProperty("username")&&t.hasOwnProperty("authorityType"):!1}class Vy{constructor(e,n,o,a,l){this.clientId=e,this.cryptoImpl=n,this.commonLogger=o.clone(Lh,Au),this.staticAuthorityOptions=l,this.performanceClient=a}getAllAccounts(e={},n){return this.buildTenantProfiles(this.getAccountsFilteredBy(e,n),n,e)}getAccountInfoFilteredBy(e,n){const o=this.getAllAccounts(e,n);return o.length>1?o.sort(l=>l.idTokenClaims?-1:1)[0]:o.length===1?o[0]:null}getBaseAccountInfo(e,n){const o=this.getAccountsFilteredBy(e,n);return o.length>0?rs(o[0]):null}buildTenantProfiles(e,n,o){return e.flatMap(a=>this.getTenantProfilesFromAccountEntity(a,n,o?.tenantId,o))}getTenantedAccountInfoByFilter(e,n,o,a,l){let c=null,d;if(l&&!this.tenantProfileMatchesFilter(o,l))return null;const f=this.getIdToken(e,a,n,o.tenantId);return f&&(d=vi(f.secret,this.cryptoImpl.base64Decode),!this.idTokenClaimsMatchTenantProfileFilter(d,l))?null:(c=ab(e,o,d,f?.secret),c)}getTenantProfilesFromAccountEntity(e,n,o,a){const l=rs(e);let c=l.tenantProfiles||new Map;const d=this.getTokenKeys();if(o){const h=c.get(o);if(h)c=new Map([[o,h]]);else return[]}const f=[];return c.forEach(h=>{const m=this.getTenantedAccountInfoByFilter(l,d,h,n,a);m&&f.push(m)}),f}tenantProfileMatchesFilter(e,n){return!(n.localAccountId&&!this.matchLocalAccountIdFromTenantProfile(e,n.localAccountId)||n.name&&e.name!==n.name||n.isHomeTenant!==void 0&&e.isHomeTenant!==n.isHomeTenant)}idTokenClaimsMatchTenantProfileFilter(e,n){return!(n&&(n.localAccountId&&!this.matchLocalAccountIdFromTokenClaims(e,n.localAccountId)||n.loginHint&&!this.matchLoginHintFromTokenClaims(e,n.loginHint)||n.username&&!this.matchUsername(e.preferred_username,n.username)||n.name&&!this.matchName(e,n.name)||n.sid&&!this.matchSid(e,n.sid)))}async saveCacheRecord(e,n,o,a,l){if(!e)throw he(WN);try{e.account&&await this.setAccount(e.account,n,o,a),e.idToken&&l?.idToken!==!1&&await this.setIdTokenCredential(e.idToken,n,o),e.accessToken&&l?.accessToken!==!1&&await this.saveAccessToken(e.accessToken,n,o),e.refreshToken&&l?.refreshToken!==!1&&await this.setRefreshTokenCredential(e.refreshToken,n,o),e.appMetadata&&this.setAppMetadata(e.appMetadata,n)}catch(c){throw this.commonLogger?.error("0j476p",n),c instanceof Kt?c:Ky(c)}}async saveAccessToken(e,n,o){const a={clientId:e.clientId,credentialType:e.credentialType,environment:e.environment,homeAccountId:e.homeAccountId,realm:e.realm,tokenType:e.tokenType},l=this.getTokenKeys(),c=qn.fromString(e.target);l.accessToken.forEach(d=>{if(!this.accessTokenKeyMatchesFilter(d,a,!1))return;const f=this.getAccessTokenCredential(d,n);f&&this.credentialMatchesFilter(f,a,n)&&qn.fromString(f.target).intersectingScopeSets(c)&&this.removeAccessToken(d,n)}),await this.setAccessTokenCredential(e,n,o)}getAccountsFilteredBy(e,n){const o=this.getAccountKeys(),a=[];return o.forEach(l=>{const c=this.getAccount(l,n);if(!c||e.homeAccountId&&!this.matchHomeAccountId(c,e.homeAccountId)||e.username&&!this.matchUsername(c.username,e.username)||e.environment&&!this.matchEnvironment(c,e.environment,n)||e.realm&&!this.matchRealm(c,e.realm)||e.nativeAccountId&&!this.matchNativeAccountId(c,e.nativeAccountId)||e.authorityType&&!this.matchAuthorityType(c,e.authorityType))return;const d={localAccountId:e?.localAccountId,name:e?.name},f=c.tenantProfiles?.filter(h=>this.tenantProfileMatchesFilter(h,d));f&&f.length===0||a.push(c)}),a}credentialMatchesFilter(e,n,o){return!(n.clientId&&!this.matchClientId(e,n.clientId)||n.userAssertionHash&&!this.matchUserAssertionHash(e,n.userAssertionHash)||typeof n.homeAccountId=="string"&&!this.matchHomeAccountId(e,n.homeAccountId)||n.environment&&!this.matchEnvironment(e,n.environment,o)||n.realm&&!this.matchRealm(e,n.realm)||n.credentialType&&!this.matchCredentialType(e,n.credentialType)||n.familyId&&!this.matchFamilyId(e,n.familyId)||n.target&&!this.matchTarget(e,n.target)||e.credentialType===zn.ACCESS_TOKEN_WITH_AUTH_SCHEME&&(n.tokenType&&!this.matchTokenType(e,n.tokenType)||n.tokenType===Nt.SSH&&n.keyId&&!this.matchKeyId(e,n.keyId)))}getAppMetadataFilteredBy(e,n){const o=this.getKeys(),a={};return o.forEach(l=>{if(!this.isAppMetadata(l))return;const c=this.getAppMetadata(l,n);c&&(e.environment&&!this.matchEnvironment(c,e.environment,n)||e.clientId&&!this.matchClientId(c,e.clientId)||(a[l]=c))}),a}getAuthorityMetadataByAlias(e,n){const o=this.getAuthorityMetadataKeys();let a=null;return o.forEach(l=>{if(!this.isAuthorityMetadata(l)||l.indexOf(this.clientId)===-1)return;const c=this.getAuthorityMetadata(l,n);c&&c.aliases.indexOf(e)!==-1&&(a=c)}),a}removeAllAccounts(e){this.getAllAccounts({},e).forEach(o=>{this.removeAccount(o,e)})}removeAccount(e,n){this.removeAccountContext(e,n);const o=this.getAccountKeys(),a=l=>l.includes(e.homeAccountId)&&l.includes(e.environment);o.filter(a).forEach(l=>{this.removeItem(l,n),this.performanceClient.incrementFields({accountsRemoved:1},n)})}removeAccountContext(e,n){const o=this.getTokenKeys(),a=l=>l.includes(e.homeAccountId)&&l.includes(e.environment);o.idToken.filter(a).forEach(l=>{this.removeIdToken(l,n)}),o.accessToken.filter(a).forEach(l=>{this.removeAccessToken(l,n)}),o.refreshToken.filter(a).forEach(l=>{this.removeRefreshToken(l,n)})}removeAccessToken(e,n){const o=this.getAccessTokenCredential(e,n);if(o&&(this.removeItem(e,n),this.performanceClient.incrementFields({accessTokensRemoved:1},n),o.credentialType.toLowerCase()===zn.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()&&o.tokenType===Nt.POP)){const l=o.keyId;l&&this.cryptoImpl.removeTokenBindingKey(l,n).catch(()=>{this.commonLogger.error("0cx291",n),this.performanceClient?.incrementFields({removeTokenBindingKeyFailure:1},n)})}}removeAppMetadata(e){return this.getKeys().forEach(o=>{this.isAppMetadata(o)&&this.removeItem(o,e)}),!0}getIdToken(e,n,o,a){this.commonLogger.trace("1drz22",n);const l={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:zn.ID_TOKEN,clientId:this.clientId,realm:a},c=this.getIdTokensByFilter(l,n,o),d=c.size;if(d<1)return this.commonLogger.info("1atvtd",n),null;if(d>1){let f=c;if(!a){const h=new Map;c.forEach((y,v)=>{y.realm===e.tenantId&&h.set(v,y)});const m=h.size;if(m<1)return this.commonLogger.info("0ooalx",n),c.values().next().value;if(m===1)return this.commonLogger.info("1eq2vc",n),h.values().next().value;f=h}return this.commonLogger.info("1ws328",n),f.forEach((h,m)=>{this.removeIdToken(m,n)}),this.performanceClient.addFields({multiMatchedID:c.size},n),null}return this.commonLogger.info("1sm769",n),c.values().next().value}getIdTokensByFilter(e,n,o){const a=o&&o.idToken||this.getTokenKeys().idToken,l=new Map;return a.forEach(c=>{if(!this.idTokenKeyMatchesFilter(c,{clientId:this.clientId,...e}))return;const d=this.getIdTokenCredential(c,n);d&&this.credentialMatchesFilter(d,e,n)&&l.set(c,d)}),l}idTokenKeyMatchesFilter(e,n){const o=e.toLowerCase();return!(n.clientId&&o.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&o.indexOf(n.homeAccountId.toLowerCase())===-1)}removeIdToken(e,n){this.removeItem(e,n)}removeRefreshToken(e,n){this.removeItem(e,n)}getAccessToken(e,n,o,a){const l=n.correlationId;this.commonLogger.trace("1t7hz1",l);const c=qn.createSearchScopes(n.scopes),d=n.authenticationScheme||Nt.BEARER,f=d.toLowerCase()!==Nt.BEARER.toLowerCase()?zn.ACCESS_TOKEN_WITH_AUTH_SCHEME:zn.ACCESS_TOKEN,h={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:f,clientId:this.clientId,realm:a||e.tenantId,target:c,tokenType:d,keyId:n.sshKid},m=o&&o.accessToken||this.getTokenKeys().accessToken,y=[];m.forEach(C=>{if(this.accessTokenKeyMatchesFilter(C,h,!0)){const b=this.getAccessTokenCredential(C,l);b&&this.credentialMatchesFilter(b,h,l)&&y.push(b)}});const v=y.length;return v<1?(this.commonLogger.info("1nckna",l),null):v>1?(this.commonLogger.info("1wkfwp",l),y.forEach(C=>{this.removeAccessToken(this.generateCredentialKey(C),l)}),this.performanceClient.addFields({multiMatchedAT:y.length},l),null):(this.commonLogger.info("06yt98",l),y[0])}accessTokenKeyMatchesFilter(e,n,o){const a=e.toLowerCase();if(n.clientId&&a.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&a.indexOf(n.homeAccountId.toLowerCase())===-1||n.realm&&a.indexOf(n.realm.toLowerCase())===-1)return!1;if(n.target){const l=n.target.asArray();for(let c=0;c{if(!this.accessTokenKeyMatchesFilter(l,e,!0))return;const c=this.getAccessTokenCredential(l,n);c&&this.credentialMatchesFilter(c,e,n)&&a.push(c)}),a}getRefreshToken(e,n,o,a){this.commonLogger.trace("0x53vi",o);const l=n?Jf:void 0,c={homeAccountId:e.homeAccountId,environment:e.environment,credentialType:zn.REFRESH_TOKEN,clientId:this.clientId,familyId:l},d=a&&a.refreshToken||this.getTokenKeys().refreshToken,f=[];d.forEach(m=>{if(this.refreshTokenKeyMatchesFilter(m,c)){const y=this.getRefreshTokenCredential(m,o);y&&this.credentialMatchesFilter(y,c,o)&&f.push(y)}});const h=f.length;return h<1?(this.commonLogger.info("0dlw11",o),null):(h>1&&this.performanceClient.addFields({multiMatchedRT:h},o),this.commonLogger.info("0wcnep",o),f[0])}refreshTokenKeyMatchesFilter(e,n){const o=e.toLowerCase();return!(n.familyId&&o.indexOf(n.familyId.toLowerCase())===-1||!n.familyId&&n.clientId&&o.indexOf(n.clientId.toLowerCase())===-1||n.homeAccountId&&o.indexOf(n.homeAccountId.toLowerCase())===-1)}readAppMetadataFromCache(e,n){const o={environment:e,clientId:this.clientId},a=this.getAppMetadataFilteredBy(o,n),l=Object.keys(a).map(d=>a[d]),c=l.length;if(c<1)return null;if(c>1)throw he(VN);return l[0]}isAppMetadataFOCI(e,n){const o=this.readAppMetadataFromCache(e,n);return!!(o&&o.familyId===Jf)}matchHomeAccountId(e,n){return typeof e.homeAccountId=="string"&&n===e.homeAccountId}matchLocalAccountIdFromTokenClaims(e,n){const o=e.oid||e.sub;return n===o}matchLocalAccountIdFromTenantProfile(e,n){return e.localAccountId===n}matchName(e,n){return n.toLowerCase()===e.name?.toLowerCase()}matchUsername(e,n){return!!(e&&typeof e=="string"&&n?.toLowerCase()===e.toLowerCase())}matchUserAssertionHash(e,n){return!!(e.userAssertionHash&&n===e.userAssertionHash)}matchEnvironment(e,n,o){if(this.staticAuthorityOptions){const l=EP(this.staticAuthorityOptions,this.commonLogger,o);if(l.includes(n)&&l.includes(e.environment))return!0}const a=this.getAuthorityMetadataByAlias(n,o);return!!(a&&a.aliases.indexOf(e.environment)>-1)}matchCredentialType(e,n){return e.credentialType&&n.toLowerCase()===e.credentialType.toLowerCase()}matchClientId(e,n){return!!(e.clientId&&n===e.clientId)}matchFamilyId(e,n){return!!(e.familyId&&n===e.familyId)}matchRealm(e,n){return e.realm?.toLowerCase()===n.toLowerCase()}matchNativeAccountId(e,n){return!!(e.nativeAccountId&&n===e.nativeAccountId)}matchLoginHintFromTokenClaims(e,n){return e.login_hint===n||e.preferred_username===n||e.upn===n}matchSid(e,n){return e.sid===n}matchAuthorityType(e,n){return!!(e.authorityType&&n.toLowerCase()===e.authorityType.toLowerCase())}matchTarget(e,n){return e.credentialType!==zn.ACCESS_TOKEN&&e.credentialType!==zn.ACCESS_TOKEN_WITH_AUTH_SCHEME||!e.target?!1:qn.fromString(e.target).containsScopeSet(n)}matchTokenType(e,n){return!!(e.tokenType&&e.tokenType===n)}matchKeyId(e,n){return!!(e.keyId&&e.keyId===n)}isAppMetadata(e){return e.indexOf(Kv)!==-1}isAuthorityMetadata(e){return e.indexOf(Hy)!==-1}generateAuthorityMetadataCacheKey(e){return`${Hy}-${this.clientId}-${e}`}static toObject(e,n){for(const o in n)e[o]=n[o];return e}}class _P extends Vy{async setAccount(){throw he(Ze)}getAccount(){throw he(Ze)}async setIdTokenCredential(){throw he(Ze)}getIdTokenCredential(){throw he(Ze)}async setAccessTokenCredential(){throw he(Ze)}getAccessTokenCredential(){throw he(Ze)}async setRefreshTokenCredential(){throw he(Ze)}getRefreshTokenCredential(){throw he(Ze)}setAppMetadata(){throw he(Ze)}getAppMetadata(){throw he(Ze)}setServerTelemetry(){throw he(Ze)}getServerTelemetry(){throw he(Ze)}setAuthorityMetadata(){throw he(Ze)}getAuthorityMetadata(){throw he(Ze)}getAuthorityMetadataKeys(){throw he(Ze)}setThrottlingCache(){throw he(Ze)}getThrottlingCache(){throw he(Ze)}removeItem(){throw he(Ze)}getKeys(){throw he(Ze)}getAccountKeys(){throw he(Ze)}getTokenKeys(){throw he(Ze)}generateCredentialKey(){throw he(Ze)}generateAccountKey(){throw he(Ze)}}const OP={InProgress:1};class Z1{generateId(){return"callback-id"}startMeasurement(e,n){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:OP.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:n||""}}}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}const ex={tokenRenewalOffsetSeconds:A1,preventCorsPreflight:!1},IP={loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:Mt.Info,correlationId:""},kP={async sendGetRequestAsync(){throw he(Ze)},async sendPostRequestAsync(){throw he(Ze)}},MP={sku:c2,version:Au,cpu:"",os:""},NP={clientSecret:"",clientAssertion:void 0},PP={azureCloudInstance:ib.None,tenant:`${y1}`},DP={application:{appName:"",appVersion:""}};function cb({authOptions:t,systemOptions:e,loggerOptions:n,storageInterface:o,networkInterface:a,cryptoInterface:l,clientCredentials:c,libraryInfo:d,telemetry:f,serverTelemetryManager:h,persistencePlugin:m,serializableCache:y}){const v={...IP,...n};return{authOptions:LP(t),systemOptions:{...ex,...e},loggerOptions:v,storageInterface:o||new _P(t.clientId,rh,new mo(v),new Z1),networkInterface:a||kP,cryptoInterface:l||rh,clientCredentials:c||NP,libraryInfo:{...MP,...d},telemetry:{...DP,...f},serverTelemetryManager:h||null,persistencePlugin:m||null,serializableCache:y||null}}function LP(t){return{clientCapabilities:[],azureCloudOptions:PP,instanceAware:!1,...t}}function tx(t){return t.authOptions.authority.options.protocolMode===cr.OIDC}class ps extends Kt{constructor(e,n,o,a,l){super(e,n,o),this.name="ServerError",this.errorNo=a,this.status=l,Object.setPrototypeOf(this,ps.prototype)}}const Gy="no_tokens_found",UP="native_account_unavailable",nx="refresh_token_expired",rx="ux_not_allowed",zP="interaction_required",BP="consent_required",HP="login_required",ub="bad_token";const sw=[zP,BP,HP,ub,rx],jP=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token","ux_not_allowed"];class yo extends Kt{constructor(e,n,o,a,l,c,d,f){super(e,n,o),Object.setPrototypeOf(this,yo.prototype),this.timestamp=a||"",this.traceId=l||"",this.correlationId=c||"",this.claims=d||"",this.name="InteractionRequiredAuthError",this.errorNo=f}}function ox(t,e,n){const o=!!t&&sw.indexOf(t)>-1,a=!!n&&jP.indexOf(n)>-1,l=!!e&&sw.some(c=>e.indexOf(c)>-1);return o||l||a}function ah(t,e){return new yo(t,e)}function $P(t,e,n){const o=FP(t,n);return e?`${o}${Uy}${e}`:o}function FP(t,e){if(!t)throw he(U1);const n={id:t.createNewGuid()};e&&(n.meta=e);const o=JSON.stringify(n);return t.base64Encode(o)}function Ru(t,e){if(!t)throw he(U1);if(!e)throw he(lu);try{const n=e.split(Uy),o=n[0],a=n.length>1?n.slice(1).join(Uy):"",l=t(o),c=JSON.parse(l);return{userRequestState:a||"",libraryState:c}}catch{throw he(lu)}}function vo(){return Math.round(new Date().getTime()/1e3)}function lw(t){return t.getTime()/1e3}function Mf(t){return t?new Date(Number(t)*1e3):new Date}function sh(t,e){const n=Number(t)||0;return vo()+e>n}function cw(t,e){const n=Number(t)+e*24*60*60*1e3;return Date.now()>n}function KP(t){return Number(t)>vo()}const VP="networkClientSendPostRequestAsync",GP="refreshTokenClientExecutePostToTokenEndpoint",qP="authorizationCodeClientExecutePostToTokenEndpoint",YP="refreshTokenClientExecuteTokenRequest",WP="refreshTokenClientAcquireToken",Gm="refreshTokenClientAcquireTokenWithCachedRefreshToken",QP="refreshTokenClientCreateTokenRequestBody",XP="silentFlowClientGenerateResultFromCacheRecord",db="getAuthCodeUrl",ix="handleCodeResponseFromServer",JP="authClientExecuteTokenRequest",ZP="authClientCreateTokenRequestBody",eD="updateTokenEndpointAuthority",xu="popTokenGenerateCnf",fb="handleServerTokenResponse",tD="authorityResolveEndpointsAsync",nD="authorityGetCloudDiscoveryMetadataFromNetwork",rD="authorityUpdateCloudDiscoveryMetadata",oD="authorityGetEndpointMetadataFromNetwork",iD="authorityUpdateEndpointMetadata",uw="authorityUpdateMetadataWithRegionalInformation",aD="regionDiscoveryDetectRegion",dw="regionDiscoveryGetRegionFromIMDS",sD="regionDiscoveryGetCurrentVersion",lD="cacheManagerGetRefreshToken",cD="setUserData";const go=(t,e,n,o,a)=>(...l)=>{n.trace("1plfzx",a);const c=o.startMeasurement(e,a);if(a){const d=e+"CallCount";o.incrementFields({[d]:1},a)}try{const d=t(...l);return c.end({success:!0}),n.trace("1g8n6a",a),d}catch(d){n.trace("0cfd8i",a);try{n.trace(JSON.stringify(d),a)}catch{n.trace("00dty7",a)}throw c.end({success:!1},d),d}},se=(t,e,n,o,a)=>(...l)=>{n.trace("1plfzx",a);const c=o.startMeasurement(e,a);if(a){const d=e+"CallCount";o.incrementFields({[d]:1},a)}return t(...l).then(d=>(n.trace("1g8n6a",a),c.end({success:!0}),d)).catch(d=>{n.trace("0cfd8i",a);try{n.trace(JSON.stringify(d),a)}catch{n.trace("00dty7",a)}throw c.end({success:!1},d),d})};const uD={SW:"sw"};class Al{constructor(e,n){this.cryptoUtils=e,this.performanceClient=n}async generateCnf(e,n){const o=await se(this.generateKid.bind(this),xu,n,this.performanceClient,e.correlationId)(e),a=this.cryptoUtils.base64UrlEncode(JSON.stringify(o));return{kid:o.kid,reqCnfString:a}}async generateKid(e){return{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:uD.SW}}async signPopToken(e,n,o){return this.signPayload(e,n,o)}async signPayload(e,n,o,a){const{resourceRequestMethod:l,resourceRequestUri:c,shrClaims:d,shrNonce:f,shrOptions:h}=o,y=(c?new At(c):void 0)?.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:vo(),m:l?.toUpperCase(),u:y?.HostNameAndPort,nonce:f||this.cryptoUtils.createNewGuid(),p:y?.AbsolutePath,q:y?.QueryString?[[],y.QueryString]:void 0,client_claims:d||void 0,...a},n,h,o.correlationId)}}class dD{constructor(e,n){this.cache=e,this.hasChanged=n}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}function hb(t,e,n,o,a){return{credentialType:zn.ID_TOKEN,homeAccountId:t,environment:e,clientId:o,secret:n,realm:a,lastUpdatedAt:Date.now().toString()}}function pb(t,e,n,o,a,l,c,d,f,h,m,y,v){const C={homeAccountId:t,credentialType:zn.ACCESS_TOKEN,secret:n,cachedAt:vo().toString(),expiresOn:c.toString(),extendedExpiresOn:d.toString(),environment:e,clientId:o,realm:a,target:l,tokenType:m||Nt.BEARER,lastUpdatedAt:Date.now().toString()};if(y&&(C.userAssertionHash=y),h&&(C.refreshOn=h.toString()),C.tokenType?.toLowerCase()!==Nt.BEARER.toLowerCase())switch(C.credentialType=zn.ACCESS_TOKEN_WITH_AUTH_SCHEME,C.tokenType){case Nt.POP:const b=vi(n,f);if(!b?.cnf?.kid)throw he(QN);C.keyId=b.cnf.kid;break;case Nt.SSH:C.keyId=v}return C}function fD(t,e,n,o,a,l,c){const d={credentialType:zn.REFRESH_TOKEN,homeAccountId:t,environment:e,clientId:o,secret:n,lastUpdatedAt:Date.now().toString()};return l&&(d.userAssertionHash=l),a&&(d.familyId=a),c&&(d.expiresOn=c.toString()),d}function Uh(t){return t.hasOwnProperty("homeAccountId")&&t.hasOwnProperty("environment")&&t.hasOwnProperty("credentialType")&&t.hasOwnProperty("clientId")&&t.hasOwnProperty("secret")}function fw(t){return t?Uh(t)&&t.hasOwnProperty("realm")&&t.hasOwnProperty("target")&&(t.credentialType===zn.ACCESS_TOKEN||t.credentialType===zn.ACCESS_TOKEN_WITH_AUTH_SCHEME):!1}function hD(t){return t?Uh(t)&&t.hasOwnProperty("realm")&&t.credentialType===zn.ID_TOKEN:!1}function hw(t){return t?Uh(t)&&t.credentialType===zn.REFRESH_TOKEN:!1}function pD(t,e){const n=t.indexOf(T1)===0;let o=!0;return e&&(o=e.hasOwnProperty("failedRequests")&&e.hasOwnProperty("errors")&&e.hasOwnProperty("cacheHits")),n&&o}function gD(t,e){let n=!1;t&&(n=t.indexOf(w1)===0);let o=!0;return e&&(o=e.hasOwnProperty("throttleTime")),n&&o}function mD({environment:t,clientId:e}){return[Kv,t,e].join(E1).toLowerCase()}function yD(t,e){return e?t.indexOf(Kv)===0&&e.hasOwnProperty("clientId")&&e.hasOwnProperty("environment"):!1}function vD(t,e){return e?t.indexOf(Hy)===0&&e.hasOwnProperty("aliases")&&e.hasOwnProperty("preferred_cache")&&e.hasOwnProperty("preferred_network")&&e.hasOwnProperty("canonical_authority")&&e.hasOwnProperty("authorization_endpoint")&&e.hasOwnProperty("token_endpoint")&&e.hasOwnProperty("issuer")&&e.hasOwnProperty("aliasesFromNetwork")&&e.hasOwnProperty("endpointsFromNetwork")&&e.hasOwnProperty("expiresAt")&&e.hasOwnProperty("jwks_uri"):!1}function pw(){return vo()+I2}function ff(t,e,n){t.authorization_endpoint=e.authorization_endpoint,t.token_endpoint=e.token_endpoint,t.end_session_endpoint=e.end_session_endpoint,t.issuer=e.issuer,t.endpointsFromNetwork=n,t.jwks_uri=e.jwks_uri}function qm(t,e,n){t.aliases=e.aliases,t.preferred_cache=e.preferred_cache,t.preferred_network=e.preferred_network,t.aliasesFromNetwork=n}function gw(t){return t.expiresAt<=vo()}class os{constructor(e,n,o,a,l,c,d){this.clientId=e,this.cacheStorage=n,this.cryptoObj=o,this.logger=a,this.performanceClient=l,this.serializableCache=c,this.persistencePlugin=d}validateTokenResponse(e,n,o){if(e.error||e.error_description||e.suberror){const a=`Error(s): ${e.error_codes||Nc} - Timestamp: ${e.timestamp||Nc} - Description: ${e.error_description||Nc} - Correlation ID: ${e.correlation_id||Nc} - Trace ID: ${e.trace_id||Nc}`,l=e.error_codes?.length?e.error_codes[0]:void 0,c=new ps(e.error,a,e.suberror,l,e.status);if(o&&e.status&&e.status>=A2&&e.status<=R2){this.logger.warning("16ks7j",n);return}else if(o&&e.status&&e.status>=T2&&e.status<=w2){this.logger.warning("0g61x3",n);return}throw ox(e.error,e.error_description,e.suberror)?new yo(e.error,e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",l):c}}async handleServerTokenResponse(e,n,o,a,l,c,d,f,h,m){let y;if(e.id_token){if(y=vi(e.id_token||"",this.cryptoObj.base64Decode),c&&c.nonce&&y.nonce!==c.nonce)throw he(FN);if(a.maxAge||a.maxAge===0){const T=y.auth_time;if(!T)throw he(P1);W1(T,a.maxAge)}}this.homeAccountIdentifier=J1(e.client_info||"",n.authorityType,this.logger,this.cryptoObj,a.correlationId,y);let v;c&&c.state&&(v=Ru(this.cryptoObj.base64Decode,c.state)),e.key_id=e.key_id||a.sshKid||void 0;const C=this.generateCacheRecord(e,n,o,a,y,d,c);let b;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("0jbz5k",a.correlationId),b=new dD(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(b)),f&&!h&&C.account&&this.cacheStorage.getAllAccounts({homeAccountId:C.account.homeAccountId,environment:C.account.environment},a.correlationId).length<1)return this.logger.warning("1gmt66",a.correlationId),this.performanceClient?.addFields({acntLoggedOut:!0},a.correlationId),await os.generateAuthenticationResult(this.cryptoObj,n,C,!1,a,this.performanceClient,y,v,void 0,m);await this.cacheStorage.saveCacheRecord(C,a.correlationId,Ja(y||{}),l,a.storeInCache)}finally{this.persistencePlugin&&this.serializableCache&&b&&(this.logger.verbose("1bh17u",a.correlationId),await this.persistencePlugin.afterCacheAccess(b))}return os.generateAuthenticationResult(this.cryptoObj,n,C,!1,a,this.performanceClient,y,v,e,m)}generateCacheRecord(e,n,o,a,l,c,d){const f=n.getPreferredCache();if(!f)throw he(L1);const h=lb(l);let m,y;e.id_token&&l&&(m=hb(this.homeAccountIdentifier,f,e.id_token,this.clientId,h||""),y=ax(this.cacheStorage,n,this.homeAccountIdentifier,this.cryptoObj.base64Decode,a.correlationId,l,e.client_info,f,h,d,void 0,this.logger));let v=null;if(e.access_token){const T=e.scope?qn.fromString(e.scope):new qn(a.scopes||[]),w=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,_=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,k=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,R=o+w,N=R+_,M=k&&k>0?o+k:void 0;v=pb(this.homeAccountIdentifier,f,e.access_token,this.clientId,h||n.tenant||"",T.printScopes(),R,N,this.cryptoObj.base64Decode,M,e.token_type,c,e.key_id)}let C=null;if(e.refresh_token){let T;if(e.refresh_token_expires_in){const w=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;T=o+w,this.performanceClient?.addFields({ntwkRtExpiresOnSeconds:T},a.correlationId)}C=fD(this.homeAccountIdentifier,f,e.refresh_token,this.clientId,e.foci,c,T)}let b=null;return e.foci&&(b={clientId:this.clientId,environment:f,familyId:e.foci}),{account:y,idToken:m,accessToken:v,refreshToken:C,appMetadata:b}}static async generateAuthenticationResult(e,n,o,a,l,c,d,f,h,m){let y="",v=[],C=null,b,T,w="";if(o.accessToken){if(o.accessToken.tokenType===Nt.POP&&!l.popKid){const N=new Al(e,c),{secret:M,keyId:U}=o.accessToken;if(!U)throw he(z1);y=await N.signPopToken(M,U,l)}else y=o.accessToken.secret;v=qn.fromString(o.accessToken.target).asArray(),C=Mf(o.accessToken.expiresOn),b=Mf(o.accessToken.extendedExpiresOn),o.accessToken.refreshOn&&(T=Mf(o.accessToken.refreshOn))}o.appMetadata&&(w=o.appMetadata.familyId===Jf?Jf:"");const _=d?.oid||d?.sub||"",k=d?.tid||"";h?.spa_accountid&&o.account&&(o.account.nativeAccountId=h?.spa_accountid);const R=o.account?ab(rs(o.account),void 0,d,o.idToken?.secret):null;return{authority:n.canonicalAuthority,uniqueId:_,tenantId:k,scopes:v,account:R,idToken:o?.idToken?.secret||"",idTokenClaims:d||{},accessToken:y,fromCache:a,expiresOn:C,extExpiresOn:b,refreshOn:T,correlationId:l.correlationId,requestId:m||"",familyId:w,tokenType:o.accessToken?.tokenType||"",state:f?f.userRequestState:"",cloudGraphHostName:o.account?.cloudGraphHostName||"",msGraphHost:o.account?.msGraphHost||"",code:h?.spa_code,fromPlatformBroker:!1}}}function ax(t,e,n,o,a,l,c,d,f,h,m,y){y?.verbose("09jz0t",a);const C=t.getAccountKeys().find(k=>k.startsWith(n));let b=null;C&&(b=t.getAccount(C,a));const T=b||AP({homeAccountId:n,idTokenClaims:l,clientInfo:c,environment:d,cloudGraphHostName:h?.cloud_graph_host_name,msGraphHost:h?.msgraph_host,nativeAccountId:m},e,o),w=T.tenantProfiles||[],_=f||T.realm;if(_&&!w.find(k=>k.tenantId===_)){const k=Dl(n,T.localAccountId,_,l);w.push(k)}return T.tenantProfiles=w,T}const po={HOME_ACCOUNT_ID:"home_account_id",UPN:"UPN"};async function sx(t,e,n){return typeof t=="string"?t:t({clientId:e,tokenEndpoint:n})}function zh(t,e,n){return{clientId:t,authority:e.authority,scopes:e.scopes,homeAccountIdentifier:n,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,embeddedClientId:e.embeddedClientId||e.extraParameters?.clientId}}class Do{static generateThrottlingStorageKey(e){return`${w1}.${JSON.stringify(e)}`}static preProcess(e,n,o){const a=Do.generateThrottlingStorageKey(n),l=e.getThrottlingCache(a,o);if(l){if(l.throttleTime=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(Jn.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const n=e<=0?0:e,o=Date.now()/1e3;return Math.floor(Math.min(o+(n||L2),o+U2)*1e3)}static removeThrottle(e,n,o,a){const l=zh(n,o,a),c=this.generateThrottlingStorageKey(l);e.removeItem(c,o.correlationId)}}class Bh extends Kt{constructor(e,n,o){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,Bh.prototype),this.name="NetworkError",this.error=e,this.httpStatus=n,this.responseHeaders=o}}function qc(t,e,n,o){return t.errorMessage=`${t.errorMessage}, additionalErrorInfo: error.name:${o?.name}, error.message:${o?.message}`,new Bh(t,e,n)}function lx(t,e,n){const o={};if(o[Jn.CONTENT_TYPE]=m2,!e&&n)switch(n.type){case po.HOME_ACCOUNT_ID:try{const a=ml(n.credential);o[Jn.CCS_HEADER]=`Oid:${a.uid}@${a.utid}`}catch{t.verbose("1qhtee","")}break;case po.UPN:o[Jn.CCS_HEADER]=`UPN: ${n.credential}`;break}return o}function cx(t,e,n,o){const a=new Map;return t.embeddedClientId&&Dh(a,e,n),t.extraQueryParameters&&zo(a,t.extraQueryParameters),wu(a,t.correlationId),Ph(a,t.correlationId,o),cu(a)}async function ux(t,e,n,o,a,l,c,d,f,h){const m=await bD(o,t,{body:e,headers:n},a,l,c,d,f);return h&&m.status<500&&m.status!==429&&h.clearTelemetryCache(),m}async function bD(t,e,n,o,a,l,c,d){Do.preProcess(a,t,o);let f;try{f=await se(l.sendPostRequestAsync.bind(l),VP,c,d,o)(e,n);const h=f.headers||{};d?.addFields({refreshTokenSize:f.body.refresh_token?.length||0,httpVerToken:h[Jn.X_MS_HTTP_VERSION]||"",requestId:h[Jn.X_MS_REQUEST_ID]||""},o)}catch(h){if(h instanceof Bh){const m=h.responseHeaders;throw m&&d?.addFields({httpVerToken:m[Jn.X_MS_HTTP_VERSION]||"",requestId:m[Jn.X_MS_REQUEST_ID]||"",contentTypeHeader:m[Jn.CONTENT_TYPE]||void 0,contentLengthHeader:m[Jn.CONTENT_LENGTH]||void 0,httpStatus:h.httpStatus},o),h.error}throw h instanceof Kt?h:he(BN)}return Do.postProcess(a,t,f,o),f}function SD(t){return t.hasOwnProperty("authorization_endpoint")&&t.hasOwnProperty("token_endpoint")&&t.hasOwnProperty("issuer")&&t.hasOwnProperty("jwks_uri")}function CD(t){return t.hasOwnProperty("tenant_discovery_endpoint")&&t.hasOwnProperty("metadata")}function ED(t){return t.hasOwnProperty("error")&&t.hasOwnProperty("error_description")}class Hh{constructor(e,n,o,a){this.networkInterface=e,this.logger=n,this.performanceClient=o,this.correlationId=a}async detectRegion(e,n){let o=e;if(o)n.region_source=el.ENVIRONMENT_VARIABLE;else{const a=Hh.IMDS_OPTIONS;try{const l=await se(this.getRegionFromIMDS.bind(this),dw,this.logger,this.performanceClient,this.correlationId)(y2,a);if(l.status===VT&&(o=l.body,n.region_source=el.IMDS),l.status===GT){const c=await se(this.getCurrentVersion.bind(this),sD,this.logger,this.performanceClient,this.correlationId)(a);if(!c)return n.region_source=el.FAILED_AUTO_DETECTION,null;const d=await se(this.getRegionFromIMDS.bind(this),dw,this.logger,this.performanceClient,this.correlationId)(c,a);d.status===VT&&(o=d.body,n.region_source=el.IMDS)}}catch{return n.region_source=el.FAILED_AUTO_DETECTION,null}}return o||(n.region_source=el.FAILED_AUTO_DETECTION),o||null}async getRegionFromIMDS(e,n){return this.networkInterface.sendGetRequestAsync(`${FT}?api-version=${e}&format=text`,n,v2)}async getCurrentVersion(e){try{const n=await this.networkInterface.sendGetRequestAsync(`${FT}?format=json`,e);return n.status===GT&&n.body&&n.body["newest-versions"]&&n.body["newest-versions"].length>0?n.body["newest-versions"][0]:null}catch{return null}}}Hh.IMDS_OPTIONS={headers:{Metadata:"true"}};class sr{constructor(e,n,o,a,l,c,d,f){this.canonicalAuthority=e,this._canonicalAuthority.validateAsUri(),this.networkInterface=n,this.cacheManager=o,this.authorityOptions=a,this.regionDiscoveryMetadata={region_used:void 0,region_source:void 0,region_outcome:void 0},this.logger=l,this.performanceClient=d,this.correlationId=c,this.managedIdentity=f||!1,this.regionDiscovery=new Hh(n,this.logger,this.performanceClient,this.correlationId)}getAuthorityType(e){if(e.HostNameAndPort.endsWith($T))return fo.Ciam;const n=e.PathSegments;if(n.length)switch(n[0].toLowerCase()){case d2:return fo.Adfs;case f2:return fo.Dsts}return fo.Default}get authorityType(){return this.getAuthorityType(this.canonicalAuthorityUrlComponents)}get protocolMode(){return this.authorityOptions.protocolMode}get options(){return this.authorityOptions}get canonicalAuthority(){return this._canonicalAuthority.urlString}set canonicalAuthority(e){this._canonicalAuthority=new At(e),this._canonicalAuthority.validateAsUri(),this._canonicalAuthorityUrlComponents=null}get canonicalAuthorityUrlComponents(){return this._canonicalAuthorityUrlComponents||(this._canonicalAuthorityUrlComponents=this._canonicalAuthority.getUrlComponents()),this._canonicalAuthorityUrlComponents}get hostnameAndPort(){return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase()}get tenant(){return this.canonicalAuthorityUrlComponents.PathSegments[0]}get authorizationEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.authorization_endpoint);throw he(ea)}get tokenEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint);throw he(ea)}get deviceCodeEndpoint(){if(this.discoveryComplete())return this.replacePath(this.metadata.token_endpoint.replace("/token","/devicecode"));throw he(ea)}get endSessionEndpoint(){if(this.discoveryComplete()){if(!this.metadata.end_session_endpoint)throw he(ZN);return this.replacePath(this.metadata.end_session_endpoint)}else throw he(ea)}get selfSignedJwtAudience(){if(this.discoveryComplete())return this.replacePath(this.metadata.issuer);throw he(ea)}get jwksUri(){if(this.discoveryComplete())return this.replacePath(this.metadata.jwks_uri);throw he(ea)}canReplaceTenant(e){return e.PathSegments.length===1&&!sr.reservedTenantDomains.has(e.PathSegments[0])&&this.getAuthorityType(e)===fo.Default&&this.protocolMode!==cr.OIDC}replaceTenant(e){return e.replace(/{tenant}|{tenantid}/g,this.tenant)}replacePath(e){let n=e;const a=new At(this.metadata.canonical_authority).getUrlComponents(),l=a.PathSegments;return this.canonicalAuthorityUrlComponents.PathSegments.forEach((d,f)=>{let h=l[f];if(f===0&&this.canReplaceTenant(a)){const m=new At(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];h!==m&&(this.logger.verbose("1q3g2x",this.correlationId),h=m)}d!==h&&(n=n.replace(`/${h}/`,`/${d}/`))}),this.replaceTenant(n)}get defaultOpenIdConfigurationEndpoint(){const e=this.hostnameAndPort;return this.canonicalAuthority.endsWith("v2.0/")||this.authorityType===fo.Adfs||this.protocolMode===cr.OIDC&&!this.isAliasOfKnownMicrosoftAuthority(e)?`${this.canonicalAuthority}.well-known/openid-configuration`:`${this.canonicalAuthority}v2.0/.well-known/openid-configuration`}discoveryComplete(){return!!this.metadata}async resolveEndpointsAsync(){const e=this.getCurrentMetadataEntity(),n=await se(this.updateCloudDiscoveryMetadata.bind(this),rD,this.logger,this.performanceClient,this.correlationId)(e);this.canonicalAuthority=this.canonicalAuthority.replace(this.hostnameAndPort,e.preferred_network);const o=await se(this.updateEndpointMetadata.bind(this),iD,this.logger,this.performanceClient,this.correlationId)(e);this.updateCachedMetadata(e,n,{source:o}),this.performanceClient?.addFields({cloudDiscoverySource:n,authorityEndpointSource:o},this.correlationId)}getCurrentMetadataEntity(){let e=this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort,this.correlationId);return e||(e={aliases:[],preferred_cache:this.hostnameAndPort,preferred_network:this.hostnameAndPort,canonical_authority:this.canonicalAuthority,authorization_endpoint:"",token_endpoint:"",end_session_endpoint:"",issuer:"",aliasesFromNetwork:!1,endpointsFromNetwork:!1,expiresAt:pw(),jwks_uri:""}),e}updateCachedMetadata(e,n,o){n!==co.CACHE&&o?.source!==co.CACHE&&(e.expiresAt=pw(),e.canonical_authority=this.canonicalAuthority);const a=this.cacheManager.generateAuthorityMetadataCacheKey(e.preferred_cache,this.correlationId);this.cacheManager.setAuthorityMetadata(a,e,this.correlationId),this.metadata=e}async updateEndpointMetadata(e){const n=this.updateEndpointMetadataFromLocalSources(e);if(n){if(n.source===co.HARDCODED_VALUES&&this.authorityOptions.azureRegionConfiguration?.azureRegion&&n.metadata){const a=await se(this.updateMetadataWithRegionalInformation.bind(this),uw,this.logger,this.performanceClient,this.correlationId)(n.metadata);ff(e,a,!1),e.canonical_authority=this.canonicalAuthority}return n.source}let o=await se(this.getEndpointMetadataFromNetwork.bind(this),oD,this.logger,this.performanceClient,this.correlationId)();if(o)return this.authorityOptions.azureRegionConfiguration?.azureRegion&&(o=await se(this.updateMetadataWithRegionalInformation.bind(this),uw,this.logger,this.performanceClient,this.correlationId)(o)),ff(e,o,!0),co.NETWORK;throw he(HN,this.defaultOpenIdConfigurationEndpoint)}updateEndpointMetadataFromLocalSources(e){this.logger.verbose("1fi0kc",this.correlationId);const n=this.getEndpointMetadataFromConfig();if(n)return this.logger.verbose("06t0uj",this.correlationId),ff(e,n,!1),{source:co.CONFIG};this.logger.verbose("151k0p",this.correlationId);const o=this.getEndpointMetadataFromHardcodedValues();if(o)return ff(e,o,!1),{source:co.HARDCODED_VALUES,metadata:o};this.logger.verbose("1imop5",this.correlationId);const a=gw(e);return this.isAuthoritySameType(e)&&e.endpointsFromNetwork&&!a?(this.logger.verbose("16uq31",""),{source:co.CACHE}):(a&&this.logger.verbose("0uoibc",""),null)}isAuthoritySameType(e){return new At(e.canonical_authority).getUrlComponents().PathSegments.length===this.canonicalAuthorityUrlComponents.PathSegments.length}getEndpointMetadataFromConfig(){if(this.authorityOptions.authorityMetadata)try{return JSON.parse(this.authorityOptions.authorityMetadata)}catch{throw Gt(IN)}return null}async getEndpointMetadataFromNetwork(){const e={},n=this.defaultOpenIdConfigurationEndpoint;this.logger.verbose("1y65x6",this.correlationId);try{const o=await this.networkInterface.sendGetRequestAsync(n,e);return SD(o.body)?o.body:(this.logger.verbose("1koyv8",this.correlationId),null)}catch{return this.logger.verbose("0a9wik",this.correlationId),null}}getEndpointMetadataFromHardcodedValues(){return this.hostnameAndPort in iw?iw[this.hostnameAndPort]:null}async updateMetadataWithRegionalInformation(e){const n=this.authorityOptions.azureRegionConfiguration?.azureRegion;if(n){if(n!==b2)return this.regionDiscoveryMetadata.region_outcome=Vm.CONFIGURED_NO_AUTO_DETECTION,this.regionDiscoveryMetadata.region_used=n,sr.replaceWithRegionalInformation(e,n);const o=await se(this.regionDiscovery.detectRegion.bind(this.regionDiscovery),aD,this.logger,this.performanceClient,this.correlationId)(this.authorityOptions.azureRegionConfiguration?.environmentRegion,this.regionDiscoveryMetadata);if(o)return this.regionDiscoveryMetadata.region_outcome=Vm.AUTO_DETECTION_REQUESTED_SUCCESSFUL,this.regionDiscoveryMetadata.region_used=o,sr.replaceWithRegionalInformation(e,o);this.regionDiscoveryMetadata.region_outcome=Vm.AUTO_DETECTION_REQUESTED_FAILED}return e}async updateCloudDiscoveryMetadata(e){const n=this.updateCloudDiscoveryMetadataFromLocalSources(e);if(n)return n;const o=await se(this.getCloudDiscoveryMetadataFromNetwork.bind(this),nD,this.logger,this.performanceClient,this.correlationId)();if(o)return qm(e,o,!0),co.NETWORK;throw Gt(kN)}updateCloudDiscoveryMetadataFromLocalSources(e){this.logger.verbose("0jhlgt",this.correlationId),this.logger.verbosePii("1fy7uz",this.correlationId),this.logger.verbosePii("08zabj",this.correlationId),this.logger.verbosePii("1o1kv3",this.correlationId);const n=this.getCloudDiscoveryMetadataFromConfig();if(n)return this.logger.verbose("1nakio",this.correlationId),qm(e,n,!1),co.CONFIG;this.logger.verbose("1x74aj",this.correlationId);const o=TP(this.hostnameAndPort);if(o)return this.logger.verbose("0by47c",this.correlationId),qm(e,o,!1),co.HARDCODED_VALUES;this.logger.verbose("0r2fzy",this.correlationId);const a=gw(e);return this.isAuthoritySameType(e)&&e.aliasesFromNetwork&&!a?(this.logger.verbose("1uffgh",""),co.CACHE):(a&&this.logger.verbose("0uoibc",""),null)}getCloudDiscoveryMetadataFromConfig(){if(this.authorityType===fo.Ciam)return this.logger.verbose("04y84h",this.correlationId),sr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);if(this.authorityOptions.cloudDiscoveryMetadata){this.logger.verbose("0gszr3",this.correlationId);try{this.logger.verbose("1iifkx",this.correlationId);const e=JSON.parse(this.authorityOptions.cloudDiscoveryMetadata),n=oh(e.metadata,this.hostnameAndPort);if(this.logger.verbose("0q67e3",""),n)return this.logger.verbose("0hzfao",this.correlationId),n;this.logger.verbose("1ajz3u",this.correlationId)}catch{throw this.logger.verbose("1wq5tu",this.correlationId),Gt(k1)}}return this.isInKnownAuthorities()?(this.logger.verbose("0mt9al",this.correlationId),sr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)):null}async getCloudDiscoveryMetadataFromNetwork(){const e=`${h2}${this.canonicalAuthority}oauth2/v2.0/authorize`,n={};let o=null;try{const a=await this.networkInterface.sendGetRequestAsync(e,n);let l,c;if(CD(a.body))l=a.body,c=l.metadata,this.logger.verbosePii("1vglyt",this.correlationId);else if(ED(a.body)){if(this.logger.warning("062uto",this.correlationId),l=a.body,l.error===E2)return this.logger.error("1x90tm",this.correlationId),null;this.logger.warning("0wchdm",this.correlationId),this.logger.warning("1s5mpv",this.correlationId),this.logger.warning("1yhqpw",this.correlationId),c=[]}else return this.logger.error("0768g0",this.correlationId),null;this.logger.verbose("1lrobr",this.correlationId),o=oh(c,this.hostnameAndPort)}catch(a){return a instanceof Kt?this.logger.error("0vwhc7",this.correlationId):this.logger.error("0s2z41",this.correlationId),null}return o||(this.logger.warning("0jp28q",this.correlationId),this.logger.verbose("130sd8",this.correlationId),o=sr.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),o}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(n=>n&&At.getDomainFromUrl(n).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,n){let o;if(n&&n.azureCloudInstance!==ib.None){const a=n.tenant?n.tenant:y1;o=`${n.azureCloudInstance}/${a}/`}return o||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return u2;if(this.discoveryComplete())return this.metadata.preferred_cache;throw he(ea)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return X1.has(e)}static isPublicCloudAuthority(e){return C2.indexOf(e)>=0}static buildRegionalAuthorityString(e,n,o){const a=new At(e);a.validateAsUri();const l=a.getUrlComponents();let c=`${n}.${l.HostNameAndPort}`;this.isPublicCloudAuthority(l.HostNameAndPort)&&(c=`${n}.${S2}`);const d=At.constructAuthorityUriFromObject({...a.getUrlComponents(),HostNameAndPort:c}).urlString;return o?`${d}?${o}`:d}static replaceWithRegionalInformation(e,n){const o={...e};return o.authorization_endpoint=sr.buildRegionalAuthorityString(o.authorization_endpoint,n),o.token_endpoint=sr.buildRegionalAuthorityString(o.token_endpoint,n),o.end_session_endpoint&&(o.end_session_endpoint=sr.buildRegionalAuthorityString(o.end_session_endpoint,n)),o}static transformCIAMAuthority(e){let n=e;const a=new At(e).getUrlComponents();if(a.PathSegments.length===0&&a.HostNameAndPort.endsWith($T)){const l=a.HostNameAndPort.split(".")[0];n=`${n}${l}${p2}`}return n}}sr.reservedTenantDomains=new Set(["{tenant}","{tenantid}",ca.COMMON,ca.CONSUMERS,ca.ORGANIZATIONS]);function TD(t){const o=new At(t).getUrlComponents().PathSegments.slice(-1)[0]?.toLowerCase();switch(o){case ca.COMMON:case ca.ORGANIZATIONS:case ca.CONSUMERS:return;default:return o}}function dx(t){return t.endsWith(zy)?t:`${t}${zy}`}function wD(t){const e=t.cloudDiscoveryMetadata;let n;if(e)try{n=JSON.parse(e)}catch{throw Gt(k1)}return{canonicalAuthority:t.authority?dx(t.authority):void 0,knownAuthorities:t.knownAuthorities,cloudDiscoveryMetadata:n}}async function fx(t,e,n,o,a,l,c){const d=sr.transformCIAMAuthority(dx(t)),f=new sr(d,e,n,o,a,l,c);try{return await se(f.resolveEndpointsAsync.bind(f),tD,a,c,l)(),f}catch{throw he(ea)}}class hx{constructor(e,n){this.includeRedirectUri=!0,this.config=cb(e),this.logger=new mo(this.config.loggerOptions,Lh,Au),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n,this.oidcDefaultScopes=this.config.authOptions.authority.options.OIDCOptions?.defaultScopes}async acquireToken(e,n,o){if(!e.code)throw he(GN);o&&o.cloud_instance_host_name&&await se(this.updateTokenEndpointAuthority.bind(this),eD,this.logger,this.performanceClient,e.correlationId)(o.cloud_instance_host_name,e.correlationId);const a=vo(),l=await se(this.executeTokenRequest.bind(this),JP,this.logger,this.performanceClient,e.correlationId)(this.authority,e,this.serverTelemetryManager),c=l.headers?.[Jn.X_MS_REQUEST_ID],d=new os(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return d.validateTokenResponse(l.body,e.correlationId),se(d.handleServerTokenResponse.bind(d),fb,this.logger,this.performanceClient,e.correlationId)(l.body,this.authority,a,e,n,o,void 0,void 0,void 0,c)}getLogoutUri(e){if(!e)throw Gt(ON);const n=this.createLogoutUrlQueryString(e);return At.appendQueryString(this.authority.endSessionEndpoint,n)}async executeTokenRequest(e,n,o){const a=cx(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),l=At.appendQueryString(e.tokenEndpoint,a),c=await se(this.createTokenRequestBody.bind(this),ZP,this.logger,this.performanceClient,n.correlationId)(n);let d;if(n.clientInfo)try{const m=ih(n.clientInfo,this.cryptoUtils.base64Decode);d={credential:`${m.uid}${By}${m.utid}`,type:po.HOME_ACCOUNT_ID}}catch{this.logger.verbose("0wznt3",n.correlationId)}const f=lx(this.logger,this.config.systemOptions.preventCorsPreflight,d||n.ccsCredential),h=zh(this.config.authOptions.clientId,n);return se(ux,qP,this.logger,this.performanceClient,n.correlationId)(l,c,f,h,n.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,o)}async createTokenRequestBody(e){const n=new Map;if(Xv(n,e.embeddedClientId||e.extraParameters?.[ns]||this.config.authOptions.clientId),this.includeRedirectUri)Jv(n,e.redirectUri);else if(!e.redirectUri)throw Gt(wN);if(Qv(n,e.scopes,!0,this.oidcDefaultScopes),sP(n,e.code),eb(n,this.config.libraryInfo),tb(n,this.config.telemetry.application),q1(n),this.serverTelemetryManager&&!tx(this.config)&&G1(n,this.serverTelemetryManager),e.codeVerifier&&cP(n,e.codeVerifier),this.config.clientCredentials.clientSecret&&H1(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const a=this.config.clientCredentials.clientAssertion;j1(n,await sx(a.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),$1(n,a.assertionType)}if(F1(n,S1.AUTHORIZATION_CODE_GRANT),rb(n),e.authenticationScheme===Nt.POP){const a=new Al(this.cryptoUtils,this.performanceClient);let l;e.popKid?l=this.cryptoUtils.encodeKid(e.popKid):l=(await se(a.generateCnf.bind(a),xu,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,ob(n,l)}else if(e.authenticationScheme===Nt.SSH)if(e.sshJwk)V1(n,e.sshJwk);else throw Gt(Yv);(!Jr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Zv(n,e.claims,this.config.authOptions.clientCapabilities);let o;if(e.clientInfo)try{const a=ih(e.clientInfo,this.cryptoUtils.base64Decode);o={credential:`${a.uid}${By}${a.utid}`,type:po.HOME_ACCOUNT_ID}}catch{this.logger.verbose("0wznt3",e.correlationId)}else o=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&o)switch(o.type){case po.HOME_ACCOUNT_ID:try{const a=ml(o.credential);eu(n,a)}catch{this.logger.verbose("1qhtee",e.correlationId)}break;case po.UPN:th(n,o.credential);break}return e.embeddedClientId&&Dh(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&zo(n,e.extraParameters),e.enableSpaAuthorizationCode&&(!e.extraParameters||!e.extraParameters[XT])&&zo(n,{[XT]:"1"}),Ph(n,e.correlationId,this.performanceClient),cu(n)}createLogoutUrlQueryString(e){const n=new Map;return e.postLogoutRedirectUri&&nP(n,e.postLogoutRedirectUri),e.correlationId&&wu(n,e.correlationId),e.idTokenHint&&rP(n,e.idTokenHint),e.state&&B1(n,e.state),e.logoutHint&&dP(n,e.logoutHint),e.extraQueryParameters&&zo(n,e.extraQueryParameters),this.config.authOptions.instanceAware&&K1(n),cu(n)}async updateTokenEndpointAuthority(e,n){const o=`https://${e}/${this.authority.tenant}/`,a=await fx(o,this.networkClient,this.cacheManager,this.authority.options,this.logger,n,this.performanceClient);this.authority=a}}const AD=300;class RD{constructor(e,n){this.config=cb(e),this.logger=new mo(this.config.loggerOptions,Lh,Au),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}async acquireToken(e,n){const o=vo(),a=await se(this.executeTokenRequest.bind(this),YP,this.logger,this.performanceClient,e.correlationId)(e,this.authority),l=a.headers?.[Jn.X_MS_REQUEST_ID],c=new os(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.performanceClient,this.config.serializableCache,this.config.persistencePlugin);return c.validateTokenResponse(a.body,e.correlationId),se(c.handleServerTokenResponse.bind(c),fb,this.logger,this.performanceClient,e.correlationId)(a.body,this.authority,o,e,n,void 0,void 0,!0,e.forceCache,l)}async acquireTokenByRefreshToken(e,n){if(!e)throw Gt(_N);if(!e.account)throw he(D1);if(this.cacheManager.isAppMetadataFOCI(e.account.environment,e.correlationId))try{return await se(this.acquireTokenWithCachedRefreshToken.bind(this),Gm,this.logger,this.performanceClient,e.correlationId)(e,!0,n)}catch(a){const l=a instanceof yo&&a.errorCode===Gy,c=a instanceof ps&&a.errorCode===B2&&a.subError===H2;if(l||c)return se(this.acquireTokenWithCachedRefreshToken.bind(this),Gm,this.logger,this.performanceClient,e.correlationId)(e,!1,n);throw a}return se(this.acquireTokenWithCachedRefreshToken.bind(this),Gm,this.logger,this.performanceClient,e.correlationId)(e,!1,n)}async acquireTokenWithCachedRefreshToken(e,n,o){const a=go(this.cacheManager.getRefreshToken.bind(this.cacheManager),lD,this.logger,this.performanceClient,e.correlationId)(e.account,n,e.correlationId,void 0);if(!a)throw ah(Gy);if(a.expiresOn){const c=e.refreshTokenExpirationOffsetSeconds||AD;if(this.performanceClient?.addFields({cacheRtExpiresOnSeconds:Number(a.expiresOn),rtOffsetSeconds:c},e.correlationId),sh(a.expiresOn,c))throw ah(nx)}const l={...e,refreshToken:a.secret,authenticationScheme:e.authenticationScheme||Nt.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:po.HOME_ACCOUNT_ID}};try{return await se(this.acquireToken.bind(this),WP,this.logger,this.performanceClient,e.correlationId)(l,o)}catch(c){if(c instanceof yo&&c.subError===ub){this.logger.verbose("1pg3ap",e.correlationId);const d=this.cacheManager.generateCredentialKey(a);this.cacheManager.removeRefreshToken(d,e.correlationId)}throw c}}async executeTokenRequest(e,n){const o=cx(e,this.config.authOptions.clientId,this.config.authOptions.redirectUri,this.performanceClient),a=At.appendQueryString(n.tokenEndpoint,o),l=await se(this.createTokenRequestBody.bind(this),QP,this.logger,this.performanceClient,e.correlationId)(e),c=lx(this.logger,this.config.systemOptions.preventCorsPreflight,e.ccsCredential),d=zh(this.config.authOptions.clientId,e);return se(ux,GP,this.logger,this.performanceClient,e.correlationId)(a,l,c,d,e.correlationId,this.cacheManager,this.networkClient,this.logger,this.performanceClient,this.serverTelemetryManager)}async createTokenRequestBody(e){const n=new Map;if(Xv(n,e.embeddedClientId||e.extraParameters?.[ns]||this.config.authOptions.clientId),e.redirectUri&&Jv(n,e.redirectUri),Qv(n,e.scopes,!0,this.config.authOptions.authority.options.OIDCOptions?.defaultScopes),F1(n,S1.REFRESH_TOKEN_GRANT),rb(n),eb(n,this.config.libraryInfo),tb(n,this.config.telemetry.application),q1(n),this.serverTelemetryManager&&!tx(this.config)&&G1(n,this.serverTelemetryManager),lP(n,e.refreshToken),this.config.clientCredentials.clientSecret&&H1(n,this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const o=this.config.clientCredentials.clientAssertion;j1(n,await sx(o.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),$1(n,o.assertionType)}if(e.authenticationScheme===Nt.POP){const o=new Al(this.cryptoUtils,this.performanceClient);let a;e.popKid?a=this.cryptoUtils.encodeKid(e.popKid):a=(await se(o.generateCnf.bind(o),xu,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,ob(n,a)}else if(e.authenticationScheme===Nt.SSH)if(e.sshJwk)V1(n,e.sshJwk);else throw Gt(Yv);if((!Jr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&Zv(n,e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case po.HOME_ACCOUNT_ID:try{const o=ml(e.ccsCredential.credential);eu(n,o)}catch{this.logger.verbose("1qhtee",e.correlationId)}break;case po.UPN:th(n,e.ccsCredential.credential);break}return e.embeddedClientId&&Dh(n,this.config.authOptions.clientId,this.config.authOptions.redirectUri),e.extraParameters&&zo(n,{...e.extraParameters}),Ph(n,e.correlationId,this.performanceClient),cu(n)}}class xD{constructor(e,n){this.config=cb(e),this.logger=new mo(this.config.loggerOptions,Lh,Au),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=n}async acquireCachedToken(e){let n=Fa.NOT_APPLICABLE;if(e.forceRefresh||!Jr.isEmptyObj(e.claims))throw this.setCacheOutcome(Fa.FORCE_REFRESH_OR_CLAIMS,e.correlationId),he(Xa);if(!e.account)throw he(D1);const o=e.account.tenantId||TD(e.authority),a=this.cacheManager.getTokenKeys(),l=this.cacheManager.getAccessToken(e.account,e,a,o);if(l){if(KP(l.cachedAt)||sh(l.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Fa.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),he(Xa);l.refreshOn&&sh(l.refreshOn,0)&&(n=Fa.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Fa.NO_CACHED_ACCESS_TOKEN,e.correlationId),he(Xa);const c=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.getAccount(this.cacheManager.generateAccountKey(e.account),e.correlationId),accessToken:l,idToken:this.cacheManager.getIdToken(e.account,e.correlationId,a,o),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c,e.correlationId)};return this.setCacheOutcome(n,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await se(this.generateResultFromCacheRecord.bind(this),XP,this.logger,this.performanceClient,e.correlationId)(d,e),n]}setCacheOutcome(e,n){this.serverTelemetryManager?.setCacheOutcome(e),this.performanceClient?.addFields({cacheOutcome:e},n),e!==Fa.NOT_APPLICABLE&&this.logger.info("09ingz",n)}async generateResultFromCacheRecord(e,n){let o;if(e.idToken&&(o=vi(e.idToken.secret,this.config.cryptoInterface.base64Decode)),n.maxAge||n.maxAge===0){const a=o?.auth_time;if(!a)throw he(P1);W1(a,n.maxAge)}return os.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,n,this.performanceClient,o)}}const _D={sendGetRequestAsync:()=>Promise.reject(he(Ze)),sendPostRequestAsync:()=>Promise.reject(he(Ze))};function OD(t,e,n,o){const a=e.correlationId,l=new Map;Xv(l,e.embeddedClientId||e.extraQueryParameters?.[ns]||t.clientId);const c=[...e.scopes||[],...e.extraScopesToConsent||[]];if(Qv(l,c,!0,t.authority.options.OIDCOptions?.defaultScopes),Jv(l,e.redirectUri),wu(l,a),eP(l,e.responseMode),rb(l),e.prompt&&(iP(l,e.prompt),o?.addFields({prompt:e.prompt},a)),e.domainHint&&(oP(l,e.domainHint),o?.addFields({domainHintFromRequest:!0},a)),e.prompt!==lr.SELECT_ACCOUNT)if(e.sid&&e.prompt===lr.NONE)n.verbose("1tvqyx",e.correlationId),tw(l,e.sid),o?.addFields({sidFromRequest:!0},a);else if(e.account){const d=MD(e.account);let f=ND(e.account);if(f&&e.domainHint&&(n.warning("0wkg3v",e.correlationId),f=null),f){n.verbose("1eyfsw",e.correlationId),df(l,f),o?.addFields({loginHintFromClaim:!0},a);try{const h=ml(e.account.homeAccountId);eu(l,h)}catch{n.verbose("12ugck",e.correlationId)}}else if(d&&e.prompt===lr.NONE){n.verbose("1rmd8s",e.correlationId),tw(l,d),o?.addFields({sidFromClaim:!0},a);try{const h=ml(e.account.homeAccountId);eu(l,h)}catch{n.verbose("12ugck",e.correlationId)}}else if(e.loginHint)n.verbose("0y3007",e.correlationId),df(l,e.loginHint),th(l,e.loginHint),o?.addFields({loginHintFromRequest:!0},a);else if(e.account.username){n.verbose("02f507",e.correlationId),df(l,e.account.username),o?.addFields({loginHintFromUpn:!0},a);try{const h=ml(e.account.homeAccountId);eu(l,h)}catch{n.verbose("12ugck",e.correlationId)}}}else e.loginHint&&(n.verbose("0g01ey",e.correlationId),df(l,e.loginHint),th(l,e.loginHint),o?.addFields({loginHintFromRequest:!0},a));else n.verbose("169k9v",e.correlationId);return e.nonce&&aP(l,e.nonce),e.state&&B1(l,e.state),(e.claims||t.clientCapabilities&&t.clientCapabilities.length>0)&&Zv(l,e.claims,t.clientCapabilities),e.embeddedClientId&&Dh(l,t.clientId,t.redirectUri),t.instanceAware&&(!e.extraQueryParameters||!Object.keys(e.extraQueryParameters).includes(jy))&&K1(l),l}function gb(t,e){const n=cu(e);return At.appendQueryString(t.authorizationEndpoint,n)}function ID(t,e){if(px(t,e),!t.code)throw he(XN);return t}function px(t,e){if(!t.state||!e)throw t.state?he(JT,"Cached State"):he(JT,"Server State");let n,o;try{n=decodeURIComponent(t.state)}catch{throw he(lu,t.state)}try{o=decodeURIComponent(e)}catch{throw he(lu,t.state)}if(n!==o)throw he($N);if(t.error||t.error_description||t.suberror){const a=kD(t);throw ox(t.error,t.error_description,t.suberror)?new yo(t.error||"",t.error_description,t.suberror,t.timestamp||"",t.trace_id||"",t.correlation_id||"",t.claims||"",a):new ps(t.error||"",t.error_description,t.suberror,a)}}function kD(t){const e="code=",n=t.error_uri?.lastIndexOf(e);return n&&n>=0?t.error_uri?.substring(n+e.length):void 0}function MD(t){return t.idTokenClaims?.sid||null}function ND(t){return t.loginHint||t.idTokenClaims?.login_hint||null}const qy="unexpected_error";const mw=",",gx="|";function PD(t){const{skus:e,libraryName:n,libraryVersion:o,extensionName:a,extensionVersion:l}=t,c=new Map([[0,[n,o]],[2,[a,l]]]);let d=[];if(e?.length){if(d=e.split(mw),d.length<4)return e}else d=Array.from({length:4},()=>gx);return c.forEach((f,h)=>{f.length===2&&f[0]?.length&&f[1]?.length&&DD({skuArr:d,index:h,skuName:f[0],skuVersion:f[1]})}),d.join(mw)}function DD(t){const{skuArr:e,index:n,skuName:o,skuVersion:a}=t;n>=e.length||(e[n]=[o,a].join(gx))}class uu{constructor(e,n){this.cacheOutcome=Fa.NOT_APPLICABLE,this.cacheManager=n,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||"",this.wrapperVer=e.wrapperVer||"",this.telemetryCacheKey=T1+E1+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Zs}${this.cacheOutcome}`,n=[this.wrapperSKU,this.wrapperVer],o=this.getNativeBrokerErrorCode();o?.length&&n.push(`broker_error=${o}`);const a=n.join(Zs),l=this.getRegionDiscoveryFields(),c=[e,l].join(Zs);return[WT,c,a].join(QT)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),n=uu.maxErrorsToSend(e),o=e.failedRequests.slice(0,2*n).join(Zs),a=e.errors.slice(0,n).join(Zs),l=e.errors.length,c=n=M2&&(n.failedRequests.shift(),n.failedRequests.shift(),n.errors.shift()),n.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof Kt?e.subError?n.errors.push(e.subError):e.errorCode?n.errors.push(e.errorCode):n.errors.push(e.toString()):n.errors.push(e.toString()):n.errors.push(D2),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,n,this.correlationId)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e,this.correlationId),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey,this.correlationId)||e}clearTelemetryCache(){const e=this.getLastRequests(),n=uu.maxErrorsToSend(e),o=e.errors.length;if(n===o)this.cacheManager.removeItem(this.telemetryCacheKey,this.correlationId);else{const a={failedRequests:e.failedRequests.slice(n*2),errors:e.errors.slice(n),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,a,this.correlationId)}}static maxErrorsToSend(e){let n,o=0,a=0;const l=e.errors.length;for(n=0;ntypeof t=="number"&&t in bw?bw[t]:"unknown";var ze;(function(t){t.Redirect="redirect",t.Popup="popup",t.Silent="silent",t.None="none"})(ze||(ze={}));const Kn={Startup:"startup",Logout:"logout",AcquireToken:"acquireToken",HandleRedirect:"handleRedirect",None:"none"},Sw={scopes:Pl},mx="jwk",BD={React:"@azure/msal-react"},Yy="msal.db",HD=1,jD=`${Yy}.keys`,Xn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},$D=[Xn.Default,Xn.Skip,Xn.RefreshTokenAndNetwork];function pf(t){return encodeURIComponent(du(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function ha(t){return yx(t).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function du(t){return yx(new TextEncoder().encode(t))}function yx(t){const e=Array.from(t,n=>String.fromCodePoint(n)).join("");return btoa(e)}const vx="pkce_not_created",bx="ear_jwk_empty",FD="ear_jwe_empty",Cw="crypto_nonexistent",vb="empty_navigate_uri",KD="hash_empty_error",bb="no_state_in_hash",VD="hash_does_not_contain_known_properties",Sx="unable_to_parse_state",GD="state_interaction_type_mismatch",qD="interaction_in_progress",YD="interaction_in_progress_cancelled",WD="popup_window_error",QD="empty_window_error",Wy="user_cancelled",XD="redirect_bridge_empty_response",JD="redirect_in_iframe",ZD="block_iframe_reload",eL="block_nested_popups",Sb="silent_logout_unsupported",tL="no_account_error",nL="no_token_request_cache_error",rL="unable_to_parse_token_request_cache_error",Cx="non_browser_environment",Dc="database_not_open",Qy="no_network_connectivity",oL="post_request_failed",iL="get_request_failed",Ew="failed_to_parse_response",Ex="crypto_key_not_found",aL="auth_code_required",sL="auth_code_or_nativeAccountId_required",lL="spa_code_and_nativeAccountId_present",Tx="database_unavailable",cL="unable_to_acquire_token_from_native_platform",uL="native_handshake_timeout",dL="native_extension_not_installed",wx="native_connection_not_established",Nf="uninitialized_public_client_application",fL="native_prompt_not_supported",hL="invalid_base64_string",pL="invalid_pop_token_request",gL="failed_to_build_headers",mL="failed_to_parse_headers",Ym="failed_to_decrypt_ear_response",lh="timed_out",yL="empty_response";function xr(t){return new TextDecoder().decode(ua(t))}function ua(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw Ce(hL)}const n=atob(e);return Uint8Array.from(n,o=>o.codePointAt(0)||0)}const vL="RSASSA-PKCS1-v1_5",Ll="AES-GCM",Ax="HKDF",Cb="SHA-256",bL=2048,SL=new Uint8Array([1,0,1]),Tw="0123456789abcdef",ww=new Uint32Array(1),Eb="raw",Rx="encrypt",Tb="decrypt",CL="deriveKey",EL="crypto_subtle_undefined",wb={name:vL,hash:Cb,modulusLength:bL,publicExponent:SL};function TL(t){if(!window)throw Ce(Cx);if(!window.crypto)throw Ce(Cw);if(!t&&!window.crypto.subtle)throw Ce(Cw,EL)}async function xx(t){const n=new TextEncoder().encode(t);return window.crypto.subtle.digest(Cb,n)}function wL(t){return window.crypto.getRandomValues(t)}function Wm(){return window.crypto.getRandomValues(ww),ww[0]}function is(){const t=Date.now(),e=Wm()*1024+(Wm()&1023),n=new Uint8Array(16),o=Math.trunc(e/2**30),a=e&2**30-1,l=Wm();n[0]=t/2**40,n[1]=t/2**32,n[2]=t/2**24,n[3]=t/2**16,n[4]=t/2**8,n[5]=t,n[6]=112|o>>>8,n[7]=o,n[8]=128|a>>>24,n[9]=a>>>16,n[10]=a>>>8,n[11]=a,n[12]=l>>>24,n[13]=l>>>16,n[14]=l>>>8,n[15]=l;let c="";for(let d=0;d>>4),c+=Tw.charAt(n[d]&15),(d===3||d===5||d===7||d===9)&&(c+="-");return c}async function AL(t,e){return window.crypto.subtle.generateKey(wb,t,e)}async function Qm(t){return window.crypto.subtle.exportKey(mx,t)}async function RL(t,e,n){return window.crypto.subtle.importKey(mx,t,wb,e,n)}async function xL(t,e){return window.crypto.subtle.sign(wb,t,e)}async function Ab(){const t=await _x(),n={alg:"dir",kty:"oct",k:ha(new Uint8Array(t))};return du(JSON.stringify(n))}async function _L(t){const e=xr(t),o=JSON.parse(e).k,a=ua(o);return window.crypto.subtle.importKey(Eb,a,Ll,!1,[Tb])}async function OL(t,e){const n=e.split(".");if(n.length!==5)throw Ce(Ym,"jwe_length");const o=await _L(t).catch(()=>{throw Ce(Ym,"import_key")});try{const a=new TextEncoder().encode(n[0]),l=ua(n[2]),c=ua(n[3]),d=ua(n[4]),f=d.byteLength*8,h=new Uint8Array(c.length+d.length);h.set(c),h.set(d,c.length);const m=await window.crypto.subtle.decrypt({name:Ll,iv:l,tagLength:f,additionalData:a},o,h);return new TextDecoder().decode(m)}catch{throw Ce(Ym,"decrypt")}}async function _x(){const t=await window.crypto.subtle.generateKey({name:Ll,length:256},!0,[Rx,Tb]);return window.crypto.subtle.exportKey(Eb,t)}async function Aw(t){return window.crypto.subtle.importKey(Eb,t,Ax,!1,[CL])}async function Ox(t,e,n){return window.crypto.subtle.deriveKey({name:Ax,salt:e,hash:Cb,info:new TextEncoder().encode(n)},t,{name:Ll,length:256},!1,[Rx,Tb])}async function IL(t,e,n){const o=new TextEncoder().encode(e),a=window.crypto.getRandomValues(new Uint8Array(16)),l=await Ox(t,a,n),c=await window.crypto.subtle.encrypt({name:Ll,iv:new Uint8Array(12)},l,o);return{data:ha(new Uint8Array(c)),nonce:ha(a)}}async function Rw(t,e,n,o){const a=ua(o),l=await Ox(t,ua(e),n),c=await window.crypto.subtle.decrypt({name:Ll,iv:new Uint8Array(12)},l,a);return new TextDecoder().decode(c)}async function kL(t){const e=await xx(t),n=new Uint8Array(e);return ha(n)}class Rb extends Kt{constructor(e,n){super(e,n),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Rb.prototype)}}function On(t){return new Rb(t,jh(t))}const Ix="storage_not_supported",Wn="stubbed_public_client_application_called",ML="in_mem_redirect_unavailable";function NL(){const t=window.location.hash,e=window.location.search;let n=!1,o=!1,a="",l;if(t&&t.length>1){const m=t.charAt(0)==="#"?t.substring(1):t,y=new URLSearchParams(m);y.has("state")&&(n=!0,a=m,l=y)}if(e&&e.length>1){const m=e.charAt(0)==="?"?e.substring(1):e,y=new URLSearchParams(m);y.has("state")&&(o=!0,a=m,l=y)}if(n&&o){const m=e.charAt(0)==="?"?e.substring(1):e,y=t.charAt(0)==="#"?t.substring(1):t;a=`${m}${y}`,l=new URLSearchParams(a)}if(!a||!l)throw Ce(yL);const c=l.get("state");if(!c)throw Ce(bb);const{libraryState:d}=Ru(xr,c),{id:f,meta:h}=d;if(!f||!h)throw Ce(Sx,"missing_library_state");return{params:l,payload:a,urlHash:t,urlQuery:e,hasResponseInHash:n,hasResponseInQuery:o,libraryState:{id:f,meta:h}}}function kx(t){t.location.hash="",typeof t.history.replaceState=="function"&&t.history.replaceState(null,"",`${t.location.origin}${t.location.pathname}${t.location.search}`)}function PL(t){const e=t.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function $h(){return window.parent!==window}function DL(){if($h())return!1;try{const{libraryState:t}=NL(),{meta:e}=t;return e.interactionType===ze.Popup}catch{return!1}}let ra=null;function LL(t,e){ra&&(t.verbose("18y01k",e),clearTimeout(ra.timeoutId),ra.channel.close(),ra.reject(Ce(YD)),ra=null)}async function dl(t,e,n,o){return new Promise((a,l)=>{e.verbose("1rf6em",o.correlationId);const{libraryState:c}=Ru(n.base64Decode,o.state||""),d=new BroadcastChannel(c.id);let f;const h=window.setTimeout(()=>{ra=null,d.close(),l(Ce(lh,"redirect_bridge_timeout"))},t);ra={timeoutId:h,channel:d,reject:l},d.onmessage=m=>{f=m.data.payload,ra=null,clearTimeout(h),d.close(),f?a(f):l(Ce(XD))}})}function aa(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function UL(){const e=new At(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function zL(){if(nh(window.location.hash)&&$h())throw Ce(ZD)}function BL(t){if($h()&&!t)throw Ce(JD)}function HL(){if(DL())throw Ce(eL)}function Mx(){if(typeof window>"u")throw Ce(Cx)}function Nx(t){if(!t)throw Ce(Nf)}function xb(t){Mx(),zL(),HL(),Nx(t)}function xw(t,e){if(xb(t),BL(e.system.allowRedirectInIframe),e.cache.cacheLocation===Zr.MemoryStorage)throw On(ML)}function Px(t){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(t).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function Xy(){return is()}const jL="acquireTokenFromCache",$L="acquireTokenByRefreshToken",FL="acquireTokenSilentAsync",KL="cryptoOptsGetPublicKeyThumbprint",VL="cryptoOptsSignJwt",GL="silentCacheClientAcquireToken",qL="silentIframeClientAcquireToken",YL="awaitConcurrentIframe",WL="silentRefreshClientAcquireToken",Za="standardInteractionClientGetDiscoveredAuthority",Dx="nativeInteractionClientAcquireToken",QL="refreshTokenClientAcquireTokenByRefreshToken",_w="acquireTokenBySilentIframe",_b="initializeBaseRequest",XL="initializeSilentRequest",JL="initializeCache",Ow="silentIframeClientTokenHelper",Xm="silentHandlerInitiateAuthRequest",ch="silentHandlerMonitorIframeForHash",ZL="silentHandlerLoadFrameSync",da="standardInteractionClientCreateAuthCodeClient",Fh="standardInteractionClientGetClientConfiguration",Kh="standardInteractionClientInitializeAuthorizationRequest",eU="silentFlowClientAcquireCachedToken",tU="getStandardParams",nU="handleCodeResponse",Ob="handleResponseEar",Lx="handleResponsePlatformBroker",yl="handleResponseCode",rU="authClientAcquireToken",tu="deserializeResponse",oU="authorityFactoryCreateDiscoveredInstance",iU="acquireTokenByCodeAsync",aU="handleRedirectPromise",sU="handleNativeRedirectPromise",lU="nativeMessageHandlerHandshake",cU="importExistingCache",as="generatePkceCodes",uU="generateCodeVerifier",dU="generateCodeChallengeFromVerifier",fU="sha256Digest",hU="getRandomValues",Iw="generateHKDF",pU="generateBaseKey",gU="base64Decode",mU="urlEncodeArr",yU="encrypt",kw="decrypt",Ib="generateEarKey",vU="decryptEarResponse";class bU{constructor(){this.dbName=Yy,this.version=HD,this.tableName=jD,this.dbOpen=!1}async open(){return new Promise((e,n)=>{const o=window.indexedDB.open(this.dbName,this.version);o.addEventListener("upgradeneeded",a=>{a.target.result.createObjectStore(this.tableName)}),o.addEventListener("success",a=>{const l=a;this.db=l.target.result,this.dbOpen=!0,e()}),o.addEventListener("error",()=>n(Ce(Tx)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((n,o)=>{if(!this.db)return o(Ce(Dc));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);c.addEventListener("success",d=>{const f=d;this.closeConnection(),n(f.target.result)}),c.addEventListener("error",d=>{this.closeConnection(),o(d)})})}async setItem(e,n){return await this.validateDbIsOpen(),new Promise((o,a)=>{if(!this.db)return a(Ce(Dc));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(n,e);d.addEventListener("success",()=>{this.closeConnection(),o()}),d.addEventListener("error",f=>{this.closeConnection(),a(f)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((n,o)=>{if(!this.db)return o(Ce(Dc));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);c.addEventListener("success",()=>{this.closeConnection(),n()}),c.addEventListener("error",d=>{this.closeConnection(),o(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,n)=>{if(!this.db)return n(Ce(Dc));const l=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();l.addEventListener("success",c=>{const d=c;this.closeConnection(),e(d.target.result)}),l.addEventListener("error",c=>{this.closeConnection(),n(c)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((n,o)=>{if(!this.db)return o(Ce(Dc));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);c.addEventListener("success",d=>{const f=d;this.closeConnection(),n(f.target.result===1)}),c.addEventListener("error",d=>{this.closeConnection(),o(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,n)=>{const o=window.indexedDB.deleteDatabase(Yy),a=setTimeout(()=>n(!1),200);o.addEventListener("success",()=>(clearTimeout(a),e(!0))),o.addEventListener("blocked",()=>(clearTimeout(a),e(!0))),o.addEventListener("error",()=>(clearTimeout(a),n(!1)))})}}class Vh{constructor(){this.cache=new Map}async initialize(){}getItem(e){return this.cache.get(e)||null}getUserData(e){return this.getItem(e)}setItem(e,n){this.cache.set(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((n,o)=>{e.push(o)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}decryptData(){return Promise.resolve(null)}}class SU{constructor(e){this.inMemoryCache=new Vh,this.indexedDBCache=new bU,this.logger=e}handleDatabaseAccessError(e,n){if(e instanceof _u&&e.errorCode===Tx)this.logger.error("1wx7zz",n);else throw e}async getItem(e,n){const o=this.inMemoryCache.getItem(e);if(!o)try{return this.logger.verbose("0naxpl",n),await this.indexedDBCache.getItem(e)}catch(a){this.handleDatabaseAccessError(a,n)}return o}async setItem(e,n,o){this.inMemoryCache.setItem(e,n);try{await this.indexedDBCache.setItem(e,n)}catch(a){this.handleDatabaseAccessError(a,o)}}async removeItem(e,n){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(o){this.handleDatabaseAccessError(o,n)}}async getKeys(e){const n=this.inMemoryCache.getKeys();if(n.length===0)try{return this.logger.verbose("1iqrbq",e),await this.indexedDBCache.getKeys()}catch(o){this.handleDatabaseAccessError(o,e)}return n}async containsKey(e,n){const o=this.inMemoryCache.containsKey(e);if(!o)try{return this.logger.verbose("03zl2j",n),await this.indexedDBCache.containsKey(e)}catch(a){this.handleDatabaseAccessError(a,n)}return o}clearInMemory(e){this.logger.verbose("03r21p",e),this.inMemoryCache.clear(),this.logger.verbose("0uksk1",e)}async clearPersistent(e){try{this.logger.verbose("0rdqut",e);const n=await this.indexedDBCache.deleteDatabase();return n&&this.logger.verbose("149ouc",e),n}catch(n){return this.handleDatabaseAccessError(n,e),!1}}}class Ei{constructor(e,n,o){this.logger=e,TL(o??!1),this.cache=new SU(this.logger),this.performanceClient=n}createNewGuid(){return is()}base64Encode(e){return du(e)}base64Decode(e){return xr(e)}base64UrlEncode(e){return pf(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){const n=this.performanceClient?.startMeasurement(KL,e.correlationId),o=await AL(Ei.EXTRACTABLE,Ei.POP_KEY_USAGES),a=await Qm(o.publicKey),l={e:a.e,kty:a.kty,n:a.n},c=Mw(l),d=await this.hashString(c),f=await Qm(o.privateKey),h=await RL(f,!1,["sign"]);return await this.cache.setItem(d,{privateKey:h,publicKey:o.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri},e.correlationId),n&&n.end({success:!0}),d}async removeTokenBindingKey(e,n){if(await this.cache.removeItem(e,n),await this.cache.containsKey(e,n))throw he(JN)}async clearKeystore(e){this.cache.clearInMemory(e);try{return await this.cache.clearPersistent(e),!0}catch(n){return n instanceof Error?this.logger.error("1owpn8",e):this.logger.error("0yrmwo",e),!1}}async signJwt(e,n,o,a){const l=this.performanceClient?.startMeasurement(VL,a),c=await this.cache.getItem(n,a||"");if(!c)throw Ce(Ex);const d=await Qm(c.publicKey),f=Mw(d),h=pf(JSON.stringify({kid:n})),m=yb.getShrHeaderString({...o?.header,alg:d.alg,kid:h}),y=pf(m);e.cnf={jwk:JSON.parse(f)};const v=pf(JSON.stringify(e)),C=`${y}.${v}`,T=new TextEncoder().encode(C),w=await xL(c.privateKey,T),_=ha(new Uint8Array(w)),k=`${C}.${_}`;return l&&l.end({success:!0}),k}async hashString(e){return kL(e)}}Ei.POP_KEY_USAGES=["sign","verify"];Ei.EXTRACTABLE=!0;function Mw(t){return JSON.stringify(t,Object.keys(t).sort())}const CU="acquireTokenSilent",EU="acquireTokenByCode",TU="acquireTokenPopup",wU="acquireTokenPreRedirect",Jm="acquireTokenRedirect",AU="ssoSilent",RU="initializeClientApplication",xU="localStorageUpdated";const Bn="msal",kb="browser",Nw="|",$n=2,Pf=2,_U=`${Bn}.${kb}.log.level`,OU=`${Bn}.${kb}.log.pii`,IU=`${Bn}.${kb}.platform.auth.dom`,Pw=`${Bn}.version`,Dw="account.keys",Lw="token.keys";function vl(t=Pf){return t<1?`${Bn}.${Dw}`:`${Bn}.${t}.${Dw}`}function bl(t,e=$n){return e<1?`${Bn}.${Lw}.${t}`:`${Bn}.${e}.${Lw}.${t}`}const kU=1440*60*1e3,Jy={Lax:"Lax",None:"None"};class Ux{initialize(){return Promise.resolve()}getItem(e){const n=`${encodeURIComponent(e)}`,o=document.cookie.split(";");for(let a=0;a{const a=decodeURIComponent(o).trim().split("=");n.push(a[0])}),n}containsKey(e){return this.getKeys().includes(e)}decryptData(){return Promise.resolve(null)}}function MU(t){const e=new Date;return new Date(e.getTime()+t*kU).toUTCString()}function ta(t,e){const n=t.getItem(vl(e));return n?JSON.parse(n):[]}function uo(t,e,n){const o=e.getItem(bl(t,n));if(o){const a=JSON.parse(o);if(a&&a.hasOwnProperty("idToken")&&a.hasOwnProperty("accessToken")&&a.hasOwnProperty("refreshToken"))return a}return{idToken:[],accessToken:[],refreshToken:[]}}function Df(t){return t.hasOwnProperty("id")&&t.hasOwnProperty("nonce")&&t.hasOwnProperty("data")}const Uw="msal.cache.encryption",NU="msal.broadcast.cache";class PU{constructor(e,n,o){if(!window.localStorage)throw On(Ix);this.memoryStorage=new Vh,this.initialized=!1,this.clientId=e,this.logger=n,this.performanceClient=o,this.broadcast=new BroadcastChannel(NU)}async initialize(e){const n=new Ux,o=n.getItem(Uw);let a={key:"",id:""};if(o)try{a=JSON.parse(o)}catch{}if(a.key&&a.id){const l=go(ua,gU,this.logger,this.performanceClient,e)(a.key);this.encryptionCookie={id:a.id,key:await se(Aw,Iw,this.logger,this.performanceClient,e)(l)}}else{const l=is(),c=await se(_x,pU,this.logger,this.performanceClient,e)(),d=go(ha,mU,this.logger,this.performanceClient,e)(new Uint8Array(c));this.encryptionCookie={id:l,key:await se(Aw,Iw,this.logger,this.performanceClient,e)(c)};const f={id:l,key:d};n.setItem(Uw,JSON.stringify(f),0,!0,Jy.None)}await se(this.importExistingCache.bind(this),cU,this.logger,this.performanceClient,e)(e),this.broadcast.addEventListener("message",l=>{this.updateCache(l,e)}),this.initialized=!0}getItem(e){return window.localStorage.getItem(e)}getUserData(e){if(!this.initialized)throw Ce(Nf);return this.memoryStorage.getItem(e)}async decryptData(e,n,o){if(!this.initialized||!this.encryptionCookie)throw Ce(Nf);if(n.id!==this.encryptionCookie.id)return this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},o),null;const a=await se(Rw,kw,this.logger,this.performanceClient,o)(this.encryptionCookie.key,n.nonce,this.getContext(e),n.data);if(!a)return null;try{return{...JSON.parse(a),lastUpdatedAt:n.lastUpdatedAt}}catch{return this.performanceClient.incrementFields({encryptedCacheCorruptionCount:1},o),null}}setItem(e,n){window.localStorage.setItem(e,n)}async setUserData(e,n,o,a,l){if(!this.initialized||!this.encryptionCookie)throw Ce(Nf);if(l)this.setItem(e,n);else{const{data:c,nonce:d}=await se(IL,yU,this.logger,this.performanceClient,o)(this.encryptionCookie.key,n,this.getContext(e)),f={id:this.encryptionCookie.id,nonce:d,data:c,lastUpdatedAt:a};this.setItem(e,JSON.stringify(f))}this.memoryStorage.setItem(e,n),this.broadcast.postMessage({key:e,value:n,context:this.getContext(e)})}removeItem(e){this.memoryStorage.containsKey(e)&&(this.memoryStorage.removeItem(e),this.broadcast.postMessage({key:e,value:null,context:this.getContext(e)})),window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}clear(){this.memoryStorage.clear(),ta(this).forEach(o=>this.removeItem(o));const n=uo(this.clientId,this);n.idToken.forEach(o=>this.removeItem(o)),n.accessToken.forEach(o=>this.removeItem(o)),n.refreshToken.forEach(o=>this.removeItem(o)),this.getKeys().forEach(o=>{(o.startsWith(Bn)||o.indexOf(this.clientId)!==-1)&&this.removeItem(o)})}async importExistingCache(e){if(!this.encryptionCookie)return;let n=ta(this);n=await this.importArray(n,e),n.length?this.setItem(vl(),JSON.stringify(n)):this.removeItem(vl());const o=uo(this.clientId,this);o.idToken=await this.importArray(o.idToken,e),o.accessToken=await this.importArray(o.accessToken,e),o.refreshToken=await this.importArray(o.refreshToken,e),o.idToken.length||o.accessToken.length||o.refreshToken.length?this.setItem(bl(this.clientId),JSON.stringify(o)):this.removeItem(bl(this.clientId))}async getItemFromEncryptedCache(e,n){if(!this.encryptionCookie)return null;const o=this.getItem(e);if(!o)return null;let a;try{a=JSON.parse(o)}catch{return null}return Df(a)?a.id!==this.encryptionCookie.id?(this.performanceClient.incrementFields({encryptedCacheExpiredCount:1},n),null):(this.performanceClient.incrementFields({encryptedCacheCount:1},n),se(Rw,kw,this.logger,this.performanceClient,n)(this.encryptionCookie.key,a.nonce,this.getContext(e),a.data)):(this.performanceClient.incrementFields({unencryptedCacheCount:1},n),o)}async importArray(e,n){const o=[],a=[];return e.forEach(l=>{const c=this.getItemFromEncryptedCache(l,n).then(d=>{d?(this.memoryStorage.setItem(l,d),o.push(l)):this.removeItem(l)});a.push(c)}),await Promise.all(a),o}getContext(e){let n="";return e.includes(this.clientId)&&(n=this.clientId),n}updateCache(e,n){this.logger.trace("17cxcm",n);const o=this.performanceClient.startMeasurement(xU);o.add({isBackground:!0});const{key:a,value:l,context:c}=e.data;if(!a){this.logger.error("0e10qr",n),o.end({success:!1,errorCode:"noKey"});return}if(c&&c!==this.clientId){this.logger.trace("04rtdy",n),o.end({success:!1,errorCode:"contextMismatch"});return}l?(this.memoryStorage.setItem(a,l),this.logger.verbose("1vzsgt",n)):(this.memoryStorage.removeItem(a),this.logger.verbose("04ypih",n)),o.end({success:!0})}}class DU{constructor(){if(!window.sessionStorage)throw On(Ix)}async initialize(){}getItem(e){return window.sessionStorage.getItem(e)}getUserData(e){return this.getItem(e)}setItem(e,n){window.sessionStorage.setItem(e,n)}async setUserData(e,n){this.setItem(e,n)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}decryptData(){return Promise.resolve(null)}}const Pe={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_SUCCESS:"msal:loginSuccess",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",BROKERED_REQUEST_START:"msal:brokeredRequestStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",BROKERED_REQUEST_SUCCESS:"msal:brokeredRequestSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",BROKERED_REQUEST_FAILURE:"msal:brokeredRequestFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache",BROKER_CONNECTION_ESTABLISHED:"msal:brokerConnectionEstablished"};const LU="@azure/msal-browser",ss="5.2.0";function Ji(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Zy extends Vy{constructor(e,n,o,a,l,c,d){super(e,o,a,l,d),this.cacheConfig=n,this.logger=a,this.internalStorage=new Vh,this.browserStorage=zw(e,n.cacheLocation,a,l),this.temporaryCacheStorage=zw(e,Zr.SessionStorage,a,l),this.cookieStorage=new Ux,this.eventHandler=c}async initialize(e){this.performanceClient.addFields({cacheLocation:this.cacheConfig.cacheLocation,cacheRetentionDays:this.cacheConfig.cacheRetentionDays},e),await this.browserStorage.initialize(e),await this.migrateExistingCache(e),this.trackVersionChanges(e)}async migrateExistingCache(e){let n=ta(this.browserStorage),o=uo(this.clientId,this.browserStorage);this.performanceClient.addFields({preMigrateAcntCount:n.length,preMigrateATCount:o.accessToken.length,preMigrateITCount:o.idToken.length,preMigrateRTCount:o.refreshToken.length},e);for(let l=0;lf.includes(c)).forEach(f=>{this.browserStorage.removeItem(f),Ji(d.idToken,f)}),[...d.accessToken].filter(f=>f.includes(c)).forEach(f=>{this.browserStorage.removeItem(f),Ji(d.accessToken,f)}),[...d.refreshToken].filter(f=>f.includes(c)).forEach(f=>{this.browserStorage.removeItem(f),Ji(d.refreshToken,f)}),this.setTokenKeys(d,a,o)}this.performanceClient.incrementFields({expiredAcntRemovedCount:1},a),this.browserStorage.removeItem(e)}getKMSIValues(){const e={},n=this.getTokenKeys().idToken;for(const o of n){const a=this.browserStorage.getUserData(o);if(a){const l=JSON.parse(a),c=vi(l.secret,xr);c&&(e[l.homeAccountId]=Ja(c))}}return e}async migrateIdTokens(e,n,o){const a=uo(this.clientId,this.browserStorage,e);if(a.idToken.length===0)return;const l=uo(this.clientId,this.browserStorage,$n),c=ta(this.browserStorage),d=ta(this.browserStorage,n);for(const f of[...a.idToken]){this.performanceClient.incrementFields({oldITCount:1},o);const h=await this.updateOldEntry(f,o);if(!h){Ji(a.idToken,f);continue}const m=c.find(k=>k.includes(h.homeAccountId)),y=d.find(k=>k.includes(h.homeAccountId));let v=null;if(m)v=this.getAccount(m,o);else if(y){const k=this.browserStorage.getItem(y),R=this.validateAndParseJson(k||"");v=R&&Df(R)?await this.browserStorage.decryptData(y,R,o):R}if(!v){this.performanceClient.incrementFields({skipITMigrateCount:1},o);continue}const C=vi(h.secret,xr),b=this.generateCredentialKey(h),T=this.getIdTokenCredential(b,o),w=Object.keys(C).includes("signin_state"),_=T&&Object.keys(vi(T.secret,xr)||{}).includes("signin_state");if(!T||h.lastUpdatedAt>T.lastUpdatedAt&&(w||!_)){const k=v.tenantProfiles||[],R=lb(C)||v.realm;if(R&&!k.find(U=>U.tenantId===R)){const U=Dl(v.homeAccountId,v.localAccountId,R,C);k.push(U)}v.tenantProfiles=k;const N=this.generateAccountKey(rs(v)),M=Ja(C);await this.setUserData(N,JSON.stringify(v),o,v.lastUpdatedAt,M),c.includes(N)||c.push(N),await this.setUserData(b,JSON.stringify(h),o,h.lastUpdatedAt,M),this.performanceClient.incrementFields({migratedITCount:1},o),l.idToken.push(b)}}this.setTokenKeys(a,o,e),this.setTokenKeys(l,o),this.setAccountKeys(c,o)}async migrateAccessTokens(e,n,o){const a=uo(this.clientId,this.browserStorage,e);if(a.accessToken.length===0)return;const l=uo(this.clientId,this.browserStorage,$n);for(const c of[...a.accessToken]){this.performanceClient.incrementFields({oldATCount:1},o);const d=await this.updateOldEntry(c,o);if(!d){Ji(a.accessToken,c);continue}if(!(d.homeAccountId in n)){this.performanceClient.incrementFields({skipATMigrateCount:1},o);continue}const f=this.generateCredentialKey(d),h=n[d.homeAccountId];if(!l.accessToken.includes(f))await this.setUserData(f,JSON.stringify(d),o,d.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedATCount:1},o),l.accessToken.push(f);else{const m=this.getAccessTokenCredential(f,o);(!m||d.lastUpdatedAt>m.lastUpdatedAt)&&(await this.setUserData(f,JSON.stringify(d),o,d.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedATCount:1},o))}}this.setTokenKeys(a,o,e),this.setTokenKeys(l,o)}async migrateRefreshTokens(e,n,o){const a=uo(this.clientId,this.browserStorage,e);if(a.refreshToken.length===0)return;const l=uo(this.clientId,this.browserStorage,$n);for(const c of[...a.refreshToken]){this.performanceClient.incrementFields({oldRTCount:1},o);const d=await this.updateOldEntry(c,o);if(!d){Ji(a.refreshToken,c);continue}if(!(d.homeAccountId in n)){this.performanceClient.incrementFields({skipRTMigrateCount:1},o);continue}const f=this.generateCredentialKey(d),h=n[d.homeAccountId];if(!l.refreshToken.includes(f))await this.setUserData(f,JSON.stringify(d),o,d.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedRTCount:1},o),l.refreshToken.push(f);else{const m=this.getRefreshTokenCredential(f,o);(!m||d.lastUpdatedAt>m.lastUpdatedAt)&&(await this.setUserData(f,JSON.stringify(d),o,d.lastUpdatedAt,h),this.performanceClient.incrementFields({migratedRTCount:1},o))}}this.setTokenKeys(a,o,e),this.setTokenKeys(l,o)}trackVersionChanges(e){const n=this.browserStorage.getItem(Pw);n&&(this.logger.info("1wuc87",e),this.performanceClient.addFields({previousLibraryVersion:n},e)),n!==ss&&this.setItem(Pw,ss,e)}validateAndParseJson(e){if(!e)return null;try{const n=JSON.parse(e);return n&&typeof n=="object"?n:null}catch{return null}}setItem(e,n,o){const a=new Array($n+1).fill(0),l=[],c=20;for(let d=0;d<=c;d++)try{if(this.browserStorage.setItem(e,n),d>0)for(let f=0;f<=$n;f++){const h=a.slice(0,f).reduce((y,v)=>y+v,0);if(h>=d)break;const m=d>h+a[f]?h+a[f]:d;d>h&&a[f]>0&&this.removeAccessTokenKeys(l.slice(h,m),o,f)}break}catch(f){const h=Ky(f);if(h.errorCode===Fy&&d0)for(let m=0;m<=$n;m++){const y=c.slice(0,m).reduce((C,b)=>C+b,0);if(y>=h)break;const v=h>y+c[m]?y+c[m]:h;h>y&&c[m]>0&&this.removeAccessTokenKeys(d.slice(y,v),o,m)}break}catch(m){const y=Ky(m);if(y.errorCode===Fy&&h-1?(o.splice(a,1),this.setAccountKeys(o,n)):this.logger.trace("1dytu2",n)}removeAccount(e,n){const o=this.getActiveAccount(n);o?.homeAccountId===e.homeAccountId&&o?.environment===e.environment&&this.setActiveAccount(null,n),super.removeAccount(e,n),this.removeAccountKeyFromMap(this.generateAccountKey(e),n),this.browserStorage.getKeys().forEach(a=>{a.includes(e.homeAccountId)&&a.includes(e.environment)&&this.browserStorage.removeItem(a)})}removeIdToken(e,n){super.removeIdToken(e,n);const o=this.getTokenKeys(),a=o.idToken.indexOf(e);a>-1&&(this.logger.info("05udv9",n),o.idToken.splice(a,1),this.setTokenKeys(o,n))}removeAccessToken(e,n,o=!0){super.removeAccessToken(e,n),o&&this.removeAccessTokenKeys([e],n)}removeAccessTokenKeys(e,n,o=$n){this.logger.trace("17o18n",n);const a=this.getTokenKeys(o);let l=0;if(e.forEach(c=>{const d=a.accessToken.indexOf(c);d>-1&&(a.accessToken.splice(d,1),l++)}),l>0){this.logger.info("15i5d5",n),this.setTokenKeys(a,n,o);return}}removeRefreshToken(e,n){super.removeRefreshToken(e,n);const o=this.getTokenKeys(),a=o.refreshToken.indexOf(e);a>-1&&(this.logger.info("1f4fq3",n),o.refreshToken.splice(a,1),this.setTokenKeys(o,n))}getTokenKeys(e=$n){return uo(this.clientId,this.browserStorage,e)}setTokenKeys(e,n,o=$n){if(e.idToken.length===0&&e.accessToken.length===0&&e.refreshToken.length===0){this.removeItem(bl(this.clientId,o));return}else this.setItem(bl(this.clientId,o),JSON.stringify(e),n)}getIdTokenCredential(e,n){const o=this.browserStorage.getUserData(e);if(!o)return this.logger.trace("1jukz6",n),this.removeIdToken(e,n),null;const a=this.validateAndParseJson(o);return!a||!hD(a)?(this.logger.trace("1jukz6",n),null):(this.logger.trace("01ju66",n),a)}async setIdTokenCredential(e,n,o){this.logger.trace("13hjll",n);const a=this.generateCredentialKey(e),l=Date.now().toString();e.lastUpdatedAt=l,await this.setUserData(a,JSON.stringify(e),n,l,o);const c=this.getTokenKeys();c.idToken.indexOf(a)===-1&&(this.logger.info("07jy92",n),c.idToken.push(a),this.setTokenKeys(c,n))}getAccessTokenCredential(e,n){const o=this.browserStorage.getUserData(e);if(!o)return this.logger.trace("0bqvx8",n),this.removeAccessTokenKeys([e],n),null;const a=this.validateAndParseJson(o);return!a||!fw(a)?(this.logger.trace("0bqvx8",n),null):(this.logger.trace("1o81rl",n),a)}async setAccessTokenCredential(e,n,o){this.logger.trace("1pondb",n);const a=this.generateCredentialKey(e),l=Date.now().toString();e.lastUpdatedAt=l,await this.setUserData(a,JSON.stringify(e),n,l,o);const c=this.getTokenKeys(),d=c.accessToken.indexOf(a);d!==-1&&c.accessToken.splice(d,1),this.logger.trace("1onhey",n),c.accessToken.push(a),this.setTokenKeys(c,n)}getRefreshTokenCredential(e,n){const o=this.browserStorage.getUserData(e);if(!o)return this.logger.trace("0jlizt",n),this.removeRefreshToken(e,n),null;const a=this.validateAndParseJson(o);return!a||!hw(a)?(this.logger.trace("0jlizt",n),null):(this.logger.trace("0nokxi",n),a)}async setRefreshTokenCredential(e,n,o){this.logger.trace("0tcg8d",n);const a=this.generateCredentialKey(e),l=Date.now().toString();e.lastUpdatedAt=l,await this.setUserData(a,JSON.stringify(e),n,l,o);const c=this.getTokenKeys();c.refreshToken.indexOf(a)===-1&&(this.logger.info("0eckjs",n),c.refreshToken.push(a),this.setTokenKeys(c,n))}getAppMetadata(e,n){const o=this.browserStorage.getItem(e);if(!o)return this.logger.trace("1q101h",n),null;const a=this.validateAndParseJson(o);return!a||!yD(e,a)?(this.logger.trace("1q101h",n),null):(this.logger.trace("19pvg2",n),a)}setAppMetadata(e,n){this.logger.trace("0cyma6",n);const o=mD(e);this.setItem(o,JSON.stringify(e),n)}getServerTelemetry(e,n){const o=this.browserStorage.getItem(e);if(!o)return this.logger.trace("0jk19c",n),null;const a=this.validateAndParseJson(o);return!a||!pD(e,a)?(this.logger.trace("0jk19c",n),null):(this.logger.trace("12jguk",n),a)}setServerTelemetry(e,n,o){this.logger.trace("1poh61",o),this.setItem(e,JSON.stringify(n),o)}getAuthorityMetadata(e,n){const o=this.internalStorage.getItem(e);if(!o)return this.logger.trace("1r39oe",n),null;const a=this.validateAndParseJson(o);return a&&vD(e,a)?(this.logger.trace("1ohvk3",n),a):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(n=>this.isAuthorityMetadata(n))}setWrapperMetadata(e,n){this.internalStorage.setItem(hf.WRAPPER_SKU,e),this.internalStorage.setItem(hf.WRAPPER_VER,n)}getWrapperMetadata(){const e=this.internalStorage.getItem(hf.WRAPPER_SKU)||"",n=this.internalStorage.getItem(hf.WRAPPER_VER)||"";return[e,n]}setAuthorityMetadata(e,n,o){this.logger.trace("07w8n2",o),this.internalStorage.setItem(e,JSON.stringify(n))}getActiveAccount(e){const n=this.generateCacheKey(YT.ACTIVE_ACCOUNT_FILTERS),o=this.browserStorage.getItem(n);if(!o)return this.logger.trace("08gw0e",e),null;const a=this.validateAndParseJson(o);return a?(this.logger.trace("1t3ch7",e),this.getAccountInfoFilteredBy({homeAccountId:a.homeAccountId,localAccountId:a.localAccountId,tenantId:a.tenantId},e)):(this.logger.trace("0me1up",e),null)}setActiveAccount(e,n){const o=this.generateCacheKey(YT.ACTIVE_ACCOUNT_FILTERS);if(e){this.logger.verbose("0rsj80",n);const a={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.setItem(o,JSON.stringify(a),n)}else this.logger.verbose("1bp5z5",n),this.browserStorage.removeItem(o);this.eventHandler.emitEvent(Pe.ACTIVE_ACCOUNT_CHANGED,n)}getThrottlingCache(e,n){const o=this.browserStorage.getItem(e);if(!o)return this.logger.trace("1h4wa6",n),null;const a=this.validateAndParseJson(o);return!a||!gD(e,a)?(this.logger.trace("1h4wa6",n),null):(this.logger.trace("0of6n8",n),a)}setThrottlingCache(e,n,o){this.logger.trace("0wfgh6",o),this.setItem(e,JSON.stringify(n),o)}getTemporaryCache(e,n,o){const a=o?this.generateCacheKey(e):e,l=this.temporaryCacheStorage.getItem(a);if(!l){if(this.cacheConfig.cacheLocation===Zr.LocalStorage){const c=this.browserStorage.getItem(a);if(c)return this.logger.trace("1yt61y",n),c}return this.logger.trace("1qhy81",n),null}return l}setTemporaryCache(e,n,o){const a=o?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(a,n)}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e)}getKeys(){return this.browserStorage.getKeys()}clear(e){this.removeAllAccounts(e),this.removeAppMetadata(e),this.temporaryCacheStorage.getKeys().forEach(n=>{(n.indexOf(Bn)!==-1||n.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(n)}),this.browserStorage.getKeys().forEach(n=>{(n.indexOf(Bn)!==-1||n.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(n)}),this.internalStorage.clear()}generateCacheKey(e){return Jr.startsWith(e,Bn)?e:`${Bn}.${this.clientId}.${e}`}generateCredentialKey(e){const n=e.credentialType===zn.REFRESH_TOKEN&&e.familyId||e.clientId,o=e.tokenType&&e.tokenType.toLowerCase()!==Nt.BEARER.toLowerCase()?e.tokenType.toLowerCase():"";return[`${Bn}.${$n}`,e.homeAccountId,e.environment,e.credentialType,n,e.realm||"",e.target||"",o].join(Nw).toLowerCase()}generateAccountKey(e){const n=e.homeAccountId.split(".")[1];return[`${Bn}.${Pf}`,e.homeAccountId,e.environment,n||e.tenantId||""].join(Nw).toLowerCase()}resetRequestCache(e){this.logger.trace("0h0ynu",e),this.removeTemporaryItem(this.generateCacheKey(Tn.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Tn.VERIFIER)),this.removeTemporaryItem(this.generateCacheKey(Tn.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Tn.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Tn.NATIVE_REQUEST)),this.setInteractionInProgress(!1,void 0)}cacheAuthorizeRequest(e,n,o){this.logger.trace("1tzef5",n);const a=du(JSON.stringify(e));if(this.setTemporaryCache(Tn.REQUEST_PARAMS,a,!0),o){const l=du(o);this.setTemporaryCache(Tn.VERIFIER,l,!0)}}getCachedRequest(e){this.logger.trace("0uen20",e);const n=this.getTemporaryCache(Tn.REQUEST_PARAMS,e,!0);if(!n)throw Ce(nL);const o=this.getTemporaryCache(Tn.VERIFIER,e,!0);let a,l="";try{a=JSON.parse(xr(n)),o&&(l=xr(o))}catch{throw this.logger.errorPii("0ewsey",e),this.logger.error("0tvdic",e),Ce(rL)}return[a,l]}getCachedNativeRequest(){this.logger.trace("1yxcdm","");const e=this.getTemporaryCache(Tn.NATIVE_REQUEST,"",!0);if(!e)return this.logger.trace("0mnxd4",""),null;const n=this.validateAndParseJson(e);return n||(this.logger.error("0rrkip",""),null)}isInteractionInProgress(e){const n=this.getInteractionInProgress()?.clientId;return e?n===this.clientId:!!n}getInteractionInProgress(){const e=`${Bn}.${Tn.INTERACTION_STATUS_KEY}`,n=this.getTemporaryCache(e,"",!1);try{return n?JSON.parse(n):null}catch{return this.logger.error("0jjyys",""),this.removeTemporaryItem(e),this.resetRequestCache(""),kx(window),null}}setInteractionInProgress(e,n=na.SIGNIN,o=!1,a=""){const l=`${Bn}.${Tn.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())if(o)this.logger.warning("1pmscr",a),LL(this.logger,a),this.removeTemporaryItem(l);else throw Ce(qD);this.setTemporaryCache(l,JSON.stringify({clientId:this.clientId,type:n}),!1)}else!e&&this.getInteractionInProgress()?.clientId===this.clientId&&this.removeTemporaryItem(l)}async hydrateCache(e,n){const o=hb(e.account.homeAccountId,e.account.environment,e.idToken,this.clientId,e.tenantId),a=pb(e.account.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?lw(e.expiresOn):0,e.extExpiresOn?lw(e.extExpiresOn):0,xr,void 0,e.tokenType,void 0,n.sshKid),l={idToken:o,accessToken:a};return this.saveCacheRecord(l,e.correlationId,Ja(vi(e.idToken,xr)),bt.hydrateCache)}async saveCacheRecord(e,n,o,a,l){try{await super.saveCacheRecord(e,n,o,a,l)}catch(c){if(c instanceof gl&&this.performanceClient&&n)try{const d=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:d.refreshToken.length,cacheIdCount:d.idToken.length,cacheAtCount:d.accessToken.length},n)}catch{}throw c}}}function zw(t,e,n,o){try{switch(e){case Zr.LocalStorage:return new PU(t,n,o);case Zr.SessionStorage:return new DU;case Zr.MemoryStorage:default:break}}catch(a){n.error(a,"")}return new Vh}const UU=(t,e,n,o)=>{const a={cacheLocation:Zr.MemoryStorage,cacheRetentionDays:5};return new Zy(t,a,rh,e,n,o)};function zU(t,e,n,o,a){return t.verbose("1yd030",o),n?e.getAllAccounts(a,o):[]}function BU(t,e,n,o){if(e.trace("0u7b90",o),Object.keys(t).length===0)return e.warning("1kz0cu",o),null;const a=n.getAccountInfoFilteredBy(t,o);return a?(e.verbose("0btgll",o),a):(e.verbose("0ltaj5",o),null)}function HU(t,e,n){e.setActiveAccount(t,n)}function jU(t,e){return t.getActiveAccount(e)}const $U="msal.broadcast.event";class FU{constructor(e){this.eventCallbacks=new Map,this.logger=e||new mo({}),typeof BroadcastChannel<"u"&&(this.broadcastChannel=new BroadcastChannel($U)),this.invokeCrossTabCallbacks=this.invokeCrossTabCallbacks.bind(this)}addEventCallback(e,n,o){if(typeof window<"u"){const a=o||Xy();return this.eventCallbacks.has(a)?(this.logger.error("1578i0",""),null):(this.eventCallbacks.set(a,[e,n||[]]),this.logger.verbose("1cnec4",""),a)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose("12zotd","")}emitEvent(e,n,o,a,l){const c={eventType:e,interactionType:o||null,payload:a||null,error:l||null,correlationId:n,timestamp:Date.now()};switch(e){case Pe.LOGIN_SUCCESS:case Pe.LOGOUT_SUCCESS:case Pe.ACTIVE_ACCOUNT_CHANGED:this.broadcastChannel?.postMessage(c)}this.invokeCallbacks(c)}invokeCallbacks(e){this.eventCallbacks.forEach(([n,o],a)=>{(o.length===0||o.includes(e.eventType))&&(this.logger.verbose("15jpwk",""),n.apply(null,[e]))})}invokeCrossTabCallbacks(e){const n=e.data;this.invokeCallbacks(n)}subscribeCrossTab(){this.broadcastChannel?.addEventListener("message",this.invokeCrossTabCallbacks)}unsubscribeCrossTab(){this.broadcastChannel?.removeEventListener("message",this.invokeCrossTabCallbacks)}}class zx{constructor(e,n,o,a,l,c,d,f,h){this.config=e,this.browserStorage=n,this.browserCrypto=o,this.networkClient=this.config.system.networkClient,this.eventHandler=l,this.navigationClient=c,this.platformAuthProvider=h,this.correlationId=f,this.logger=a.clone(Yr.MSAL_SKU,ss),this.performanceClient=d}}function uh(t,e,n,o){n.verbose("0bd1la",o);const a=t||e||"";return At.getAbsoluteUrl(a,aa())}function ur(t,e,n,o,a,l){a.verbose("1p12tq",n);const c={clientId:e,correlationId:n,apiId:t,forceRefresh:!1,wrapperSKU:o.getWrapperMetadata()[0],wrapperVer:o.getWrapperMetadata()[1]};return new uu(c,o)}async function bi(t,e,n,o,a,l,c,d,f){const h=d&&d.hasOwnProperty("instance_aware")?d.instance_aware:void 0,m={protocolMode:t.system.protocolMode,OIDCOptions:t.auth.OIDCOptions,knownAuthorities:t.auth.knownAuthorities,cloudDiscoveryMetadata:t.auth.cloudDiscoveryMetadata,authorityMetadata:t.auth.authorityMetadata},y=l||t.auth.authority,v=h?.length?h==="true":t.auth.instanceAware,C=f&&v?t.auth.authority.replace(At.getDomainFromUrl(y),f.environment):y,b=sr.generateAuthority(C,c||t.auth.azureCloudOptions),T=await se(fx,oU,a,n,e)(b,t.system.networkClient,o,m,a,e,n);if(f&&!T.isAlias(f.environment))throw Gt(DN);return T}async function Mb(t,e,n,o,a){if(a)try{t.removeAccount(a,o),n.verbose("0s4z6h",o)}catch{n.error("0mgg1d",o)}else try{n.verbose("0zj631",o),t.clear(o),await e.clearKeystore(o)}catch{n.error("12ih0c",o)}}async function Nb(t,e,n,o,a){const l=t.authority||e.auth.authority,c=[...t&&t.scopes||[]],d={...t,correlationId:t.correlationId,authority:l,scopes:c};if(!d.authenticationScheme)d.authenticationScheme=Nt.BEARER,o.verbose("1l4fwv",a);else{if(d.authenticationScheme===Nt.SSH){if(!t.sshJwk)throw Gt(Yv);if(!t.sshKid)throw Gt(MN)}o.verbose("1ecmns",a)}return d}async function KU(t,e,n,o,a){const l=await se(Nb,_b,a,o,t.correlationId)(t,n,o,a,t.correlationId);return{...t,...l,account:e,forceRefresh:t.forceRefresh||!1}}function Bx(t,e){let n;const o=t.httpMethod;if(e===cr.EAR){if(o&&o!==pl.POST)throw Gt(LN);n=pl.POST}else n=o||pl.GET;return n}class Ul extends zx{initializeLogoutRequest(e){this.logger.verbose("0546u4",this.correlationId);const n={correlationId:this.correlationId,...e};if(e)if(e.logoutHint)this.logger.verbose("12k4l4",this.correlationId);else if(e.account){const o=this.getLogoutHintFromIdTokenClaims(e.account);o&&(this.logger.verbose("0st5di",this.correlationId),n.logoutHint=o)}else this.logger.verbose("0pdtc3",this.correlationId);else this.logger.verbose("07ndze",this.correlationId);return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("1vamm6",n.correlationId),n.postLogoutRedirectUri=At.getAbsoluteUrl(e.postLogoutRedirectUri,aa())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("15m5g7",n.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("1f4xlz",n.correlationId),n.postLogoutRedirectUri=At.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,aa())):(this.logger.verbose("17s5rf",n.correlationId),n.postLogoutRedirectUri=At.getAbsoluteUrl(aa(),aa())):this.logger.verbose("0ljv63",n.correlationId),n}getLogoutHintFromIdTokenClaims(e){const n=e.idTokenClaims;if(n){if(n.login_hint)return n.login_hint;this.logger.verbose("0mvp54",this.correlationId)}else this.logger.verbose("1e7bdp",this.correlationId);return null}async createAuthCodeClient(e){const n=await se(this.getClientConfiguration.bind(this),Fh,this.logger,this.performanceClient,this.correlationId)(e);return new hx(n,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:n,requestAuthority:o,requestAzureCloudOptions:a,requestExtraQueryParameters:l,account:c}=e,d=e.authority||await se(bi,Za,this.logger,this.performanceClient,this.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,a,l,c),f=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:f.loggerCallback,piiLoggingEnabled:f.piiLoggingEnabled,logLevel:f.logLevel,correlationId:this.correlationId},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:n,libraryInfo:{sku:Yr.MSAL_SKU,version:ss,cpu:"",os:""},telemetry:this.config.telemetry}}}async function Gh(t,e,n,o,a,l,c,d){const f=uh(t.redirectUri,n.auth.redirectUri,l,d),h={interactionType:e},m=$P(o,t&&t.state||"",h),v={...await se(Nb,_b,l,c,d)({...t,correlationId:d},n,c,l,d),redirectUri:f,state:m,nonce:t.nonce||is(),responseMode:n.auth.OIDCOptions.responseMode},C={...v,httpMethod:Bx(v,n.system.protocolMode)};if(t.loginHint||t.sid)return C;const b=t.account||a.getActiveAccount(d);return b&&(l.verbose("1eqlb3",d),l.verbosePii("0tf99t",d),C.account=b),C}function VU(t,e){if(!e)return null;try{return Ru(t.base64Decode,e).libraryState.meta}catch{throw he(lu)}}function nu(t,e,n,o){const a=nh(t);if(!a)throw Y1(t)?(n.error("13pl0s",o),n.errorPii("1097vx",o),Ce(VD)):(n.error("18h0l1",o),Ce(KD));return a}function GU(t,e,n){if(!t.state)throw Ce(bb);const o=VU(e,t.state);if(!o)throw Ce(Sx);if(o.interactionType!==n)throw Ce(GD)}class Hx{constructor(e,n,o,a,l){this.authModule=e,this.browserStorage=n,this.authCodeRequest=o,this.logger=a,this.performanceClient=l}async handleCodeResponse(e,n,o){let a;try{a=ID(e,n.state)}catch(l){throw l instanceof ps&&l.subError===Wy?Ce(Wy):l}return se(this.handleCodeResponseFromServer.bind(this),ix,this.logger,this.performanceClient,n.correlationId)(a,n,o)}async handleCodeResponseFromServer(e,n,o,a=!0){if(this.logger.trace("0mf2hb",n.correlationId),this.authCodeRequest.code=e.code,a&&(e.nonce=n.nonce||void 0),e.state=n.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const c=this.createCcsCredentials(n);c&&(this.authCodeRequest.ccsCredential=c)}return await se(this.authModule.acquireToken.bind(this.authModule),rU,this.logger,this.performanceClient,n.correlationId)(this.authCodeRequest,o,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:po.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:po.UPN}:null}}const qU="ContentError",YU="PageException",WU="user_switch";const QU="USER_INTERACTION_REQUIRED",XU="USER_CANCEL",JU="NO_NETWORK",ZU="PERSISTENT_ERROR",ez="DISABLED",tz="ACCOUNT_UNAVAILABLE",nz="UX_NOT_ALLOWED";const rz=-2147186943;class Lo extends Kt{constructor(e,n,o){super(e,n||jh(e)),Object.setPrototypeOf(this,Lo.prototype),this.name="NativeAuthError",this.ext=o}}function sl(t){if(t.ext&&t.ext.status&&(t.ext.status===ZU||t.ext.status===ez)||t.ext&&t.ext.error&&t.ext.error===rz)return!0;switch(t.errorCode){case qU:case YU:return!0;default:return!1}}function dh(t,e,n){if(n&&n.status)switch(n.status){case tz:return ah(UP,jh(t));case QU:return new yo(t,e);case XU:return Ce(Wy);case JU:return Ce(Qy);case nz:return ah(rx)}return new Lo(t,e,n)}class jx extends Ul{async acquireToken(e){const n=ur(bt.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),o=await se(this.getClientConfiguration.bind(this),Fh,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:n,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),a=new xD(o,this.performanceClient);this.logger.verbose("0wa871",this.correlationId);try{const c=(await se(a.acquireCachedToken.bind(a),eU,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),c}catch(l){throw l instanceof _u&&l.errorCode===Ex&&this.logger.verbose("06wena",this.correlationId),l}}logout(e){this.logger.verbose("1rkurh",this.correlationId);const n=this.initializeLogoutRequest(e);return Mb(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,n.account)}}class Lf extends zx{constructor(e,n,o,a,l,c,d,f,h,m,y,v){super(e,n,o,a,l,c,f,v,h),this.apiId=d,this.accountId=m,this.platformAuthProvider=h,this.nativeStorageManager=y,this.silentCacheClient=new jx(e,this.nativeStorageManager,o,a,l,c,f,v,h);const C=this.platformAuthProvider.getExtensionName();this.skus=uu.makeExtraSkuString({libraryName:Yr.MSAL_SKU,libraryVersion:ss,extensionName:C,extensionVersion:this.platformAuthProvider.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[CN]:this.skus}}async acquireToken(e,n){this.logger.trace("03qeos",this.correlationId);const o=this.performanceClient.startMeasurement(Dx,e.correlationId),a=vo(),l=ur(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const c=await this.initializeNativeRequest(e);try{const f=await this.acquireTokensFromCache(this.accountId,c);return o.end({success:!0,isNativeBroker:!1,fromCache:!0}),f}catch(f){if(n===Xn.AccessToken)throw this.logger.info("0eitbc",this.correlationId),f;this.logger.info("0957j1",this.correlationId)}const d=await this.platformAuthProvider.sendMessage(c);return await this.handleNativeResponse(d,c,a).then(f=>(o.end({success:!0,isNativeBroker:!0,requestId:f.requestId}),l.clearNativeBrokerErrorCode(),f)).catch(f=>{throw o.end({success:!1,errorCode:f.errorCode,subErrorCode:f.subError,isNativeBroker:!0}),f})}catch(c){throw c instanceof Lo&&l.setNativeBrokerErrorCode(c.errorCode),c}}createSilentCacheRequest(e,n){return{authority:e.authority,correlationId:this.correlationId,scopes:qn.fromString(e.scope).asArray(),account:n,forceRefresh:!1}}async acquireTokensFromCache(e,n){if(!e)throw this.logger.warning("1ndf3e",this.correlationId),he(ew);const o=this.browserStorage.getBaseAccountInfo({nativeAccountId:e},n.correlationId);if(!o)throw he(ew);try{const a=this.createSilentCacheRequest(n,o),l=await this.silentCacheClient.acquireToken(a),c={...o,idTokenClaims:l?.idTokenClaims,idToken:l?.idToken};return{...l,account:c}}catch(a){throw a}}async acquireTokenRedirect(e,n,o){this.logger.trace("0luikq",this.correlationId);const a=await this.initializeNativeRequest(e),l=o?.navigateToLoginRequestUrl??!0;try{await this.platformAuthProvider.sendMessage(a)}catch(f){if(f instanceof Lo&&(ur(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).setNativeBrokerErrorCode(f.errorCode),sl(f)))throw f}this.browserStorage.setTemporaryCache(Tn.NATIVE_REQUEST,JSON.stringify(a),!0);const c={apiId:bt.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=l?window.location.href:uh(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId);n.end({success:!0}),await this.navigationClient.navigateExternal(d,c)}async handleRedirectPromise(e,n){if(this.logger.trace("1c5lhw",this.correlationId),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",this.correlationId),null;const o=this.browserStorage.getCachedNativeRequest();if(!o)return this.logger.verbose("0a6zjb",this.correlationId),e&&n&&e?.addFields({errorCode:"no_cached_request"},n),null;const{prompt:a,...l}=o;a&&this.logger.verbose("0ac34v",this.correlationId),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Tn.NATIVE_REQUEST));const c=vo();try{this.logger.verbose("003x5a",this.correlationId);const d=await this.platformAuthProvider.sendMessage(l),f=await this.handleNativeResponse(d,l,c);return ur(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger).clearNativeBrokerErrorCode(),f}catch(d){throw d}}logout(){return this.logger.trace("0u2sjm",this.correlationId),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,n,o){this.logger.trace("1bojln",this.correlationId);const a=vi(e.id_token,xr),l=this.createHomeAccountIdentifier(e,a),c=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:n.accountId},this.correlationId)?.homeAccountId;if(n.extraParameters?.child_client_id&&e.account.id!==n.accountId)this.logger.info("1ub1in",this.correlationId);else if(l!==c&&e.account.id!==n.accountId)throw dh(WU);const d=await bi(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,n.authority),f=ax(this.browserStorage,d,l,xr,this.correlationId,a,e.client_info,void 0,a.tid,void 0,e.account.id);e.expires_in=Number(e.expires_in);const h=await this.generateAuthenticationResult(e,n,a,f,d.canonicalAuthority,o);return await this.cacheAccount(f,Ja(a)),await this.cacheNativeTokens(e,n,l,a,e.access_token,h.tenantId,o),h}createHomeAccountIdentifier(e,n){return J1(e.client_info||"",fo.Default,this.logger,this.browserCrypto,this.correlationId,n)}generateScopes(e,n){return n?qn.fromString(n):qn.fromString(e)}async generatePopAccessToken(e,n){if(n.tokenType===Nt.POP&&n.signPopToken){if(e.shr)return this.logger.trace("0coqhu",this.correlationId),e.shr;const o=new Al(this.browserCrypto,this.performanceClient),a={resourceRequestMethod:n.resourceRequestMethod,resourceRequestUri:n.resourceRequestUri,shrClaims:n.shrClaims,shrNonce:n.shrNonce,correlationId:this.correlationId};if(!n.keyId)throw he(z1);return o.signPopToken(e.access_token,n.keyId,a)}else return e.access_token}async generateAuthenticationResult(e,n,o,a,l,c){const d=this.addTelemetryFromNativeResponse(e.properties.MATS),f=this.generateScopes(n.scope,e.scope),h=e.account.properties||{},m=h.UID||o.oid||o.sub||"",y=h.TenantId||o.tid||"",v=ab(rs(a),void 0,o,e.id_token);v.nativeAccountId!==e.account.id&&(v.nativeAccountId=e.account.id);const C=await this.generatePopAccessToken(e,n),b=n.tokenType===Nt.POP?Nt.POP:Nt.BEARER;return{authority:l,uniqueId:m,tenantId:y,scopes:f.asArray(),account:v,idToken:e.id_token,idTokenClaims:o,accessToken:C,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:Mf(c+e.expires_in),tokenType:b,correlationId:this.correlationId,state:e.state,fromPlatformBroker:!0}}async cacheAccount(e,n){await this.browserStorage.setAccount(e,this.correlationId,n,this.apiId),this.browserStorage.removeAccountContext(rs(e),this.correlationId)}cacheNativeTokens(e,n,o,a,l,c,d){const f=hb(o,n.authority,e.id_token||"",n.clientId,a.tid||""),h=n.tokenType===Nt.POP?KT:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,m=d+h,y=this.generateScopes(e.scope,n.scope),v=pb(o,n.authority,l,n.clientId,a.tid||c,y.printScopes(),m,0,xr,void 0,n.tokenType,void 0,n.keyId),C={idToken:f,accessToken:v};return this.nativeStorageManager.saveCacheRecord(C,this.correlationId,Ja(a),this.apiId,n.storeInCache)}getExpiresInValue(e,n){return e===Nt.POP?KT:(typeof n=="string"?parseInt(n,10):n)||0}addTelemetryFromNativeResponse(e){const n=this.getMATSFromResponse(e);return n?(this.performanceClient.addFields({extensionId:this.platformAuthProvider.getExtensionId(),extensionVersion:this.platformAuthProvider.getExtensionVersion(),matsBrokerVersion:n.broker_version,matsAccountJoinOnStart:n.account_join_on_start,matsAccountJoinOnEnd:n.account_join_on_end,matsDeviceJoin:n.device_join,matsPromptBehavior:n.prompt_behavior,matsApiErrorCode:n.api_error_code,matsUiVisible:n.ui_visible,matsSilentCode:n.silent_code,matsSilentBiSubCode:n.silent_bi_sub_code,matsSilentMessage:n.silent_message,matsSilentStatus:n.silent_status,matsHttpStatus:n.http_status,matsHttpEventCount:n.http_event_count},this.correlationId),n):null}getMATSFromResponse(e){if(e)try{return JSON.parse(e)}catch{this.logger.error("0b3l57",this.correlationId)}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("1okqev",this.correlationId),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("04j6wj",this.correlationId);const n=await this.getCanonicalAuthority(e),{scopes:o,...a}=e,l=new qn(o||[]);l.appendScopes(Pl);const c={...a,accountId:this.accountId,clientId:this.config.auth.clientId,authority:n.urlString,scope:l.printScopes(),redirectUri:uh(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId),prompt:this.getPrompt(e.prompt),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraParameters},extendedExpiryToken:!1,keyId:e.popKid};if(c.signPopToken&&e.popKid)throw Ce(pL);if(this.handleExtraBrokerParams(c),c.extraParameters=c.extraParameters||{},c.extraParameters.telemetry=Wr.MATS_TELEMETRY,e.authenticationScheme===Nt.POP){const d={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce,correlationId:this.correlationId},f=new Al(this.browserCrypto,this.performanceClient);let h;if(c.keyId)h=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:c.keyId})),c.signPopToken=!1;else{const m=await se(f.generateCnf.bind(f),xu,this.logger,this.performanceClient,this.correlationId)(d,this.logger);h=m.reqCnfString,c.keyId=m.kid,c.signPopToken=!0}c.reqCnf=h}return this.addRequestSKUs(c),c}async getCanonicalAuthority(e){const n=e.authority||this.config.auth.authority,{azureCloudOptions:o,account:a}=e;a&&await bi(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,n,o,void 0,a);const l=new At(n);return l.validateAsUri(),l}getPrompt(e){switch(this.apiId){case bt.ssoSilent:case bt.acquireTokenSilent_silentFlow:return this.logger.trace("1hiwaz",this.correlationId),lr.NONE}if(!e){this.logger.trace("1qlu04",this.correlationId);return}switch(e){case lr.NONE:case lr.CONSENT:case lr.LOGIN:return this.logger.trace("1ynje4",this.correlationId),e;default:throw this.logger.trace("0nkr6q",this.correlationId),Ce(fL)}}handleExtraBrokerParams(e){const n=e.extraParameters&&e.extraParameters.hasOwnProperty(Zf)&&e.extraParameters.hasOwnProperty(eh)&&e.extraParameters.hasOwnProperty(ns);if(!e.embeddedClientId&&!n)return;let o="";const a=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,o=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[eh],o=e.extraParameters[ns]),e.extraParameters={child_client_id:o,child_redirect_uri:a},this.performanceClient?.addFields({embeddedClientId:o,embeddedRedirectUri:a},e.correlationId)}}async function Pb(t,e,n,o,a){const l=OD({...t.auth,authority:e},n,o,a);if(eb(l,{sku:Yr.MSAL_SKU,version:ss,os:"",cpu:""}),t.system.protocolMode!==cr.OIDC&&tb(l,t.telemetry.application),n.platformBroker&&(tP(l),n.authenticationScheme===Nt.POP)){const c=new Ei(o,a),d=new Al(c,a);let f;n.popKid?f=c.encodeKid(n.popKid):f=(await se(d.generateCnf.bind(d),xu,o,a,n.correlationId)(n,o)).reqCnfString,ob(l,f)}return Ph(l,n.correlationId,a),l}async function Db(t,e,n,o,a){if(!n.codeChallenge)throw Gt(I1);const l=await se(Pb,tU,o,a,n.correlationId)(t,e,n,o,a);return Wv(l,$v.CODE),nb(l,n.codeChallenge,jv),zo(l,{...n.extraQueryParameters,...n.extraParameters}),gb(e,l)}async function Lb(t,e,n,o,a,l){if(!o.earJwk)throw Ce(bx);const c=await Pb(e,n,o,a,l);Wv(c,$v.IDTOKEN_TOKEN_REFRESHTOKEN),fP(c,o.earJwk),nb(c,o.codeChallenge,jv),zo(c,{...o.extraParameters});const d=new Map;zo(d,o.extraQueryParameters||{}),wu(d,o.correlationId);const f=gb(n,d);return $x(t,f,c)}async function Ub(t,e,n,o,a,l){const c=await Pb(e,n,o,a,l);Wv(c,$v.CODE),nb(c,o.codeChallenge,o.codeChallengeMethod||jv),zo(c,{...o.extraParameters});const d=new Map;zo(d,o.extraQueryParameters||{}),wu(d,o.correlationId);const f=gb(n,d);return $x(t,f,c)}function $x(t,e,n){const o=t.createElement("form");return o.method="post",o.action=e,n.forEach((a,l)=>{const c=t.createElement("input");c.hidden=!0,c.name=l,c.value=a,o.appendChild(c)}),t.body.appendChild(o),o}async function Fx(t,e,n,o,a,l,c,d,f,h){if(d.verbose("11qcow",t.correlationId),!h)throw Ce(wx);const m=new Ei(d,f),y=new Lf(o,a,m,d,c,o.system.navigationClient,n,f,h,e,l,t.correlationId),{userRequestState:v}=Ru(m.base64Decode,t.state);return se(y.acquireToken.bind(y),Dx,d,f,t.correlationId)({...t,state:v,prompt:void 0})}async function Sl(t,e,n,o,a,l,c,d,f,h,m,y){if(Do.removeThrottle(c,a.auth.clientId,t),e.accountId)return se(Fx,Lx,h,m,t.correlationId)(t,e.accountId,o,a,c,d,f,h,m,y);const v={...t,code:e.code||"",codeVerifier:n},C=new Hx(l,c,v,h,m);return await se(C.handleCodeResponse.bind(C),nU,h,m,t.correlationId)(e,t,o)}async function zb(t,e,n,o,a,l,c,d,f,h,m){if(Do.removeThrottle(l,o.auth.clientId,t),px(e,t.state),!e.ear_jwe)throw Ce(FD);if(!t.earJwk)throw Ce(bx);const y=JSON.parse(await se(OL,vU,f,h,t.correlationId)(t.earJwk,e.ear_jwe));if(y.accountId)return se(Fx,Lx,f,h,t.correlationId)(t,y.accountId,n,o,l,c,d,f,h,m);const v=new os(o.auth.clientId,l,new Ei(f,h),f,h,null,null);v.validateTokenResponse(y,t.correlationId);const C={code:"",state:t.state,nonce:t.nonce,client_info:y.client_info,cloud_graph_host_name:y.cloud_graph_host_name,cloud_instance_host_name:y.cloud_instance_host_name,cloud_instance_name:y.cloud_instance_name,msgraph_host:y.msgraph_host};return await se(v.handleServerTokenResponse.bind(v),fb,f,h,t.correlationId)(y,a,vo(),t,n,C,void 0,void 0,void 0,void 0)}const oz=32;async function ls(t,e,n){const o=go(iz,uU,e,t,n)(t,e,n),a=await se(az,dU,e,t,n)(o,t,e,n);return{verifier:o,challenge:a}}function iz(t,e,n){try{const o=new Uint8Array(oz);return go(wL,hU,e,t,n)(o),ha(o)}catch{throw Ce(vx)}}async function az(t,e,n,o){try{const a=await se(xx,fU,n,e,o)(t);return ha(new Uint8Array(a))}catch{throw Ce(vx)}}class fh{navigateInternal(e,n){return fh.defaultNavigateWindow(e,n)}navigateExternal(e,n){return fh.defaultNavigateWindow(e,n)}static defaultNavigateWindow(e,n){return n.noHistory?window.location.replace(e):window.location.assign(e),new Promise((o,a)=>{setTimeout(()=>{a(Ce(lh,"failed_to_redirect"))},n.timeout)})}}class sz{async sendGetRequestAsync(e,n){let o,a={},l=0;const c=Bw(n);try{o=await fetch(e,{method:vw.GET,headers:c})}catch(d){throw qc(Ce(window.navigator.onLine?iL:Qy),void 0,void 0,d)}a=Hw(o.headers);try{return l=o.status,{headers:a,body:await o.json(),status:l}}catch(d){throw qc(Ce(Ew),l,a,d)}}async sendPostRequestAsync(e,n){const o=n&&n.body||"",a=Bw(n);let l,c=0,d={};try{l=await fetch(e,{method:vw.POST,headers:a,body:o})}catch(f){throw qc(Ce(window.navigator.onLine?oL:Qy),void 0,void 0,f)}d=Hw(l.headers);try{return c=l.status,{headers:d,body:await l.json(),status:c}}catch(f){throw qc(Ce(Ew),c,d,f)}}}function Bw(t){try{const e=new Headers;if(!(t&&t.headers))return e;const n=t.headers;return Object.entries(n).forEach(([o,a])=>{e.append(o,a)}),e}catch(e){throw qc(Ce(gL),void 0,void 0,e)}}function Hw(t){try{const e={};return t.forEach((n,o)=>{e[o]=n}),e}catch{throw Ce(mL)}}const lz=6e4,cz=1e4,uz=3e4,Kx=2e3;function dz({auth:t,cache:e,system:n,telemetry:o},a){const l={clientId:"",authority:`${m1}`,knownAuthorities:[],cloudDiscoveryMetadata:"",authorityMetadata:"",redirectUri:typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:"",postLogoutRedirectUri:"",clientCapabilities:[],OIDCOptions:{responseMode:Fv.FRAGMENT,defaultScopes:[v1,b1,Hv]},azureCloudOptions:{azureCloudInstance:ib.None,tenant:""},instanceAware:!1},c={cacheLocation:Zr.SessionStorage,cacheRetentionDays:5},d={loggerCallback:()=>{},logLevel:Mt.Info,piiLoggingEnabled:!1},h={...{...ex,loggerOptions:d,networkClient:a?new sz:_D,navigationClient:new fh,popupBridgeTimeout:n?.popupBridgeTimeout||lz,iframeBridgeTimeout:n?.iframeBridgeTimeout||cz,redirectNavigationTimeout:uz,allowRedirectInIframe:!1,navigatePopups:!0,allowPlatformBroker:!1,nativeBrokerHandshakeTimeout:n?.nativeBrokerHandshakeTimeout||Kx,protocolMode:cr.AAD},...n,loggerOptions:n?.loggerOptions||d},m={application:{appName:"",appVersion:""},client:new Z1};if(n?.protocolMode!==cr.OIDC&&t?.OIDCOptions&&new mo(h.loggerOptions).warning(JSON.stringify(Gt(NN)),""),n?.protocolMode&&n.protocolMode===cr.OIDC&&h?.allowPlatformBroker)throw Gt(PN);return{auth:{...l,...t,OIDCOptions:{...l.OIDCOptions,...t?.OIDCOptions}},cache:{...c,...e},system:h,telemetry:{...m,...o}}}class hh{constructor(e,n,o,a){this.logger=e,this.handshakeTimeoutMs=n,this.extensionId=a,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=o,this.handshakeEvent=o.startMeasurement(lU),this.platformAuthType=Wr.PLATFORM_EXTENSION_PROVIDER}async sendMessage(e){this.logger.trace("0on4p2",e.correlationId);const n={method:Pc.GetToken,request:e},o={channel:Wr.CHANNEL_ID,extensionId:this.extensionId,responseId:is(),body:n};this.logger.trace("1qadfi",e.correlationId),this.logger.tracePii("1xm533",e.correlationId),this.messageChannel.port1.postMessage(o);const a=await new Promise((c,d)=>{this.resolvers.set(o.responseId,{resolve:c,reject:d})});return this.validatePlatformBrokerResponse(a)}static async createProvider(e,n,o,a){e.trace("15zfnw",a);try{const l=new hh(e,n,o,Wr.PREFERRED_EXTENSION_ID);return await l.sendHandshakeRequest(a),l}catch{const c=new hh(e,n,o);return await c.sendHandshakeRequest(a),c}}async sendHandshakeRequest(e){this.logger.trace("1dpg9o",e),window.addEventListener("message",this.windowListener,!1);const n={channel:Wr.CHANNEL_ID,extensionId:this.extensionId,responseId:is(),body:{method:Pc.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=o=>{this.onChannelMessage(o)},window.postMessage(n,window.origin,[this.messageChannel.port2]),new Promise((o,a)=>{this.handshakeResolvers.set(n.responseId,{resolve:o,reject:a}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),a(Ce(uL)),this.handshakeResolvers.delete(n.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){const n=Xy();if(this.logger.trace("0jpn5u",n),e.source!==window)return;const o=e.data;if(!(!o.channel||o.channel!==Wr.CHANNEL_ID)&&!(o.extensionId&&o.extensionId!==this.extensionId)&&o.body.method===Pc.HandshakeRequest){const a=this.handshakeResolvers.get(o.responseId);if(!a){this.logger.trace("07buhm",n);return}this.logger.verbose(o.extensionId?"0xrkug":"No extension installed",n),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),a.reject(Ce(dL))}}onChannelMessage(e){const n=Xy();this.logger.trace("1py8yf",n);const o=e.data,a=this.resolvers.get(o.responseId),l=this.handshakeResolvers.get(o.responseId);try{const c=o.body.method;if(c===Pc.Response){if(!a)return;const d=o.body.response;if(this.logger.trace("19hpgm",n),this.logger.tracePii("179a24",n),d.status!=="Success")a.reject(dh(d.code,d.description,d.ext));else if(d.result)d.result.code&&d.result.description?a.reject(dh(d.result.code,d.result.description,d.result.ext)):a.resolve(d.result);else throw $y(qy,"Event does not contain result.");this.resolvers.delete(o.responseId)}else if(c===Pc.HandshakeResponse){if(!l){this.logger.trace("082qnt",n);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=o.extensionId,this.extensionVersion=o.body.version,this.logger.verbose("0yf5ib",n),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),l.resolve(),this.handshakeResolvers.delete(o.responseId)}}catch(c){this.logger.error("0xf978",n),this.logger.errorPii("04i99o",n),this.logger.errorPii("0xdvsy",n),a?a.reject(c):l&&l.reject(c)}}validatePlatformBrokerResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw $y(qy,"Response missing expected properties.")}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}getExtensionName(){return this.getExtensionId()===Wr.PREFERRED_EXTENSION_ID?"chrome":this.getExtensionId()?.length?"unknown":void 0}}class Bb{constructor(e,n,o){this.logger=e,this.performanceClient=n,this.correlationId=o,this.platformAuthType=Wr.PLATFORM_DOM_PROVIDER}static async createProvider(e,n,o){if(e.trace("12mj4a",o),window.navigator?.platformAuthentication&&(await window.navigator.platformAuthentication.getSupportedContracts(Wr.MICROSOFT_ENTRA_BROKERID))?.includes(Wr.PLATFORM_DOM_APIS))return e.trace("1h5q1r",o),new Bb(e,n,o)}getExtensionId(){return Wr.MICROSOFT_ENTRA_BROKERID}getExtensionVersion(){return""}getExtensionName(){return Wr.DOM_API_NAME}async sendMessage(e){this.logger.trace("02bcil",e.correlationId);try{const n=this.initializePlatformDOMRequest(e),o=await window.navigator.platformAuthentication.executeGetToken(n);return this.validatePlatformBrokerResponse(o,e.correlationId)}catch(n){throw this.logger.error("11im7g",e.correlationId),n}}initializePlatformDOMRequest(e){this.logger.trace("15d6yv",e.correlationId);const{accountId:n,clientId:o,authority:a,scope:l,redirectUri:c,correlationId:d,state:f,storeInCache:h,embeddedClientId:m,extraParameters:y,...v}=e,C=this.getDOMExtraParams(v);return{accountId:n,brokerId:this.getExtensionId(),authority:a,clientId:o,correlationId:d||this.correlationId,extraParameters:{...y,...C},isSecurityTokenService:!1,redirectUri:c,scope:l,state:f,storeInCache:h,embeddedClientId:m}}validatePlatformBrokerResponse(e,n){if(e.hasOwnProperty("isSuccess")){if(e.hasOwnProperty("accessToken")&&e.hasOwnProperty("idToken")&&e.hasOwnProperty("clientInfo")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scopes")&&e.hasOwnProperty("expiresIn"))return this.logger.trace("0h4vei",n),this.convertToPlatformBrokerResponse(e,n);if(e.hasOwnProperty("error")){const o=e;if(o.isSuccess===!1&&o.error&&o.error.code)throw this.logger.trace("0g92vm",n),dh(o.error.code,o.error.description,{error:parseInt(o.error.errorCode),protocol_error:o.error.protocolError,status:o.error.status,properties:o.error.properties})}}throw $y(qy,"Response missing expected properties.")}convertToPlatformBrokerResponse(e,n){return this.logger.trace("14913t",n),{access_token:e.accessToken,id_token:e.idToken,client_info:e.clientInfo,account:e.account,expires_in:e.expiresIn,scope:e.scopes,state:e.state||"",properties:e.properties||{},extendedLifetimeToken:e.extendedLifetimeToken??!1,shr:e.proofOfPossessionPayload}}getDOMExtraParams(e){return{...Object.entries(e).reduce((a,[l,c])=>(a[l]=String(c),a),{})}}}async function fz(t,e,n,o){t.trace("134j0v",n);const a=hz();t.trace("04c81g",n);let l;try{a&&(l=await Bb.createProvider(t,e,n)),l||(t.trace("0l3na8",n),l=await hh.createProvider(t,o||Kx,e,n))}catch(c){t.trace("0icbd7",c)}return l}function hz(){let t;try{return t=window[Zr.SessionStorage],t?.getItem(IU)==="true"}catch{return!1}}function fu(t,e,n,o,a){if(e.trace("0uko3r",n),!t.system.allowPlatformBroker)return e.trace("04hozs",n),!1;if(!o)return e.trace("0kvv1r",n),!1;if(a)switch(a){case Nt.BEARER:case Nt.POP:return e.trace("18tev1",n),!0;default:return e.trace("1dd2nh",n),!1}return!0}class pz extends Ul{constructor(e,n,o,a,l,c,d,f,h,m){super(e,n,o,a,l,c,d,h,m),this.nativeStorage=f,this.eventHandler=l}acquireToken(e,n){let o;try{if(o={popupName:this.generatePopupName(e.scopes||Pl,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window},this.performanceClient.addFields({isAsyncPopup:!this.config.system.navigatePopups},this.correlationId),this.config.system.navigatePopups){const l={...e,httpMethod:Bx(e,this.config.system.protocolMode)};return this.logger.verbose("1f9ok3",this.correlationId),o.popup=this.openSizedPopup("about:blank",o),this.acquireTokenPopupAsync(l,o,n)}else return this.logger.verbose("162h4u",this.correlationId),this.acquireTokenPopupAsync(e,o,n)}catch(a){return Promise.reject(a)}}logout(e){try{this.logger.verbose("068rup",this.correlationId);const n=this.initializeLogoutRequest(e),o={popupName:this.generateLogoutPopupName(n),popupWindowAttributes:e?.popupWindowAttributes||{},popupWindowParent:e?.popupWindowParent??window},a=e&&e.authority,l=e&&e.mainWindowRedirectUri;return this.config.system.navigatePopups?(this.logger.verbose("1a28da",this.correlationId),o.popup=this.openSizedPopup("about:blank",o),this.logoutPopupAsync(n,o,a,l)):(this.logger.verbose("1phd8u",this.correlationId),this.logoutPopupAsync(n,o,a,l))}catch(n){return Promise.reject(n)}}async acquireTokenPopupAsync(e,n,o){this.logger.verbose("1g77pg",this.correlationId);const a=await se(Gh,Kh,this.logger,this.performanceClient,this.correlationId)(e,ze.Popup,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);n.popup&&Px(a.authority);const l=fu(this.config,this.logger,this.correlationId,this.platformAuthProvider,e.authenticationScheme);return a.platformBroker=l,this.config.system.protocolMode===cr.EAR?this.executeEarFlow(a,n,o):this.executeCodeFlow(a,n,o)}async executeCodeFlow(e,n,o){const a=e.correlationId,l=ur(bt.acquireTokenPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),c=o||await se(ls,as,this.logger,this.performanceClient,a)(this.performanceClient,this.logger,a),d={...e,codeChallenge:c.challenge};try{const f=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,a)({serverTelemetryManager:l,requestAuthority:d.authority,requestAzureCloudOptions:d.azureCloudOptions,requestExtraQueryParameters:d.extraQueryParameters,account:d.account});if(d.httpMethod===pl.POST)return await this.executeCodeFlowWithPost(d,n,f,c.verifier);{const h=await se(Db,db,this.logger,this.performanceClient,a)(this.config,f.authority,d,this.logger,this.performanceClient),m=this.initiateAuthRequest(h,n);this.eventHandler.emitEvent(Pe.POPUP_OPENED,a,ze.Popup,{popupWindow:m},null);const y=await dl(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e),v=go(nu,tu,this.logger,this.performanceClient,this.correlationId)(y,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return await se(Sl,yl,this.logger,this.performanceClient,a)(e,v,c.verifier,bt.acquireTokenPopup,this.config,f,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}catch(f){throw n.popup?.close(),f instanceof Kt&&(f.setCorrelationId(this.correlationId),l.cacheFailedRequest(f)),f}}async executeEarFlow(e,n,o){const{correlationId:a,authority:l,azureCloudOptions:c,extraQueryParameters:d,account:f}=e,h=await se(bi,Za,this.logger,this.performanceClient,a)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,l,c,d,f),m=await se(Ab,Ib,this.logger,this.performanceClient,a)(),y=o||await se(ls,as,this.logger,this.performanceClient,a)(this.performanceClient,this.logger,a),v={...e,earJwk:m,codeChallenge:y.challenge},C=n.popup||this.openPopup("about:blank",n);(await Lb(C.document,this.config,h,v,this.logger,this.performanceClient)).submit();const T=await se(dl,ch,this.logger,this.performanceClient,a)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,v),w=go(nu,tu,this.logger,this.performanceClient,this.correlationId)(T,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);if(!w.ear_jwe&&w.code){const _=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,a)({serverTelemetryManager:ur(bt.acquireTokenPopup,this.config.auth.clientId,a,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:h});return se(Sl,yl,this.logger,this.performanceClient,a)(v,w,y.verifier,bt.acquireTokenPopup,this.config,_,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return se(zb,Ob,this.logger,this.performanceClient,a)(v,w,bt.acquireTokenPopup,this.config,h,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async executeCodeFlowWithPost(e,n,o,a){const l=e.correlationId,c=await se(bi,Za,this.logger,this.performanceClient,l)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger),d=n.popup||this.openPopup("about:blank",n);(await Ub(d.document,this.config,c,e,this.logger,this.performanceClient)).submit();const h=await se(dl,ch,this.logger,this.performanceClient,l)(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e),m=go(nu,tu,this.logger,this.performanceClient,this.correlationId)(h,this.config.auth.OIDCOptions.responseMode,this.logger,this.correlationId);return se(Sl,yl,this.logger,this.performanceClient,l)(e,m,a,bt.acquireTokenPopup,this.config,o,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async logoutPopupAsync(e,n,o,a){this.logger.verbose("0b7yrk",this.correlationId),this.eventHandler.emitEvent(Pe.LOGOUT_START,this.correlationId,ze.Popup,e);const l=ur(bt.logoutPopup,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{await Mb(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,e.account);const c=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:l,requestAuthority:o,account:e.account||void 0});try{c.authority.endSessionEndpoint}catch{if(e.account?.homeAccountId&&e.postLogoutRedirectUri&&c.authority.protocolMode===cr.OIDC){if(this.eventHandler.emitEvent(Pe.LOGOUT_SUCCESS,e.correlationId,ze.Popup,e),a){const h={apiId:bt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},m=At.getAbsoluteUrl(a,aa());await this.navigationClient.navigateInternal(m,h)}n.popup?.close();return}}const d=c.getLogoutUri(e);this.eventHandler.emitEvent(Pe.LOGOUT_SUCCESS,e.correlationId,ze.Popup,e);const f=this.openPopup(d,n);if(this.eventHandler.emitEvent(Pe.POPUP_OPENED,e.correlationId,ze.Popup,{popupWindow:f},null),await dl(this.config.system.popupBridgeTimeout,this.logger,this.browserCrypto,e).catch(()=>{}),a){const h={apiId:bt.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},m=At.getAbsoluteUrl(a,aa());this.logger.verbose("0qcur2",this.correlationId),this.logger.verbosePii("0oj7lk",this.correlationId),await this.navigationClient.navigateInternal(m,h)}else this.logger.verbose("03zgcf",this.correlationId)}catch(c){throw n.popup?.close(),c instanceof Kt&&(c.setCorrelationId(this.correlationId),l.cacheFailedRequest(c)),this.eventHandler.emitEvent(Pe.LOGOUT_FAILURE,this.correlationId,ze.Popup,null,c),this.eventHandler.emitEvent(Pe.LOGOUT_END,this.correlationId,ze.Popup),c}this.eventHandler.emitEvent(Pe.LOGOUT_END,this.correlationId,ze.Popup)}initiateAuthRequest(e,n){if(e)return this.logger.infoPii("1kcr9k",this.correlationId),this.openPopup(e,n);throw this.logger.error("1l7hyp",this.correlationId),Ce(vb)}openPopup(e,n){try{let o;if(n.popup?(o=n.popup,this.logger.verbosePii("0cgeo7",this.correlationId),o.location.assign(e)):typeof n.popup>"u"&&(this.logger.verbosePii("0c2awd",this.correlationId),o=this.openSizedPopup(e,n)),!o)throw Ce(QD);return o.focus&&o.focus(),this.currentWindow=o,o}catch{throw this.logger.error("0dxfb9",this.correlationId),Ce(WD)}}openSizedPopup(e,{popupName:n,popupWindowAttributes:o,popupWindowParent:a}){const l=a.screenLeft?a.screenLeft:a.screenX,c=a.screenTop?a.screenTop:a.screenY,d=a.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,f=a.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let h=o.popupSize?.width,m=o.popupSize?.height,y=o.popupPosition?.top,v=o.popupPosition?.left;return(!h||h<0||h>d)&&(this.logger.verbose("08vfmo",this.correlationId),h=Yr.POPUP_WIDTH),(!m||m<0||m>f)&&(this.logger.verbose("09cxa0",this.correlationId),m=Yr.POPUP_HEIGHT),(!y||y<0||y>f)&&(this.logger.verbose("1qh4wo",this.correlationId),y=Math.max(0,f/2-Yr.POPUP_HEIGHT/2+c)),(!v||v<0||v>d)&&(this.logger.verbose("1sz3en",this.correlationId),v=Math.max(0,d/2-Yr.POPUP_WIDTH/2+l)),a.open(e,n,`width=${h}, height=${m}, top=${y}, left=${v}, scrollbars=yes`)}generatePopupName(e,n){return`${Yr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${n}.${this.correlationId}`}generateLogoutPopupName(e){const n=e.account&&e.account.homeAccountId;return`${Yr.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${n}.${this.correlationId}`}}function gz(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const t=window.performance.getEntriesByType("navigation");return(t.length?t[0]:void 0)?.type}class mz extends Ul{constructor(e,n,o,a,l,c,d,f,h,m){super(e,n,o,a,l,c,d,h,m),this.nativeStorage=f}async acquireToken(e){const n=await se(Gh,Kh,this.logger,this.performanceClient,this.correlationId)(e,ze.Redirect,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);n.platformBroker=fu(this.config,this.logger,this.correlationId,this.platformAuthProvider,e.authenticationScheme);const o=l=>{l.persisted&&(this.logger.verbose("0udvtt",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),this.eventHandler.emitEvent(Pe.RESTORE_FROM_BFCACHE,this.correlationId,ze.Redirect))},a=this.getRedirectStartPage(e.redirectStartPage);this.logger.verbosePii("0zao0a",this.correlationId),this.browserStorage.setTemporaryCache(Tn.ORIGIN_URI,a,!0),window.addEventListener("pageshow",o);try{this.config.system.protocolMode===cr.EAR?await this.executeEarFlow(n):await this.executeCodeFlow(n)}catch(l){throw l instanceof Kt&&l.setCorrelationId(this.correlationId),window.removeEventListener("pageshow",o),l}}async executeCodeFlow(e){const n=e.correlationId,o=ur(bt.acquireTokenRedirect,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),a=await se(ls,as,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),l={...e,codeChallenge:a.challenge};this.browserStorage.cacheAuthorizeRequest(l,this.correlationId,a.verifier);try{if(l.httpMethod===pl.POST)return await this.executeCodeFlowWithPost(l);{const c=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:l.authority,requestAzureCloudOptions:l.azureCloudOptions,requestExtraQueryParameters:l.extraQueryParameters,account:l.account}),d=await se(Db,db,this.logger,this.performanceClient,e.correlationId)(this.config,c.authority,l,this.logger,this.performanceClient);return await this.initiateAuthRequest(d)}}catch(c){throw c instanceof Kt&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),c}}async executeEarFlow(e){const{correlationId:n,authority:o,azureCloudOptions:a,extraQueryParameters:l,account:c}=e,d=await se(bi,Za,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,a,l,c),f=await se(Ab,Ib,this.logger,this.performanceClient,n)(),h=await se(ls,as,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),m={...e,earJwk:f,codeChallenge:h.challenge};return this.browserStorage.cacheAuthorizeRequest(m,this.correlationId,h.verifier),(await Lb(document,this.config,d,m,this.logger,this.performanceClient)).submit(),new Promise((v,C)=>{setTimeout(()=>{C(Ce(lh,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async executeCodeFlowWithPost(e){const n=e.correlationId,o=await se(bi,Za,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger);return this.browserStorage.cacheAuthorizeRequest(e,this.correlationId),(await Ub(document,this.config,o,e,this.logger,this.performanceClient)).submit(),new Promise((l,c)=>{setTimeout(()=>{c(Ce(lh,"failed_to_redirect"))},this.config.system.redirectNavigationTimeout)})}async handleRedirectPromise(e,n,o,a){const l=ur(bt.handleRedirectPromise,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),c=a?.navigateToLoginRequestUrl??!0;try{const[d,f]=this.getRedirectResponse(a?.hash||"");if(!d)return this.logger.info("1qmv0q",this.correlationId),this.browserStorage.resetRequestCache(this.correlationId),gz()!=="back_forward"?o.event.errorCode="no_server_response":this.logger.verbose("1eqegq",this.correlationId),null;const h=this.browserStorage.getTemporaryCache(Tn.ORIGIN_URI,this.correlationId,!0)||"",m=rw(h),y=rw(window.location.href);if(m===y&&c)return this.logger.verbose("11yred",this.correlationId),h.indexOf("#")>-1&&PL(h),await this.handleResponse(d,e,n,l);if(c){if(!$h()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Tn.URL_HASH,f,!0);const v={apiId:bt.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let C=!0;if(!h||h==="null"){const b=UL();this.browserStorage.setTemporaryCache(Tn.ORIGIN_URI,b,!0),this.logger.warning("1dutq1",this.correlationId),C=await this.navigationClient.navigateInternal(b,v)}else this.logger.verbose("08jpy1",this.correlationId),C=await this.navigationClient.navigateInternal(h,v);if(!C)return await this.handleResponse(d,e,n,l)}}else return this.logger.verbose("0v4sdv",this.correlationId),await this.handleResponse(d,e,n,l);return null}catch(d){throw d instanceof Kt&&(d.setCorrelationId(this.correlationId),l.cacheFailedRequest(d)),d}}getRedirectResponse(e){this.logger.verbose("1c5i8m",this.correlationId);let n=e;n||(this.config.auth.OIDCOptions.responseMode===Fv.QUERY?n=window.location.search:n=window.location.hash);let o=nh(n);if(o){try{GU(o,this.browserCrypto,ze.Redirect)}catch(l){return l instanceof Kt&&this.logger.error("0bkq6p",this.correlationId),[null,""]}return kx(window),this.logger.verbose("00uvho",this.correlationId),[o,n]}const a=this.browserStorage.getTemporaryCache(Tn.URL_HASH,this.correlationId,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Tn.URL_HASH)),a&&(o=nh(a),o)?(this.logger.verbose("001671",this.correlationId),[o,a]):[null,""]}async handleResponse(e,n,o,a){if(!e.state)throw Ce(bb);const{authority:c,azureCloudOptions:d,extraQueryParameters:f,account:h}=n;if(e.ear_jwe){const y=await se(bi,Za,this.logger,this.performanceClient,n.correlationId)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,c,d,f,h);return se(zb,Ob,this.logger,this.performanceClient,n.correlationId)(n,e,bt.acquireTokenRedirect,this.config,y,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}const m=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:n.authority});return se(Sl,yl,this.logger,this.performanceClient,n.correlationId)(n,e,o,bt.acquireTokenRedirect,this.config,m,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}async initiateAuthRequest(e){if(this.logger.verbose("0yaw2e",this.correlationId),e){this.logger.infoPii("1luf83",this.correlationId);const n={apiId:bt.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},o=this.config.auth.onRedirectNavigate;if(typeof o=="function")if(this.logger.verbose("1nehvl",this.correlationId),o(e)!==!1){this.logger.verbose("1a0jxh",this.correlationId),await this.navigationClient.navigateExternal(e,n);return}else{this.logger.verbose("09k5h5",this.correlationId);return}else{this.logger.verbose("0klwf7",this.correlationId),await this.navigationClient.navigateExternal(e,n);return}}else throw this.logger.info("0rlh4e",this.correlationId),Ce(vb)}async logout(e){this.logger.verbose("1rkurh",this.correlationId);const n=this.initializeLogoutRequest(e),o=ur(bt.logout,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{this.eventHandler.emitEvent(Pe.LOGOUT_START,this.correlationId,ze.Redirect,e),await Mb(this.browserStorage,this.browserCrypto,this.logger,this.correlationId,n.account);const a={apiId:bt.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},l=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:e&&e.authority,requestExtraQueryParameters:e?.extraQueryParameters,account:e&&e.account||void 0});if(l.authority.protocolMode===cr.OIDC)try{l.authority.endSessionEndpoint}catch{if(n.account?.homeAccountId){this.eventHandler.emitEvent(Pe.LOGOUT_SUCCESS,this.correlationId,ze.Redirect,n);return}}const c=l.getLogoutUri(n);n.account?.homeAccountId&&this.eventHandler.emitEvent(Pe.LOGOUT_SUCCESS,this.correlationId,ze.Redirect,n);const d=this.config.auth.onRedirectNavigate;if(typeof d=="function")if(d(c)!==!1){this.logger.verbose("06v57e",this.correlationId),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,na.SIGNOUT),await this.navigationClient.navigateExternal(c,a);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("0xqes1",this.correlationId);else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0,na.SIGNOUT),await this.navigationClient.navigateExternal(c,a);return}}catch(a){throw a instanceof Kt&&(a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a)),this.eventHandler.emitEvent(Pe.LOGOUT_FAILURE,this.correlationId,ze.Redirect,null,a),this.eventHandler.emitEvent(Pe.LOGOUT_END,this.correlationId,ze.Redirect),a}this.eventHandler.emitEvent(Pe.LOGOUT_END,this.correlationId,ze.Redirect)}getRedirectStartPage(e){const n=e||window.location.href;return At.getAbsoluteUrl(n,aa())}}async function yz(t,e,n,o){if(!t)throw n.info("1l7hyp",o),Ce(vb);return go(Sz,ZL,n,e,o)(t)}async function vz(t,e,n,o,a){const l=Hb();if(!l.contentDocument)throw"No document associated with iframe!";return(await Ub(l.contentDocument,t,e,n,o,a)).submit(),l}async function bz(t,e,n,o,a){const l=Hb();if(!l.contentDocument)throw"No document associated with iframe!";return(await Lb(l.contentDocument,t,e,n,o,a)).submit(),l}function Sz(t){const e=Hb();return e.src=t,e}function Hb(){const t=document.createElement("iframe");return t.className="msalSilentIframe",t.style.visibility="hidden",t.style.position="absolute",t.style.width=t.style.height="0",t.style.border="0",t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),t.setAttribute("allow","local-network-access *"),document.body.appendChild(t),t}class Cz extends Ul{constructor(e,n,o,a,l,c,d,f,h,m,y){super(e,n,o,a,l,c,f,m,y),this.apiId=d,this.nativeStorage=h}async acquireToken(e){!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("1kl318",this.correlationId);const n={...e};n.prompt?n.prompt!==lr.NONE&&n.prompt!==lr.NO_SESSION&&(this.logger.warning("0bmctg",this.correlationId),n.prompt=lr.NONE):n.prompt=lr.NONE;const o=await se(Gh,Kh,this.logger,this.performanceClient,this.correlationId)(n,ze.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId);return o.platformBroker=fu(this.config,this.logger,this.correlationId,this.platformAuthProvider,o.authenticationScheme),Px(o.authority),this.config.system.protocolMode===cr.EAR?this.executeEarFlow(o):this.executeCodeFlow(o)}async executeCodeFlow(e){let n;const o=ur(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{return n=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account}),await se(this.silentTokenHelper.bind(this),Ow,this.logger,this.performanceClient,e.correlationId)(n,e)}catch(a){if(a instanceof Kt&&(a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a)),!n||!(a instanceof Kt)||a.errorCode!==Yr.INVALID_GRANT_ERROR)throw a;return this.performanceClient.addFields({retryError:a.errorCode},this.correlationId),await se(this.silentTokenHelper.bind(this),Ow,this.logger,this.performanceClient,this.correlationId)(n,e)}}async executeEarFlow(e){const{correlationId:n,authority:o,azureCloudOptions:a,extraQueryParameters:l,account:c}=e,d=await se(bi,Za,this.logger,this.performanceClient,n)(this.config,this.correlationId,this.performanceClient,this.browserStorage,this.logger,o,a,l,c),f=await se(Ab,Ib,this.logger,this.performanceClient,n)(),h=await se(ls,as,this.logger,this.performanceClient,n)(this.performanceClient,this.logger,n),m={...e,earJwk:f,codeChallenge:h.challenge};await se(bz,Xm,this.logger,this.performanceClient,n)(this.config,d,m,this.logger,this.performanceClient);const y=this.config.auth.OIDCOptions.responseMode,v=await se(dl,ch,this.logger,this.performanceClient,n)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,e),C=go(nu,tu,this.logger,this.performanceClient,n)(v,y,this.logger,this.correlationId);if(!C.ear_jwe&&C.code){const b=await se(this.createAuthCodeClient.bind(this),da,this.logger,this.performanceClient,n)({serverTelemetryManager:ur(this.apiId,this.config.auth.clientId,n,this.browserStorage,this.logger),requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account,authority:d});return se(Sl,yl,this.logger,this.performanceClient,n)(m,C,h.verifier,this.apiId,this.config,b,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}else return se(zb,Ob,this.logger,this.performanceClient,n)(m,C,this.apiId,this.config,d,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}logout(){return Promise.reject(Ce(Sb))}async silentTokenHelper(e,n){const o=n.correlationId,a=await se(ls,as,this.logger,this.performanceClient,o)(this.performanceClient,this.logger,o),l={...n,codeChallenge:a.challenge};if(n.httpMethod===pl.POST)await se(vz,Xm,this.logger,this.performanceClient,o)(this.config,e.authority,l,this.logger,this.performanceClient);else{const h=await se(Db,db,this.logger,this.performanceClient,o)(this.config,e.authority,l,this.logger,this.performanceClient);await se(yz,Xm,this.logger,this.performanceClient,o)(h,this.performanceClient,this.logger,o)}const c=this.config.auth.OIDCOptions.responseMode,d=await se(dl,ch,this.logger,this.performanceClient,o)(this.config.system.iframeBridgeTimeout,this.logger,this.browserCrypto,n),f=go(nu,tu,this.logger,this.performanceClient,o)(d,c,this.logger,this.correlationId);return se(Sl,yl,this.logger,this.performanceClient,o)(n,f,a.verifier,this.apiId,this.config,e,this.browserStorage,this.nativeStorage,this.eventHandler,this.logger,this.performanceClient,this.platformAuthProvider)}}class Ez extends Ul{async acquireToken(e){const n=await se(Nb,_b,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger,this.correlationId),o={...e,...n};e.redirectUri&&(o.redirectUri=uh(e.redirectUri,this.config.auth.redirectUri,this.logger,this.correlationId));const a=ur(bt.acquireTokenSilent_silentFlow,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger),l=await this.createRefreshTokenClient({serverTelemetryManager:a,authorityUrl:o.authority,azureCloudOptions:o.azureCloudOptions,account:o.account});return se(l.acquireTokenByRefreshToken.bind(l),QL,this.logger,this.performanceClient,e.correlationId)(o,bt.acquireTokenSilent_silentFlow).catch(c=>{throw c.setCorrelationId(this.correlationId),a.cacheFailedRequest(c),c})}logout(){return Promise.reject(Ce(Sb))}async createRefreshTokenClient(e){const n=await se(this.getClientConfiguration.bind(this),Fh,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new RD(n,this.performanceClient)}}class Tz extends hx{constructor(e,n){super(e,n),this.includeRedirectUri=!1}}class wz extends Ul{constructor(e,n,o,a,l,c,d,f,h,m){super(e,n,o,a,l,c,f,h,m),this.apiId=d}async acquireToken(e){if(!e.code)throw Ce(aL);const n=await se(Gh,Kh,this.logger,this.performanceClient,this.correlationId)(e,ze.Silent,this.config,this.browserCrypto,this.browserStorage,this.logger,this.performanceClient,this.correlationId),o=ur(this.apiId,this.config.auth.clientId,this.correlationId,this.browserStorage,this.logger);try{const a={...n,code:e.code},l=await se(this.getClientConfiguration.bind(this),Fh,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:o,requestAuthority:n.authority,requestAzureCloudOptions:n.azureCloudOptions,requestExtraQueryParameters:n.extraQueryParameters,account:n.account}),c=new Tz(l,this.performanceClient);this.logger.verbose("1uic5e",this.correlationId);const d=new Hx(c,this.browserStorage,a,this.logger,this.performanceClient);return await se(d.handleCodeResponseFromServer.bind(d),ix,this.logger,this.performanceClient,this.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},n,this.apiId,!1)}catch(a){throw a instanceof Kt&&(a.setCorrelationId(this.correlationId),o.cacheFailedRequest(a)),a}}logout(){return Promise.reject(Ce(Sb))}}function Az(t,e,n,o){const a=window.msal?.clientIds||[],l=a.length,c=a.filter(d=>d===t).length;c>1&&n.warning("1e88vg",o),e.add({msalInstanceCount:l,sameClientIdInstanceCount:c})}function gf(t,e,n){try{xb(t)}catch(o){throw e.end({success:!1},o,n),o}}class jb{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Ei(this.logger,this.performanceClient):rh,this.eventHandler=new FU(this.logger),this.browserStorage=this.isBrowserEnvironment?new Zy(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler,wD(this.config.auth)):UU(this.config.auth.clientId,this.logger,this.performanceClient,this.eventHandler);const n={cacheLocation:Zr.MemoryStorage,cacheRetentionDays:5};this.nativeInternalStorage=new Zy(this.config.auth.clientId,n,this.browserCrypto,this.logger,this.performanceClient,this.eventHandler),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this)}static async createController(e,n){const o=new jb(e);return await o.initialize(n),o}trackPageVisibility(e){e&&(this.logger.info("16v6hv",e),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){const n=this.getRequestCorrelationId(e);if(this.logger.trace("1f7joy",n),this.initialized){this.logger.info("061m5x",n);return}if(!this.isBrowserEnvironment){this.logger.info("19fvpi",n),this.initialized=!0,this.eventHandler.emitEvent(Pe.INITIALIZE_END,n);return}const o=this.config.system.allowPlatformBroker,a=this.performanceClient.startMeasurement(RU,n);if(this.eventHandler.emitEvent(Pe.INITIALIZE_START,n),this.logMultipleInstances(a,n),await se(this.browserStorage.initialize.bind(this.browserStorage),JL,this.logger,this.performanceClient,n)(n),o)try{this.platformAuthProvider=await fz(this.logger,this.performanceClient,n,this.config.system.nativeBrokerHandshakeTimeout)}catch(l){this.logger.verbose(l,n)}this.config.cache.cacheLocation===Zr.LocalStorage&&this.eventHandler.subscribeCrossTab(),!this.config.system.navigatePopups&&await this.preGeneratePkceCodes(n),this.initialized=!0,this.eventHandler.emitEvent(Pe.INITIALIZE_END,n),a.end({allowPlatformBroker:o,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("02l8bm",""),Nx(this.initialized),this.isBrowserEnvironment){const n=e?.hash||"";let o=this.redirectResponse.get(n);return typeof o>"u"?(o=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(n,o),this.logger.verbose("1wn9kp","")):this.logger.verbose("0w0gm3",""),o}return this.logger.verbose("12xi63",""),null}async handleRedirectPromiseInternal(e){if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("0le6uv",""),null;if(this.browserStorage.getInteractionInProgress()?.type===na.SIGNOUT)return this.logger.verbose("1ywcv2",""),this.browserStorage.setInteractionInProgress(!1),Promise.resolve(null);const o=this.getAllAccounts(),a=this.browserStorage.getCachedNativeRequest(),l=a&&this.platformAuthProvider&&!e?.hash;let c,d;try{if(l&&this.platformAuthProvider){const f=a?.correlationId||"";this.eventHandler.emitEvent(Pe.HANDLE_REDIRECT_START,f,ze.Redirect),c=this.performanceClient.startMeasurement(Jm,f),this.logger.trace("12v7is",f);const h=new Lf(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,bt.handleRedirectPromise,this.performanceClient,this.platformAuthProvider,a.accountId,this.nativeInternalStorage,a.correlationId);d=se(h.handleRedirectPromise.bind(h),sU,this.logger,this.performanceClient,c.event.correlationId)(this.performanceClient,c.event.correlationId)}else{const[f,h]=this.browserStorage.getCachedRequest(""),m=f.correlationId;this.eventHandler.emitEvent(Pe.HANDLE_REDIRECT_START,m,ze.Redirect),c=this.performanceClient.startMeasurement(Jm,m),this.logger.trace("0znzs5",m);const y=this.createRedirectClient(m);d=se(y.handleRedirectPromise.bind(y),aU,this.logger,this.performanceClient,c.event.correlationId)(f,h,c,e)}}catch(f){throw this.browserStorage.resetRequestCache(""),f}return d.then(f=>(f?(this.browserStorage.resetRequestCache(f.correlationId),this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_SUCCESS,f.correlationId,ze.Redirect,f),this.logger.verbose("0ui8f5",f.correlationId),o.length{this.browserStorage.resetRequestCache(c.event.correlationId);const h=f;throw this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_FAILURE,c.event.correlationId,ze.Redirect,null,h),this.eventHandler.emitEvent(Pe.HANDLE_REDIRECT_END,c.event.correlationId,ze.Redirect),c.end({success:!1},h),f})}async acquireTokenRedirect(e){const n=this.getRequestCorrelationId(e);this.logger.verbose("0os66p",n);const o=this.performanceClient.startMeasurement(wU,n);o.add({scenarioId:e.scenarioId});const a=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=l=>{const c=typeof a=="function"?a(l):void 0;return o.add({navigateCallbackResult:c!==!1}),o.event=o.end({success:!0},void 0,e.account)||o.event,c};try{xw(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,na.SIGNIN),this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_START,n,ze.Redirect,e);let l;return this.platformAuthProvider&&this.canUsePlatformBroker(e)?l=new Lf(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,bt.acquireTokenRedirect,this.performanceClient,this.platformAuthProvider,this.getNativeAccountId(e),this.nativeInternalStorage,n).acquireTokenRedirect(e,o).catch(d=>{if(d instanceof Lo&&sl(d))return this.platformAuthProvider=void 0,this.createRedirectClient(n).acquireToken(e);if(d instanceof yo)return this.logger.verbose("1ipyz4",n),this.createRedirectClient(n).acquireToken(e);throw d}):l=this.createRedirectClient(n).acquireToken(e),await l}catch(l){throw this.browserStorage.resetRequestCache(n),o.event.status===2?this.performanceClient.startMeasurement(Jm,n).end({success:!1},l,e.account):o.end({success:!1},l,e.account),this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_FAILURE,n,ze.Redirect,null,l),l}}acquireTokenPopup(e){const n=this.getRequestCorrelationId(e),o=this.performanceClient.startMeasurement(TU,n);o.add({scenarioId:e.scenarioId});try{this.logger.verbose("0ch87b",n),gf(this.initialized,o,e.account),this.browserStorage.setInteractionInProgress(!0,na.SIGNIN,e.overrideInteractionInProgress,n)}catch(d){return Promise.reject(d)}const a=this.getAllAccounts();this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_START,n,ze.Popup,e);let l;const c=this.getPreGeneratedPkceCodes(n);return this.canUsePlatformBroker(e)?l=this.acquireTokenNative({...e,correlationId:n},bt.acquireTokenPopup).then(d=>(o.end({success:!0,isNativeBroker:!0},void 0,d.account),d)).catch(d=>{if(d instanceof Lo&&sl(d))return this.platformAuthProvider=void 0,this.createPopupClient(n).acquireToken(e,c);if(d instanceof yo)return this.logger.verbose("0yy5fw",n),this.createPopupClient(n).acquireToken(e,c);throw d}):l=this.createPopupClient(n).acquireToken(e,c),l.then(d=>{const f=a.length(this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_FAILURE,n,ze.Popup,null,d),o.end({success:!1},d,e.account),Promise.reject(d))).finally(async()=>{this.browserStorage.setInteractionInProgress(!1),this.config.system.navigatePopups||await this.preGeneratePkceCodes(n)})}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&e.increment({visibilityChangeCount:1})}async ssoSilent(e){const n=this.getRequestCorrelationId(e),o={...e,prompt:e.prompt,correlationId:n};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(AU,n),this.ssoSilentMeasurement?.add({scenarioId:e.scenarioId}),gf(this.initialized,this.ssoSilentMeasurement,e.account),this.ssoSilentMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement);const a=this.getAllAccounts();this.logger.verbose("0w1b45",n),this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_START,n,ze.Silent,o);let l;return this.canUsePlatformBroker(o)?l=this.acquireTokenNative(o,bt.ssoSilent).catch(c=>{if(c instanceof Lo&&sl(c))return this.platformAuthProvider=void 0,this.createSilentIframeClient(o.correlationId).acquireToken(o);throw c}):l=this.createSilentIframeClient(o.correlationId).acquireToken(o),l.then(c=>{const d=a.length{throw this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_FAILURE,n,ze.Silent,null,c),this.ssoSilentMeasurement?.end({success:!1},c,e.account),c}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const n=this.getRequestCorrelationId(e);this.logger.trace("0ch6ga",n);const o=this.performanceClient.startMeasurement(EU,n);gf(this.initialized,o),this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_START,n,ze.Silent,e),o.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw Ce(lL);if(e.code){const a=e.code;let l=this.hybridAuthCodeResponses.get(a);return l?(this.logger.verbose("0qgp28",n),o.discard()):(this.logger.verbose("06eh73",n),l=this.acquireTokenByCodeAsync({...e,correlationId:n}).then(c=>(this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_SUCCESS,n,ze.Silent,c),this.hybridAuthCodeResponses.delete(a),o.end({success:!0,isNativeBroker:c.fromPlatformBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length},void 0,c.account),c)).catch(c=>{throw this.hybridAuthCodeResponses.delete(a),this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_FAILURE,n,ze.Silent,null,c),o.end({success:!1},c),c}),this.hybridAuthCodeResponses.set(a,l)),await l}else if(e.nativeAccountId)if(this.canUsePlatformBroker(e,e.nativeAccountId)){const a=await this.acquireTokenNative({...e,correlationId:n},bt.acquireTokenByCode,e.nativeAccountId).catch(l=>{throw l instanceof Lo&&sl(l)&&(this.platformAuthProvider=void 0),l});return o.end({success:!0},void 0,a.account),a}else throw Ce(cL);else throw Ce(sL)}catch(a){throw this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_FAILURE,n,ze.Silent,null,a),o.end({success:!1},a),a}}async acquireTokenByCodeAsync(e){const n=this.getRequestCorrelationId(e);return this.logger.trace("10d9hy",n),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(iU,n),this.acquireTokenByCodeAsyncMeasurement?.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(n).acquireToken(e).then(l=>(this.acquireTokenByCodeAsyncMeasurement?.end({success:!0,fromCache:l.fromCache,isNativeBroker:l.fromPlatformBroker}),l)).catch(l=>{throw this.acquireTokenByCodeAsyncMeasurement?.end({success:!1},l),l}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,n){switch(n){case Xn.Default:case Xn.AccessToken:case Xn.AccessTokenAndRefreshToken:const o=this.createSilentCacheClient(e.correlationId);return se(o.acquireToken.bind(o),GL,this.logger,this.performanceClient,e.correlationId)(e);default:throw he(Xa)}}async acquireTokenByRefreshToken(e,n){switch(n){case Xn.Default:case Xn.AccessTokenAndRefreshToken:case Xn.RefreshToken:case Xn.RefreshTokenAndNetwork:const o=this.createSilentRefreshClient(e.correlationId);return se(o.acquireToken.bind(o),WL,this.logger,this.performanceClient,e.correlationId)(e);default:throw he(Xa)}}async acquireTokenBySilentIframe(e){const n=this.createSilentIframeClient(e.correlationId);return se(n.acquireToken.bind(n),qL,this.logger,this.performanceClient,e.correlationId)(e)}async logoutRedirect(e){const n=this.getRequestCorrelationId(e);return xw(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0,na.SIGNOUT),this.createRedirectClient(n).logout(e)}logoutPopup(e){try{const n=this.getRequestCorrelationId(e);return xb(this.initialized),this.browserStorage.setInteractionInProgress(!0,na.SIGNOUT),this.createPopupClient(n).logout(e).finally(()=>{this.browserStorage.setInteractionInProgress(!1)})}catch(n){return Promise.reject(n)}}async clearCache(e){if(!this.isBrowserEnvironment)return;const n=this.getRequestCorrelationId(e);return this.createSilentCacheClient(n).logout(e)}getAllAccounts(e){return zU(this.logger,this.browserStorage,this.isBrowserEnvironment,this.getRequestCorrelationId(),e)}getAccount(e){return BU(e,this.logger,this.browserStorage,this.getRequestCorrelationId())}setActiveAccount(e){HU(e,this.browserStorage,this.getRequestCorrelationId())}getActiveAccount(){return jU(this.browserStorage,this.getRequestCorrelationId())}async hydrateCache(e,n){this.logger.verbose("16jycr",e.correlationId);const o=RP(e.account,e.cloudGraphHostName,e.msGraphHost);return await this.browserStorage.setAccount(o,e.correlationId,Ja(e.idTokenClaims),bt.hydrateCache),e.fromPlatformBroker?(this.logger.verbose("1fxyu8",e.correlationId),this.nativeInternalStorage.hydrateCache(e,n)):this.browserStorage.hydrateCache(e,n)}async acquireTokenNative(e,n,o,a){const l=this.getRequestCorrelationId(e);if(this.logger.trace("0b9y3p",l),!this.platformAuthProvider)throw Ce(wx);return new Lf(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,n,this.performanceClient,this.platformAuthProvider,o||this.getNativeAccountId(e),this.nativeInternalStorage,l).acquireToken(e,a)}canUsePlatformBroker(e,n){const o=this.getRequestCorrelationId(e);if(this.logger.trace("1n9lbl",o),!this.platformAuthProvider)return this.logger.trace("0vnu11",o),!1;if(!fu(this.config,this.logger,o,this.platformAuthProvider,e.authenticationScheme))return this.logger.trace("1m4bzf",o),!1;if(e.prompt)switch(e.prompt){case lr.NONE:case lr.CONSENT:case lr.LOGIN:this.logger.trace("0vdv8e",o);break;default:return this.logger.trace("0pdzw6",o),!1}return!n&&!this.getNativeAccountId(e)?(this.logger.trace("16lbtk",o),!1):!0}getNativeAccountId(e){const n=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return n&&n.nativeAccountId||""}createPopupClient(e){return new pz(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createRedirectClient(e){return new mz(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentIframeClient(e){return new Cz(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,bt.ssoSilent,this.performanceClient,this.nativeInternalStorage,e,this.platformAuthProvider)}createSilentCacheClient(e){return new jx(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentRefreshClient(e){return new Ez(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,e,this.platformAuthProvider)}createSilentAuthCodeClient(e){return new wz(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,bt.acquireTokenByCode,this.performanceClient,e,this.platformAuthProvider)}addEventCallback(e,n){return this.eventHandler.addEventCallback(e,n)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return Mx(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,n){this.browserStorage.setWrapperMetadata(e,n)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e?.correlationId?e.correlationId:this.isBrowserEnvironment?is():""}async loginRedirect(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("0lz9hf",n),this.acquireTokenRedirect({correlationId:n,...e||Sw})}loginPopup(e){const n=this.getRequestCorrelationId(e);return this.logger.verbose("0qw7v5",n),this.acquireTokenPopup({correlationId:n,...e||Sw})}async acquireTokenSilent(e){const n=this.getRequestCorrelationId(e),o=this.performanceClient.startMeasurement(CU,n);o.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),gf(this.initialized,o,e.account),this.logger.verbose("0x1c4s",n);const a=e.account||this.getActiveAccount();if(!a)throw Ce(tL);return this.acquireTokenSilentDeduped(e,a,n).then(l=>(o.end({success:!0,fromCache:l.fromCache,isNativeBroker:l.fromPlatformBroker,accessTokenSize:l.accessToken.length,idTokenSize:l.idToken.length},void 0,l.account),{...l,state:e.state,correlationId:n})).catch(l=>{throw l instanceof Kt&&l.setCorrelationId(n),o.end({success:!1},l,a),l})}async acquireTokenSilentDeduped(e,n,o){const a=zh(this.config.auth.clientId,{...e,authority:e.authority||this.config.auth.authority},n.homeAccountId),l=JSON.stringify(a),c=this.activeSilentTokenRequests.get(l);if(typeof c>"u"){this.logger.verbose("0fcjbk",o),this.performanceClient.addFields({deduped:!1},o);const d=se(this.acquireTokenSilentAsync.bind(this),FL,this.logger,this.performanceClient,o)({...e,correlationId:o},n);return this.activeSilentTokenRequests.set(l,d),d.finally(()=>{this.activeSilentTokenRequests.delete(l)})}else return this.logger.verbose("1yq7nb",o),this.performanceClient.addFields({deduped:!0},o),c}async acquireTokenSilentAsync(e,n){const o=()=>this.trackPageVisibility(e.correlationId);this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_START,e.correlationId,ze.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",o);const a=await se(KU,XL,this.logger,this.performanceClient,e.correlationId)(e,n,this.config,this.performanceClient,this.logger),l=e.cacheLookupPolicy||Xn.Default;return this.acquireTokenSilentNoIframe(a,l).catch(async d=>{if(Rz(d,l))if(this.activeIframeRequest)if(l!==Xn.Skip){const[h,m]=this.activeIframeRequest;this.logger.verbose("1w8fso",a.correlationId);const y=this.performanceClient.startMeasurement(YL,a.correlationId);y.add({awaitIframeCorrelationId:m});const v=await h;if(y.end({success:v}),v)return this.logger.verbose("0ywzzi",a.correlationId),this.acquireTokenSilentNoIframe(a,l);throw this.logger.info("17y14q",a.correlationId),d}else return this.logger.warning("1bd4p8",a.correlationId),se(this.acquireTokenBySilentIframe.bind(this),_w,this.logger,this.performanceClient,a.correlationId)(a);else{let h;return this.activeIframeRequest=[new Promise(m=>{h=m}),a.correlationId],this.logger.verbose("0rh08z",a.correlationId),se(this.acquireTokenBySilentIframe.bind(this),_w,this.logger,this.performanceClient,a.correlationId)(a).then(m=>(h(!0),m)).catch(m=>{throw h(!1),m}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_SUCCESS,e.correlationId,ze.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromPlatformBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_FAILURE,e.correlationId,ze.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",o)})}async acquireTokenSilentNoIframe(e,n){return fu(this.config,this.logger,e.correlationId,this.platformAuthProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("0sczo4",e.correlationId),this.acquireTokenNative(e,bt.acquireTokenSilent_silentFlow,e.account.nativeAccountId,n).catch(async o=>{throw o instanceof Lo&&sl(o)?(this.logger.verbose("07rkmb",e.correlationId),this.platformAuthProvider=void 0,he(Xa)):o})):(this.logger.verbose("0ox81t",e.correlationId),n===Xn.AccessToken&&this.logger.verbose("0fvwxe",e.correlationId),se(this.acquireTokenFromCache.bind(this),jL,this.logger,this.performanceClient,e.correlationId)(e,n).catch(o=>{if(n===Xn.AccessToken)throw o;return this.eventHandler.emitEvent(Pe.ACQUIRE_TOKEN_NETWORK_START,e.correlationId,ze.Silent,e),se(this.acquireTokenByRefreshToken.bind(this),$L,this.logger,this.performanceClient,e.correlationId)(e,n)}))}async preGeneratePkceCodes(e){return this.logger.verbose("1x6uj6",e),this.pkceCode=await se(ls,as,this.logger,this.performanceClient,e)(this.performanceClient,this.logger,e),Promise.resolve()}getPreGeneratedPkceCodes(e){const n=this.pkceCode?{...this.pkceCode}:void 0;return this.pkceCode=void 0,n?this.logger.verbose("12js1o",e):this.logger.verbose("1oe9ci",e),this.performanceClient.addFields({usePreGeneratedPkce:!!n},e),n}logMultipleInstances(e,n){const o=this.config.auth.clientId;if(!window)return;window.msal=window.msal||{},window.msal.clientIds=window.msal.clientIds||[],window.msal.clientIds.length>0&&this.logger.verbose("1qtz3l",n),window.msal.clientIds.push(o),Az(o,e,this.logger,n)}}function Rz(t,e){const n=!(t instanceof yo&&t.subError!==ub),o=t.errorCode===Yr.INVALID_GRANT_ERROR||t.errorCode===Xa,a=n&&o||t.errorCode===Gy||t.errorCode===nx,l=$D.includes(e);return a&&l}class $b{static loggerCallback(e,n){switch(e){case Mt.Error:console.error(n);return;case Mt.Info:console.info(n);return;case Mt.Verbose:console.debug(n);return;case Mt.Warning:console.warn(n);return;default:console.log(n);return}}constructor(e){this.browserEnvironment=typeof window<"u",this.config=dz(e,this.browserEnvironment);let n;try{n=window[Zr.SessionStorage]}catch{}const o=n?.getItem(_U),a=n?.getItem(OU)?.toLowerCase(),l=a==="true"?!0:a==="false"?!1:void 0,c={...this.config.system.loggerOptions},d=o&&Object.keys(Mt).includes(o)?Mt[o]:void 0;d&&(c.loggerCallback=$b.loggerCallback,c.logLevel=d),l!==void 0&&(c.piiLoggingEnabled=l),this.logger=new mo(c,LU,ss),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}class Rl extends $b{getModuleName(){return Rl.MODULE_NAME}getId(){return Rl.ID}async initialize(e){return this.available=typeof window<"u",this.available}}Rl.MODULE_NAME="";Rl.ID="StandardOperatingContext";class xz{constructor(e,n){this.controller=n||new jb(new Rl(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,n){return this.controller.addEventCallback(e,n)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}getAccount(e){return this.controller.getAccount(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,n){return this.controller.initializeWrapperLibrary(e,n)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,n){return this.controller.hydrateCache(e,n)}clearCache(e){return this.controller.clearCache(e)}}const _z={initialize:()=>Promise.reject(On(Wn)),acquireTokenPopup:()=>Promise.reject(On(Wn)),acquireTokenRedirect:()=>Promise.reject(On(Wn)),acquireTokenSilent:()=>Promise.reject(On(Wn)),acquireTokenByCode:()=>Promise.reject(On(Wn)),getAllAccounts:()=>[],getAccount:()=>null,handleRedirectPromise:()=>Promise.reject(On(Wn)),loginPopup:()=>Promise.reject(On(Wn)),loginRedirect:()=>Promise.reject(On(Wn)),logoutRedirect:()=>Promise.reject(On(Wn)),logoutPopup:()=>Promise.reject(On(Wn)),ssoSilent:()=>Promise.reject(On(Wn)),addEventCallback:()=>null,removeEventCallback:()=>{},addPerformanceCallback:()=>"",removePerformanceCallback:()=>!1,getLogger:()=>{throw On(Wn)},setLogger:()=>{},setActiveAccount:()=>{},getActiveAccount:()=>null,initializeWrapperLibrary:()=>{},setNavigationClient:()=>{},getConfiguration:()=>{throw On(Wn)},hydrateCache:()=>Promise.reject(On(Wn)),clearCache:()=>Promise.reject(On(Wn))};class Oz{static getInteractionStatusFromEvent(e,n){switch(e.eventType){case Pe.ACQUIRE_TOKEN_START:if(e.interactionType===ze.Redirect||e.interactionType===ze.Popup)return Kn.AcquireToken;break;case Pe.HANDLE_REDIRECT_START:return Kn.HandleRedirect;case Pe.LOGOUT_START:return Kn.Logout;case Pe.LOGOUT_END:if(n&&n!==Kn.Logout)break;return Kn.None;case Pe.HANDLE_REDIRECT_END:if(n&&n!==Kn.HandleRedirect)break;return Kn.None;case Pe.ACQUIRE_TOKEN_SUCCESS:case Pe.ACQUIRE_TOKEN_FAILURE:case Pe.RESTORE_FROM_BFCACHE:if(e.interactionType===ze.Redirect||e.interactionType===ze.Popup){if(n&&n!==Kn.AcquireToken)break;return Kn.None}break}return null}}const Iz="modulepreload",kz=function(t){return"/"+t},jw={},Vx=function(e,n,o){let a=Promise.resolve();if(n&&n.length>0){let f=function(h){return Promise.all(h.map(m=>Promise.resolve(m).then(y=>({status:"fulfilled",value:y}),y=>({status:"rejected",reason:y}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=c?.nonce||c?.getAttribute("nonce");a=f(n.map(h=>{if(h=kz(h),h in jw)return;jw[h]=!0;const m=h.endsWith(".css"),y=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${y}`))return;const v=document.createElement("link");if(v.rel=m?"stylesheet":Iz,m||(v.as="script"),v.crossOrigin="",v.href=h,d&&v.setAttribute("nonce",d),document.head.appendChild(v),m)return new Promise((C,b)=>{v.addEventListener("load",C),v.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${h}`)))})}))}function l(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&l(d.reason);return e().catch(l)})};const Mz={instance:_z,inProgress:Kn.None,accounts:[],logger:new mo({})},Fb=E.createContext(Mz);Fb.Consumer;function $w(t,e){if(t.length!==e.length)return!1;const n=[...e];return t.every(o=>{const a=n.shift();return!o||!a?!1:o.homeAccountId===a.homeAccountId&&o.localAccountId===a.localAccountId&&o.username===a.username})}function iq(t,e){return t.length>0&&(e.homeAccountId||e.localAccountId||e.username)&&t.filter(o=>!(e.username&&e.username.toLowerCase()!==o.username.toLowerCase()||e.homeAccountId&&e.homeAccountId.toLowerCase()!==o.homeAccountId.toLowerCase()||e.localAccountId&&e.localAccountId.toLowerCase()!==o.localAccountId.toLowerCase()))[0]||null}const Nz="@azure/msal-react",Fw="5.0.4";const ph={UNBLOCK_INPROGRESS:"UNBLOCK_INPROGRESS",EVENT:"EVENT"},Pz=(t,e)=>{const{type:n,payload:o}=e;let a=t.inProgress;switch(n){case ph.UNBLOCK_INPROGRESS:t.inProgress===Kn.Startup&&(a=Kn.None,o.logger.info("MsalProvider - handleRedirectPromise resolved, setting inProgress to 'none'",""));break;case ph.EVENT:const c=o.message,d=Oz.getInteractionStatusFromEvent(c,t.inProgress);d&&(o.logger.info(`MsalProvider - '${c.eventType}' results in setting inProgress from '${t.inProgress}' to '${d}'`,""),a=d);break;default:throw new Error(`Unknown action type: ${n}`)}if(a===Kn.Startup)return t;const l=o.instance.getAllAccounts();return a!==t.inProgress&&!$w(l,t.accounts)?{...t,inProgress:a,accounts:l}:a!==t.inProgress?{...t,inProgress:a}:$w(l,t.accounts)?t:{...t,accounts:l}};function Dz({instance:t,children:e}){E.useEffect(()=>{t.initializeWrapperLibrary(BD.React,Fw)},[t]);const n=E.useMemo(()=>t.getLogger().clone(Nz,Fw),[t]),[o,a]=E.useReducer(Pz,void 0,()=>({inProgress:Kn.Startup,accounts:[]}));E.useEffect(()=>{const c=t.addEventCallback(d=>{a({payload:{instance:t,logger:n,message:d},type:ph.EVENT})});return n.verbose(`MsalProvider - Registered event callback with id: '${c}'`,""),t.initialize().then(()=>{t.handleRedirectPromise().catch(()=>{}).finally(()=>{a({payload:{instance:t,logger:n},type:ph.UNBLOCK_INPROGRESS})})}).catch(()=>{}),()=>{c&&(n.verbose(`MsalProvider - Removing event callback '${c}'`,""),t.removeEventCallback(c))}},[t,n]);const l={instance:t,inProgress:o.inProgress,accounts:o.accounts,logger:n};return Xr.createElement(Fb.Provider,{value:l},e)}const Kb=()=>E.useContext(Fb);function Lz(t,e){return t.length>0}function Uz(t){const{accounts:e,inProgress:n}=Kb();return E.useMemo(()=>n===Kn.Startup?!1:Lz(e),[e,n,t])}function Gx(t,e){return function(){return t.apply(e,arguments)}}const{toString:zz}=Object.prototype,{getPrototypeOf:Vb}=Object,{iterator:qh,toStringTag:qx}=Symbol,Yh=(t=>e=>{const n=zz.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),To=t=>(t=t.toLowerCase(),e=>Yh(e)===t),Wh=t=>e=>typeof e===t,{isArray:zl}=Array,xl=Wh("undefined");function Ou(t){return t!==null&&!xl(t)&&t.constructor!==null&&!xl(t.constructor)&&dr(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Yx=To("ArrayBuffer");function Bz(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&Yx(t.buffer),e}const Hz=Wh("string"),dr=Wh("function"),Wx=Wh("number"),Iu=t=>t!==null&&typeof t=="object",jz=t=>t===!0||t===!1,Uf=t=>{if(Yh(t)!=="object")return!1;const e=Vb(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(qx in t)&&!(qh in t)},$z=t=>{if(!Iu(t)||Ou(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},Fz=To("Date"),Kz=To("File"),Vz=To("Blob"),Gz=To("FileList"),qz=t=>Iu(t)&&dr(t.pipe),Yz=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||dr(t.append)&&((e=Yh(t))==="formdata"||e==="object"&&dr(t.toString)&&t.toString()==="[object FormData]"))},Wz=To("URLSearchParams"),[Qz,Xz,Jz,Zz]=["ReadableStream","Request","Response","Headers"].map(To),e5=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function ku(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let o,a;if(typeof t!="object"&&(t=[t]),zl(t))for(o=0,a=t.length;o0;)if(a=n[o],e===a.toLowerCase())return a;return null}const qa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,Xx=t=>!xl(t)&&t!==qa;function ev(){const{caseless:t,skipUndefined:e}=Xx(this)&&this||{},n={},o=(a,l)=>{const c=t&&Qx(n,l)||l;Uf(n[c])&&Uf(a)?n[c]=ev(n[c],a):Uf(a)?n[c]=ev({},a):zl(a)?n[c]=a.slice():(!e||!xl(a))&&(n[c]=a)};for(let a=0,l=arguments.length;a(ku(e,(a,l)=>{n&&dr(a)?Object.defineProperty(t,l,{value:Gx(a,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(t,l,{value:a,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:o}),t),n5=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),r5=(t,e,n,o)=>{t.prototype=Object.create(e.prototype,o),Object.defineProperty(t.prototype,"constructor",{value:t,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},o5=(t,e,n,o)=>{let a,l,c;const d={};if(e=e||{},t==null)return e;do{for(a=Object.getOwnPropertyNames(t),l=a.length;l-- >0;)c=a[l],(!o||o(c,t,e))&&!d[c]&&(e[c]=t[c],d[c]=!0);t=n!==!1&&Vb(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},i5=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const o=t.indexOf(e,n);return o!==-1&&o===n},a5=t=>{if(!t)return null;if(zl(t))return t;let e=t.length;if(!Wx(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},s5=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&Vb(Uint8Array)),l5=(t,e)=>{const o=(t&&t[qh]).call(t);let a;for(;(a=o.next())&&!a.done;){const l=a.value;e.call(t,l[0],l[1])}},c5=(t,e)=>{let n;const o=[];for(;(n=t.exec(e))!==null;)o.push(n);return o},u5=To("HTMLFormElement"),d5=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,o,a){return o.toUpperCase()+a}),Kw=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),f5=To("RegExp"),Jx=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),o={};ku(n,(a,l)=>{let c;(c=e(a,l,t))!==!1&&(o[l]=c||a)}),Object.defineProperties(t,o)},h5=t=>{Jx(t,(e,n)=>{if(dr(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const o=t[n];if(dr(o)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},p5=(t,e)=>{const n={},o=a=>{a.forEach(l=>{n[l]=!0})};return zl(t)?o(t):o(String(t).split(e)),n},g5=()=>{},m5=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function y5(t){return!!(t&&dr(t.append)&&t[qx]==="FormData"&&t[qh])}const v5=t=>{const e=new Array(10),n=(o,a)=>{if(Iu(o)){if(e.indexOf(o)>=0)return;if(Ou(o))return o;if(!("toJSON"in o)){e[a]=o;const l=zl(o)?[]:{};return ku(o,(c,d)=>{const f=n(c,a+1);!xl(f)&&(l[d]=f)}),e[a]=void 0,l}}return o};return n(t,0)},b5=To("AsyncFunction"),S5=t=>t&&(Iu(t)||dr(t))&&dr(t.then)&&dr(t.catch),Zx=((t,e)=>t?setImmediate:e?((n,o)=>(qa.addEventListener("message",({source:a,data:l})=>{a===qa&&l===n&&o.length&&o.shift()()},!1),a=>{o.push(a),qa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",dr(qa.postMessage)),C5=typeof queueMicrotask<"u"?queueMicrotask.bind(qa):typeof process<"u"&&process.nextTick||Zx,E5=t=>t!=null&&dr(t[qh]),ne={isArray:zl,isArrayBuffer:Yx,isBuffer:Ou,isFormData:Yz,isArrayBufferView:Bz,isString:Hz,isNumber:Wx,isBoolean:jz,isObject:Iu,isPlainObject:Uf,isEmptyObject:$z,isReadableStream:Qz,isRequest:Xz,isResponse:Jz,isHeaders:Zz,isUndefined:xl,isDate:Fz,isFile:Kz,isBlob:Vz,isRegExp:f5,isFunction:dr,isStream:qz,isURLSearchParams:Wz,isTypedArray:s5,isFileList:Gz,forEach:ku,merge:ev,extend:t5,trim:e5,stripBOM:n5,inherits:r5,toFlatObject:o5,kindOf:Yh,kindOfTest:To,endsWith:i5,toArray:a5,forEachEntry:l5,matchAll:c5,isHTMLForm:u5,hasOwnProperty:Kw,hasOwnProp:Kw,reduceDescriptors:Jx,freezeMethods:h5,toObjectSet:p5,toCamelCase:d5,noop:g5,toFiniteNumber:m5,findKey:Qx,global:qa,isContextDefined:Xx,isSpecCompliantForm:y5,toJSONObject:v5,isAsyncFn:b5,isThenable:S5,setImmediate:Zx,asap:C5,isIterable:E5};let je=class e_ extends Error{static from(e,n,o,a,l,c){const d=new e_(e.message,n||e.code,o,a,l);return d.cause=e,d.name=e.name,c&&Object.assign(d,c),d}constructor(e,n,o,a,l){super(e),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),o&&(this.config=o),a&&(this.request=a),l&&(this.response=l,this.status=l.status)}toJSON(){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:ne.toJSONObject(this.config),code:this.code,status:this.status}}};je.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";je.ERR_BAD_OPTION="ERR_BAD_OPTION";je.ECONNABORTED="ECONNABORTED";je.ETIMEDOUT="ETIMEDOUT";je.ERR_NETWORK="ERR_NETWORK";je.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";je.ERR_DEPRECATED="ERR_DEPRECATED";je.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";je.ERR_BAD_REQUEST="ERR_BAD_REQUEST";je.ERR_CANCELED="ERR_CANCELED";je.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";je.ERR_INVALID_URL="ERR_INVALID_URL";const T5=null;function tv(t){return ne.isPlainObject(t)||ne.isArray(t)}function t_(t){return ne.endsWith(t,"[]")?t.slice(0,-2):t}function Vw(t,e,n){return t?t.concat(e).map(function(a,l){return a=t_(a),!n&&l?"["+a+"]":a}).join(n?".":""):e}function w5(t){return ne.isArray(t)&&!t.some(tv)}const A5=ne.toFlatObject(ne,{},null,function(e){return/^is[A-Z]/.test(e)});function Qh(t,e,n){if(!ne.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=ne.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,w){return!ne.isUndefined(w[T])});const o=n.metaTokens,a=n.visitor||m,l=n.dots,c=n.indexes,f=(n.Blob||typeof Blob<"u"&&Blob)&&ne.isSpecCompliantForm(e);if(!ne.isFunction(a))throw new TypeError("visitor must be a function");function h(b){if(b===null)return"";if(ne.isDate(b))return b.toISOString();if(ne.isBoolean(b))return b.toString();if(!f&&ne.isBlob(b))throw new je("Blob is not supported. Use a Buffer instead.");return ne.isArrayBuffer(b)||ne.isTypedArray(b)?f&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function m(b,T,w){let _=b;if(b&&!w&&typeof b=="object"){if(ne.endsWith(T,"{}"))T=o?T:T.slice(0,-2),b=JSON.stringify(b);else if(ne.isArray(b)&&w5(b)||(ne.isFileList(b)||ne.endsWith(T,"[]"))&&(_=ne.toArray(b)))return T=t_(T),_.forEach(function(R,N){!(ne.isUndefined(R)||R===null)&&e.append(c===!0?Vw([T],N,l):c===null?T:T+"[]",h(R))}),!1}return tv(b)?!0:(e.append(Vw(w,T,l),h(b)),!1)}const y=[],v=Object.assign(A5,{defaultVisitor:m,convertValue:h,isVisitable:tv});function C(b,T){if(!ne.isUndefined(b)){if(y.indexOf(b)!==-1)throw Error("Circular reference detected in "+T.join("."));y.push(b),ne.forEach(b,function(_,k){(!(ne.isUndefined(_)||_===null)&&a.call(e,_,ne.isString(k)?k.trim():k,T,v))===!0&&C(_,T?T.concat(k):[k])}),y.pop()}}if(!ne.isObject(t))throw new TypeError("data must be an object");return C(t),e}function Gw(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(o){return e[o]})}function Gb(t,e){this._pairs=[],t&&Qh(t,this,e)}const n_=Gb.prototype;n_.append=function(e,n){this._pairs.push([e,n])};n_.toString=function(e){const n=e?function(o){return e.call(this,o,Gw)}:Gw;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function R5(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function r_(t,e,n){if(!e)return t;const o=n&&n.encode||R5,a=ne.isFunction(n)?{serialize:n}:n,l=a&&a.serialize;let c;if(l?c=l(e,a):c=ne.isURLSearchParams(e)?e.toString():new Gb(e,a).toString(o),c){const d=t.indexOf("#");d!==-1&&(t=t.slice(0,d)),t+=(t.indexOf("?")===-1?"?":"&")+c}return t}class qw{constructor(){this.handlers=[]}use(e,n,o){return this.handlers.push({fulfilled:e,rejected:n,synchronous:o?o.synchronous:!1,runWhen:o?o.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){ne.forEach(this.handlers,function(o){o!==null&&e(o)})}}const o_={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},x5=typeof URLSearchParams<"u"?URLSearchParams:Gb,_5=typeof FormData<"u"?FormData:null,O5=typeof Blob<"u"?Blob:null,I5={isBrowser:!0,classes:{URLSearchParams:x5,FormData:_5,Blob:O5},protocols:["http","https","file","blob","url","data"]},qb=typeof window<"u"&&typeof document<"u",nv=typeof navigator=="object"&&navigator||void 0,k5=qb&&(!nv||["ReactNative","NativeScript","NS"].indexOf(nv.product)<0),M5=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",N5=qb&&window.location.href||"http://localhost",P5=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:qb,hasStandardBrowserEnv:k5,hasStandardBrowserWebWorkerEnv:M5,navigator:nv,origin:N5},Symbol.toStringTag,{value:"Module"})),Gn={...P5,...I5};function D5(t,e){return Qh(t,new Gn.classes.URLSearchParams,{visitor:function(n,o,a,l){return Gn.isNode&&ne.isBuffer(n)?(this.append(o,n.toString("base64")),!1):l.defaultVisitor.apply(this,arguments)},...e})}function L5(t){return ne.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function U5(t){const e={},n=Object.keys(t);let o;const a=n.length;let l;for(o=0;o=n.length;return c=!c&&ne.isArray(a)?a.length:c,f?(ne.hasOwnProp(a,c)?a[c]=[a[c],o]:a[c]=o,!d):((!a[c]||!ne.isObject(a[c]))&&(a[c]=[]),e(n,o,a[c],l)&&ne.isArray(a[c])&&(a[c]=U5(a[c])),!d)}if(ne.isFormData(t)&&ne.isFunction(t.entries)){const n={};return ne.forEachEntry(t,(o,a)=>{e(L5(o),a,n,0)}),n}return null}function z5(t,e,n){if(ne.isString(t))try{return(e||JSON.parse)(t),ne.trim(t)}catch(o){if(o.name!=="SyntaxError")throw o}return(n||JSON.stringify)(t)}const Mu={transitional:o_,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const o=n.getContentType()||"",a=o.indexOf("application/json")>-1,l=ne.isObject(e);if(l&&ne.isHTMLForm(e)&&(e=new FormData(e)),ne.isFormData(e))return a?JSON.stringify(i_(e)):e;if(ne.isArrayBuffer(e)||ne.isBuffer(e)||ne.isStream(e)||ne.isFile(e)||ne.isBlob(e)||ne.isReadableStream(e))return e;if(ne.isArrayBufferView(e))return e.buffer;if(ne.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(l){if(o.indexOf("application/x-www-form-urlencoded")>-1)return D5(e,this.formSerializer).toString();if((d=ne.isFileList(e))||o.indexOf("multipart/form-data")>-1){const f=this.env&&this.env.FormData;return Qh(d?{"files[]":e}:e,f&&new f,this.formSerializer)}}return l||a?(n.setContentType("application/json",!1),z5(e)):e}],transformResponse:[function(e){const n=this.transitional||Mu.transitional,o=n&&n.forcedJSONParsing,a=this.responseType==="json";if(ne.isResponse(e)||ne.isReadableStream(e))return e;if(e&&ne.isString(e)&&(o&&!this.responseType||a)){const c=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(e,this.parseReviver)}catch(d){if(c)throw d.name==="SyntaxError"?je.from(d,je.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Gn.classes.FormData,Blob:Gn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ne.forEach(["delete","get","head","post","put","patch"],t=>{Mu.headers[t]={}});const B5=ne.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"]),H5=t=>{const e={};let n,o,a;return t&&t.split(` `).forEach(function(c){a=c.indexOf(":"),n=c.substring(0,a).trim().toLowerCase(),o=c.substring(a+1).trim(),!(!n||e[n]&&B5[n])&&(n==="set-cookie"?e[n]?e[n].push(o):e[n]=[o]:e[n]=e[n]?e[n]+", "+o:o)}),e},Yw=Symbol("internals");function Lc(t){return t&&String(t).trim().toLowerCase()}function zf(t){return t===!1||t==null?t:ne.isArray(t)?t.map(zf):String(t)}function j5(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let o;for(;o=n.exec(t);)e[o[1]]=o[2];return e}const $5=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function Zm(t,e,n,o,a){if(ne.isFunction(o))return o.call(this,e,n);if(a&&(e=n),!!ne.isString(e)){if(ne.isString(o))return e.indexOf(o)!==-1;if(ne.isRegExp(o))return o.test(e)}}function F5(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,o)=>n.toUpperCase()+o)}function K5(t,e){const n=ne.toCamelCase(" "+e);["get","set","has"].forEach(o=>{Object.defineProperty(t,o+n,{value:function(a,l,c){return this[o].call(this,e,a,l,c)},configurable:!0})})}let fr=class{constructor(e){e&&this.set(e)}set(e,n,o){const a=this;function l(d,f,h){const m=Lc(f);if(!m)throw new Error("header name must be a non-empty string");const y=ne.findKey(a,m);(!y||a[y]===void 0||h===!0||h===void 0&&a[y]!==!1)&&(a[y||f]=zf(d))}const c=(d,f)=>ne.forEach(d,(h,m)=>l(h,m,f));if(ne.isPlainObject(e)||e instanceof this.constructor)c(e,n);else if(ne.isString(e)&&(e=e.trim())&&!$5(e))c(H5(e),n);else if(ne.isObject(e)&&ne.isIterable(e)){let d={},f,h;for(const m of e){if(!ne.isArray(m))throw TypeError("Object iterator must return a key-value pair");d[h=m[0]]=(f=d[h])?ne.isArray(f)?[...f,m[1]]:[f,m[1]]:m[1]}c(d,n)}else e!=null&&l(n,e,o);return this}get(e,n){if(e=Lc(e),e){const o=ne.findKey(this,e);if(o){const a=this[o];if(!n)return a;if(n===!0)return j5(a);if(ne.isFunction(n))return n.call(this,a,o);if(ne.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Lc(e),e){const o=ne.findKey(this,e);return!!(o&&this[o]!==void 0&&(!n||Zm(this,this[o],o,n)))}return!1}delete(e,n){const o=this;let a=!1;function l(c){if(c=Lc(c),c){const d=ne.findKey(o,c);d&&(!n||Zm(o,o[d],d,n))&&(delete o[d],a=!0)}}return ne.isArray(e)?e.forEach(l):l(e),a}clear(e){const n=Object.keys(this);let o=n.length,a=!1;for(;o--;){const l=n[o];(!e||Zm(this,this[l],l,e,!0))&&(delete this[l],a=!0)}return a}normalize(e){const n=this,o={};return ne.forEach(this,(a,l)=>{const c=ne.findKey(o,l);if(c){n[c]=zf(a),delete n[l];return}const d=e?F5(l):String(l).trim();d!==l&&delete n[l],n[d]=zf(a),o[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return ne.forEach(this,(o,a)=>{o!=null&&o!==!1&&(n[a]=e&&ne.isArray(o)?o.join(", "):o)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const o=new this(e);return n.forEach(a=>o.set(a)),o}static accessor(e){const o=(this[Yw]=this[Yw]={accessors:{}}).accessors,a=this.prototype;function l(c){const d=Lc(c);o[d]||(K5(a,c),o[d]=!0)}return ne.isArray(e)?e.forEach(l):l(e),this}};fr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ne.reduceDescriptors(fr.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(o){this[n]=o}}});ne.freezeMethods(fr);function ey(t,e){const n=this||Mu,o=e||n,a=fr.from(o.headers);let l=o.data;return ne.forEach(t,function(d){l=d.call(n,l,a.normalize(),e?e.status:void 0)}),a.normalize(),l}function a_(t){return!!(t&&t.__CANCEL__)}let Nu=class extends je{constructor(e,n,o){super(e??"canceled",je.ERR_CANCELED,n,o),this.name="CanceledError",this.__CANCEL__=!0}};function s_(t,e,n){const o=n.config.validateStatus;!n.status||!o||o(n.status)?t(n):e(new je("Request failed with status code "+n.status,[je.ERR_BAD_REQUEST,je.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function V5(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function G5(t,e){t=t||10;const n=new Array(t),o=new Array(t);let a=0,l=0,c;return e=e!==void 0?e:1e3,function(f){const h=Date.now(),m=o[l];c||(c=h),n[a]=f,o[a]=h;let y=l,v=0;for(;y!==a;)v+=n[y++],y=y%t;if(a=(a+1)%t,a===l&&(l=(l+1)%t),h-c{n=m,a=null,l&&(clearTimeout(l),l=null),t(...h)};return[(...h)=>{const m=Date.now(),y=m-n;y>=o?c(h,m):(a=h,l||(l=setTimeout(()=>{l=null,c(a)},o-y)))},()=>a&&c(a)]}const gh=(t,e,n=3)=>{let o=0;const a=G5(50,250);return q5(l=>{const c=l.loaded,d=l.lengthComputable?l.total:void 0,f=c-o,h=a(f),m=c<=d;o=c;const y={loaded:c,total:d,progress:d?c/d:void 0,bytes:f,rate:h||void 0,estimated:h&&d&&m?(d-c)/h:void 0,event:l,lengthComputable:d!=null,[e?"download":"upload"]:!0};t(y)},n)},Ww=(t,e)=>{const n=t!=null;return[o=>e[0]({lengthComputable:n,total:t,loaded:o}),e[1]]},Qw=t=>(...e)=>ne.asap(()=>t(...e)),Y5=Gn.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Gn.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Gn.origin),Gn.navigator&&/(msie|trident)/i.test(Gn.navigator.userAgent)):()=>!0,W5=Gn.hasStandardBrowserEnv?{write(t,e,n,o,a,l,c){if(typeof document>"u")return;const d=[`${t}=${encodeURIComponent(e)}`];ne.isNumber(n)&&d.push(`expires=${new Date(n).toUTCString()}`),ne.isString(o)&&d.push(`path=${o}`),ne.isString(a)&&d.push(`domain=${a}`),l===!0&&d.push("secure"),ne.isString(c)&&d.push(`SameSite=${c}`),document.cookie=d.join("; ")},read(t){if(typeof document>"u")return null;const e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Q5(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function X5(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function l_(t,e,n){let o=!Q5(e);return t&&(o||n==!1)?X5(t,e):e}const Xw=t=>t instanceof fr?{...t}:t;function cs(t,e){e=e||{};const n={};function o(h,m,y,v){return ne.isPlainObject(h)&&ne.isPlainObject(m)?ne.merge.call({caseless:v},h,m):ne.isPlainObject(m)?ne.merge({},m):ne.isArray(m)?m.slice():m}function a(h,m,y,v){if(ne.isUndefined(m)){if(!ne.isUndefined(h))return o(void 0,h,y,v)}else return o(h,m,y,v)}function l(h,m){if(!ne.isUndefined(m))return o(void 0,m)}function c(h,m){if(ne.isUndefined(m)){if(!ne.isUndefined(h))return o(void 0,h)}else return o(void 0,m)}function d(h,m,y){if(y in e)return o(h,m);if(y in t)return o(void 0,h)}const f={url:l,method:l,data:l,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(h,m,y)=>a(Xw(h),Xw(m),y,!0)};return ne.forEach(Object.keys({...t,...e}),function(m){const y=f[m]||a,v=y(t[m],e[m],m);ne.isUndefined(v)&&y!==d||(n[m]=v)}),n}const c_=t=>{const e=cs({},t);let{data:n,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:l,headers:c,auth:d}=e;if(e.headers=c=fr.from(c),e.url=r_(l_(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):""))),ne.isFormData(n)){if(Gn.hasStandardBrowserEnv||Gn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(ne.isFunction(n.getHeaders)){const f=n.getHeaders(),h=["content-type","content-length"];Object.entries(f).forEach(([m,y])=>{h.includes(m.toLowerCase())&&c.set(m,y)})}}if(Gn.hasStandardBrowserEnv&&(o&&ne.isFunction(o)&&(o=o(e)),o||o!==!1&&Y5(e.url))){const f=a&&l&&W5.read(l);f&&c.set(a,f)}return e},J5=typeof XMLHttpRequest<"u",Z5=J5&&function(t){return new Promise(function(n,o){const a=c_(t);let l=a.data;const c=fr.from(a.headers).normalize();let{responseType:d,onUploadProgress:f,onDownloadProgress:h}=a,m,y,v,C,b;function T(){C&&C(),b&&b(),a.cancelToken&&a.cancelToken.unsubscribe(m),a.signal&&a.signal.removeEventListener("abort",m)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function _(){if(!w)return;const R=fr.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),M={data:!d||d==="text"||d==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:R,config:t,request:w};s_(function(x){n(x),T()},function(x){o(x),T()},M),w=null}"onloadend"in w?w.onloadend=_:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(_)},w.onabort=function(){w&&(o(new je("Request aborted",je.ECONNABORTED,t,w)),w=null)},w.onerror=function(N){const M=N&&N.message?N.message:"Network Error",U=new je(M,je.ERR_NETWORK,t,w);U.event=N||null,o(U),w=null},w.ontimeout=function(){let N=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const M=a.transitional||o_;a.timeoutErrorMessage&&(N=a.timeoutErrorMessage),o(new je(N,M.clarifyTimeoutError?je.ETIMEDOUT:je.ECONNABORTED,t,w)),w=null},l===void 0&&c.setContentType(null),"setRequestHeader"in w&&ne.forEach(c.toJSON(),function(N,M){w.setRequestHeader(M,N)}),ne.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),d&&d!=="json"&&(w.responseType=a.responseType),h&&([v,b]=gh(h,!0),w.addEventListener("progress",v)),f&&w.upload&&([y,C]=gh(f),w.upload.addEventListener("progress",y),w.upload.addEventListener("loadend",C)),(a.cancelToken||a.signal)&&(m=R=>{w&&(o(!R||R.type?new Nu(null,t,w):R),w.abort(),w=null)},a.cancelToken&&a.cancelToken.subscribe(m),a.signal&&(a.signal.aborted?m():a.signal.addEventListener("abort",m)));const k=V5(a.url);if(k&&Gn.protocols.indexOf(k)===-1){o(new je("Unsupported protocol "+k+":",je.ERR_BAD_REQUEST,t));return}w.send(l||null)})},eB=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let o=new AbortController,a;const l=function(h){if(!a){a=!0,d();const m=h instanceof Error?h:this.reason;o.abort(m instanceof je?m:new Nu(m instanceof Error?m.message:m))}};let c=e&&setTimeout(()=>{c=null,l(new je(`timeout of ${e}ms exceeded`,je.ETIMEDOUT))},e);const d=()=>{t&&(c&&clearTimeout(c),c=null,t.forEach(h=>{h.unsubscribe?h.unsubscribe(l):h.removeEventListener("abort",l)}),t=null)};t.forEach(h=>h.addEventListener("abort",l));const{signal:f}=o;return f.unsubscribe=()=>ne.asap(d),f}},tB=function*(t,e){let n=t.byteLength;if(n{const a=nB(t,e);let l=0,c,d=f=>{c||(c=!0,o&&o(f))};return new ReadableStream({async pull(f){try{const{done:h,value:m}=await a.next();if(h){d(),f.close();return}let y=m.byteLength;if(n){let v=l+=y;n(v)}f.enqueue(new Uint8Array(m))}catch(h){throw d(h),h}},cancel(f){return d(f),a.return()}},{highWaterMark:2})},Zw=64*1024,{isFunction:mf}=ne,oB=(({Request:t,Response:e})=>({Request:t,Response:e}))(ne.global),{ReadableStream:eA,TextEncoder:tA}=ne.global,nA=(t,...e)=>{try{return!!t(...e)}catch{return!1}},iB=t=>{t=ne.merge.call({skipUndefined:!0},oB,t);const{fetch:e,Request:n,Response:o}=t,a=e?mf(e):typeof fetch=="function",l=mf(n),c=mf(o);if(!a)return!1;const d=a&&mf(eA),f=a&&(typeof tA=="function"?(b=>T=>b.encode(T))(new tA):async b=>new Uint8Array(await new n(b).arrayBuffer())),h=l&&d&&nA(()=>{let b=!1;const T=new n(Gn.origin,{body:new eA,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!T}),m=c&&d&&nA(()=>ne.isReadableStream(new o("").body)),y={stream:m&&(b=>b.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!y[b]&&(y[b]=(T,w)=>{let _=T&&T[b];if(_)return _.call(T);throw new je(`Response type '${b}' is not supported`,je.ERR_NOT_SUPPORT,w)})});const v=async b=>{if(b==null)return 0;if(ne.isBlob(b))return b.size;if(ne.isSpecCompliantForm(b))return(await new n(Gn.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(ne.isArrayBufferView(b)||ne.isArrayBuffer(b))return b.byteLength;if(ne.isURLSearchParams(b)&&(b=b+""),ne.isString(b))return(await f(b)).byteLength},C=async(b,T)=>{const w=ne.toFiniteNumber(b.getContentLength());return w??v(T)};return async b=>{let{url:T,method:w,data:_,signal:k,cancelToken:R,timeout:N,onDownloadProgress:M,onUploadProgress:U,responseType:x,headers:L,withCredentials:H="same-origin",fetchOptions:A}=c_(b),$=e||fetch;x=x?(x+"").toLowerCase():"text";let ee=eB([k,R&&R.toAbortSignal()],N),re=null;const le=ee&&ee.unsubscribe&&(()=>{ee.unsubscribe()});let W;try{if(U&&h&&w!=="get"&&w!=="head"&&(W=await C(L,_))!==0){let P=new n(T,{method:"POST",body:_,duplex:"half"}),V;if(ne.isFormData(_)&&(V=P.headers.get("content-type"))&&L.setContentType(V),P.body){const[oe,de]=Ww(W,gh(Qw(U)));_=Jw(P.body,Zw,oe,de)}}ne.isString(H)||(H=H?"include":"omit");const D=l&&"credentials"in n.prototype,J={...A,signal:ee,method:w.toUpperCase(),headers:L.normalize().toJSON(),body:_,duplex:"half",credentials:D?H:void 0};re=l&&new n(T,J);let q=await(l?$(re,A):$(T,J));const X=m&&(x==="stream"||x==="response");if(m&&(M||X&&le)){const P={};["status","statusText","headers"].forEach(ye=>{P[ye]=q[ye]});const V=ne.toFiniteNumber(q.headers.get("content-length")),[oe,de]=M&&Ww(V,gh(Qw(M),!0))||[];q=new o(Jw(q.body,Zw,oe,()=>{de&&de(),le&&le()}),P)}x=x||"text";let pe=await y[ne.findKey(y,x)||"text"](q,b);return!X&&le&&le(),await new Promise((P,V)=>{s_(P,V,{data:pe,headers:fr.from(q.headers),status:q.status,statusText:q.statusText,config:b,request:re})})}catch(D){throw le&&le(),D&&D.name==="TypeError"&&/Load failed|fetch/i.test(D.message)?Object.assign(new je("Network Error",je.ERR_NETWORK,b,re),{cause:D.cause||D}):je.from(D,D&&D.code,b,re)}}},aB=new Map,u_=t=>{let e=t&&t.env||{};const{fetch:n,Request:o,Response:a}=e,l=[o,a,n];let c=l.length,d=c,f,h,m=aB;for(;d--;)f=l[d],h=m.get(f),h===void 0&&m.set(f,h=d?new Map:iB(e)),m=h;return h};u_();const Yb={http:T5,xhr:Z5,fetch:{get:u_}};ne.forEach(Yb,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const rA=t=>`- ${t}`,sB=t=>ne.isFunction(t)||t===null||t===!1;function lB(t,e){t=ne.isArray(t)?t:[t];const{length:n}=t;let o,a;const l={};for(let c=0;c`adapter ${f} `+(h===!1?"is not supported by the environment":"is not available in the build"));let d=n?c.length>1?`since : `+c.map(rA).join(` `):" "+rA(c[0]):"as no adapter specified";throw new je("There is no suitable adapter to dispatch the request "+d,"ERR_NOT_SUPPORT")}return a}const d_={getAdapter:lB,adapters:Yb};function ty(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Nu(null,t)}function oA(t){return ty(t),t.headers=fr.from(t.headers),t.data=ey.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),d_.getAdapter(t.adapter||Mu.adapter,t)(t).then(function(o){return ty(t),o.data=ey.call(t,t.transformResponse,o),o.headers=fr.from(o.headers),o},function(o){return a_(o)||(ty(t),o&&o.response&&(o.response.data=ey.call(t,t.transformResponse,o.response),o.response.headers=fr.from(o.response.headers))),Promise.reject(o)})}const f_="1.13.4",Xh={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Xh[t]=function(o){return typeof o===t||"a"+(e<1?"n ":" ")+t}});const iA={};Xh.transitional=function(e,n,o){function a(l,c){return"[Axios v"+f_+"] Transitional option '"+l+"'"+c+(o?". "+o:"")}return(l,c,d)=>{if(e===!1)throw new je(a(c," has been removed"+(n?" in "+n:"")),je.ERR_DEPRECATED);return n&&!iA[c]&&(iA[c]=!0,console.warn(a(c," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(l,c,d):!0}};Xh.spelling=function(e){return(n,o)=>(console.warn(`${o} is likely a misspelling of ${e}`),!0)};function cB(t,e,n){if(typeof t!="object")throw new je("options must be an object",je.ERR_BAD_OPTION_VALUE);const o=Object.keys(t);let a=o.length;for(;a-- >0;){const l=o[a],c=e[l];if(c){const d=t[l],f=d===void 0||c(d,l,t);if(f!==!0)throw new je("option "+l+" must be "+f,je.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new je("Unknown option "+l,je.ERR_BAD_OPTION)}}const Bf={assertOptions:cB,validators:Xh},Io=Bf.validators;let es=class{constructor(e){this.defaults=e||{},this.interceptors={request:new qw,response:new qw}}async request(e,n){try{return await this._request(e,n)}catch(o){if(o instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const l=a.stack?a.stack.replace(/^.+\n/,""):"";try{o.stack?l&&!String(o.stack).endsWith(l.replace(/^.+\n.+\n/,""))&&(o.stack+=` `+l):o.stack=l}catch{}}throw o}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=cs(this.defaults,n);const{transitional:o,paramsSerializer:a,headers:l}=n;o!==void 0&&Bf.assertOptions(o,{silentJSONParsing:Io.transitional(Io.boolean),forcedJSONParsing:Io.transitional(Io.boolean),clarifyTimeoutError:Io.transitional(Io.boolean)},!1),a!=null&&(ne.isFunction(a)?n.paramsSerializer={serialize:a}:Bf.assertOptions(a,{encode:Io.function,serialize:Io.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),Bf.assertOptions(n,{baseUrl:Io.spelling("baseURL"),withXsrfToken:Io.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let c=l&&ne.merge(l.common,l[n.method]);l&&ne.forEach(["delete","get","head","post","put","patch","common"],b=>{delete l[b]}),n.headers=fr.concat(c,l);const d=[];let f=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(f=f&&T.synchronous,d.unshift(T.fulfilled,T.rejected))});const h=[];this.interceptors.response.forEach(function(T){h.push(T.fulfilled,T.rejected)});let m,y=0,v;if(!f){const b=[oA.bind(this),void 0];for(b.unshift(...d),b.push(...h),v=b.length,m=Promise.resolve(n);y{if(!o._listeners)return;let l=o._listeners.length;for(;l-- >0;)o._listeners[l](a);o._listeners=null}),this.promise.then=a=>{let l;const c=new Promise(d=>{o.subscribe(d),l=d}).then(a);return c.cancel=function(){o.unsubscribe(l)},c},e(function(l,c,d){o.reason||(o.reason=new Nu(l,c,d),n(o.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=o=>{e.abort(o)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new h_(function(a){e=a}),cancel:e}}};function dB(t){return function(n){return t.apply(null,n)}}function fB(t){return ne.isObject(t)&&t.isAxiosError===!0}const rv={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,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(rv).forEach(([t,e])=>{rv[e]=t});function p_(t){const e=new es(t),n=Gx(es.prototype.request,e);return ne.extend(n,es.prototype,e,{allOwnKeys:!0}),ne.extend(n,e,null,{allOwnKeys:!0}),n.create=function(a){return p_(cs(t,a))},n}const nn=p_(Mu);nn.Axios=es;nn.CanceledError=Nu;nn.CancelToken=uB;nn.isCancel=a_;nn.VERSION=f_;nn.toFormData=Qh;nn.AxiosError=je;nn.Cancel=nn.CanceledError;nn.all=function(e){return Promise.all(e)};nn.spread=dB;nn.isAxiosError=fB;nn.mergeConfig=cs;nn.AxiosHeaders=fr;nn.formToJSON=t=>i_(ne.isHTMLForm(t)?new FormData(t):t);nn.getAdapter=d_.getAdapter;nn.HttpStatusCode=rv;nn.default=nn;const{Axios:cq,AxiosError:uq,CanceledError:dq,isCancel:fq,CancelToken:hq,VERSION:pq,all:gq,Cancel:mq,isAxiosError:yq,spread:vq,toFormData:bq,AxiosHeaders:Sq,HttpStatusCode:Cq,formToJSON:Eq,getAdapter:Tq,mergeConfig:wq}=nn,hB={auth:{clientId:"840e811f-9bbc-4239-b932-26d5f8e9971d",authority:"https://login.microsoftonline.com/3742a04d-aa16-46b9-b910-6e7ae5ae1229",redirectUri:window.location.origin,postLogoutRedirectUri:window.location.origin},cache:{cacheLocation:"sessionStorage"},system:{loggerOptions:{loggerCallback:(t,e,n)=>{if(!n)switch(t){case Mt.Error:console.error(e);break;case Mt.Info:console.info(e);break;case Mt.Verbose:console.debug(e);break;case Mt.Warning:console.warn(e);break}},logLevel:Mt.Warning}}},pB={scopes:["User.Read","openid","profile","email"]},Ti={LOGIN:"/login",SEARCH:"/search",NOT_FOUND:"/404"},ct={common:{systemName:"理論在庫管理システム",systemNameShort:"理論在庫管理",systemNameEn:"Inventory Management System",loading:"読み込み中...",searching:"検索中...",noData:"データがありません",noMatch:"条件に一致するデータがありません",error:"エラーが発生しました",success:"成功しました",all:"すべて",clear:"クリア",close:"閉じる",open:"開く",search:"検索",filter:"フィルター",sort:"並び替え",export:"エクスポート",refresh:"再取得",update:"更新",delete:"削除",cancel:"キャンセル",confirm:"確認",save:"保存",back:"戻る",next:"次へ",prev:"前へ",viewAll:"すべて見る",viewDetails:"詳細を見る"},units:{pieces:"個",items:"件",kg:"kg",cm:"cm",weight:"重さ",height:"縦",width:"横",count:t=>`${t}件`,total:t=>`合計: ${t}個`,types:t=>`${t}種類`,displayed:(t,e,n)=>`${t}-${e} / ${n!==-1?n:`more than ${e}`}`},nav:{inventorySearch:"在庫検索",inventoryList:"在庫一覧",storeInventory:"店舗在庫",dashboard:"ダッシュボード",backToSearch:"検索に戻る",backToDashboard:"ダッシュボードに戻る"},auth:{login:"ログイン",logout:"ログアウト",loginWith:"Microsoft 365でログイン",loggingIn:"ログイン中...",authenticating:"認証中...",processingAuth:"認証情報を処理中...",initializingAuth:"認証を初期化しています...",loginFailed:"ログインに失敗しました",authFailed:"認証に失敗しました",interactionInProgress:"認証を準備しています。しばらくしてからもう一度クリックしてください。"},pages:{inventorySearch:t=>`${t}店 在庫検索`,inventoryList:"在庫一覧(サンプル)",storeInventory:t=>`${t}の在庫`,dashboard:"ダッシュボード",systemTagline:"在庫を 瞬時に 確認",systemDescription:"顧客が必要としている商品をいち早く検索して提供するための在庫確認システム"},search:{placeholder:"JANコード・品番・型番・商品名で検索",placeholderSimple:"店舗",storeSearchPlaceholder:"店舗を検索...",searching:"検索中...",noResults:"該当する商品が見つかりませんでした",noResultsDetails:"JANコード・品番・商品名を確認するか、検索条件を変更してお試しください",storeSwitch:"店舗切り替え:",currentStore:"(所属店舗)",myStore:"自店",storeNotFound:"店舗が見つかりません",searchPageTitle:t=>`${t}店 在庫検索`,ocInventory:"OC在庫",searchByModel:"型番",loadMore:"もっと見る",locationEC:"EC",locationOC:"OC",storeInfoTitle:"店舗情報",storeCode:"店舗コード",storeName:"店舗名",address:"住所",phoneNumber:"電話番号",storeInfoEmpty:"—",stockEmpty:"-"},table:{location:"場所",quantity:"在庫",expectedIncomingQuantity:"当日入荷予定",customerOrderReservedQuantity:"客注"},inventory:{totalQuantity:"総在庫数",totalSku:"総SKU数",lowStock:"低在庫",outOfStock:"欠品",noStock:"在庫なし",lowStockAlert:"低在庫アラート",fewRemaining:"残りわずか",inStock:"在庫あり",available:"利用可能在庫",orderable:"注文可能",inventoryStatus:"在庫状況",storeInventory:"店舗別在庫",ocWarehouse:"OC倉庫在庫",scheduled:"入荷予定(2週間以内)",recentlyUpdated:"最近更新された在庫",productInfo:t=>`商品情報 (${t}件)`,inventoryCount:t=>`${t}件の在庫`,noInventoryData:"在庫データがありません",noStoreData:"この店舗には在庫データがありません",storeInventoryNotFound:"店舗在庫データがありません"},inventoryTypes:{normal:"通常",customerOrder:"客注",display:"展示品"},status:{available:"在庫あり",reserved:"予約済み",display:"展示品",outOfStock:"欠品"},categories:{all:"すべてのカテゴリ",apparel:"アパレル",gear:"ギア",accessories:"アクセサリー"},product:{name:"商品名",janCode:"JANコード",productCode:"品番",code:"品番",janText:t=>`JAN: ${t}`,codeText:t=>`品目コード: ${t}`,brand:"ブランド",category:"カテゴリ",weight:"重さ",height:"縦",width:"横",attributes:"商品属性",material:"素材",size:"サイズ",modelNumber:"モデル番号",color:"カラー",price:"価格",image:"商品画像",similarProducts:"類似商品",similar:"類似商品",detailsLabel:"商品詳細:"},store:{storeCode:"店舗コード",storeName:"店舗名",myStore:"自店",myStoreInventory:"自店舗の在庫",otherStoreInventory:"他店舗の在庫",storeList:"店舗一覧",currentStore:"所属店舗"},actions:{search:"検索",filter:"フィルター",refresh:"再取得",update:"更新",export:"エクスポート",clear:"クリア",viewDetails:"詳細を見る",viewAll:"すべて見る",login:"ログイン",logout:"ログアウト",back:"戻る",confirm:"確認",cancel:"キャンセル",close:"閉じる",reload:"ページを再読み込み"},errors:{fetchFailed:"取得に失敗しました",loginFailed:"ログインに失敗しました",authFailed:"認証に失敗しました",searchFailed:"検索に失敗しました",updateFailed:"更新に失敗しました",deleteFailed:"削除に失敗しました",exportFailed:"エクスポートに失敗しました",storeListFetchFailed:"店舗一覧の取得に失敗しました",storeListFetchError:"店舗一覧取得エラー:",apiError:"API が /inventory を返すか確認してください。",unexpected:"予期しないエラーが発生しました",productInfoFetchFailed:"商品情報の取得に失敗しました",systemError:"システムエラーが発生しました"},success:{inventoryFetched:"在庫一覧を取得しました",updated:"更新しました",deleted:"削除しました",saved:"保存しました"},dashboard:{welcome:t=>`おかえりなさい、${t}さん`,stats:{totalInventory:"総在庫数",totalSku:"在庫SKU",lowStockAlert:"低在庫アラート",stores:"店舗"},cards:{inventorySearch:"在庫検索",inventorySearchDesc:"JANコード・商品名で在庫を検索",storeInventoryList:"店舗在庫一覧",storeInventoryDesc:t=>`${t}の在庫を確認`,recentlyUpdated:"最近更新された在庫"}},login:{tagline:"在庫を 瞬時に 確認",description:"顧客が必要としている商品をいち早く検索して提供するための在庫確認システム",features:{realtimeSearch:{title:"リアルタイム検索",description:"JANコード・商品名で瞬時に在庫を検索"},allStoresView:{title:"全店舗可視化",description:"自店・他店・OC在庫を一元管理"},secureAuth:{title:"セキュア認証",description:"Microsoft 365でシングルサインオン"}}},validation:{required:"必須項目です",invalidFormat:"形式が正しくありません",invalidJanCode:"JANコードの形式が正しくありません"},api:{loading:"読み込み中...",error:"エラーが発生しました",noResponse:"サーバーからの応答がありません",unauthorized:"認証が必要です",forbidden:"アクセス権限がありません",notFound:"データが見つかりません",serverError:"サーバーエラーが発生しました",requestFailed:"リクエストに失敗しました",unknownError:"予期しないエラーが発生しました"},internal:{authMigrationDone:"[Auth Migration] ✅ Migrated auth data to secure storage key",authMigrationFailed:"[Auth Migration] ❌ Failed to migrate auth storage:"}},gB={LOGIN:"/v1/auth/login",LOGOUT:"/v1/auth/logout"},mB={LIST:"/v1/inventory",BY_JAN_CODE:t=>`/v1/inventory/${t}`,BY_STORE:t=>`/v1/inventory/store/${t}`,SUMMARY:t=>`/v1/inventory/summary/${t}`,SCHEDULED:t=>`/v1/inventory/scheduled/${t}`,UPDATE:t=>`/v1/inventory/${t}`},yB={INVENTORY:"/v1/search/inventory",SUGGEST:"/v1/search/suggest",BY_JAN:t=>`/v1/search/jan/${t}`,MULTI_STORE:"/v1/search/multi-store",DETECT_TYPE:"/v1/search/detect-type",SIMILAR:t=>`/v1/search/similar/${t}`},vB={LIST:"/v1/stores",BY_CODE:t=>`/v1/stores/${t}`},Vr={AUTH:gB,INVENTORY:mB,SEARCH:yB,STORE:vB},sa=64,ov=256,bB=(()=>{const t="http://localhost:3001/api";return t.endsWith("/")?t.slice(0,-1):t})();function SB(t){const e=t.startsWith("/")?t:`/${t}`;return`${bB}${e}`}let ny=!1,iv=[];const CB=t=>{iv.forEach(e=>e(t)),iv=[]},EB=t=>{iv.push(t)};let ru=null;const TB=async()=>{const t=ru?.getMsalInstance();if(!t)return console.error("MSAL instance not set"),null;try{const e=t.getAllAccounts();if(e.length===0)return null;const n=await t.acquireTokenSilent({...pB,account:e[0]}),{data:o}=await nn.post(SB(Vr.AUTH.LOGIN),{accessToken:n.accessToken});if(o.success){const a=o.data.token;return ru?.onTokenRefreshed(o.data.user,a),a}return null}catch(e){return console.error("Token refresh failed:",e),null}};function wB(t,e){ru=e,t.interceptors.request.use(n=>{const o=ru?.getToken()??null;return o&&(n.headers.Authorization=`Bearer ${o}`),n},n=>Promise.reject(n)),t.interceptors.response.use(n=>n,async n=>{const o=n.config,a=n.response?.status,l=o?.url?.includes(Vr.AUTH.LOGIN)===!0;if(a===401&&l)return Promise.reject(n);if(a===401&&o&&!o._retry){if(o._retry=!0,ny)return new Promise(c=>{EB(d=>{o.headers.Authorization=`Bearer ${d}`,c(t(o))})});ny=!0;try{const c=await TB();if(c)return CB(c),o.headers.Authorization=`Bearer ${c}`,t(o);ru?.onAuthFailed(),window.location.href=Ti.LOGIN}finally{ny=!1}}return Promise.reject(n)})}const AB="http://localhost:3001/api";let g_=null,m_=null,y_=null,v_=null;const RB=t=>{g_=t};function xB(t,e){m_=t,y_=e.onTokenRefreshed,v_=e.onAuthFailed}const gs=nn.create({baseURL:AB,timeout:3e4,headers:{"Content-Type":"application/json"}});wB(gs,{getMsalInstance:()=>g_,getToken:()=>m_?.()?.token??null,onTokenRefreshed:(t,e)=>{y_?.(t,e)},onAuthFailed:()=>{v_?.()}});const aA=120;function Bl(t){if(t==null||t==="")return ct.api.requestFailed;const e=t.trim();return e.length===0||e.includes(` `)||/\s+at\s+/.test(e)||/[/\\](var|home|node_modules|dist|build)[/\\]/.test(e)||/[a-z]:\\/i.test(e)||/\.[tj]sx?\s*:?\s*\d+/i.test(e)?ct.api.requestFailed:e.length>aA?e.slice(0,aA).trimEnd()+"…":e}function Pu(t){throw t instanceof Si||nn.isAxiosError(t)&&t.code==="ERR_CANCELED"?t:nn.isAxiosError(t)?new Si(Bl(t.response?.data?.error?.message??t.message),t.response?.data?.error?.code,t.response?.status,t.response?.data):new Si(ct.api.unknownError)}class Si extends Error{code;statusCode;details;constructor(e,n,o,a){super(e),this.name="ApiError",this.code=n,this.statusCode=o,this.details=a}}async function _B(t,e){try{const n=await gs.get(t,e);if(n.data.success&&n.data.data!==void 0)return n.data.data;throw new Si(Bl(n.data.error?.message),n.data.error?.code,n.status,n.data.error?.details)}catch(n){Pu(n)}}async function OB(t,e){try{const n=await gs.get(t,e);if(n.data.success&&n.data.data!==void 0)return{data:n.data.data,pagination:n.data.pagination,aggregations:n.data.aggregations};throw new Si(Bl(n.data.error?.message),n.data.error?.code,n.status,n.data.error?.details)}catch(n){Pu(n)}}async function IB(t,e,n){try{const o=await gs.post(t,e,n);if(o.data.success&&o.data.data!==void 0)return o.data.data;throw new Si(Bl(o.data.error?.message),o.data.error?.code,o.status,o.data.error?.details)}catch(o){Pu(o)}}async function kB(t,e,n){try{const o=await gs.put(t,e,n);if(o.data.success&&o.data.data!==void 0)return o.data.data;throw new Si(Bl(o.data.error?.message),o.data.error?.code,o.status,o.data.error?.details)}catch(o){Pu(o)}}async function MB(t,e){try{const n=await gs.delete(t,e);if(n.data.success)return n.data.data??void 0;throw new Si(Bl(n.data.error?.message),n.data.error?.code,n.status,n.data.error?.details)}catch(n){Pu(n)}}const pi={get:_B,getWithMeta:OB,post:IB,put:kB,delete:MB};function NB(t){return t instanceof Si}function b_(t){return NB(t)||t instanceof Error?t.message:ct.api.unknownError}function Un(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var PB=typeof Symbol=="function"&&Symbol.observable||"@@observable",sA=PB,ry=()=>Math.random().toString(36).substring(7).split("").join("."),DB={INIT:`@@redux/INIT${ry()}`,REPLACE:`@@redux/REPLACE${ry()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${ry()}`},mh=DB;function Wb(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function S_(t,e,n){if(typeof t!="function")throw new Error(Un(2));if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(Un(0));if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Un(1));return n(S_)(t,e)}let o=t,a=e,l=new Map,c=l,d=0,f=!1;function h(){c===l&&(c=new Map,l.forEach((w,_)=>{c.set(_,w)}))}function m(){if(f)throw new Error(Un(3));return a}function y(w){if(typeof w!="function")throw new Error(Un(4));if(f)throw new Error(Un(5));let _=!0;h();const k=d++;return c.set(k,w),function(){if(_){if(f)throw new Error(Un(6));_=!1,h(),c.delete(k),l=null}}}function v(w){if(!Wb(w))throw new Error(Un(7));if(typeof w.type>"u")throw new Error(Un(8));if(typeof w.type!="string")throw new Error(Un(17));if(f)throw new Error(Un(9));try{f=!0,a=o(a,w)}finally{f=!1}return(l=c).forEach(k=>{k()}),w}function C(w){if(typeof w!="function")throw new Error(Un(10));o=w,v({type:mh.REPLACE})}function b(){const w=y;return{subscribe(_){if(typeof _!="object"||_===null)throw new Error(Un(11));function k(){const N=_;N.next&&N.next(m())}return k(),{unsubscribe:w(k)}},[sA](){return this}}}return v({type:mh.INIT}),{dispatch:v,subscribe:y,getState:m,replaceReducer:C,[sA]:b}}function LB(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:mh.INIT})>"u")throw new Error(Un(12));if(typeof n(void 0,{type:mh.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Un(13))})}function C_(t){const e=Object.keys(t),n={};for(let l=0;l"u")throw d&&d.type,new Error(Un(14));h[y]=b,f=f||b!==C}return f=f||o.length!==Object.keys(c).length,f?h:c}}function yh(...t){return t.length===0?e=>e:t.length===1?t[0]:t.reduce((e,n)=>(...o)=>e(n(...o)))}function UB(...t){return e=>(n,o)=>{const a=e(n,o);let l=()=>{throw new Error(Un(15))};const c={getState:a.getState,dispatch:(f,...h)=>l(f,...h)},d=t.map(f=>f(c));return l=yh(...d)(a.dispatch),{...a,dispatch:l}}}function zB(t){return Wb(t)&&"type"in t&&typeof t.type=="string"}var E_=Symbol.for("immer-nothing"),lA=Symbol.for("immer-draftable"),Zn=Symbol.for("immer-state");function ho(t,...e){throw new Error(`[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`)}var Ir=Object,_l=Ir.getPrototypeOf,vh="constructor",Jh="prototype",av="configurable",bh="enumerable",Hf="writable",hu="value",wi=t=>!!t&&!!t[Zn];function bo(t){return t?T_(t)||ep(t)||!!t[lA]||!!t[vh]?.[lA]||tp(t)||np(t):!1}var BB=Ir[Jh][vh].toString(),cA=new WeakMap;function T_(t){if(!t||!Qb(t))return!1;const e=_l(t);if(e===null||e===Ir[Jh])return!0;const n=Ir.hasOwnProperty.call(e,vh)&&e[vh];if(n===Object)return!0;if(!ll(n))return!1;let o=cA.get(n);return o===void 0&&(o=Function.toString.call(n),cA.set(n,o)),o===BB}function Zh(t,e,n=!0){Du(t)===0?(n?Reflect.ownKeys(t):Ir.keys(t)).forEach(a=>{e(a,t[a],t)}):t.forEach((o,a)=>e(a,o,t))}function Du(t){const e=t[Zn];return e?e.type_:ep(t)?1:tp(t)?2:np(t)?3:0}var uA=(t,e,n=Du(t))=>n===2?t.has(e):Ir[Jh].hasOwnProperty.call(t,e),sv=(t,e,n=Du(t))=>n===2?t.get(e):t[e],Sh=(t,e,n,o=Du(t))=>{o===2?t.set(e,n):o===3?t.add(n):t[e]=n};function HB(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var ep=Array.isArray,tp=t=>t instanceof Map,np=t=>t instanceof Set,Qb=t=>typeof t=="object",ll=t=>typeof t=="function",oy=t=>typeof t=="boolean";function jB(t){const e=+t;return Number.isInteger(e)&&String(e)===t}var yi=t=>t.copy_||t.base_,Xb=t=>t.modified_?t.copy_:t.base_;function lv(t,e){if(tp(t))return new Map(t);if(np(t))return new Set(t);if(ep(t))return Array[Jh].slice.call(t);const n=T_(t);if(e===!0||e==="class_only"&&!n){const o=Ir.getOwnPropertyDescriptors(t);delete o[Zn];let a=Reflect.ownKeys(o);for(let l=0;l1&&Ir.defineProperties(t,{set:yf,add:yf,clear:yf,delete:yf}),Ir.freeze(t),e&&Zh(t,(n,o)=>{Jb(o,!0)},!1)),t}function $B(){ho(2)}var yf={[hu]:$B};function rp(t){return t===null||!Qb(t)?!0:Ir.isFrozen(t)}var Ch="MapSet",cv="Patches",dA="ArrayMethods",w_={};function us(t){const e=w_[t];return e||ho(0,t),e}var fA=t=>!!w_[t],pu,A_=()=>pu,FB=(t,e)=>({drafts_:[],parent_:t,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:fA(Ch)?us(Ch):void 0,arrayMethodsPlugin_:fA(dA)?us(dA):void 0});function hA(t,e){e&&(t.patchPlugin_=us(cv),t.patches_=[],t.inversePatches_=[],t.patchListener_=e)}function uv(t){dv(t),t.drafts_.forEach(KB),t.drafts_=null}function dv(t){t===pu&&(pu=t.parent_)}var pA=t=>pu=FB(pu,t);function KB(t){const e=t[Zn];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function gA(t,e){e.unfinalizedDrafts_=e.drafts_.length;const n=e.drafts_[0];if(t!==void 0&&t!==n){n[Zn].modified_&&(uv(e),ho(4)),bo(t)&&(t=mA(e,t));const{patchPlugin_:a}=e;a&&a.generateReplacementPatches_(n[Zn].base_,t,e)}else t=mA(e,n);return VB(e,t,!0),uv(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),t!==E_?t:void 0}function mA(t,e){if(rp(e))return e;const n=e[Zn];if(!n)return Eh(e,t.handledSet_,t);if(!op(n,t))return e;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(t);__(n,t)}return n.copy_}function VB(t,e,n=!1){!t.parent_&&t.immer_.autoFreeze_&&t.canAutoFreeze_&&Jb(e,n)}function R_(t){t.finalized_=!0,t.scope_.unfinalizedDrafts_--}var op=(t,e)=>t.scope_===e,GB=[];function x_(t,e,n,o){const a=yi(t),l=t.type_;if(o!==void 0&&sv(a,o,l)===e){Sh(a,o,n,l);return}if(!t.draftLocations_){const d=t.draftLocations_=new Map;Zh(a,(f,h)=>{if(wi(h)){const m=d.get(h)||[];m.push(f),d.set(h,m)}})}const c=t.draftLocations_.get(e)??GB;for(const d of c)Sh(a,d,n,l)}function qB(t,e,n){t.callbacks_.push(function(a){const l=e;if(!l||!op(l,a))return;a.mapSetPlugin_?.fixSetContents(l);const c=Xb(l);x_(t,l.draft_??l,c,n),__(l,a)})}function __(t,e){if(t.modified_&&!t.finalized_&&(t.type_===3||t.type_===1&&t.allIndicesReassigned_||(t.assigned_?.size??0)>0)){const{patchPlugin_:o}=e;if(o){const a=o.getPath(t);a&&o.generatePatches_(t,a,e)}R_(t)}}function YB(t,e,n){const{scope_:o}=t;if(wi(n)){const a=n[Zn];op(a,o)&&a.callbacks_.push(function(){jf(t);const c=Xb(a);x_(t,n,c,e)})}else bo(n)&&t.callbacks_.push(function(){const l=yi(t);t.type_===3?l.has(n)&&Eh(n,o.handledSet_,o):sv(l,e,t.type_)===n&&o.drafts_.length>1&&(t.assigned_.get(e)??!1)===!0&&t.copy_&&Eh(sv(t.copy_,e,t.type_),o.handledSet_,o)})}function Eh(t,e,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||wi(t)||e.has(t)||!bo(t)||rp(t)||(e.add(t),Zh(t,(o,a)=>{if(wi(a)){const l=a[Zn];if(op(l,n)){const c=Xb(l);Sh(t,o,c,t.type_),R_(l)}}else bo(a)&&Eh(a,e,n)})),t}function WB(t,e){const n=ep(t),o={type_:n?1:0,scope_:e?e.scope_:A_(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:t,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let a=o,l=Th;n&&(a=[o],l=gu);const{revoke:c,proxy:d}=Proxy.revocable(a,l);return o.draft_=d,o.revoke_=c,[d,o]}var Th={get(t,e){if(e===Zn)return t;let n=t.scope_.arrayMethodsPlugin_;const o=t.type_===1&&typeof e=="string";if(o&&n?.isArrayOperationMethod(e))return n.createMethodInterceptor(t,e);const a=yi(t);if(!uA(a,e,t.type_))return QB(t,a,e);const l=a[e];if(t.finalized_||!bo(l)||o&&t.operationMethod&&n?.isMutatingArrayMethod(t.operationMethod)&&jB(e))return l;if(l===iy(t.base_,e)){jf(t);const c=t.type_===1?+e:e,d=hv(t.scope_,l,t,c);return t.copy_[c]=d}return l},has(t,e){return e in yi(t)},ownKeys(t){return Reflect.ownKeys(yi(t))},set(t,e,n){const o=O_(yi(t),e);if(o?.set)return o.set.call(t.draft_,n),!0;if(!t.modified_){const a=iy(yi(t),e),l=a?.[Zn];if(l&&l.base_===n)return t.copy_[e]=n,t.assigned_.set(e,!1),!0;if(HB(n,a)&&(n!==void 0||uA(t.base_,e,t.type_)))return!0;jf(t),fv(t)}return t.copy_[e]===n&&(n!==void 0||e in t.copy_)||Number.isNaN(n)&&Number.isNaN(t.copy_[e])||(t.copy_[e]=n,t.assigned_.set(e,!0),YB(t,e,n)),!0},deleteProperty(t,e){return jf(t),iy(t.base_,e)!==void 0||e in t.base_?(t.assigned_.set(e,!1),fv(t)):t.assigned_.delete(e),t.copy_&&delete t.copy_[e],!0},getOwnPropertyDescriptor(t,e){const n=yi(t),o=Reflect.getOwnPropertyDescriptor(n,e);return o&&{[Hf]:!0,[av]:t.type_!==1||e!=="length",[bh]:o[bh],[hu]:n[e]}},defineProperty(){ho(11)},getPrototypeOf(t){return _l(t.base_)},setPrototypeOf(){ho(12)}},gu={};for(let t in Th){let e=Th[t];gu[t]=function(){const n=arguments;return n[0]=n[0][0],e.apply(this,n)}}gu.deleteProperty=function(t,e){return gu.set.call(this,t,e,void 0)};gu.set=function(t,e,n){return Th.set.call(this,t[0],e,n,t[0])};function iy(t,e){const n=t[Zn];return(n?yi(n):t)[e]}function QB(t,e,n){const o=O_(e,n);return o?hu in o?o[hu]:o.get?.call(t.draft_):void 0}function O_(t,e){if(!(e in t))return;let n=_l(t);for(;n;){const o=Object.getOwnPropertyDescriptor(n,e);if(o)return o;n=_l(n)}}function fv(t){t.modified_||(t.modified_=!0,t.parent_&&fv(t.parent_))}function jf(t){t.copy_||(t.assigned_=new Map,t.copy_=lv(t.base_,t.scope_.immer_.useStrictShallowCopy_))}var XB=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,n,o)=>{if(ll(e)&&!ll(n)){const l=n;n=e;const c=this;return function(f=l,...h){return c.produce(f,m=>n.call(this,m,...h))}}ll(n)||ho(6),o!==void 0&&!ll(o)&&ho(7);let a;if(bo(e)){const l=pA(this),c=hv(l,e,void 0);let d=!0;try{a=n(c),d=!1}finally{d?uv(l):dv(l)}return hA(l,o),gA(a,l)}else if(!e||!Qb(e)){if(a=n(e),a===void 0&&(a=e),a===E_&&(a=void 0),this.autoFreeze_&&Jb(a,!0),o){const l=[],c=[];us(cv).generateReplacementPatches_(e,a,{patches_:l,inversePatches_:c}),o(l,c)}return a}else ho(1,e)},this.produceWithPatches=(e,n)=>{if(ll(e))return(c,...d)=>this.produceWithPatches(c,f=>e(f,...d));let o,a;return[this.produce(e,n,(c,d)=>{o=c,a=d}),o,a]},oy(t?.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),oy(t?.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),oy(t?.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){bo(t)||ho(8),wi(t)&&(t=JB(t));const e=pA(this),n=hv(e,t,void 0);return n[Zn].isManual_=!0,dv(e),n}finishDraft(t,e){const n=t&&t[Zn];(!n||!n.isManual_)&&ho(9);const{scope_:o}=n;return hA(o,e),gA(void 0,o)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,e){let n;for(n=e.length-1;n>=0;n--){const a=e[n];if(a.path.length===0&&a.op==="replace"){t=a.value;break}}n>-1&&(e=e.slice(n+1));const o=us(cv).applyPatches_;return wi(t)?o(t,e):this.produce(t,a=>o(a,e))}};function hv(t,e,n,o){const[a,l]=tp(e)?us(Ch).proxyMap_(e,n):np(e)?us(Ch).proxySet_(e,n):WB(e,n);return(n?.scope_??A_()).drafts_.push(a),l.callbacks_=n?.callbacks_??[],l.key_=o,n&&o!==void 0?qB(n,l,o):l.callbacks_.push(function(f){f.mapSetPlugin_?.fixSetContents(l);const{patchPlugin_:h}=f;l.modified_&&h&&h.generatePatches_(l,[],f)}),a}function JB(t){return wi(t)||ho(10,t),I_(t)}function I_(t){if(!bo(t)||rp(t))return t;const e=t[Zn];let n,o=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,n=lv(t,e.scope_.immer_.useStrictShallowCopy_),o=e.scope_.immer_.shouldUseStrictIteration()}else n=lv(t,!0);return Zh(n,(a,l)=>{Sh(n,a,I_(l))},o),e&&(e.finalized_=!1),n}var ZB=new XB,k_=ZB.produce;function M_(t){return({dispatch:n,getState:o})=>a=>l=>typeof l=="function"?l(n,o,t):a(l)}var e4=M_(),t4=M_,n4=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?yh:yh.apply(null,arguments)},r4=t=>t&&typeof t.match=="function";function ou(t,e){function n(...o){if(e){let a=e(...o);if(!a)throw new Error(Ci(0));return{type:t,payload:a.payload,..."meta"in a&&{meta:a.meta},..."error"in a&&{error:a.error}}}return{type:t,payload:o[0]}}return n.toString=()=>`${t}`,n.type=t,n.match=o=>zB(o)&&o.type===t,n}var N_=class Yc extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,Yc.prototype)}static get[Symbol.species](){return Yc}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new Yc(...e[0].concat(this)):new Yc(...e.concat(this))}};function yA(t){return bo(t)?k_(t,()=>{}):t}function vf(t,e,n){return t.has(e)?t.get(e):t.set(e,n(e)).get(e)}function o4(t){return typeof t=="boolean"}var i4=()=>function(e){const{thunk:n=!0,immutableCheck:o=!0,serializableCheck:a=!0,actionCreatorCheck:l=!0}=e??{};let c=new N_;return n&&(o4(n)?c.push(e4):c.push(t4(n.extraArgument))),c},a4="RTK_autoBatch",vA=t=>e=>{setTimeout(e,t)},s4=(t={type:"raf"})=>e=>(...n)=>{const o=e(...n);let a=!0,l=!1,c=!1;const d=new Set,f=t.type==="tick"?queueMicrotask:t.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:vA(10):t.type==="callback"?t.queueNotification:vA(t.timeout),h=()=>{c=!1,l&&(l=!1,d.forEach(m=>m()))};return Object.assign({},o,{subscribe(m){const y=()=>a&&m(),v=o.subscribe(y);return d.add(m),()=>{v(),d.delete(m)}},dispatch(m){try{return a=!m?.meta?.[a4],l=!a,l&&(c||(c=!0,f(h))),o.dispatch(m)}finally{a=!0}}})},l4=t=>function(n){const{autoBatch:o=!0}=n??{};let a=new N_(t);return o&&a.push(s4(typeof o=="object"?o:void 0)),a};function c4(t){const e=i4(),{reducer:n=void 0,middleware:o,devTools:a=!0,preloadedState:l=void 0,enhancers:c=void 0}=t||{};let d;if(typeof n=="function")d=n;else if(Wb(n))d=C_(n);else throw new Error(Ci(1));let f;typeof o=="function"?f=o(e):f=e();let h=yh;a&&(h=n4({trace:!1,...typeof a=="object"&&a}));const m=UB(...f),y=l4(m);let v=typeof c=="function"?c(y):y();const C=h(...v);return S_(d,l,C)}function P_(t){const e={},n=[];let o;const a={addCase(l,c){const d=typeof l=="string"?l:l.type;if(!d)throw new Error(Ci(28));if(d in e)throw new Error(Ci(29));return e[d]=c,a},addAsyncThunk(l,c){return c.pending&&(e[l.pending.type]=c.pending),c.rejected&&(e[l.rejected.type]=c.rejected),c.fulfilled&&(e[l.fulfilled.type]=c.fulfilled),c.settled&&n.push({matcher:l.settled,reducer:c.settled}),a},addMatcher(l,c){return n.push({matcher:l,reducer:c}),a},addDefaultCase(l){return o=l,a}};return t(a),[e,n,o]}function u4(t){return typeof t=="function"}function d4(t,e){let[n,o,a]=P_(e),l;if(u4(t))l=()=>yA(t());else{const d=yA(t);l=()=>d}function c(d=l(),f){let h=[n[f.type],...o.filter(({matcher:m})=>m(f)).map(({reducer:m})=>m)];return h.filter(m=>!!m).length===0&&(h=[a]),h.reduce((m,y)=>{if(y)if(wi(m)){const C=y(m,f);return C===void 0?m:C}else{if(bo(m))return k_(m,v=>y(v,f));{const v=y(m,f);if(v===void 0){if(m===null)return m;throw Error("A case reducer on a non-draftable value must not return undefined")}return v}}return m},d)}return c.getInitialState=l,c}var f4=(t,e)=>r4(t)?t.match(e):t(e);function h4(...t){return e=>t.some(n=>f4(n,e))}var p4="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",g4=(t=21)=>{let e="",n=t;for(;n--;)e+=p4[Math.random()*64|0];return e},m4=["name","message","stack","code"],ay=class{constructor(t,e){this.payload=t,this.meta=e}_type},bA=class{constructor(t,e){this.payload=t,this.meta=e}_type},y4=t=>{if(typeof t=="object"&&t!==null){const e={};for(const n of m4)typeof t[n]=="string"&&(e[n]=t[n]);return e}return{message:String(t)}},SA="External signal was aborted",D_=(()=>{function t(e,n,o){const a=ou(e+"/fulfilled",(f,h,m,y)=>({payload:f,meta:{...y||{},arg:m,requestId:h,requestStatus:"fulfilled"}})),l=ou(e+"/pending",(f,h,m)=>({payload:void 0,meta:{...m||{},arg:h,requestId:f,requestStatus:"pending"}})),c=ou(e+"/rejected",(f,h,m,y,v)=>({payload:y,error:(o&&o.serializeError||y4)(f||"Rejected"),meta:{...v||{},arg:m,requestId:h,rejectedWithValue:!!y,requestStatus:"rejected",aborted:f?.name==="AbortError",condition:f?.name==="ConditionError"}}));function d(f,{signal:h}={}){return(m,y,v)=>{const C=o?.idGenerator?o.idGenerator(f):g4(),b=new AbortController;let T,w;function _(R){w=R,b.abort()}h&&(h.aborted?_(SA):h.addEventListener("abort",()=>_(SA),{once:!0}));const k=(async function(){let R;try{let M=o?.condition?.(f,{getState:y,extra:v});if(b4(M)&&(M=await M),M===!1||b.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};const U=new Promise((x,L)=>{T=()=>{L({name:"AbortError",message:w||"Aborted"})},b.signal.addEventListener("abort",T,{once:!0})});m(l(C,f,o?.getPendingMeta?.({requestId:C,arg:f},{getState:y,extra:v}))),R=await Promise.race([U,Promise.resolve(n(f,{dispatch:m,getState:y,extra:v,requestId:C,signal:b.signal,abort:_,rejectWithValue:(x,L)=>new ay(x,L),fulfillWithValue:(x,L)=>new bA(x,L)})).then(x=>{if(x instanceof ay)throw x;return x instanceof bA?a(x.payload,C,f,x.meta):a(x,C,f)})])}catch(M){R=M instanceof ay?c(null,C,f,M.payload,M.meta):c(M,C,f)}finally{T&&b.signal.removeEventListener("abort",T)}return o&&!o.dispatchConditionRejection&&c.match(R)&&R.meta.condition||m(R),R})();return Object.assign(k,{abort:_,requestId:C,arg:f,unwrap(){return k.then(v4)}})}}return Object.assign(d,{pending:l,rejected:c,fulfilled:a,settled:h4(c,a),typePrefix:e})}return t.withTypes=()=>t,t})();function v4(t){if(t.meta&&t.meta.rejectedWithValue)throw t.payload;if(t.error)throw t.error;return t.payload}function b4(t){return t!==null&&typeof t=="object"&&typeof t.then=="function"}var S4=Symbol.for("rtk-slice-createasyncthunk");function C4(t,e){return`${t}/${e}`}function E4({creators:t}={}){const e=t?.asyncThunk?.[S4];return function(o){const{name:a,reducerPath:l=a}=o;if(!a)throw new Error(Ci(11));const c=(typeof o.reducers=="function"?o.reducers(w4()):o.reducers)||{},d=Object.keys(c),f={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(R,N){const M=typeof R=="string"?R:R.type;if(!M)throw new Error(Ci(12));if(M in f.sliceCaseReducersByType)throw new Error(Ci(13));return f.sliceCaseReducersByType[M]=N,h},addMatcher(R,N){return f.sliceMatchers.push({matcher:R,reducer:N}),h},exposeAction(R,N){return f.actionCreators[R]=N,h},exposeCaseReducer(R,N){return f.sliceCaseReducersByName[R]=N,h}};d.forEach(R=>{const N=c[R],M={reducerName:R,type:C4(a,R),createNotation:typeof o.reducers=="function"};R4(N)?_4(M,N,h,e):A4(M,N,h)});function m(){const[R={},N=[],M=void 0]=typeof o.extraReducers=="function"?P_(o.extraReducers):[o.extraReducers],U={...R,...f.sliceCaseReducersByType};return d4(o.initialState,x=>{for(let L in U)x.addCase(L,U[L]);for(let L of f.sliceMatchers)x.addMatcher(L.matcher,L.reducer);for(let L of N)x.addMatcher(L.matcher,L.reducer);M&&x.addDefaultCase(M)})}const y=R=>R,v=new Map,C=new WeakMap;let b;function T(R,N){return b||(b=m()),b(R,N)}function w(){return b||(b=m()),b.getInitialState()}function _(R,N=!1){function M(x){let L=x[R];return typeof L>"u"&&N&&(L=vf(C,M,w)),L}function U(x=y){const L=vf(v,N,()=>new WeakMap);return vf(L,x,()=>{const H={};for(const[A,$]of Object.entries(o.selectors??{}))H[A]=T4($,x,()=>vf(C,x,w),N);return H})}return{reducerPath:R,getSelectors:U,get selectors(){return U(M)},selectSlice:M}}const k={name:a,reducer:T,actions:f.actionCreators,caseReducers:f.sliceCaseReducersByName,getInitialState:w,..._(l),injectInto(R,{reducerPath:N,...M}={}){const U=N??l;return R.inject({reducerPath:U,reducer:T},M),{...k,..._(U,!0)}}};return k}}function T4(t,e,n,o){function a(l,...c){let d=e(l);return typeof d>"u"&&o&&(d=n()),t(d,...c)}return a.unwrapped=t,a}var ip=E4();function w4(){function t(e,n){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...n}}return t.withTypes=()=>t,{reducer(e){return Object.assign({[e.name](...n){return e(...n)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,n){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:n}},asyncThunk:t}}function A4({type:t,reducerName:e,createNotation:n},o,a){let l,c;if("reducer"in o){if(n&&!x4(o))throw new Error(Ci(17));l=o.reducer,c=o.prepare}else l=o;a.addCase(t,l).exposeCaseReducer(e,l).exposeAction(e,c?ou(t,c):ou(t))}function R4(t){return t._reducerDefinitionType==="asyncThunk"}function x4(t){return t._reducerDefinitionType==="reducerWithPrepare"}function _4({type:t,reducerName:e},n,o,a){if(!a)throw new Error(Ci(18));const{payloadCreator:l,fulfilled:c,pending:d,rejected:f,settled:h,options:m}=n,y=a(t,l,m);o.exposeAction(e,y),c&&o.addCase(y.fulfilled,c),d&&o.addCase(y.pending,d),f&&o.addCase(y.rejected,f),h&&o.addMatcher(y.settled,h),o.exposeCaseReducer(e,{fulfilled:c||bf,pending:d||bf,rejected:f||bf,settled:h||bf})}function bf(){}function Ci(t){return`Minified Redux Toolkit error #${t}; visit https://redux-toolkit.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}const L_={login:t=>pi.post(Vr.AUTH.LOGIN,{accessToken:t}),logout:()=>gs.post(Vr.AUTH.LOGOUT)},sy=D_("auth/login",async(t,{dispatch:e,rejectWithValue:n})=>{try{return e($_()),await L_.login(t)}catch(o){return n(b_(o))}finally{e(F_())}});function O4(t=1){const n=btoa("snowpeak:datahub:inventory").substring(0,12);return`__sp_auth_v${t}_${n}`}const ts=O4(1),Cl={session:"inventory-auth",localV1:"inventory-auth",localV2:"inventory-web-"};function I4(){try{const t=sessionStorage.getItem(ts);if(!t)return null;const e=JSON.parse(t);if(e?.user&&e?.token)return{user:e.user,token:e.token}}catch{}return null}function ly(t,e){t&&e?sessionStorage.setItem(ts,JSON.stringify({user:t,token:e})):sessionStorage.removeItem(ts)}const cy=I4(),k4=cy?{user:cy.user,token:cy.token,isAuthenticated:!0,error:null}:{user:null,token:null,isAuthenticated:!1,error:null},U_=ip({name:"auth",initialState:k4,reducers:{setAuth:(t,e)=>{t.user=e.payload.user,t.token=e.payload.token,t.isAuthenticated=!0,t.error=null,ly(e.payload.user,e.payload.token)},logout:t=>{t.user=null,t.token=null,t.isAuthenticated=!1,t.error=null,ly(null,null)}},extraReducers:t=>{t.addCase(sy.pending,e=>{e.error=null}).addCase(sy.fulfilled,(e,n)=>{e.user=n.payload.user,e.token=n.payload.token,e.isAuthenticated=!0,e.error=null,ly(n.payload.user,n.payload.token)}).addCase(sy.rejected,(e,n)=>{e.error=n.payload??ct.errors.loginFailed})}}),{setAuth:M4,logout:z_}=U_.actions,N4=U_.reducer,P4={inventory:t=>pi.getWithMeta(Vr.SEARCH.INVENTORY,{params:t}),suggestions:(t,e="product")=>pi.get(Vr.SEARCH.SUGGEST,{params:{q:t,type:e}}),byJan:(t,e=!0)=>pi.get(Vr.SEARCH.BY_JAN(t),{params:{includeAllStores:e}}),multiStore:t=>{const{append:e,...n}=t;return pi.post(Vr.SEARCH.MULTI_STORE,n)},detectType:t=>pi.get(Vr.SEARCH.DETECT_TYPE,{params:{q:t}}),similar:(t,e=5)=>pi.get(Vr.SEARCH.SIMILAR(t),{params:{limit:e}}),storeList:t=>pi.get(Vr.STORE.LIST,t),productByJan:t=>pi.get(Vr.INVENTORY.BY_JAN_CODE(t),{params:{includeOC:!1,includeScheduled:!1}})},uy=D_("search/multiStore",async(t,{dispatch:e,rejectWithValue:n})=>{const o=t.append===!0;try{o||e($_());const a=await P4.multiStore(t),l=a?.result??[];return{query:a?.query??t.query,searchType:a?.searchType??"jan_code",result:l,page:a?.page??1,limit:a?.limit??10,total:a?.total??l.length,totalPages:a?.totalPages??1}}catch(a){return n(b_(a))}finally{o||e(F_())}}),B_={query:"",storeCode:void 0,category:void 0,brand:void 0,inStock:void 0},D4={filters:B_,recentSearches:[],isSearching:!1,suggestions:[],multiStoreResult:null,error:null},H_=ip({name:"search",initialState:D4,reducers:{setFilters:(t,e)=>{t.filters={...t.filters,...e.payload}},clearFilters:t=>{t.filters=B_},addToHistory:(t,e)=>{t.recentSearches=[e.payload,...t.recentSearches.slice(0,9)]},clearHistory:t=>{t.recentSearches=[]},setSearching:(t,e)=>{t.isSearching=e.payload},setSuggestions:(t,e)=>{t.suggestions=e.payload},clearMultiStoreResult:t=>{t.multiStoreResult=null,t.error=null}},extraReducers:t=>{t.addCase(uy.pending,(e,n)=>{e.isSearching=!0,e.error=null,n.meta.arg.append||(e.multiStoreResult=null)}).addCase(uy.fulfilled,(e,n)=>{e.isSearching=!1,e.error=null;const o=n.payload;n.meta.arg.append&&e.multiStoreResult?e.multiStoreResult={...o,result:[...e.multiStoreResult.result,...o.result]}:e.multiStoreResult=o}).addCase(uy.rejected,(e,n)=>{e.isSearching=!1,e.error=n.payload??ct.errors.searchFailed})}}),{setFilters:Aq,clearFilters:Rq,addToHistory:xq,clearHistory:_q,setSearching:Oq,setSuggestions:Iq,clearMultiStoreResult:kq}=H_.actions,L4=H_.reducer,U4={globalLoading:!1},j_=ip({name:"loading",initialState:U4,reducers:{showLoading:t=>{t.globalLoading=!0},hideLoading:t=>{t.globalLoading=!1}}}),{showLoading:$_,hideLoading:F_}=j_.actions,z4=j_.reducer,B4={open:!1,message:"",severity:"info"},K_=ip({name:"notify",initialState:B4,reducers:{showError:(t,e)=>{t.open=!0,t.message=e.payload,t.severity="error"},showSuccess:(t,e)=>{t.open=!0,t.message=e.payload,t.severity="success"},showInfo:(t,e)=>{t.open=!0,t.message=e.payload,t.severity="info"},showWarning:(t,e)=>{t.open=!0,t.message=e.payload,t.severity="warning"},hideNotify:t=>{t.open=!1}}}),{showError:Mq,showSuccess:Nq,showInfo:Pq,showWarning:Dq,hideNotify:H4}=K_.actions,j4=K_.reducer,$4=C_({auth:N4,loading:z4,notify:j4,search:L4}),$f=c4({reducer:$4,devTools:!1});var dy={exports:{}},fy={};var CA;function F4(){if(CA)return fy;CA=1;var t=Nh();function e(f,h){return f===h&&(f!==0||1/f===1/h)||f!==f&&h!==h}var n=typeof Object.is=="function"?Object.is:e,o=t.useSyncExternalStore,a=t.useRef,l=t.useEffect,c=t.useMemo,d=t.useDebugValue;return fy.useSyncExternalStoreWithSelector=function(f,h,m,y,v){var C=a(null);if(C.current===null){var b={hasValue:!1,value:null};C.current=b}else b=C.current;C=c(function(){function w(M){if(!_){if(_=!0,k=M,M=y(M),v!==void 0&&b.hasValue){var U=b.value;if(v(U,M))return R=U}return R=M}if(U=R,n(k,M))return U;var x=y(M);return v!==void 0&&v(U,x)?(k=M,U):(k=M,R=x)}var _=!1,k,R,N=m===void 0?null:m;return[function(){return w(h())},N===null?void 0:function(){return w(N())}]},[h,m,y,v]);var T=o(f,C[0],C[1]);return l(function(){b.hasValue=!0,b.value=T},[T]),d(T),T},fy}var EA;function K4(){return EA||(EA=1,dy.exports=F4()),dy.exports}var V4=K4();function G4(t){t()}function q4(){let t=null,e=null;return{clear(){t=null,e=null},notify(){G4(()=>{let n=t;for(;n;)n.callback(),n=n.next})},get(){const n=[];let o=t;for(;o;)n.push(o),o=o.next;return n},subscribe(n){let o=!0;const a=e={callback:n,next:null,prev:e};return a.prev?a.prev.next=a:t=a,function(){!o||t===null||(o=!1,a.next?a.next.prev=a.prev:e=a.prev,a.prev?a.prev.next=a.next:t=a.next)}}}}var TA={notify(){},get:()=>[]};function Y4(t,e){let n,o=TA,a=0,l=!1;function c(T){m();const w=o.subscribe(T);let _=!1;return()=>{_||(_=!0,w(),y())}}function d(){o.notify()}function f(){b.onStateChange&&b.onStateChange()}function h(){return l}function m(){a++,n||(n=t.subscribe(f),o=q4())}function y(){a--,n&&a===0&&(n(),n=void 0,o.clear(),o=TA)}function v(){l||(l=!0,m())}function C(){l&&(l=!1,y())}const b={addNestedSub:c,notifyNestedSubs:d,handleChangeWrapper:f,isSubscribed:h,trySubscribe:v,tryUnsubscribe:C,getListeners:()=>o};return b}var W4=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Q4=W4(),X4=()=>typeof navigator<"u"&&navigator.product==="ReactNative",J4=X4(),Z4=()=>Q4||J4?E.useLayoutEffect:E.useEffect,eH=Z4(),tH=Symbol.for("react-redux-context"),nH=typeof globalThis<"u"?globalThis:{};function rH(){if(!E.createContext)return{};const t=nH[tH]??=new Map;let e=t.get(E.createContext);return e||(e=E.createContext(null),t.set(E.createContext,e)),e}var pa=rH();function oH(t){const{children:e,context:n,serverState:o,store:a}=t,l=E.useMemo(()=>{const f=Y4(a);return{store:a,subscription:f,getServerState:o?()=>o:void 0}},[a,o]),c=E.useMemo(()=>a.getState(),[a]);eH(()=>{const{subscription:f}=l;return f.onStateChange=f.notifyNestedSubs,f.trySubscribe(),c!==a.getState()&&f.notifyNestedSubs(),()=>{f.tryUnsubscribe(),f.onStateChange=void 0}},[l,c]);const d=n||pa;return E.createElement(d.Provider,{value:l},e)}var iH=oH;function Zb(t=pa){return function(){return E.useContext(t)}}var V_=Zb();function G_(t=pa){const e=t===pa?V_:Zb(t),n=()=>{const{store:o}=e();return o};return Object.assign(n,{withTypes:()=>n}),n}var aH=G_();function sH(t=pa){const e=t===pa?aH:G_(t),n=()=>e().dispatch;return Object.assign(n,{withTypes:()=>n}),n}var lH=sH(),cH=(t,e)=>t===e;function uH(t=pa){const e=t===pa?V_:Zb(t),n=(o,a={})=>{const{equalityFn:l=cH}=typeof a=="function"?{equalityFn:a}:a,c=e(),{store:d,subscription:f,getServerState:h}=c;E.useRef(!0);const m=E.useCallback({[o.name](v){return o(v)}}[o.name],[o]),y=V4.useSyncExternalStoreWithSelector(f.addNestedSub,d.getState,h||d.getState,m,l);return E.useDebugValue(y),y};return Object.assign(n,{withTypes:()=>n}),n}var eS=uH();const q_=lH,ap=eS;function dH(){try{if(sessionStorage.getItem(ts)){wA();return}let e=null;e=localStorage.getItem(ts),e||(e=sessionStorage.getItem(Cl.session)),e||(e=localStorage.getItem(Cl.localV1)??localStorage.getItem(Cl.localV2)),e&&(sessionStorage.setItem(ts,e),console.log(ct.internal.authMigrationDone)),wA()}catch(t){console.error(ct.internal.authMigrationFailed,t)}}function wA(){try{sessionStorage.removeItem(Cl.session),localStorage.removeItem(ts),localStorage.removeItem(Cl.localV1),localStorage.removeItem(Cl.localV2)}catch{}}const fH=E.lazy(()=>Vx(()=>import("./LoginPage-Babamebo.js"),[]).then(t=>({default:t.LoginPage}))),hH=[{path:Ti.LOGIN,element:I.jsx(fH,{}),isProtected:!1}];function Ai(t,...e){const n=new URL(`https://mui.com/production-error/?code=${t}`);return e.forEach(o=>n.searchParams.append("args[]",o)),`Minified MUI error #${t}; visit ${n} for the full message.`}function wh(){return wh=Object.assign?Object.assign.bind():function(t){for(var e=1;e0?Hn(Hl,--gr):0,Ol--,wn===10&&(Ol=1,lp--),wn}function kr(){return wn=gr2||yu(wn)>3?"":" "}function xH(t,e){for(;--e&&kr()&&!(wn<48||wn>102||wn>57&&wn<65||wn>70&&wn<97););return Lu(t,Ff()+(e<6&&Bo()==32&&kr()==32))}function gv(t){for(;kr();)switch(wn){case t:return gr;case 34:case 39:t!==34&&t!==39&&gv(wn);break;case 40:t===41&&gv(t);break;case 92:kr();break}return gr}function _H(t,e){for(;kr()&&t+wn!==57;)if(t+wn===84&&Bo()===47)break;return"/*"+Lu(e,gr-1)+"*"+sp(t===47?t:kr())}function OH(t){for(;!yu(Bo());)kr();return Lu(t,gr)}function IH(t){return Z_(Vf("",null,null,null,[""],t=J_(t),0,[0],t))}function Vf(t,e,n,o,a,l,c,d,f){for(var h=0,m=0,y=c,v=0,C=0,b=0,T=1,w=1,_=1,k=0,R="",N=a,M=l,U=o,x=R;w;)switch(b=k,k=kr()){case 40:if(b!=108&&Hn(x,y-1)==58){pv(x+=wt(Kf(k),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:x+=Kf(k);break;case 9:case 10:case 13:case 32:x+=RH(b);break;case 92:x+=xH(Ff()-1,7);continue;case 47:switch(Bo()){case 42:case 47:Sf(kH(_H(kr(),Ff()),e,n),f);break;default:x+="/"}break;case 123*T:d[h++]=No(x)*_;case 125*T:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+m:_==-1&&(x=wt(x,/\f/g,"")),C>0&&No(x)-y&&Sf(C>32?RA(x+";",o,n,y-1):RA(wt(x," ","")+";",o,n,y-2),f);break;case 59:x+=";";default:if(Sf(U=AA(x,e,n,h,m,a,d,R,N=[],M=[],y),l),k===123)if(m===0)Vf(x,e,U,U,N,l,y,d,M);else switch(v===99&&Hn(x,3)===110?100:v){case 100:case 108:case 109:case 115:Vf(t,U,U,o&&Sf(AA(t,U,U,0,0,a,d,R,a,N=[],y),M),a,M,y,d,o?N:M);break;default:Vf(x,U,U,U,[""],M,0,d,M)}}h=m=C=0,T=_=1,R=x="",y=c;break;case 58:y=1+No(x),C=b;default:if(T<1){if(k==123)--T;else if(k==125&&T++==0&&AH()==125)continue}switch(x+=sp(k),k*T){case 38:_=m>0?1:(x+="\f",-1);break;case 44:d[h++]=(No(x)-1)*_,_=1;break;case 64:Bo()===45&&(x+=Kf(kr())),v=Bo(),m=y=No(R=x+=OH(Ff())),k++;break;case 45:b===45&&No(x)==2&&(T=0)}}return l}function AA(t,e,n,o,a,l,c,d,f,h,m){for(var y=a-1,v=a===0?l:[""],C=rS(v),b=0,T=0,w=0;b0?v[_]+" "+k:wt(k,/&\f/g,v[_])))&&(f[w++]=R);return cp(t,e,n,a===0?tS:d,f,h,m)}function kH(t,e,n){return cp(t,e,n,Y_,sp(wH()),mu(t,2,-2),0)}function RA(t,e,n,o){return cp(t,e,n,nS,mu(t,0,o),mu(t,o+1,-1),o)}function El(t,e){for(var n="",o=rS(t),a=0;a6)switch(Hn(t,e+1)){case 109:if(Hn(t,e+4)!==45)break;case 102:return wt(t,/(.+:)(.+)-([^]+)/,"$1"+Tt+"$2-$3$1"+Ah+(Hn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~pv(t,"stretch")?tO(wt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Hn(t,e+1)!==115)break;case 6444:switch(Hn(t,No(t)-3-(~pv(t,"!important")&&10))){case 107:return wt(t,":",":"+Tt)+t;case 101:return wt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Tt+(Hn(t,14)===45?"inline-":"")+"box$3$1"+Tt+"$2$3$1"+Fn+"$2box$3")+t}break;case 5936:switch(Hn(t,e+11)){case 114:return Tt+t+Fn+wt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Tt+t+Fn+wt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Tt+t+Fn+wt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Tt+t+Fn+t+t}return t}var HH=function(e,n,o,a){if(e.length>-1&&!e.return)switch(e.type){case nS:e.return=tO(e.value,e.length);break;case W_:return El([Uc(e,{value:wt(e.value,"@","@"+Tt)})],a);case tS:if(e.length)return TH(e.props,function(l){switch(EH(l,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return El([Uc(e,{props:[wt(l,/:(read-\w+)/,":"+Ah+"$1")]})],a);case"::placeholder":return El([Uc(e,{props:[wt(l,/:(plac\w+)/,":"+Tt+"input-$1")]}),Uc(e,{props:[wt(l,/:(plac\w+)/,":"+Ah+"$1")]}),Uc(e,{props:[wt(l,/:(plac\w+)/,Fn+"input-$1")]})],a)}return""})}},jH=[HH],$H=function(e){var n=e.key;if(n==="css"){var o=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(o,function(T){var w=T.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(T),T.setAttribute("data-s",""))})}var a=e.stylisPlugins||jH,l={},c,d=[];c=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(T){for(var w=T.getAttribute("data-emotion").split(" "),_=1;_=4;++o,a-=4)n=t.charCodeAt(o)&255|(t.charCodeAt(++o)&255)<<8|(t.charCodeAt(++o)&255)<<16|(t.charCodeAt(++o)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(a){case 3:e^=(t.charCodeAt(o+2)&255)<<16;case 2:e^=(t.charCodeAt(o+1)&255)<<8;case 1:e^=t.charCodeAt(o)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var YH={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},WH=/[A-Z]|^ms/g,QH=/_EMO_([^_]+?)_([^]*?)_EMO_/g,rO=function(e){return e.charCodeAt(1)===45},kA=function(e){return e!=null&&typeof e!="boolean"},gy=eO(function(t){return rO(t)?t:t.replace(WH,"-$&").toLowerCase()}),MA=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(QH,function(o,a,l){return Po={name:a,styles:l,next:Po},a})}return YH[e]!==1&&!rO(e)&&typeof n=="number"&&n!==0?n+"px":n};function vu(t,e,n){if(n==null)return"";var o=n;if(o.__emotion_styles!==void 0)return o;switch(typeof n){case"boolean":return"";case"object":{var a=n;if(a.anim===1)return Po={name:a.name,styles:a.styles,next:Po},a.name;var l=n;if(l.styles!==void 0){var c=l.next;if(c!==void 0)for(;c!==void 0;)Po={name:c.name,styles:c.styles,next:Po},c=c.next;var d=l.styles+";";return d}return XH(t,e,n)}case"function":{if(t!==void 0){var f=Po,h=n(t);return Po=f,vu(t,e,h)}break}}var m=n;if(e==null)return m;var y=e[m];return y!==void 0?y:m}function XH(t,e,n){var o="";if(Array.isArray(n))for(var a=0;a96?aj:sj},UA=function(e,n,o){var a;if(n){var l=n.shouldForwardProp;a=e.__emotion_forwardProp&&l?function(c){return e.__emotion_forwardProp(c)&&l(c)}:l}return typeof a!="function"&&o&&(a=e.__emotion_forwardProp),a},lj=function(e){var n=e.cache,o=e.serialized,a=e.isStringTag;return oS(n,o,a),iO(function(){return iS(n,o,a)}),null},cj=function t(e,n){var o=e.__emotion_real===e,a=o&&e.__emotion_base||e,l,c;n!==void 0&&(l=n.label,c=n.target);var d=UA(e,n,o),f=d||LA(a),h=!f("as");return function(){var m=arguments,y=o&&e.__emotion_styles!==void 0?e.__emotion_styles.slice(0):[];if(l!==void 0&&y.push("label:"+l+";"),m[0]==null||m[0].raw===void 0)y.push.apply(y,m);else{var v=m[0];y.push(v[0]);for(var C=m.length,b=1;be(dj(a)?n:a):e;return I.jsx(rj,{styles:o})}function lO(t,e){return yv(t,e)}function fj(t,e){Array.isArray(t.__emotion_styles)&&(t.__emotion_styles=e(t.__emotion_styles))}const zA=[];function fa(t){return zA[0]=t,Uu(zA)}var my={exports:{}},zt={};var BA;function hj(){if(BA)return zt;BA=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.view_transition"),C=Symbol.for("react.client.reference");function b(T){if(typeof T=="object"&&T!==null){var w=T.$$typeof;switch(w){case t:switch(T=T.type,T){case n:case a:case o:case f:case h:case v:return T;default:switch(T=T&&T.$$typeof,T){case c:case d:case y:case m:return T;case l:return T;default:return w}}case e:return w}}}return zt.ContextConsumer=l,zt.ContextProvider=c,zt.Element=t,zt.ForwardRef=d,zt.Fragment=n,zt.Lazy=y,zt.Memo=m,zt.Portal=e,zt.Profiler=a,zt.StrictMode=o,zt.Suspense=f,zt.SuspenseList=h,zt.isContextConsumer=function(T){return b(T)===l},zt.isContextProvider=function(T){return b(T)===c},zt.isElement=function(T){return typeof T=="object"&&T!==null&&T.$$typeof===t},zt.isForwardRef=function(T){return b(T)===d},zt.isFragment=function(T){return b(T)===n},zt.isLazy=function(T){return b(T)===y},zt.isMemo=function(T){return b(T)===m},zt.isPortal=function(T){return b(T)===e},zt.isProfiler=function(T){return b(T)===a},zt.isStrictMode=function(T){return b(T)===o},zt.isSuspense=function(T){return b(T)===f},zt.isSuspenseList=function(T){return b(T)===h},zt.isValidElementType=function(T){return typeof T=="string"||typeof T=="function"||T===n||T===a||T===o||T===f||T===h||typeof T=="object"&&T!==null&&(T.$$typeof===y||T.$$typeof===m||T.$$typeof===c||T.$$typeof===l||T.$$typeof===d||T.$$typeof===C||T.getModuleId!==void 0)},zt.typeOf=b,zt}var HA;function pj(){return HA||(HA=1,my.exports=hj()),my.exports}var cO=pj();function Uo(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function uO(t){if(E.isValidElement(t)||cO.isValidElementType(t)||!Uo(t))return t;const e={};return Object.keys(t).forEach(n=>{e[n]=uO(t[n])}),e}function In(t,e,n={clone:!0}){const o=n.clone?{...t}:t;return Uo(t)&&Uo(e)&&Object.keys(e).forEach(a=>{E.isValidElement(e[a])||cO.isValidElementType(e[a])?o[a]=e[a]:Uo(e[a])&&Object.prototype.hasOwnProperty.call(t,a)&&Uo(t[a])?o[a]=In(t[a],e[a],n):n.clone?o[a]=Uo(e[a])?uO(e[a]):e[a]:o[a]=e[a]}),o}const gj=t=>{const e=Object.keys(t).map(n=>({key:n,val:t[n]}))||[];return e.sort((n,o)=>n.val-o.val),e.reduce((n,o)=>({...n,[o.key]:o.val}),{})};function mj(t){const{values:e={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:o=5,...a}=t,l=gj(e),c=Object.keys(l);function d(v){return`@media (min-width:${typeof e[v]=="number"?e[v]:v}${n})`}function f(v){return`@media (max-width:${(typeof e[v]=="number"?e[v]:v)-o/100}${n})`}function h(v,C){const b=c.indexOf(C);return`@media (min-width:${typeof e[v]=="number"?e[v]:v}${n}) and (max-width:${(b!==-1&&typeof e[c[b]]=="number"?e[c[b]]:C)-o/100}${n})`}function m(v){return c.indexOf(v)+1o.startsWith("@container")).sort((o,a)=>{const l=/min-width:\s*([0-9.]+)/;return+(o.match(l)?.[1]||0)-+(a.match(l)?.[1]||0)});return n.length?n.reduce((o,a)=>{const l=e[a];return delete o[a],o[a]=l,o},{...e}):e}function yj(t,e){return e==="@"||e.startsWith("@")&&(t.some(n=>e.startsWith(`@${n}`))||!!e.match(/^@\d/))}function vj(t,e){const n=e.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,o,a]=n,l=Number.isNaN(+o)?o||0:+o;return t.containerQueries(a).up(l)}function bj(t){const e=(l,c)=>l.replace("@media",c?`@container ${c}`:"@container");function n(l,c){l.up=(...d)=>e(t.breakpoints.up(...d),c),l.down=(...d)=>e(t.breakpoints.down(...d),c),l.between=(...d)=>e(t.breakpoints.between(...d),c),l.only=(...d)=>e(t.breakpoints.only(...d),c),l.not=(...d)=>{const f=e(t.breakpoints.not(...d),c);return f.includes("not all and")?f.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):f}}const o={},a=l=>(n(o,l),o);return n(a),{...t,containerQueries:a}}const Sj={borderRadius:4};function iu(t,e){return e?In(t,e,{clone:!1}):t}const up={xs:0,sm:600,md:900,lg:1200,xl:1536},$A={keys:["xs","sm","md","lg","xl"],up:t=>`@media (min-width:${up[t]}px)`},Cj={containerQueries:t=>({up:e=>{let n=typeof e=="number"?e:up[e]||e;return typeof n=="number"&&(n=`${n}px`),t?`@container ${t} (min-width:${n})`:`@container (min-width:${n})`}})};function So(t,e,n){const o=t.theme||{};if(Array.isArray(e)){const l=o.breakpoints||$A;return e.reduce((c,d,f)=>(c[l.up(l.keys[f])]=n(e[f]),c),{})}if(typeof e=="object"){const l=o.breakpoints||$A;return Object.keys(e).reduce((c,d)=>{if(yj(l.keys,d)){const f=vj(o.containerQueries?o:Cj,d);f&&(c[f]=n(e[d],d))}else if(Object.keys(l.values||up).includes(d)){const f=l.up(d);c[f]=n(e[d],d)}else{const f=d;c[f]=e[f]}return c},{})}return n(e)}function dO(t={}){return t.keys?.reduce((n,o)=>{const a=t.up(o);return n[a]={},n},{})||{}}function vv(t,e){return t.reduce((n,o)=>{const a=n[o];return(!a||Object.keys(a).length===0)&&delete n[o],n},e)}function Ej(t,...e){const n=dO(t),o=[n,...e].reduce((a,l)=>In(a,l),{});return vv(Object.keys(n),o)}function Tj(t,e){if(typeof t!="object")return{};const n={},o=Object.keys(e);return Array.isArray(t)?o.forEach((a,l)=>{l{t[a]!=null&&(n[a]=!0)}),n}function yy({values:t,breakpoints:e,base:n}){const o=n||Tj(t,e),a=Object.keys(o);if(a.length===0)return t;let l;return a.reduce((c,d,f)=>(Array.isArray(t)?(c[d]=t[f]!=null?t[f]:t[l],l=f):typeof t=="object"?(c[d]=t[d]!=null?t[d]:t[l],l=d):c[d]=t,c),{})}function ve(t){if(typeof t!="string")throw new Error(Ai(7));return t.charAt(0).toUpperCase()+t.slice(1)}function dp(t,e,n=!0){if(!e||typeof e!="string")return null;if(t&&t.vars&&n){const o=`vars.${e}`.split(".").reduce((a,l)=>a&&a[l]?a[l]:null,t);if(o!=null)return o}return e.split(".").reduce((o,a)=>o&&o[a]!=null?o[a]:null,t)}function Rh(t,e,n,o=n){let a;return typeof t=="function"?a=t(n):Array.isArray(t)?a=t[n]||o:a=dp(t,n)||o,e&&(a=e(a,o,t)),a}function yn(t){const{prop:e,cssProperty:n=t.prop,themeKey:o,transform:a}=t,l=c=>{if(c[e]==null)return null;const d=c[e],f=c.theme,h=dp(f,o)||{};return So(c,d,y=>{let v=Rh(h,a,y);return y===v&&typeof y=="string"&&(v=Rh(h,a,`${e}${y==="default"?"":ve(y)}`,y)),n===!1?v:{[n]:v}})};return l.propTypes={},l.filterProps=[e],l}function wj(t){const e={};return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}const Aj={m:"margin",p:"padding"},Rj={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},FA={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},xj=wj(t=>{if(t.length>2)if(FA[t])t=FA[t];else return[t];const[e,n]=t.split(""),o=Aj[e],a=Rj[n]||"";return Array.isArray(a)?a.map(l=>o+l):[o+a]}),cS=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],uS=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...cS,...uS];function Hu(t,e,n,o){const a=dp(t,e,!0)??n;return typeof a=="number"||typeof a=="string"?l=>typeof l=="string"?l:typeof a=="string"?`calc(${l} * ${a})`:a*l:Array.isArray(a)?l=>{if(typeof l=="string")return l;const c=Math.abs(l),d=a[c];return l>=0?d:typeof d=="number"?-d:`-${d}`}:typeof a=="function"?a:()=>{}}function fp(t){return Hu(t,"spacing",8)}function ds(t,e){return typeof e=="string"||e==null?e:t(e)}function _j(t,e){return n=>t.reduce((o,a)=>(o[a]=ds(e,n),o),{})}function Oj(t,e,n,o){if(!e.includes(n))return null;const a=xj(n),l=_j(a,o),c=t[n];return So(t,c,l)}function fO(t,e){const n=fp(t.theme);return Object.keys(t).map(o=>Oj(t,e,o,n)).reduce(iu,{})}function un(t){return fO(t,cS)}un.propTypes={};un.filterProps=cS;function dn(t){return fO(t,uS)}dn.propTypes={};dn.filterProps=uS;function hO(t=8,e=fp({spacing:t})){if(t.mui)return t;const n=(...o)=>(o.length===0?[1]:o).map(l=>{const c=e(l);return typeof c=="number"?`${c}px`:c}).join(" ");return n.mui=!0,n}function hp(...t){const e=t.reduce((o,a)=>(a.filterProps.forEach(l=>{o[l]=a}),o),{}),n=o=>Object.keys(o).reduce((a,l)=>e[l]?iu(a,e[l](o)):a,{});return n.propTypes={},n.filterProps=t.reduce((o,a)=>o.concat(a.filterProps),[]),n}function Qr(t){return typeof t!="number"?t:`${t}px solid`}function to(t,e){return yn({prop:t,themeKey:"borders",transform:e})}const Ij=to("border",Qr),kj=to("borderTop",Qr),Mj=to("borderRight",Qr),Nj=to("borderBottom",Qr),Pj=to("borderLeft",Qr),Dj=to("borderColor"),Lj=to("borderTopColor"),Uj=to("borderRightColor"),zj=to("borderBottomColor"),Bj=to("borderLeftColor"),Hj=to("outline",Qr),jj=to("outlineColor"),pp=t=>{if(t.borderRadius!==void 0&&t.borderRadius!==null){const e=Hu(t.theme,"shape.borderRadius",4),n=o=>({borderRadius:ds(e,o)});return So(t,t.borderRadius,n)}return null};pp.propTypes={};pp.filterProps=["borderRadius"];hp(Ij,kj,Mj,Nj,Pj,Dj,Lj,Uj,zj,Bj,pp,Hj,jj);const gp=t=>{if(t.gap!==void 0&&t.gap!==null){const e=Hu(t.theme,"spacing",8),n=o=>({gap:ds(e,o)});return So(t,t.gap,n)}return null};gp.propTypes={};gp.filterProps=["gap"];const mp=t=>{if(t.columnGap!==void 0&&t.columnGap!==null){const e=Hu(t.theme,"spacing",8),n=o=>({columnGap:ds(e,o)});return So(t,t.columnGap,n)}return null};mp.propTypes={};mp.filterProps=["columnGap"];const yp=t=>{if(t.rowGap!==void 0&&t.rowGap!==null){const e=Hu(t.theme,"spacing",8),n=o=>({rowGap:ds(e,o)});return So(t,t.rowGap,n)}return null};yp.propTypes={};yp.filterProps=["rowGap"];const $j=yn({prop:"gridColumn"}),Fj=yn({prop:"gridRow"}),Kj=yn({prop:"gridAutoFlow"}),Vj=yn({prop:"gridAutoColumns"}),Gj=yn({prop:"gridAutoRows"}),qj=yn({prop:"gridTemplateColumns"}),Yj=yn({prop:"gridTemplateRows"}),Wj=yn({prop:"gridTemplateAreas"}),Qj=yn({prop:"gridArea"});hp(gp,mp,yp,$j,Fj,Kj,Vj,Gj,qj,Yj,Wj,Qj);function Tl(t,e){return e==="grey"?e:t}const Xj=yn({prop:"color",themeKey:"palette",transform:Tl}),Jj=yn({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Tl}),Zj=yn({prop:"backgroundColor",themeKey:"palette",transform:Tl});hp(Xj,Jj,Zj);function Or(t){return t<=1&&t!==0?`${t*100}%`:t}const e3=yn({prop:"width",transform:Or}),dS=t=>{if(t.maxWidth!==void 0&&t.maxWidth!==null){const e=n=>{const o=t.theme?.breakpoints?.values?.[n]||up[n];return o?t.theme?.breakpoints?.unit!=="px"?{maxWidth:`${o}${t.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:Or(n)}};return So(t,t.maxWidth,e)}return null};dS.filterProps=["maxWidth"];const t3=yn({prop:"minWidth",transform:Or}),n3=yn({prop:"height",transform:Or}),r3=yn({prop:"maxHeight",transform:Or}),o3=yn({prop:"minHeight",transform:Or});yn({prop:"size",cssProperty:"width",transform:Or});yn({prop:"size",cssProperty:"height",transform:Or});const i3=yn({prop:"boxSizing"});hp(e3,dS,t3,n3,r3,o3,i3);const ju={border:{themeKey:"borders",transform:Qr},borderTop:{themeKey:"borders",transform:Qr},borderRight:{themeKey:"borders",transform:Qr},borderBottom:{themeKey:"borders",transform:Qr},borderLeft:{themeKey:"borders",transform:Qr},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Qr},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:pp},color:{themeKey:"palette",transform:Tl},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Tl},backgroundColor:{themeKey:"palette",transform:Tl},p:{style:dn},pt:{style:dn},pr:{style:dn},pb:{style:dn},pl:{style:dn},px:{style:dn},py:{style:dn},padding:{style:dn},paddingTop:{style:dn},paddingRight:{style:dn},paddingBottom:{style:dn},paddingLeft:{style:dn},paddingX:{style:dn},paddingY:{style:dn},paddingInline:{style:dn},paddingInlineStart:{style:dn},paddingInlineEnd:{style:dn},paddingBlock:{style:dn},paddingBlockStart:{style:dn},paddingBlockEnd:{style:dn},m:{style:un},mt:{style:un},mr:{style:un},mb:{style:un},ml:{style:un},mx:{style:un},my:{style:un},margin:{style:un},marginTop:{style:un},marginRight:{style:un},marginBottom:{style:un},marginLeft:{style:un},marginX:{style:un},marginY:{style:un},marginInline:{style:un},marginInlineStart:{style:un},marginInlineEnd:{style:un},marginBlock:{style:un},marginBlockStart:{style:un},marginBlockEnd:{style:un},displayPrint:{cssProperty:!1,transform:t=>({"@media print":{display:t}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gp},rowGap:{style:yp},columnGap:{style:mp},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Or},maxWidth:{style:dS},minWidth:{transform:Or},height:{transform:Or},maxHeight:{transform:Or},minHeight:{transform:Or},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function a3(...t){const e=t.reduce((o,a)=>o.concat(Object.keys(a)),[]),n=new Set(e);return t.every(o=>n.size===Object.keys(o).length)}function s3(t,e){return typeof t=="function"?t(e):t}function l3(){function t(n,o,a,l){const c={[n]:o,theme:a},d=l[n];if(!d)return{[n]:o};const{cssProperty:f=n,themeKey:h,transform:m,style:y}=d;if(o==null)return null;if(h==="typography"&&o==="inherit")return{[n]:o};const v=dp(a,h)||{};return y?y(c):So(c,o,b=>{let T=Rh(v,m,b);return b===T&&typeof b=="string"&&(T=Rh(v,m,`${n}${b==="default"?"":ve(b)}`,b)),f===!1?T:{[f]:T}})}function e(n){const{sx:o,theme:a={},nested:l}=n||{};if(!o)return null;const c=a.unstable_sxConfig??ju;function d(f){let h=f;if(typeof f=="function")h=f(a);else if(typeof f!="object")return f;if(!h)return null;const m=dO(a.breakpoints),y=Object.keys(m);let v=m;return Object.keys(h).forEach(C=>{const b=s3(h[C],a);if(b!=null)if(typeof b=="object")if(c[C])v=iu(v,t(C,b,a,c));else{const T=So({theme:a},b,w=>({[C]:w}));a3(T,b)?v[C]=e({sx:b,theme:a,nested:!0}):v=iu(v,T)}else v=iu(v,t(C,b,a,c))}),!l&&a.modularCssLayers?{"@layer sx":jA(a,vv(y,v))}:jA(a,vv(y,v))}return Array.isArray(o)?o.map(d):d(o)}return e}const ga=l3();ga.filterProps=["sx"];function c3(t,e){const n=this;if(n.vars){if(!n.colorSchemes?.[t]||typeof n.getColorSchemeSelector!="function")return{};let o=n.getColorSchemeSelector(t);return o==="&"?e:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:e})}return n.palette.mode===t?e:{}}function vp(t={},...e){const{breakpoints:n={},palette:o={},spacing:a,shape:l={},...c}=t,d=mj(n),f=hO(a);let h=In({breakpoints:d,direction:"ltr",components:{},palette:{mode:"light",...o},spacing:f,shape:{...Sj,...l}},c);return h=bj(h),h.applyStyles=c3,h=e.reduce((m,y)=>In(m,y),h),h.unstable_sxConfig={...ju,...c?.unstable_sxConfig},h.unstable_sx=function(y){return ga({sx:y,theme:this})},h}function u3(t){return Object.keys(t).length===0}function fS(t=null){const e=E.useContext(zu);return!e||u3(e)?t:e}const d3=vp();function bp(t=d3){return fS(t)}function vy(t){const e=fa(t);return t!==e&&e.styles?(e.styles.match(/^@layer\s+[^{]*$/)||(e.styles=`@layer global{${e.styles}}`),e):t}function pO({styles:t,themeId:e,defaultTheme:n={}}){const o=bp(n),a=e&&o[e]||o;let l=typeof t=="function"?t(a):t;return a.modularCssLayers&&(Array.isArray(l)?l=l.map(c=>vy(typeof c=="function"?c(a):c)):l=vy(l)),I.jsx(sO,{styles:l})}const f3=t=>{const e={systemProps:{},otherProps:{}},n=t?.theme?.unstable_sxConfig??ju;return Object.keys(t).forEach(o=>{n[o]?e.systemProps[o]=t[o]:e.otherProps[o]=t[o]}),e};function hS(t){const{sx:e,...n}=t,{systemProps:o,otherProps:a}=f3(n);let l;return Array.isArray(e)?l=[o,...e]:typeof e=="function"?l=(...c)=>{const d=e(...c);return Uo(d)?{...o,...d}:o}:l={...o,...e},{...a,sx:l}}const KA=t=>t,h3=()=>{let t=KA;return{configure(e){t=e},generate(e){return t(e)},reset(){t=KA}}},gO=h3();function mO(t){var e,n,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;ed!=="theme"&&d!=="sx"&&d!=="as"})(ga);return E.forwardRef(function(f,h){const m=bp(n),{className:y,component:v="div",...C}=hS(f);return I.jsx(l,{as:v,ref:h,className:xe(y,a?a(o):o),theme:e&&m[e]||m,...C})})}const g3={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Ge(t,e,n="Mui"){const o=g3[e];return o?`${n}-${o}`:`${gO.generate(t)}-${e}`}function Ke(t,e,n="Mui"){const o={};return e.forEach(a=>{o[a]=Ge(t,a,n)}),o}function yO(t){const{variants:e,...n}=t,o={variants:e,style:fa(n),isProcessed:!0};return o.style===n||e&&e.forEach(a=>{typeof a.style!="function"&&(a.style=fa(a.style))}),o}const m3=vp();function by(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}function Ya(t,e){return e&&t&&typeof t=="object"&&t.styles&&!t.styles.startsWith("@layer")&&(t.styles=`@layer ${e}{${String(t.styles)}}`),t}function y3(t){return t?(e,n)=>n[t]:null}function v3(t,e,n){t.theme=S3(t.theme)?n:t.theme[e]||t.theme}function Gf(t,e,n){const o=typeof e=="function"?e(t):e;if(Array.isArray(o))return o.flatMap(a=>Gf(t,a,n));if(Array.isArray(o?.variants)){let a;if(o.isProcessed)a=n?Ya(o.style,n):o.style;else{const{variants:l,...c}=o;a=n?Ya(fa(c),n):c}return vO(t,o.variants,[a],n)}return o?.isProcessed?n?Ya(fa(o.style),n):o.style:n?Ya(fa(o),n):o}function vO(t,e,n=[],o=void 0){let a;e:for(let l=0;l{fj(d,U=>U.filter(x=>x!==ga));const{name:h,slot:m,skipVariantsResolver:y,skipSx:v,overridesResolver:C=y3(E3(m)),...b}=f,T=h&&h.startsWith("Mui")||m?"components":"custom",w=y!==void 0?y:m&&m!=="Root"&&m!=="root"||!1,_=v||!1;let k=by;m==="Root"||m==="root"?k=o:m?k=a:C3(d)&&(k=void 0);const R=lO(d,{shouldForwardProp:k,label:b3(),...b}),N=U=>{if(U.__emotion_real===U)return U;if(typeof U=="function")return function(L){return Gf(L,U,L.theme.modularCssLayers?T:void 0)};if(Uo(U)){const x=yO(U);return function(H){return x.variants?Gf(H,x,H.theme.modularCssLayers?T:void 0):H.theme.modularCssLayers?Ya(x.style,T):x.style}}return U},M=(...U)=>{const x=[],L=U.map(N),H=[];if(x.push(l),h&&C&&H.push(function(re){const W=re.theme.components?.[h]?.styleOverrides;if(!W)return null;const D={};for(const J in W)D[J]=Gf(re,W[J],re.theme.modularCssLayers?"theme":void 0);return C(re,D)}),h&&!w&&H.push(function(re){const W=re.theme?.components?.[h]?.variants;return W?vO(re,W,[],re.theme.modularCssLayers?"theme":void 0):null}),_||H.push(ga),Array.isArray(L[0])){const ee=L.shift(),re=new Array(x.length).fill(""),le=new Array(H.length).fill("");let W;W=[...re,...ee,...le],W.raw=[...re,...ee.raw,...le],x.unshift(W)}const A=[...x,...L,...H],$=R(...A);return d.muiName&&($.muiName=d.muiName),$};return R.withConfig&&(M.withConfig=R.withConfig),M}}function b3(t,e){return void 0}function S3(t){for(const e in t)return!1;return!0}function C3(t){return typeof t=="string"&&t.charCodeAt(0)>96}function E3(t){return t&&t.charAt(0).toLowerCase()+t.slice(1)}const T3=bO();function bu(t,e){const n={...e};for(const o in t)if(Object.prototype.hasOwnProperty.call(t,o)){const a=o;if(a==="components"||a==="slots")n[a]={...t[a],...n[a]};else if(a==="componentsProps"||a==="slotProps"){const l=t[a],c=e[a];if(!c)n[a]=l||{};else if(!l)n[a]=c;else{n[a]={...c};for(const d in l)if(Object.prototype.hasOwnProperty.call(l,d)){const f=d;n[a][f]=bu(l[f],c[f])}}}else n[a]===void 0&&(n[a]=t[a])}return n}function w3(t){const{theme:e,name:n,props:o}=t;return!e||!e.components||!e.components[n]||!e.components[n].defaultProps?o:bu(e.components[n].defaultProps,o)}function A3({props:t,name:e,defaultTheme:n,themeId:o}){let a=bp(n);return o&&(a=a[o]||a),w3({theme:a,name:e,props:t})}const Co=typeof window<"u"?E.useLayoutEffect:E.useEffect;function R3(t,e=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(e,Math.min(t,n))}function pS(t,e=0,n=1){return R3(t,e,n)}function x3(t){t=t.slice(1);const e=new RegExp(`.{1,${t.length>=6?2:1}}`,"g");let n=t.match(e);return n&&n[0].length===1&&(n=n.map(o=>o+o)),n?`rgb${n.length===4?"a":""}(${n.map((o,a)=>a<3?parseInt(o,16):Math.round(parseInt(o,16)/255*1e3)/1e3).join(", ")})`:""}function ma(t){if(t.type)return t;if(t.charAt(0)==="#")return ma(x3(t));const e=t.indexOf("("),n=t.substring(0,e);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(Ai(9,t));let o=t.substring(e+1,t.length-1),a;if(n==="color"){if(o=o.split(" "),a=o.shift(),o.length===4&&o[3].charAt(0)==="/"&&(o[3]=o[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(a))throw new Error(Ai(10,a))}else o=o.split(",");return o=o.map(l=>parseFloat(l)),{type:n,values:o,colorSpace:a}}const _3=t=>{const e=ma(t);return e.values.slice(0,3).map((n,o)=>e.type.includes("hsl")&&o!==0?`${n}%`:n).join(" ")},Wc=(t,e)=>{try{return _3(t)}catch{return t}};function Sp(t){const{type:e,colorSpace:n}=t;let{values:o}=t;return e.includes("rgb")?o=o.map((a,l)=>l<3?parseInt(a,10):a):e.includes("hsl")&&(o[1]=`${o[1]}%`,o[2]=`${o[2]}%`),e.includes("color")?o=`${n} ${o.join(" ")}`:o=`${o.join(", ")}`,`${e}(${o})`}function SO(t){t=ma(t);const{values:e}=t,n=e[0],o=e[1]/100,a=e[2]/100,l=o*Math.min(a,1-a),c=(h,m=(h+n/30)%12)=>a-l*Math.max(Math.min(m-3,9-m,1),-1);let d="rgb";const f=[Math.round(c(0)*255),Math.round(c(8)*255),Math.round(c(4)*255)];return t.type==="hsla"&&(d+="a",f.push(e[3])),Sp({type:d,values:f})}function bv(t){t=ma(t);let e=t.type==="hsl"||t.type==="hsla"?ma(SO(t)).values:t.values;return e=e.map(n=>(t.type!=="color"&&(n/=255),n<=.03928?n/12.92:((n+.055)/1.055)**2.4)),Number((.2126*e[0]+.7152*e[1]+.0722*e[2]).toFixed(3))}function O3(t,e){const n=bv(t),o=bv(e);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function Bt(t,e){return t=ma(t),e=pS(e),(t.type==="rgb"||t.type==="hsl")&&(t.type+="a"),t.type==="color"?t.values[3]=`/${e}`:t.values[3]=e,Sp(t)}function Cf(t,e,n){try{return Bt(t,e)}catch{return t}}function Il(t,e){if(t=ma(t),e=pS(e),t.type.includes("hsl"))t.values[2]*=1-e;else if(t.type.includes("rgb")||t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]*=1-e;return Sp(t)}function $t(t,e,n){try{return Il(t,e)}catch{return t}}function kl(t,e){if(t=ma(t),e=pS(e),t.type.includes("hsl"))t.values[2]+=(100-t.values[2])*e;else if(t.type.includes("rgb"))for(let n=0;n<3;n+=1)t.values[n]+=(255-t.values[n])*e;else if(t.type.includes("color"))for(let n=0;n<3;n+=1)t.values[n]+=(1-t.values[n])*e;return Sp(t)}function Ft(t,e,n){try{return kl(t,e)}catch{return t}}function CO(t,e=.15){return bv(t)>.5?Il(t,e):kl(t,e)}function Ef(t,e,n){try{return CO(t,e)}catch{return t}}function VA(...t){return t.reduce((e,n)=>n==null?e:function(...a){e.apply(this,a),n.apply(this,a)},()=>{})}function gS(t,e=166){let n;function o(...a){const l=()=>{t.apply(this,a)};clearTimeout(n),n=setTimeout(l,e)}return o.clear=()=>{clearTimeout(n)},o}function Sy(t,e){return E.isValidElement(t)&&e.indexOf(t.type.muiName??t.type?._payload?.value?.muiName)!==-1}function hr(t){return t&&t.ownerDocument||document}function Eo(t){return hr(t).defaultView||window}function GA(t,e){typeof t=="function"?t(e):t&&(t.current=e)}let qA=0;function I3(t){const[e,n]=E.useState(t),o=t||e;return E.useEffect(()=>{e==null&&(qA+=1,n(`mui-${qA}`))},[e]),o}const k3={...Xf},YA=k3.useId;function $u(t){if(YA!==void 0){const e=YA();return t??e}return I3(t)}function Sv({controlled:t,default:e,name:n,state:o="value"}){const{current:a}=E.useRef(t!==void 0),[l,c]=E.useState(e),d=a?t:l,f=E.useCallback(h=>{a||c(h)},[]);return[d,f]}function Ho(t){const e=E.useRef(t);return Co(()=>{e.current=t}),E.useRef((...n)=>(0,e.current)(...n)).current}function kn(...t){const e=E.useRef(void 0),n=E.useCallback(o=>{const a=t.map(l=>{if(l==null)return null;if(typeof l=="function"){const c=l,d=c(o);return typeof d=="function"?d:()=>{c(null)}}return l.current=o,()=>{l.current=null}});return()=>{a.forEach(l=>l?.())}},t);return E.useMemo(()=>t.every(o=>o==null)?null:o=>{e.current&&(e.current(),e.current=void 0),o!=null&&(e.current=n(o))},t)}const WA={};function EO(t,e){const n=E.useRef(WA);return n.current===WA&&(n.current=t(e)),n}const M3=[];function N3(t){E.useEffect(t,M3)}class mS{static create(){return new mS}currentId=null;start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},e)}clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)};disposeEffect=()=>this.clear}function yS(){const t=EO(mS.create).current;return N3(t.disposeEffect),t}function QA(t){try{return t.matches(":focus-visible")}catch{}return!1}function TO(t=window){const e=t.document.documentElement.clientWidth;return t.innerWidth-e}function qe(t,e,n=void 0){const o={};for(const a in t){const l=t[a];let c="",d=!0;for(let f=0;fo.match(/^on[A-Z]/)&&typeof t[o]=="function"&&!e.includes(o)).forEach(o=>{n[o]=t[o]}),n}function XA(t){if(t===void 0)return{};const e={};return Object.keys(t).filter(n=>!(n.match(/^on[A-Z]/)&&typeof t[n]=="function")).forEach(n=>{e[n]=t[n]}),e}function AO(t){const{getSlotProps:e,additionalProps:n,externalSlotProps:o,externalForwardedProps:a,className:l}=t;if(!e){const C=xe(n?.className,l,a?.className,o?.className),b={...n?.style,...a?.style,...o?.style},T={...n,...a,...o};return C.length>0&&(T.className=C),Object.keys(b).length>0&&(T.style=b),{props:T,internalRef:void 0}}const c=xh({...a,...o}),d=XA(o),f=XA(a),h=e(c),m=xe(h?.className,n?.className,l,a?.className,o?.className),y={...h?.style,...n?.style,...a?.style,...o?.style},v={...h,...n,...f,...d};return m.length>0&&(v.className=m),Object.keys(y).length>0&&(v.style=y),{props:v,internalRef:h.ref}}function RO(t,e,n){return typeof t=="function"?t(e,n):t}function D3(t){const{elementType:e,externalSlotProps:n,ownerState:o,skipResolvingSlotProps:a=!1,...l}=t,c=a?{}:RO(n,o),{props:d,internalRef:f}=AO({...l,externalSlotProps:c}),h=kn(f,c?.ref,t.additionalProps?.ref);return wO(e,{...d,ref:h},o)}function ms(t){return parseInt(E.version,10)>=19?t?.props?.ref||null:t?.ref||null}const xO=E.createContext(null);function vS(){return E.useContext(xO)}const L3=typeof Symbol=="function"&&Symbol.for,U3=L3?Symbol.for("mui.nested"):"__THEME_NESTED__";function z3(t,e){return typeof e=="function"?e(t):{...t,...e}}function B3(t){const{children:e,theme:n}=t,o=vS(),a=E.useMemo(()=>{const l=o===null?{...n}:z3(o,n);return l!=null&&(l[U3]=o!==null),l},[n,o]);return I.jsx(xO.Provider,{value:a,children:e})}const _O=E.createContext();function H3({value:t,...e}){return I.jsx(_O.Provider,{value:t??!0,...e})}const bS=()=>E.useContext(_O)??!1,OO=E.createContext(void 0);function j3({value:t,children:e}){return I.jsx(OO.Provider,{value:t,children:e})}function $3(t){const{theme:e,name:n,props:o}=t;if(!e||!e.components||!e.components[n])return o;const a=e.components[n];return a.defaultProps?bu(a.defaultProps,o):!a.styleOverrides&&!a.variants?bu(a,o):o}function F3({props:t,name:e}){const n=E.useContext(OO);return $3({props:t,name:e,theme:{components:n}})}function K3(t){const e=fS(),n=$u()||"",{modularCssLayers:o}=t;let a="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!o||e!==null?a="":typeof o=="string"?a=o.replace(/mui(?!\.)/g,a):a=`@layer ${a};`,Co(()=>{const l=document.querySelector("head");if(!l)return;const c=l.firstChild;if(a){if(c&&c.hasAttribute?.("data-mui-layer-order")&&c.getAttribute("data-mui-layer-order")===n)return;const d=document.createElement("style");d.setAttribute("data-mui-layer-order",n),d.textContent=a,l.prepend(d)}else l.querySelector(`style[data-mui-layer-order="${n}"]`)?.remove()},[a,n]),a?I.jsx(pO,{styles:a}):null}const JA={};function ZA(t,e,n,o=!1){return E.useMemo(()=>{const a=t&&e[t]||e;if(typeof n=="function"){const l=n(a),c=t?{...e,[t]:l}:l;return o?()=>c:c}return t?{...e,[t]:n}:{...e,...n}},[t,e,n,o])}function IO(t){const{children:e,theme:n,themeId:o}=t,a=fS(JA),l=vS()||JA,c=ZA(o,a,n),d=ZA(o,l,n,!0),f=(o?c[o]:c).direction==="rtl",h=K3(c);return I.jsx(B3,{theme:d,children:I.jsx(zu.Provider,{value:c,children:I.jsx(H3,{value:f,children:I.jsxs(j3,{value:o?c[o].components:c.components,children:[h,e]})})})})}const eR={theme:void 0};function V3(t){let e,n;return function(a){let l=e;return(l===void 0||a.theme!==n)&&(eR.theme=a.theme,l=yO(t(eR)),e=l,n=a.theme),l}}const SS="mode",CS="color-scheme",G3="data-color-scheme";function q3(t){const{defaultMode:e="system",defaultLightColorScheme:n="light",defaultDarkColorScheme:o="dark",modeStorageKey:a=SS,colorSchemeStorageKey:l=CS,attribute:c=G3,colorSchemeNode:d="document.documentElement",nonce:f}=t||{};let h="",m=c;if(c==="class"&&(m=".%s"),c==="data"&&(m="[data-%s]"),m.startsWith(".")){const v=m.substring(1);h+=`${d}.classList.remove('${v}'.replace('%s', light), '${v}'.replace('%s', dark)); ${d}.classList.add('${v}'.replace('%s', colorScheme));`}const y=m.match(/\[([^\]]+)\]/);if(y){const[v,C]=y[1].split("=");C||(h+=`${d}.removeAttribute('${v}'.replace('%s', light)); ${d}.removeAttribute('${v}'.replace('%s', dark));`),h+=` ${d}.setAttribute('${v}'.replace('%s', colorScheme), ${C?`${C}.replace('%s', colorScheme)`:'""'});`}else h+=`${d}.setAttribute('${m}', colorScheme);`;return I.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?f:"",dangerouslySetInnerHTML:{__html:`(function() { try { let colorScheme = ''; const mode = localStorage.getItem('${a}') || '${e}'; const dark = localStorage.getItem('${l}-dark') || '${o}'; const light = localStorage.getItem('${l}-light') || '${n}'; if (mode === 'system') { // handle system mode const mql = window.matchMedia('(prefers-color-scheme: dark)'); if (mql.matches) { colorScheme = dark } else { colorScheme = light } } if (mode === 'light') { colorScheme = light; } if (mode === 'dark') { colorScheme = dark; } if (colorScheme) { ${h} } } catch(e){}})();`}},"mui-color-scheme-init")}function Y3(){}const W3=({key:t,storageWindow:e})=>(!e&&typeof window<"u"&&(e=window),{get(n){if(typeof window>"u")return;if(!e)return n;let o;try{o=e.localStorage.getItem(t)}catch{}return o||n},set:n=>{if(e)try{e.localStorage.setItem(t,n)}catch{}},subscribe:n=>{if(!e)return Y3;const o=a=>{const l=a.newValue;a.key===t&&n(l)};return e.addEventListener("storage",o),()=>{e.removeEventListener("storage",o)}}});function Cy(){}function tR(t){if(typeof window<"u"&&typeof window.matchMedia=="function"&&t==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function kO(t,e){if(t.mode==="light"||t.mode==="system"&&t.systemMode==="light")return e("light");if(t.mode==="dark"||t.mode==="system"&&t.systemMode==="dark")return e("dark")}function Q3(t){return kO(t,e=>{if(e==="light")return t.lightColorScheme;if(e==="dark")return t.darkColorScheme})}function X3(t){const{defaultMode:e="light",defaultLightColorScheme:n,defaultDarkColorScheme:o,supportedColorSchemes:a=[],modeStorageKey:l=SS,colorSchemeStorageKey:c=CS,storageWindow:d=typeof window>"u"?void 0:window,storageManager:f=W3,noSsr:h=!1}=t,m=a.join(","),y=a.length>1,v=E.useMemo(()=>f?.({key:l,storageWindow:d}),[f,l,d]),C=E.useMemo(()=>f?.({key:`${c}-light`,storageWindow:d}),[f,c,d]),b=E.useMemo(()=>f?.({key:`${c}-dark`,storageWindow:d}),[f,c,d]),[T,w]=E.useState(()=>{const L=v?.get(e)||e,H=C?.get(n)||n,A=b?.get(o)||o;return{mode:L,systemMode:tR(L),lightColorScheme:H,darkColorScheme:A}}),[_,k]=E.useState(h||!y);E.useEffect(()=>{k(!0)},[]);const R=Q3(T),N=E.useCallback(L=>{w(H=>{if(L===H.mode)return H;const A=L??e;return v?.set(A),{...H,mode:A,systemMode:tR(A)}})},[v,e]),M=E.useCallback(L=>{L?typeof L=="string"?L&&!m.includes(L)?console.error(`\`${L}\` does not exist in \`theme.colorSchemes\`.`):w(H=>{const A={...H};return kO(H,$=>{$==="light"&&(C?.set(L),A.lightColorScheme=L),$==="dark"&&(b?.set(L),A.darkColorScheme=L)}),A}):w(H=>{const A={...H},$=L.light===null?n:L.light,ee=L.dark===null?o:L.dark;return $&&(m.includes($)?(A.lightColorScheme=$,C?.set($)):console.error(`\`${$}\` does not exist in \`theme.colorSchemes\`.`)),ee&&(m.includes(ee)?(A.darkColorScheme=ee,b?.set(ee)):console.error(`\`${ee}\` does not exist in \`theme.colorSchemes\`.`)),A}):w(H=>(C?.set(n),b?.set(o),{...H,lightColorScheme:n,darkColorScheme:o}))},[m,C,b,n,o]),U=E.useCallback(L=>{T.mode==="system"&&w(H=>{const A=L?.matches?"dark":"light";return H.systemMode===A?H:{...H,systemMode:A}})},[T.mode]),x=E.useRef(U);return x.current=U,E.useEffect(()=>{if(typeof window.matchMedia!="function"||!y)return;const L=(...A)=>x.current(...A),H=window.matchMedia("(prefers-color-scheme: dark)");return H.addListener(L),L(H),()=>{H.removeListener(L)}},[y]),E.useEffect(()=>{if(y){const L=v?.subscribe($=>{(!$||["light","dark","system"].includes($))&&N($||e)})||Cy,H=C?.subscribe($=>{(!$||m.match($))&&M({light:$})})||Cy,A=b?.subscribe($=>{(!$||m.match($))&&M({dark:$})})||Cy;return()=>{L(),H(),A()}}},[M,N,m,e,d,y,v,C,b]),{...T,mode:_?T.mode:void 0,systemMode:_?T.systemMode:void 0,colorScheme:_?R:void 0,setMode:N,setColorScheme:M}}const J3="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Z3(t){const{themeId:e,theme:n={},modeStorageKey:o=SS,colorSchemeStorageKey:a=CS,disableTransitionOnChange:l=!1,defaultColorScheme:c,resolveTheme:d}=t,f={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},h=E.createContext(void 0),m=()=>E.useContext(h)||f,y={},v={};function C(_){const{children:k,theme:R,modeStorageKey:N=o,colorSchemeStorageKey:M=a,disableTransitionOnChange:U=l,storageManager:x,storageWindow:L=typeof window>"u"?void 0:window,documentNode:H=typeof document>"u"?void 0:document,colorSchemeNode:A=typeof document>"u"?void 0:document.documentElement,disableNestedContext:$=!1,disableStyleSheetGeneration:ee=!1,defaultMode:re="system",noSsr:le}=_,W=E.useRef(!1),D=vS(),J=E.useContext(h),q=!!J&&!$,X=E.useMemo(()=>R||(typeof n=="function"?n():n),[R]),pe=X[e],P=pe||X,{colorSchemes:V=y,components:oe=v,cssVarPrefix:de}=P,ye=Object.keys(V).filter(He=>!!V[He]).join(","),we=E.useMemo(()=>ye.split(","),[ye]),Me=typeof c=="string"?c:c.light,Je=typeof c=="string"?c:c.dark,$e=V[Me]&&V[Je]?re:V[P.defaultColorScheme]?.palette?.mode||P.palette?.mode,{mode:Fe,setMode:We,systemMode:Ie,lightColorScheme:rt,darkColorScheme:Re,colorScheme:Rt,setColorScheme:Vt}=X3({supportedColorSchemes:we,defaultLightColorScheme:Me,defaultDarkColorScheme:Je,modeStorageKey:N,colorSchemeStorageKey:M,defaultMode:$e,storageManager:x,storageWindow:L,noSsr:le});let fn=Fe,gt=Rt;q&&(fn=J.mode,gt=J.colorScheme);const An=E.useMemo(()=>{const He=gt||P.defaultColorScheme,Ot=P.generateThemeVars?.()||P.vars,Wt={...P,components:oe,colorSchemes:V,cssVarPrefix:de,vars:Ot};if(typeof Wt.generateSpacing=="function"&&(Wt.spacing=Wt.generateSpacing()),He){const rn=V[He];rn&&typeof rn=="object"&&Object.keys(rn).forEach(vt=>{rn[vt]&&typeof rn[vt]=="object"?Wt[vt]={...Wt[vt],...rn[vt]}:Wt[vt]=rn[vt]})}return d?d(Wt):Wt},[P,gt,oe,V,de]),qt=P.colorSchemeSelector;Co(()=>{if(gt&&A&&qt&&qt!=="media"){const He=qt;let Ot=qt;if(He==="class"&&(Ot=".%s"),He==="data"&&(Ot="[data-%s]"),He?.startsWith("data-")&&!He.includes("%s")&&(Ot=`[${He}="%s"]`),Ot.startsWith("."))A.classList.remove(...we.map(Wt=>Ot.substring(1).replace("%s",Wt))),A.classList.add(Ot.substring(1).replace("%s",gt));else{const Wt=Ot.replace("%s",gt).match(/\[([^\]]+)\]/);if(Wt){const[rn,vt]=Wt[1].split("=");vt||we.forEach(vn=>{A.removeAttribute(rn.replace(gt,vn))}),A.setAttribute(rn,vt?vt.replace(/"|'/g,""):"")}else A.setAttribute(Ot,gt)}}},[gt,qt,A,we]),E.useEffect(()=>{let He;if(U&&W.current&&H){const Ot=H.createElement("style");Ot.appendChild(H.createTextNode(J3)),H.head.appendChild(Ot),window.getComputedStyle(H.body),He=setTimeout(()=>{H.head.removeChild(Ot)},1)}return()=>{clearTimeout(He)}},[gt,U,H]),E.useEffect(()=>(W.current=!0,()=>{W.current=!1}),[]);const Yt=E.useMemo(()=>({allColorSchemes:we,colorScheme:gt,darkColorScheme:Re,lightColorScheme:rt,mode:fn,setColorScheme:Vt,setMode:We,systemMode:Ie}),[we,gt,Re,rt,fn,Vt,We,Ie,An.colorSchemeSelector]);let De=!0;(ee||P.cssVariables===!1||q&&D?.cssVarPrefix===de)&&(De=!1);const mr=I.jsxs(E.Fragment,{children:[I.jsx(IO,{themeId:pe?e:void 0,theme:An,children:k}),De&&I.jsx(sO,{styles:An.generateStyleSheets?.()||[]})]});return q?mr:I.jsx(h.Provider,{value:Yt,children:mr})}const b=typeof c=="string"?c:c.light,T=typeof c=="string"?c:c.dark;return{CssVarsProvider:C,useColorScheme:m,getInitColorSchemeScript:_=>q3({colorSchemeStorageKey:a,defaultLightColorScheme:b,defaultDarkColorScheme:T,modeStorageKey:o,..._})}}function e6(t=""){function e(...o){if(!o.length)return"";const a=o[0];return typeof a=="string"&&!a.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${t?`${t}-`:""}${a}${e(...o.slice(1))})`:`, ${a}`}return(o,...a)=>`var(--${t?`${t}-`:""}${o}${e(...a)})`}const nR=(t,e,n,o=[])=>{let a=t;e.forEach((l,c)=>{c===e.length-1?Array.isArray(a)?a[Number(l)]=n:a&&typeof a=="object"&&(a[l]=n):a&&typeof a=="object"&&(a[l]||(a[l]=o.includes(l)?[]:{}),a=a[l])})},t6=(t,e,n)=>{function o(a,l=[],c=[]){Object.entries(a).forEach(([d,f])=>{(!n||n&&!n([...l,d]))&&f!=null&&(typeof f=="object"&&Object.keys(f).length>0?o(f,[...l,d],Array.isArray(f)?[...c,d]:c):e([...l,d],f,c))})}o(t)},n6=(t,e)=>typeof e=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(o=>t.includes(o))||t[t.length-1].toLowerCase().includes("opacity")?e:`${e}px`:e;function Ey(t,e){const{prefix:n,shouldSkipGeneratingVar:o}=e||{},a={},l={},c={};return t6(t,(d,f,h)=>{if((typeof f=="string"||typeof f=="number")&&(!o||!o(d,f))){const m=`--${n?`${n}-`:""}${d.join("-")}`,y=n6(d,f);Object.assign(a,{[m]:y}),nR(l,d,`var(${m})`,h),nR(c,d,`var(${m}, ${y})`,h)}},d=>d[0]==="vars"),{css:a,vars:l,varsWithDefaults:c}}function r6(t,e={}){const{getSelector:n=w,disableCssColorScheme:o,colorSchemeSelector:a}=e,{colorSchemes:l={},components:c,defaultColorScheme:d="light",...f}=t,{vars:h,css:m,varsWithDefaults:y}=Ey(f,e);let v=y;const C={},{[d]:b,...T}=l;if(Object.entries(T||{}).forEach(([R,N])=>{const{vars:M,css:U,varsWithDefaults:x}=Ey(N,e);v=In(v,x),C[R]={css:U,vars:M}}),b){const{css:R,vars:N,varsWithDefaults:M}=Ey(b,e);v=In(v,M),C[d]={css:R,vars:N}}function w(R,N){let M=a;if(a==="class"&&(M=".%s"),a==="data"&&(M="[data-%s]"),a?.startsWith("data-")&&!a.includes("%s")&&(M=`[${a}="%s"]`),R){if(M==="media")return t.defaultColorScheme===R?":root":{[`@media (prefers-color-scheme: ${l[R]?.palette?.mode||R})`]:{":root":N}};if(M)return t.defaultColorScheme===R?`:root, ${M.replace("%s",String(R))}`:M.replace("%s",String(R))}return":root"}return{vars:v,generateThemeVars:()=>{let R={...h};return Object.entries(C).forEach(([,{vars:N}])=>{R=In(R,N)}),R},generateStyleSheets:()=>{const R=[],N=t.defaultColorScheme||"light";function M(L,H){Object.keys(H).length&&R.push(typeof L=="string"?{[L]:{...H}}:L)}M(n(void 0,{...m}),m);const{[N]:U,...x}=C;if(U){const{css:L}=U,H=l[N]?.palette?.mode,A=!o&&H?{colorScheme:H,...L}:{...L};M(n(N,{...A}),A)}return Object.entries(x).forEach(([L,{css:H}])=>{const A=l[L]?.palette?.mode,$=!o&&A?{colorScheme:A,...H}:{...H};M(n(L,{...$}),$)}),R}}}function o6(t){return function(n){return t==="media"?`@media (prefers-color-scheme: ${n})`:t?t.startsWith("data-")&&!t.includes("%s")?`[${t}="${n}"] &`:t==="class"?`.${n} &`:t==="data"?`[data-${n}] &`:`${t.replace("%s",n)} &`:"&"}}const i6=vp(),a6=T3("div",{name:"MuiStack",slot:"Root",overridesResolver:(t,e)=>e.root});function s6(t){return A3({props:t,name:"MuiStack",defaultTheme:i6})}function l6(t,e){const n=E.Children.toArray(t).filter(Boolean);return n.reduce((o,a,l)=>(o.push(a),l({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[t],u6=({ownerState:t,theme:e})=>{let n={display:"flex",flexDirection:"column",...So({theme:e},yy({values:t.direction,breakpoints:e.breakpoints.values}),o=>({flexDirection:o}))};if(t.spacing){const o=fp(e),a=Object.keys(e.breakpoints.values).reduce((f,h)=>((typeof t.spacing=="object"&&t.spacing[h]!=null||typeof t.direction=="object"&&t.direction[h]!=null)&&(f[h]=!0),f),{}),l=yy({values:t.direction,base:a}),c=yy({values:t.spacing,base:a});typeof l=="object"&&Object.keys(l).forEach((f,h,m)=>{if(!l[f]){const v=h>0?l[m[h-1]]:"column";l[f]=v}}),n=In(n,So({theme:e},c,(f,h)=>t.useFlexGap?{gap:ds(o,f)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${c6(h?l[h]:t.direction)}`]:ds(o,f)}}))}return n=Ej(e.breakpoints,n),n};function d6(t={}){const{createStyledComponent:e=a6,useThemeProps:n=s6,componentName:o="MuiStack"}=t,a=()=>qe({root:["root"]},f=>Ge(o,f),{}),l=e(u6);return E.forwardRef(function(f,h){const m=n(f),y=hS(m),{component:v="div",direction:C="column",spacing:b=0,divider:T,children:w,className:_,useFlexGap:k=!1,...R}=y,N={direction:C,spacing:b,useFlexGap:k},M=a();return I.jsx(l,{as:v,ownerState:N,ref:h,className:xe(M.root,_),...R,children:T?l6(w,T):w})})}const jo="$$material",Su={black:"#000",white:"#fff"},f6={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},tl={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},nl={300:"#e57373",400:"#ef5350",500:"#f44336",700:"#d32f2f",800:"#c62828"},zc={300:"#ffb74d",400:"#ffa726",500:"#ff9800",700:"#f57c00",900:"#e65100"},rl={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",700:"#1976d2",800:"#1565c0"},ol={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},il={300:"#81c784",400:"#66bb6a",500:"#4caf50",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"};function MO(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Su.white,default:Su.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const h6=MO();function NO(){return{text:{primary:Su.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Su.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const rR=NO();function oR(t,e,n,o){const a=o.light||o,l=o.dark||o*1.5;t[e]||(t.hasOwnProperty(n)?t[e]=t[n]:e==="light"?t.light=kl(t.main,a):e==="dark"&&(t.dark=Il(t.main,l)))}function p6(t="light"){return t==="dark"?{main:rl[200],light:rl[50],dark:rl[400]}:{main:rl[700],light:rl[400],dark:rl[800]}}function g6(t="light"){return t==="dark"?{main:tl[200],light:tl[50],dark:tl[400]}:{main:tl[500],light:tl[300],dark:tl[700]}}function m6(t="light"){return t==="dark"?{main:nl[500],light:nl[300],dark:nl[700]}:{main:nl[700],light:nl[400],dark:nl[800]}}function y6(t="light"){return t==="dark"?{main:ol[400],light:ol[300],dark:ol[700]}:{main:ol[700],light:ol[500],dark:ol[900]}}function v6(t="light"){return t==="dark"?{main:il[400],light:il[300],dark:il[700]}:{main:il[800],light:il[500],dark:il[900]}}function b6(t="light"){return t==="dark"?{main:zc[400],light:zc[300],dark:zc[700]}:{main:"#ed6c02",light:zc[500],dark:zc[900]}}function ES(t){const{mode:e="light",contrastThreshold:n=3,tonalOffset:o=.2,...a}=t,l=t.primary||p6(e),c=t.secondary||g6(e),d=t.error||m6(e),f=t.info||y6(e),h=t.success||v6(e),m=t.warning||b6(e);function y(T){return O3(T,rR.text.primary)>=n?rR.text.primary:h6.text.primary}const v=({color:T,name:w,mainShade:_=500,lightShade:k=300,darkShade:R=700})=>{if(T={...T},!T.main&&T[_]&&(T.main=T[_]),!T.hasOwnProperty("main"))throw new Error(Ai(11,w?` (${w})`:"",_));if(typeof T.main!="string")throw new Error(Ai(12,w?` (${w})`:"",JSON.stringify(T.main)));return oR(T,"light",k,o),oR(T,"dark",R,o),T.contrastText||(T.contrastText=y(T.main)),T};let C;return e==="light"?C=MO():e==="dark"&&(C=NO()),In({common:{...Su},mode:e,primary:v({color:l,name:"primary"}),secondary:v({color:c,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:v({color:d,name:"error"}),warning:v({color:m,name:"warning"}),info:v({color:f,name:"info"}),success:v({color:h,name:"success"}),grey:f6,contrastThreshold:n,getContrastText:y,augmentColor:v,tonalOffset:o,...C},a)}function S6(t){const e={};return Object.entries(t).forEach(o=>{const[a,l]=o;typeof l=="object"&&(e[a]=`${l.fontStyle?`${l.fontStyle} `:""}${l.fontVariant?`${l.fontVariant} `:""}${l.fontWeight?`${l.fontWeight} `:""}${l.fontStretch?`${l.fontStretch} `:""}${l.fontSize||""}${l.lineHeight?`/${l.lineHeight} `:""}${l.fontFamily||""}`)}),e}function C6(t,e){return{toolbar:{minHeight:56,[t.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[t.up("sm")]:{minHeight:64}},...e}}function E6(t){return Math.round(t*1e5)/1e5}const iR={textTransform:"uppercase"},aR='"Roboto", "Helvetica", "Arial", sans-serif';function PO(t,e){const{fontFamily:n=aR,fontSize:o=14,fontWeightLight:a=300,fontWeightRegular:l=400,fontWeightMedium:c=500,fontWeightBold:d=700,htmlFontSize:f=16,allVariants:h,pxToRem:m,...y}=typeof e=="function"?e(t):e,v=o/14,C=m||(w=>`${w/f*v}rem`),b=(w,_,k,R,N)=>({fontFamily:n,fontWeight:w,fontSize:C(_),lineHeight:k,...n===aR?{letterSpacing:`${E6(R/_)}em`}:{},...N,...h}),T={h1:b(a,96,1.167,-1.5),h2:b(a,60,1.2,-.5),h3:b(l,48,1.167,0),h4:b(l,34,1.235,.25),h5:b(l,24,1.334,0),h6:b(c,20,1.6,.15),subtitle1:b(l,16,1.75,.15),subtitle2:b(c,14,1.57,.1),body1:b(l,16,1.5,.15),body2:b(l,14,1.43,.15),button:b(c,14,1.75,.4,iR),caption:b(l,12,1.66,.4),overline:b(l,12,2.66,1,iR),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return In({htmlFontSize:f,pxToRem:C,fontFamily:n,fontSize:o,fontWeightLight:a,fontWeightRegular:l,fontWeightMedium:c,fontWeightBold:d,...T},y,{clone:!1})}const T6=.2,w6=.14,A6=.12;function tn(...t){return[`${t[0]}px ${t[1]}px ${t[2]}px ${t[3]}px rgba(0,0,0,${T6})`,`${t[4]}px ${t[5]}px ${t[6]}px ${t[7]}px rgba(0,0,0,${w6})`,`${t[8]}px ${t[9]}px ${t[10]}px ${t[11]}px rgba(0,0,0,${A6})`].join(",")}const R6=["none",tn(0,2,1,-1,0,1,1,0,0,1,3,0),tn(0,3,1,-2,0,2,2,0,0,1,5,0),tn(0,3,3,-2,0,3,4,0,0,1,8,0),tn(0,2,4,-1,0,4,5,0,0,1,10,0),tn(0,3,5,-1,0,5,8,0,0,1,14,0),tn(0,3,5,-1,0,6,10,0,0,1,18,0),tn(0,4,5,-2,0,7,10,1,0,2,16,1),tn(0,5,5,-3,0,8,10,1,0,3,14,2),tn(0,5,6,-3,0,9,12,1,0,3,16,2),tn(0,6,6,-3,0,10,14,1,0,4,18,3),tn(0,6,7,-4,0,11,15,1,0,4,20,3),tn(0,7,8,-4,0,12,17,2,0,5,22,4),tn(0,7,8,-4,0,13,19,2,0,5,24,4),tn(0,7,9,-4,0,14,21,2,0,5,26,4),tn(0,8,9,-5,0,15,22,2,0,6,28,5),tn(0,8,10,-5,0,16,24,2,0,6,30,5),tn(0,8,11,-5,0,17,26,2,0,6,32,5),tn(0,9,11,-5,0,18,28,2,0,7,34,6),tn(0,9,12,-6,0,19,29,2,0,7,36,6),tn(0,10,13,-6,0,20,31,3,0,8,38,7),tn(0,10,13,-6,0,21,33,3,0,8,40,7),tn(0,10,14,-6,0,22,35,3,0,8,42,7),tn(0,11,14,-7,0,23,36,3,0,9,44,8),tn(0,11,15,-7,0,24,38,3,0,9,46,8)],x6={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},_6={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function sR(t){return`${Math.round(t)}ms`}function O6(t){if(!t)return 0;const e=t/36;return Math.min(Math.round((4+15*e**.25+e/5)*10),3e3)}function I6(t){const e={...x6,...t.easing},n={..._6,...t.duration};return{getAutoHeightDuration:O6,create:(a=["all"],l={})=>{const{duration:c=n.standard,easing:d=e.easeInOut,delay:f=0,...h}=l;return(Array.isArray(a)?a:[a]).map(m=>`${m} ${typeof c=="string"?c:sR(c)} ${d} ${typeof f=="string"?f:sR(f)}`).join(",")},...t,easing:e,duration:n}}const k6={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function M6(t){return Uo(t)||typeof t>"u"||typeof t=="string"||typeof t=="boolean"||typeof t=="number"||Array.isArray(t)}function DO(t={}){const e={...t};function n(o){const a=Object.entries(o);for(let l=0;lIn(C,b),v),v.unstable_sxConfig={...ju,...h?.unstable_sxConfig},v.unstable_sx=function(b){return ga({sx:b,theme:this})},v.toRuntimeSource=DO,v}function Ev(t){let e;return t<1?e=5.11916*t**2:e=4.5*Math.log(t+1)+2,Math.round(e*10)/1e3}const N6=[...Array(25)].map((t,e)=>{if(e===0)return"none";const n=Ev(e);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function LO(t){return{inputPlaceholder:t==="dark"?.5:.42,inputUnderline:t==="dark"?.7:.42,switchTrackDisabled:t==="dark"?.2:.12,switchTrack:t==="dark"?.3:.38}}function UO(t){return t==="dark"?N6:[]}function P6(t){const{palette:e={mode:"light"},opacity:n,overlays:o,...a}=t,l=ES(e);return{palette:l,opacity:{...LO(l.mode),...n},overlays:o||UO(l.mode),...a}}function D6(t){return!!t[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!t[0].match(/sxConfig$/)||t[0]==="palette"&&!!t[1]?.match(/(mode|contrastThreshold|tonalOffset)/)}const L6=t=>[...[...Array(25)].map((e,n)=>`--${t?`${t}-`:""}overlays-${n}`),`--${t?`${t}-`:""}palette-AppBar-darkBg`,`--${t?`${t}-`:""}palette-AppBar-darkColor`],U6=t=>(e,n)=>{const o=t.rootSelector||":root",a=t.colorSchemeSelector;let l=a;if(a==="class"&&(l=".%s"),a==="data"&&(l="[data-%s]"),a?.startsWith("data-")&&!a.includes("%s")&&(l=`[${a}="%s"]`),t.defaultColorScheme===e){if(e==="dark"){const c={};return L6(t.cssVarPrefix).forEach(d=>{c[d]=n[d],delete n[d]}),l==="media"?{[o]:n,"@media (prefers-color-scheme: dark)":{[o]:c}}:l?{[l.replace("%s",e)]:c,[`${o}, ${l.replace("%s",e)}`]:n}:{[o]:{...n,...c}}}if(l&&l!=="media")return`${o}, ${l.replace("%s",String(e))}`}else if(e){if(l==="media")return{[`@media (prefers-color-scheme: ${String(e)})`]:{[o]:n}};if(l)return l.replace("%s",String(e))}return o};function z6(t,e){e.forEach(n=>{t[n]||(t[n]={})})}function ae(t,e,n){!t[e]&&n&&(t[e]=n)}function Qc(t){return typeof t!="string"||!t.startsWith("hsl")?t:SO(t)}function fi(t,e){`${e}Channel`in t||(t[`${e}Channel`]=Wc(Qc(t[e])))}function B6(t){return typeof t=="number"?`${t}px`:typeof t=="string"||typeof t=="function"||Array.isArray(t)?t:"8px"}const ko=t=>{try{return t()}catch{}},H6=(t="mui")=>e6(t);function Ty(t,e,n,o){if(!e)return;e=e===!0?{}:e;const a=o==="dark"?"dark":"light";if(!n){t[o]=P6({...e,palette:{mode:a,...e?.palette}});return}const{palette:l,...c}=Cv({...n,palette:{mode:a,...e?.palette}});return t[o]={...e,palette:l,opacity:{...LO(a),...e?.opacity},overlays:e?.overlays||UO(a)},c}function j6(t={},...e){const{colorSchemes:n={light:!0},defaultColorScheme:o,disableCssColorScheme:a=!1,cssVarPrefix:l="mui",shouldSkipGeneratingVar:c=D6,colorSchemeSelector:d=n.light&&n.dark?"media":void 0,rootSelector:f=":root",...h}=t,m=Object.keys(n)[0],y=o||(n.light&&m!=="light"?"light":m),v=H6(l),{[y]:C,light:b,dark:T,...w}=n,_={...w};let k=C;if((y==="dark"&&!("dark"in n)||y==="light"&&!("light"in n))&&(k=!0),!k)throw new Error(Ai(21,y));const R=Ty(_,k,h,y);b&&!_.light&&Ty(_,b,void 0,"light"),T&&!_.dark&&Ty(_,T,void 0,"dark");let N={defaultColorScheme:y,...R,cssVarPrefix:l,colorSchemeSelector:d,rootSelector:f,getCssVar:v,colorSchemes:_,font:{...S6(R.typography),...R.font},spacing:B6(h.spacing)};Object.keys(N.colorSchemes).forEach(H=>{const A=N.colorSchemes[H].palette,$=ee=>{const re=ee.split("-"),le=re[1],W=re[2];return v(ee,A[le][W])};if(A.mode==="light"&&(ae(A.common,"background","#fff"),ae(A.common,"onBackground","#000")),A.mode==="dark"&&(ae(A.common,"background","#000"),ae(A.common,"onBackground","#fff")),z6(A,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),A.mode==="light"){ae(A.Alert,"errorColor",$t(A.error.light,.6)),ae(A.Alert,"infoColor",$t(A.info.light,.6)),ae(A.Alert,"successColor",$t(A.success.light,.6)),ae(A.Alert,"warningColor",$t(A.warning.light,.6)),ae(A.Alert,"errorFilledBg",$("palette-error-main")),ae(A.Alert,"infoFilledBg",$("palette-info-main")),ae(A.Alert,"successFilledBg",$("palette-success-main")),ae(A.Alert,"warningFilledBg",$("palette-warning-main")),ae(A.Alert,"errorFilledColor",ko(()=>A.getContrastText(A.error.main))),ae(A.Alert,"infoFilledColor",ko(()=>A.getContrastText(A.info.main))),ae(A.Alert,"successFilledColor",ko(()=>A.getContrastText(A.success.main))),ae(A.Alert,"warningFilledColor",ko(()=>A.getContrastText(A.warning.main))),ae(A.Alert,"errorStandardBg",Ft(A.error.light,.9)),ae(A.Alert,"infoStandardBg",Ft(A.info.light,.9)),ae(A.Alert,"successStandardBg",Ft(A.success.light,.9)),ae(A.Alert,"warningStandardBg",Ft(A.warning.light,.9)),ae(A.Alert,"errorIconColor",$("palette-error-main")),ae(A.Alert,"infoIconColor",$("palette-info-main")),ae(A.Alert,"successIconColor",$("palette-success-main")),ae(A.Alert,"warningIconColor",$("palette-warning-main")),ae(A.AppBar,"defaultBg",$("palette-grey-100")),ae(A.Avatar,"defaultBg",$("palette-grey-400")),ae(A.Button,"inheritContainedBg",$("palette-grey-300")),ae(A.Button,"inheritContainedHoverBg",$("palette-grey-A100")),ae(A.Chip,"defaultBorder",$("palette-grey-400")),ae(A.Chip,"defaultAvatarColor",$("palette-grey-700")),ae(A.Chip,"defaultIconColor",$("palette-grey-700")),ae(A.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),ae(A.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),ae(A.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),ae(A.LinearProgress,"primaryBg",Ft(A.primary.main,.62)),ae(A.LinearProgress,"secondaryBg",Ft(A.secondary.main,.62)),ae(A.LinearProgress,"errorBg",Ft(A.error.main,.62)),ae(A.LinearProgress,"infoBg",Ft(A.info.main,.62)),ae(A.LinearProgress,"successBg",Ft(A.success.main,.62)),ae(A.LinearProgress,"warningBg",Ft(A.warning.main,.62)),ae(A.Skeleton,"bg",`rgba(${$("palette-text-primaryChannel")} / 0.11)`),ae(A.Slider,"primaryTrack",Ft(A.primary.main,.62)),ae(A.Slider,"secondaryTrack",Ft(A.secondary.main,.62)),ae(A.Slider,"errorTrack",Ft(A.error.main,.62)),ae(A.Slider,"infoTrack",Ft(A.info.main,.62)),ae(A.Slider,"successTrack",Ft(A.success.main,.62)),ae(A.Slider,"warningTrack",Ft(A.warning.main,.62));const ee=Ef(A.background.default,.8);ae(A.SnackbarContent,"bg",ee),ae(A.SnackbarContent,"color",ko(()=>A.getContrastText(ee))),ae(A.SpeedDialAction,"fabHoverBg",Ef(A.background.paper,.15)),ae(A.StepConnector,"border",$("palette-grey-400")),ae(A.StepContent,"border",$("palette-grey-400")),ae(A.Switch,"defaultColor",$("palette-common-white")),ae(A.Switch,"defaultDisabledColor",$("palette-grey-100")),ae(A.Switch,"primaryDisabledColor",Ft(A.primary.main,.62)),ae(A.Switch,"secondaryDisabledColor",Ft(A.secondary.main,.62)),ae(A.Switch,"errorDisabledColor",Ft(A.error.main,.62)),ae(A.Switch,"infoDisabledColor",Ft(A.info.main,.62)),ae(A.Switch,"successDisabledColor",Ft(A.success.main,.62)),ae(A.Switch,"warningDisabledColor",Ft(A.warning.main,.62)),ae(A.TableCell,"border",Ft(Cf(A.divider,1),.88)),ae(A.Tooltip,"bg",Cf(A.grey[700],.92))}if(A.mode==="dark"){ae(A.Alert,"errorColor",Ft(A.error.light,.6)),ae(A.Alert,"infoColor",Ft(A.info.light,.6)),ae(A.Alert,"successColor",Ft(A.success.light,.6)),ae(A.Alert,"warningColor",Ft(A.warning.light,.6)),ae(A.Alert,"errorFilledBg",$("palette-error-dark")),ae(A.Alert,"infoFilledBg",$("palette-info-dark")),ae(A.Alert,"successFilledBg",$("palette-success-dark")),ae(A.Alert,"warningFilledBg",$("palette-warning-dark")),ae(A.Alert,"errorFilledColor",ko(()=>A.getContrastText(A.error.dark))),ae(A.Alert,"infoFilledColor",ko(()=>A.getContrastText(A.info.dark))),ae(A.Alert,"successFilledColor",ko(()=>A.getContrastText(A.success.dark))),ae(A.Alert,"warningFilledColor",ko(()=>A.getContrastText(A.warning.dark))),ae(A.Alert,"errorStandardBg",$t(A.error.light,.9)),ae(A.Alert,"infoStandardBg",$t(A.info.light,.9)),ae(A.Alert,"successStandardBg",$t(A.success.light,.9)),ae(A.Alert,"warningStandardBg",$t(A.warning.light,.9)),ae(A.Alert,"errorIconColor",$("palette-error-main")),ae(A.Alert,"infoIconColor",$("palette-info-main")),ae(A.Alert,"successIconColor",$("palette-success-main")),ae(A.Alert,"warningIconColor",$("palette-warning-main")),ae(A.AppBar,"defaultBg",$("palette-grey-900")),ae(A.AppBar,"darkBg",$("palette-background-paper")),ae(A.AppBar,"darkColor",$("palette-text-primary")),ae(A.Avatar,"defaultBg",$("palette-grey-600")),ae(A.Button,"inheritContainedBg",$("palette-grey-800")),ae(A.Button,"inheritContainedHoverBg",$("palette-grey-700")),ae(A.Chip,"defaultBorder",$("palette-grey-700")),ae(A.Chip,"defaultAvatarColor",$("palette-grey-300")),ae(A.Chip,"defaultIconColor",$("palette-grey-300")),ae(A.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),ae(A.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),ae(A.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),ae(A.LinearProgress,"primaryBg",$t(A.primary.main,.5)),ae(A.LinearProgress,"secondaryBg",$t(A.secondary.main,.5)),ae(A.LinearProgress,"errorBg",$t(A.error.main,.5)),ae(A.LinearProgress,"infoBg",$t(A.info.main,.5)),ae(A.LinearProgress,"successBg",$t(A.success.main,.5)),ae(A.LinearProgress,"warningBg",$t(A.warning.main,.5)),ae(A.Skeleton,"bg",`rgba(${$("palette-text-primaryChannel")} / 0.13)`),ae(A.Slider,"primaryTrack",$t(A.primary.main,.5)),ae(A.Slider,"secondaryTrack",$t(A.secondary.main,.5)),ae(A.Slider,"errorTrack",$t(A.error.main,.5)),ae(A.Slider,"infoTrack",$t(A.info.main,.5)),ae(A.Slider,"successTrack",$t(A.success.main,.5)),ae(A.Slider,"warningTrack",$t(A.warning.main,.5));const ee=Ef(A.background.default,.98);ae(A.SnackbarContent,"bg",ee),ae(A.SnackbarContent,"color",ko(()=>A.getContrastText(ee))),ae(A.SpeedDialAction,"fabHoverBg",Ef(A.background.paper,.15)),ae(A.StepConnector,"border",$("palette-grey-600")),ae(A.StepContent,"border",$("palette-grey-600")),ae(A.Switch,"defaultColor",$("palette-grey-300")),ae(A.Switch,"defaultDisabledColor",$("palette-grey-600")),ae(A.Switch,"primaryDisabledColor",$t(A.primary.main,.55)),ae(A.Switch,"secondaryDisabledColor",$t(A.secondary.main,.55)),ae(A.Switch,"errorDisabledColor",$t(A.error.main,.55)),ae(A.Switch,"infoDisabledColor",$t(A.info.main,.55)),ae(A.Switch,"successDisabledColor",$t(A.success.main,.55)),ae(A.Switch,"warningDisabledColor",$t(A.warning.main,.55)),ae(A.TableCell,"border",$t(Cf(A.divider,1),.68)),ae(A.Tooltip,"bg",Cf(A.grey[700],.92))}fi(A.background,"default"),fi(A.background,"paper"),fi(A.common,"background"),fi(A.common,"onBackground"),fi(A,"divider"),Object.keys(A).forEach(ee=>{const re=A[ee];ee!=="tonalOffset"&&re&&typeof re=="object"&&(re.main&&ae(A[ee],"mainChannel",Wc(Qc(re.main))),re.light&&ae(A[ee],"lightChannel",Wc(Qc(re.light))),re.dark&&ae(A[ee],"darkChannel",Wc(Qc(re.dark))),re.contrastText&&ae(A[ee],"contrastTextChannel",Wc(Qc(re.contrastText))),ee==="text"&&(fi(A[ee],"primary"),fi(A[ee],"secondary")),ee==="action"&&(re.active&&fi(A[ee],"active"),re.selected&&fi(A[ee],"selected")))})}),N=e.reduce((H,A)=>In(H,A),N);const M={prefix:l,disableCssColorScheme:a,shouldSkipGeneratingVar:c,getSelector:U6(N)},{vars:U,generateThemeVars:x,generateStyleSheets:L}=r6(N,M);return N.vars=U,Object.entries(N.colorSchemes[N.defaultColorScheme]).forEach(([H,A])=>{N[H]=A}),N.generateThemeVars=x,N.generateStyleSheets=L,N.generateSpacing=function(){return hO(h.spacing,fp(this))},N.getColorSchemeSelector=o6(d),N.spacing=N.generateSpacing(),N.shouldSkipGeneratingVar=c,N.unstable_sxConfig={...ju,...h?.unstable_sxConfig},N.unstable_sx=function(A){return ga({sx:A,theme:this})},N.toRuntimeSource=DO,N}function lR(t,e,n){t.colorSchemes&&n&&(t.colorSchemes[e]={...n!==!0&&n,palette:ES({...n===!0?{}:n.palette,mode:e})})}function Cp(t={},...e){const{palette:n,cssVariables:o=!1,colorSchemes:a=n?void 0:{light:!0},defaultColorScheme:l=n?.mode,...c}=t,d=l||"light",f=a?.[d],h={...a,...n?{[d]:{...typeof f!="boolean"&&f,palette:n}}:void 0};if(o===!1){if(!("colorSchemes"in t))return Cv(t,...e);let m=n;"palette"in t||h[d]&&(h[d]!==!0?m=h[d].palette:d==="dark"&&(m={mode:"dark"}));const y=Cv({...t,palette:m},...e);return y.defaultColorScheme=d,y.colorSchemes=h,y.palette.mode==="light"&&(y.colorSchemes.light={...h.light!==!0&&h.light,palette:y.palette},lR(y,"dark",h.dark)),y.palette.mode==="dark"&&(y.colorSchemes.dark={...h.dark!==!0&&h.dark,palette:y.palette},lR(y,"light",h.light)),y}return!n&&!("light"in h)&&d==="light"&&(h.light=!0),j6({...c,colorSchemes:h,defaultColorScheme:d,...typeof o!="boolean"&&o},...e)}const TS=Cp();function ys(){const t=bp(TS);return t[jo]||t}function zO(t){return t!=="ownerState"&&t!=="theme"&&t!=="sx"&&t!=="as"}const Mr=t=>zO(t)&&t!=="classes",me=bO({themeId:jo,defaultTheme:TS,rootShouldForwardProp:Mr});function $6({theme:t,...e}){const n=jo in t?t[jo]:void 0;return I.jsx(IO,{...e,themeId:n?jo:void 0,theme:n||t})}const Tf={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:F6}=Z3({themeId:jo,theme:()=>Cp({cssVariables:!0}),colorSchemeStorageKey:Tf.colorSchemeStorageKey,modeStorageKey:Tf.modeStorageKey,defaultColorScheme:{light:Tf.defaultLightColorScheme,dark:Tf.defaultDarkColorScheme},resolveTheme:t=>{const e={...t,typography:PO(t.palette,t.typography)};return e.unstable_sx=function(o){return ga({sx:o,theme:this})},e}}),K6=F6;function V6({theme:t,...e}){const n=E.useMemo(()=>{if(typeof t=="function")return t;const o=jo in t?t[jo]:t;return"colorSchemes"in o?null:"vars"in o?t:{...t,vars:null}},[t]);return n?I.jsx($6,{theme:n,...e}):I.jsx(K6,{theme:t,...e})}const G6=Ke("MuiBox",["root"]),q6=Cp(),Ht=p3({themeId:jo,defaultTheme:q6,defaultClassName:G6.root,generateClassName:gO.generate});function Y6(t){return I.jsx(pO,{...t,defaultTheme:TS,themeId:jo})}function wS(t){return function(n){return I.jsx(Y6,{styles:typeof t=="function"?o=>t({theme:o,...n}):t})}}function W6(){return hS}const nt=V3;function Ye(t){return F3(t)}function Q6(t){return typeof t.main=="string"}function X6(t,e=[]){if(!Q6(t))return!1;for(const n of e)if(!t.hasOwnProperty(n)||typeof t[n]!="string")return!1;return!0}function pr(t=[]){return([,e])=>e&&X6(e,t)}function J6(t){return Ge("MuiTypography",t)}const cR=Ke("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]),Z6={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},e$=W6(),t$=t=>{const{align:e,gutterBottom:n,noWrap:o,paragraph:a,variant:l,classes:c}=t,d={root:["root",l,t.align!=="inherit"&&`align${ve(e)}`,n&&"gutterBottom",o&&"noWrap",a&&"paragraph"]};return qe(d,J6,c)},n$=me("span",{name:"MuiTypography",slot:"Root",overridesResolver:(t,e)=>{const{ownerState:n}=t;return[e.root,n.variant&&e[n.variant],n.align!=="inherit"&&e[`align${ve(n.align)}`],n.noWrap&&e.noWrap,n.gutterBottom&&e.gutterBottom,n.paragraph&&e.paragraph]}})(nt(({theme:t})=>({margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(t.typography).filter(([e,n])=>e!=="inherit"&&n&&typeof n=="object").map(([e,n])=>({props:{variant:e},style:n})),...Object.entries(t.palette).filter(pr()).map(([e])=>({props:{color:e},style:{color:(t.vars||t).palette[e].main}})),...Object.entries(t.palette?.text||{}).filter(([,e])=>typeof e=="string").map(([e])=>({props:{color:`text${ve(e)}`},style:{color:(t.vars||t).palette.text[e]}})),{props:({ownerState:e})=>e.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:e})=>e.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:e})=>e.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:e})=>e.paragraph,style:{marginBottom:16}}]}))),uR={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},_t=E.forwardRef(function(e,n){const{color:o,...a}=Ye({props:e,name:"MuiTypography"}),l=!Z6[o],c=e$({...a,...l&&{color:o}}),{align:d="inherit",className:f,component:h,gutterBottom:m=!1,noWrap:y=!1,paragraph:v=!1,variant:C="body1",variantMapping:b=uR,...T}=c,w={...c,align:d,color:o,className:f,component:h,gutterBottom:m,noWrap:y,paragraph:v,variant:C,variantMapping:b},_=h||(v?"p":b[C]||uR[C])||"span",k=t$(w);return I.jsx(n$,{as:_,ref:n,className:xe(k.root,f),...T,ownerState:w,style:{...d!=="inherit"&&{"--Typography-textAlign":d},...T.style}})}),BO=E.memo(({feature:t})=>{const e=t.icon;return I.jsxs(Ht,{sx:{display:"flex",alignItems:"flex-start",gap:2,mb:3},children:[I.jsx(Ht,{sx:{width:48,height:48,bgcolor:"action.hover",borderRadius:2,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:I.jsx(e,{color:"primary"})}),I.jsxs(Ht,{children:[I.jsx(_t,{fontWeight:"600",children:t.title}),I.jsx(_t,{variant:"body2",color:"text.secondary",children:t.description})]})]})});BO.displayName="FeatureCard";var HO=t=>{throw TypeError(t)},r$=(t,e,n)=>e.has(t)||HO("Cannot "+n),wy=(t,e,n)=>(r$(t,e,"read from private field"),n?n.call(t):e.get(t)),o$=(t,e,n)=>e.has(t)?HO("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),dR="popstate";function i$(t={}){function e(o,a){let{pathname:l,search:c,hash:d}=o.location;return Cu("",{pathname:l,search:c,hash:d},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(o,a){return typeof a=="string"?a:Fo(a)}return s$(e,n,null,t)}function et(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function mn(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function a$(){return Math.random().toString(36).substring(2,10)}function fR(t,e){return{usr:t.state,key:t.key,idx:e}}function Cu(t,e,n=null,o){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ya(e):e,state:n,key:e&&e.key||o||a$()}}function Fo({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function ya(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let o=t.indexOf("?");o>=0&&(e.search=t.substring(o),t=t.substring(0,o)),t&&(e.pathname=t)}return e}function s$(t,e,n,o={}){let{window:a=document.defaultView,v5Compat:l=!1}=o,c=a.history,d="POP",f=null,h=m();h==null&&(h=0,c.replaceState({...c.state,idx:h},""));function m(){return(c.state||{idx:null}).idx}function y(){d="POP";let w=m(),_=w==null?null:w-h;h=w,f&&f({action:d,location:T.location,delta:_})}function v(w,_){d="PUSH";let k=Cu(T.location,w,_);h=m()+1;let R=fR(k,h),N=T.createHref(k);try{c.pushState(R,"",N)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;a.location.assign(N)}l&&f&&f({action:d,location:T.location,delta:1})}function C(w,_){d="REPLACE";let k=Cu(T.location,w,_);h=m();let R=fR(k,h),N=T.createHref(k);c.replaceState(R,"",N),l&&f&&f({action:d,location:T.location,delta:0})}function b(w){return jO(w)}let T={get action(){return d},get location(){return t(a,c)},listen(w){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(dR,y),f=w,()=>{a.removeEventListener(dR,y),f=null}},createHref(w){return e(a,w)},createURL:b,encodeLocation(w){let _=b(w);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:v,replace:C,go(w){return c.go(w)}};return T}function jO(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),et(n,"No window.location.(origin|href) available to create URL");let o=typeof t=="string"?t:Fo(t);return o=o.replace(/ $/,"%20"),!e&&o.startsWith("//")&&(o=n+o),new URL(o,n)}var Xc,hR=class{constructor(t){if(o$(this,Xc,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(wy(this,Xc).has(t))return wy(this,Xc).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){wy(this,Xc).set(t,e)}};Xc=new WeakMap;var l$=new Set(["lazy","caseSensitive","path","id","index","children"]);function c$(t){return l$.has(t)}var u$=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function d$(t){return u$.has(t)}function f$(t){return t.index===!0}function Eu(t,e,n=[],o={},a=!1){return t.map((l,c)=>{let d=[...n,String(c)],f=typeof l.id=="string"?l.id:d.join("-");if(et(l.index!==!0||!l.children,"Cannot specify children on an index route"),et(a||!o[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),f$(l)){let h={...l,id:f};return o[f]=pR(h,e(h)),h}else{let h={...l,id:f,children:void 0};return o[f]=pR(h,e(h)),l.children&&(h.children=Eu(l.children,e,d,o,a)),h}})}function pR(t,e){return Object.assign(t,{...e,...typeof e.lazy=="object"&&e.lazy!=null?{lazy:{...t.lazy,...e.lazy}}:{}})}function oa(t,e,n="/"){return Jc(t,e,n,!1)}function Jc(t,e,n,o){let a=typeof e=="string"?ya(e):e,l=eo(a.pathname||"/",n);if(l==null)return null;let c=$O(t);p$(c);let d=null;for(let f=0;d==null&&f{let m={relativePath:h===void 0?c.path||"":h,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(o)&&f)return;et(m.relativePath.startsWith(o),`Absolute route path "${m.relativePath}" nested under path "${o}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(o.length)}let y=$o([o,m.relativePath]),v=n.concat(m);c.children&&c.children.length>0&&(et(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),$O(c.children,e,v,y,f)),!(c.path==null&&!c.index)&&e.push({path:y,score:C$(y,c.index),routesMeta:v})};return t.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))l(c,d);else for(let f of FO(c.path))l(c,d,!0,f)}),e}function FO(t){let e=t.split("/");if(e.length===0)return[];let[n,...o]=e,a=n.endsWith("?"),l=n.replace(/\?$/,"");if(o.length===0)return a?[l,""]:[l];let c=FO(o.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),a&&d.push(...c),d.map(f=>t.startsWith("/")&&f===""?"/":f)}function p$(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:E$(e.routesMeta.map(o=>o.childrenIndex),n.routesMeta.map(o=>o.childrenIndex)))}var g$=/^:[\w-]+$/,m$=3,y$=2,v$=1,b$=10,S$=-2,gR=t=>t==="*";function C$(t,e){let n=t.split("/"),o=n.length;return n.some(gR)&&(o+=S$),e&&(o+=y$),n.filter(a=>!gR(a)).reduce((a,l)=>a+(g$.test(l)?m$:l===""?v$:b$),o)}function E$(t,e){return t.length===e.length&&t.slice(0,-1).every((o,a)=>o===e[a])?t[t.length-1]-e[e.length-1]:0}function T$(t,e,n=!1){let{routesMeta:o}=t,a={},l="/",c=[];for(let d=0;d{if(m==="*"){let b=d[v]||"";c=l.slice(0,l.length-b.length).replace(/(.)\/+$/,"$1")}const C=d[v];return y&&!C?h[m]=void 0:h[m]=(C||"").replace(/%2F/g,"/"),h},{}),pathname:l,pathnameBase:c,pattern:t}}function w$(t,e=!1,n=!0){mn(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let o=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(o.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(o.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),o]}function A$(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return mn(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function eo(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,o=t.charAt(n);return o&&o!=="/"?null:t.slice(n)||"/"}function R$({basename:t,pathname:e}){return e==="/"?t:$o([t,e])}var KO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,AS=t=>KO.test(t);function x$(t,e="/"){let{pathname:n,search:o="",hash:a=""}=typeof t=="string"?ya(t):t,l;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?l=mR(n.substring(1),"/"):l=mR(n,e)):l=e,{pathname:l,search:O$(o),hash:I$(a)}}function mR(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ay(t,e,n,o){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(o)}]. 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 VO(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Ep(t){let e=VO(t);return e.map((n,o)=>o===e.length-1?n.pathname:n.pathnameBase)}function Tp(t,e,n,o=!1){let a;typeof t=="string"?a=ya(t):(a={...t},et(!a.pathname||!a.pathname.includes("?"),Ay("?","pathname","search",a)),et(!a.pathname||!a.pathname.includes("#"),Ay("#","pathname","hash",a)),et(!a.search||!a.search.includes("#"),Ay("#","search","hash",a)));let l=t===""||a.pathname==="",c=l?"/":a.pathname,d;if(c==null)d=n;else{let y=e.length-1;if(!o&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),y-=1;a.pathname=v.join("/")}d=y>=0?e[y]:"/"}let f=x$(a,d),h=c&&c!=="/"&&c.endsWith("/"),m=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||m)&&(f.pathname+="/"),f}var $o=t=>t.join("/").replace(/\/\/+/g,"/"),_$=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),O$=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,I$=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,Fu=class{constructor(t,e,n,o=!1){this.status=t,this.statusText=e||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Tu(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function Ku(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var GO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function qO(t,e){let n=t;if(typeof n!="string"||!KO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let o=n,a=!1;if(GO)try{let l=new URL(window.location.href),c=n.startsWith("//")?new URL(l.protocol+n):new URL(n),d=eo(c.pathname,e);c.origin===l.origin&&d!=null?n=d+c.search+c.hash:a=!0}catch{mn(!1,` contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:o,isExternal:a,to:n}}var la=Symbol("Uninstrumented");function k$(t,e){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};t.forEach(a=>a({id:e.id,index:e.index,path:e.path,instrument(l){let c=Object.keys(n);for(let d of c)l[d]&&n[d].push(l[d])}}));let o={};if(typeof e.lazy=="function"&&n.lazy.length>0){let a=fl(n.lazy,e.lazy,()=>{});a&&(o.lazy=a)}if(typeof e.lazy=="object"){let a=e.lazy;["middleware","loader","action"].forEach(l=>{let c=a[l],d=n[`lazy.${l}`];if(typeof c=="function"&&d.length>0){let f=fl(d,c,()=>{});f&&(o.lazy=Object.assign(o.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(a=>{let l=e[a];if(typeof l=="function"&&n[a].length>0){let c=l[la]??l,d=fl(n[a],c,(...f)=>yR(f[0]));d&&(a==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[la]=c,o[a]=d)}}),e.middleware&&e.middleware.length>0&&n.middleware.length>0&&(o.middleware=e.middleware.map(a=>{let l=a[la]??a,c=fl(n.middleware,l,(...d)=>yR(d[0]));return c?(c[la]=l,c):a})),o}function M$(t,e){let n={navigate:[],fetch:[]};if(e.forEach(o=>o({instrument(a){let l=Object.keys(a);for(let c of l)a[c]&&n[c].push(a[c])}})),n.navigate.length>0){let o=t.navigate[la]??t.navigate,a=fl(n.navigate,o,(...l)=>{let[c,d]=l;return{to:typeof c=="number"||typeof c=="string"?c:c?Fo(c):".",...vR(t,d??{})}});a&&(a[la]=o,t.navigate=a)}if(n.fetch.length>0){let o=t.fetch[la]??t.fetch,a=fl(n.fetch,o,(...l)=>{let[c,,d,f]=l;return{href:d??".",fetcherKey:c,...vR(t,f??{})}});a&&(a[la]=o,t.fetch=a)}return t}function fl(t,e,n){return t.length===0?null:async(...o)=>{let a=await YO(t,n(...o),()=>e(...o),t.length-1);if(a.type==="error")throw a.value;return a.value}}async function YO(t,e,n,o){let a=t[o],l;if(a){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=YO(t,e,n,o-1),l=await c,et(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await a(d,e)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await d(),await c}else try{l={type:"success",value:await n()}}catch(c){l={type:"error",value:c}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function yR(t){let{request:e,context:n,params:o,unstable_pattern:a}=t;return{request:N$(e),params:{...o},unstable_pattern:a,context:P$(n)}}function vR(t,e){return{currentUrl:Fo(t.state.location),..."formMethod"in e?{formMethod:e.formMethod}:{},..."formEncType"in e?{formEncType:e.formEncType}:{},..."formData"in e?{formData:e.formData}:{},..."body"in e?{body:e.body}:{}}}function N$(t){return{method:t.method,url:t.url,headers:{get:(...e)=>t.headers.get(...e)}}}function P$(t){if(L$(t)){let e={...t};return Object.freeze(e),e}else return{get:e=>t.get(e)}}var D$=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function L$(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null||Object.getOwnPropertyNames(e).sort().join("\0")===D$}var WO=["POST","PUT","PATCH","DELETE"],U$=new Set(WO),z$=["GET",...WO],B$=new Set(z$),QO=new Set([301,302,303,307,308]),H$=new Set([307,308]),Ry={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},j$={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Bc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},$$=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),XO="remix-router-transitions",JO=Symbol("ResetLoaderData");function F$(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";et(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let o=t.hydrationRouteProperties||[],a=t.mapRouteProperties||$$,l=a;if(t.unstable_instrumentations){let z=t.unstable_instrumentations;l=K=>({...a(K),...k$(z.map(Z=>Z.route).filter(Boolean),K)})}let c={},d=Eu(t.routes,l,void 0,c),f,h=t.basename||"/";h.startsWith("/")||(h=`/${h}`);let m=t.dataStrategy||Y$,y={...t.future},v=null,C=new Set,b=null,T=null,w=null,_=t.hydrationData!=null,k=oa(d,t.history.location,h),R=!1,N=null,M;if(k==null&&!t.patchRoutesOnNavigation){let z=Gr(404,{pathname:t.history.location.pathname}),{matches:K,route:Z}=wf(d);M=!0,k=K,N={[Z.id]:z}}else if(k&&!t.hydrationData&&Ca(k,d,t.history.location.pathname).active&&(k=null),k)if(k.some(z=>z.route.lazy))M=!1;else if(!k.some(z=>RS(z.route)))M=!0;else{let z=t.hydrationData?t.hydrationData.loaderData:null,K=t.hydrationData?t.hydrationData.errors:null;if(K){let Z=k.findIndex(fe=>K[fe.route.id]!==void 0);M=k.slice(0,Z+1).every(fe=>!wv(fe.route,z,K))}else M=k.every(Z=>!wv(Z.route,z,K))}else{M=!1,k=[];let z=Ca(null,d,t.history.location.pathname);z.active&&z.matches&&(R=!0,k=z.matches)}let U,x={historyAction:t.history.action,location:t.history.location,matches:k,initialized:M,navigation:Ry,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||N,fetchers:new Map,blockers:new Map},L="POP",H=null,A=!1,$,ee=!1,re=new Map,le=null,W=!1,D=!1,J=new Set,q=new Map,X=0,pe=-1,P=new Map,V=new Set,oe=new Map,de=new Map,ye=new Set,we=new Map,Me,Je=null;function $e(){if(v=t.history.listen(({action:z,location:K,delta:Z})=>{if(Me){Me(),Me=void 0;return}mn(we.size===0||Z!=null,"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 fe=va({currentLocation:x.location,nextLocation:K,historyAction:z});if(fe&&Z!=null){let ge=new Promise(ke=>{Me=ke});t.history.go(Z*-1),Go(fe,{state:"blocked",location:K,proceed(){Go(fe,{state:"proceeding",proceed:void 0,reset:void 0,location:K}),ge.then(()=>t.history.go(Z))},reset(){let ke=new Map(x.blockers);ke.set(fe,Bc),Ie({blockers:ke})}}),H?.resolve(),H=null;return}return Vt(z,K)}),n){fF(e,re);let z=()=>hF(e,re);e.addEventListener("pagehide",z),le=()=>e.removeEventListener("pagehide",z)}return x.initialized||Vt("POP",x.location,{initialHydration:!0}),U}function Fe(){v&&v(),le&&le(),C.clear(),$&&$.abort(),x.fetchers.forEach((z,K)=>Pr(K)),x.blockers.forEach((z,K)=>Yu(K))}function We(z){return C.add(z),()=>C.delete(z)}function Ie(z,K={}){z.matches&&(z.matches=z.matches.map(ge=>{let ke=c[ge.route.id],Se=ge.route;return Se.element!==ke.element||Se.errorElement!==ke.errorElement||Se.hydrateFallbackElement!==ke.hydrateFallbackElement?{...ge,route:ke}:ge})),x={...x,...z};let Z=[],fe=[];x.fetchers.forEach((ge,ke)=>{ge.state==="idle"&&(ye.has(ke)?Z.push(ke):fe.push(ke))}),ye.forEach(ge=>{!x.fetchers.has(ge)&&!q.has(ge)&&Z.push(ge)}),[...C].forEach(ge=>ge(x,{deletedFetchers:Z,newErrors:z.errors??null,viewTransitionOpts:K.viewTransitionOpts,flushSync:K.flushSync===!0})),Z.forEach(ge=>Pr(ge)),fe.forEach(ge=>x.fetchers.delete(ge))}function rt(z,K,{flushSync:Z}={}){let fe=x.actionData!=null&&x.navigation.formMethod!=null&&Vn(x.navigation.formMethod)&&x.navigation.state==="loading"&&z.state?._isRedirect!==!0,ge;K.actionData?Object.keys(K.actionData).length>0?ge=K.actionData:ge=null:fe?ge=x.actionData:ge=null;let ke=K.loaderData?_R(x.loaderData,K.loaderData,K.matches||[],K.errors):x.loaderData,Se=x.blockers;Se.size>0&&(Se=new Map(Se),Se.forEach((Ue,Ne)=>Se.set(Ne,Bc)));let be=W?!1:Wu(z,K.matches||x.matches),Te=A===!0||x.navigation.formMethod!=null&&Vn(x.navigation.formMethod)&&z.state?._isRedirect!==!0;f&&(d=f,f=void 0),W||L==="POP"||(L==="PUSH"?t.history.push(z,z.state):L==="REPLACE"&&t.history.replace(z,z.state));let Oe;if(L==="POP"){let Ue=re.get(x.location.pathname);Ue&&Ue.has(z.pathname)?Oe={currentLocation:x.location,nextLocation:z}:re.has(z.pathname)&&(Oe={currentLocation:z,nextLocation:x.location})}else if(ee){let Ue=re.get(x.location.pathname);Ue?Ue.add(z.pathname):(Ue=new Set([z.pathname]),re.set(x.location.pathname,Ue)),Oe={currentLocation:x.location,nextLocation:z}}Ie({...K,actionData:ge,loaderData:ke,historyAction:L,location:z,initialized:!0,navigation:Ry,revalidation:"idle",restoreScrollPosition:be,preventScrollReset:Te,blockers:Se},{viewTransitionOpts:Oe,flushSync:Z===!0}),L="POP",A=!1,ee=!1,W=!1,D=!1,H?.resolve(),H=null,Je?.resolve(),Je=null}async function Re(z,K){if(H?.resolve(),H=null,typeof z=="number"){H||(H=MR());let ut=H.promise;return t.history.go(z),ut}let Z=Tv(x.location,x.matches,h,z,K?.fromRouteId,K?.relative),{path:fe,submission:ge,error:ke}=bR(!1,Z,K),Se=x.location,be=Cu(x.location,fe,K&&K.state);be={...be,...t.history.encodeLocation(be)};let Te=K&&K.replace!=null?K.replace:void 0,Oe="PUSH";Te===!0?Oe="REPLACE":Te===!1||ge!=null&&Vn(ge.formMethod)&&ge.formAction===x.location.pathname+x.location.search&&(Oe="REPLACE");let Ue=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,Ne=(K&&K.flushSync)===!0,yt=va({currentLocation:Se,nextLocation:be,historyAction:Oe});if(yt){Go(yt,{state:"blocked",location:be,proceed(){Go(yt,{state:"proceeding",proceed:void 0,reset:void 0,location:be}),Re(z,K)},reset(){let ut=new Map(x.blockers);ut.set(yt,Bc),Ie({blockers:ut})}});return}await Vt(Oe,be,{submission:ge,pendingError:ke,preventScrollReset:Ue,replace:K&&K.replace,enableViewTransition:K&&K.viewTransition,flushSync:Ne,callSiteDefaultShouldRevalidate:K&&K.unstable_defaultShouldRevalidate})}function Rt(){Je||(Je=MR()),rn(),Ie({revalidation:"loading"});let z=Je.promise;return x.navigation.state==="submitting"?z:x.navigation.state==="idle"?(Vt(x.historyAction,x.location,{startUninterruptedRevalidation:!0}),z):(Vt(L||x.historyAction,x.navigation.location,{overrideNavigation:x.navigation,enableViewTransition:ee===!0}),z)}async function Vt(z,K,Z){$&&$.abort(),$=null,L=z,W=(Z&&Z.startUninterruptedRevalidation)===!0,Sa(x.location,x.matches),A=(Z&&Z.preventScrollReset)===!0,ee=(Z&&Z.enableViewTransition)===!0;let fe=f||d,ge=Z&&Z.overrideNavigation,ke=Z?.initialHydration&&x.matches&&x.matches.length>0&&!R?x.matches:oa(fe,K,h),Se=(Z&&Z.flushSync)===!0;if(ke&&x.initialized&&!D&&nF(x.location,K)&&!(Z&&Z.submission&&Vn(Z.submission.formMethod))){rt(K,{matches:ke},{flushSync:Se});return}let be=Ca(ke,fe,K.pathname);if(be.active&&be.matches&&(ke=be.matches),!ke){let{error:an,notFoundMatches:sn,route:dt}=Ri(K.pathname);rt(K,{matches:sn,loaderData:{},errors:{[dt.id]:an}},{flushSync:Se});return}$=new AbortController;let Te=cl(t.history,K,$.signal,Z&&Z.submission),Oe=t.getContext?await t.getContext():new hR,Ue;if(Z&&Z.pendingError)Ue=[ia(ke).route.id,{type:"error",error:Z.pendingError}];else if(Z&&Z.submission&&Vn(Z.submission.formMethod)){let an=await fn(Te,K,Z.submission,ke,Oe,be.active,Z&&Z.initialHydration===!0,{replace:Z.replace,flushSync:Se});if(an.shortCircuited)return;if(an.pendingActionResult){let[sn,dt]=an.pendingActionResult;if(_r(dt)&&Tu(dt.error)&&dt.error.status===404){$=null,rt(K,{matches:an.matches,loaderData:{},errors:{[sn]:dt.error}});return}}ke=an.matches||ke,Ue=an.pendingActionResult,ge=xy(K,Z.submission),Se=!1,be.active=!1,Te=cl(t.history,Te.url,Te.signal)}let{shortCircuited:Ne,matches:yt,loaderData:ut,errors:on}=await gt(Te,K,ke,Oe,be.active,ge,Z&&Z.submission,Z&&Z.fetcherSubmission,Z&&Z.replace,Z&&Z.initialHydration===!0,Se,Ue,Z&&Z.callSiteDefaultShouldRevalidate);Ne||($=null,rt(K,{matches:yt||ke,...OR(Ue),loaderData:ut,errors:on}))}async function fn(z,K,Z,fe,ge,ke,Se,be={}){rn();let Te=uF(K,Z);if(Ie({navigation:Te},{flushSync:be.flushSync===!0}),ke){let Ne=await xi(fe,K.pathname,z.signal);if(Ne.type==="aborted")return{shortCircuited:!0};if(Ne.type==="error"){if(Ne.partialMatches.length===0){let{matches:ut,route:on}=wf(d);return{matches:ut,pendingActionResult:[on.id,{type:"error",error:Ne.error}]}}let yt=ia(Ne.partialMatches).route.id;return{matches:Ne.partialMatches,pendingActionResult:[yt,{type:"error",error:Ne.error}]}}else if(Ne.matches)fe=Ne.matches;else{let{notFoundMatches:yt,error:ut,route:on}=Ri(K.pathname);return{matches:yt,pendingActionResult:[on.id,{type:"error",error:ut}]}}}let Oe,Ue=qf(fe,K);if(!Ue.route.action&&!Ue.route.lazy)Oe={type:"error",error:Gr(405,{method:z.method,pathname:K.pathname,routeId:Ue.route.id})};else{let Ne=wl(l,c,z,fe,Ue,Se?[]:o,ge),yt=await Ot(z,Ne,ge,null);if(Oe=yt[Ue.route.id],!Oe){for(let ut of fe)if(yt[ut.route.id]){Oe=yt[ut.route.id];break}}if(z.signal.aborted)return{shortCircuited:!0}}if(Wa(Oe)){let Ne;return be&&be.replace!=null?Ne=be.replace:Ne=AR(Oe.response.headers.get("Location"),new URL(z.url),h,t.history)===x.location.pathname+x.location.search,await He(z,Oe,!0,{submission:Z,replace:Ne}),{shortCircuited:!0}}if(_r(Oe)){let Ne=ia(fe,Ue.route.id);return(be&&be.replace)!==!0&&(L="PUSH"),{matches:fe,pendingActionResult:[Ne.route.id,Oe,Ue.route.id]}}return{matches:fe,pendingActionResult:[Ue.route.id,Oe]}}async function gt(z,K,Z,fe,ge,ke,Se,be,Te,Oe,Ue,Ne,yt){let ut=ke||xy(K,Se),on=Se||be||kR(ut),an=!W&&!Oe;if(ge){if(an){let hn=An(Ne);Ie({navigation:ut,...hn!==void 0?{actionData:hn}:{}},{flushSync:Ue})}let ft=await xi(Z,K.pathname,z.signal);if(ft.type==="aborted")return{shortCircuited:!0};if(ft.type==="error"){if(ft.partialMatches.length===0){let{matches:io,route:Mn}=wf(d);return{matches:io,loaderData:{},errors:{[Mn.id]:ft.error}}}let hn=ia(ft.partialMatches).route.id;return{matches:ft.partialMatches,loaderData:{},errors:{[hn]:ft.error}}}else if(ft.matches)Z=ft.matches;else{let{error:hn,notFoundMatches:io,route:Mn}=Ri(K.pathname);return{matches:io,loaderData:{},errors:{[Mn.id]:hn}}}}let sn=f||d,{dsMatches:dt,revalidatingFetchers:xn}=SR(z,fe,l,c,t.history,x,Z,on,K,Oe?[]:o,Oe===!0,D,J,ye,oe,V,sn,h,t.patchRoutesOnNavigation!=null,Ne,yt);if(pe=++X,!t.dataStrategy&&!dt.some(ft=>ft.shouldLoad)&&!dt.some(ft=>ft.route.middleware&&ft.route.middleware.length>0)&&xn.length===0){let ft=mt();return rt(K,{matches:Z,loaderData:{},errors:Ne&&_r(Ne[1])?{[Ne[0]]:Ne[1].error}:null,...OR(Ne),...ft?{fetchers:new Map(x.fetchers)}:{}},{flushSync:Ue}),{shortCircuited:!0}}if(an){let ft={};if(!ge){ft.navigation=ut;let hn=An(Ne);hn!==void 0&&(ft.actionData=hn)}xn.length>0&&(ft.fetchers=qt(xn)),Ie(ft,{flushSync:Ue})}xn.forEach(ft=>{Ee(ft.key),ft.controller&&q.set(ft.key,ft.controller)});let er=()=>xn.forEach(ft=>Ee(ft.key));$&&$.signal.addEventListener("abort",er);let{loaderResults:Zt,fetcherResults:ro}=await Wt(dt,xn,z,fe);if(z.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",er),xn.forEach(ft=>q.delete(ft.key));let br=Af(Zt);if(br)return await He(z,br.result,!0,{replace:Te}),{shortCircuited:!0};if(br=Af(ro),br)return V.add(br.key),await He(z,br.result,!0,{replace:Te}),{shortCircuited:!0};let{loaderData:oo,errors:Dr}=xR(x,Z,Zt,Ne,xn,ro);Oe&&x.errors&&(Dr={...x.errors,...Dr});let Yo=mt(),Ea=no(pe),Ta=Yo||Ea||xn.length>0;return{matches:Z,loaderData:oo,errors:Dr,...Ta?{fetchers:new Map(x.fetchers)}:{}}}function An(z){if(z&&!_r(z[1]))return{[z[0]]:z[1].data};if(x.actionData)return Object.keys(x.actionData).length===0?null:x.actionData}function qt(z){return z.forEach(K=>{let Z=x.fetchers.get(K.key),fe=Hc(void 0,Z?Z.data:void 0);x.fetchers.set(K.key,fe)}),new Map(x.fetchers)}async function Yt(z,K,Z,fe){Ee(z);let ge=(fe&&fe.flushSync)===!0,ke=f||d,Se=Tv(x.location,x.matches,h,Z,K,fe?.relative),be=oa(ke,Se,h),Te=Ca(be,ke,Se);if(Te.active&&Te.matches&&(be=Te.matches),!be){vn(z,K,Gr(404,{pathname:Se}),{flushSync:ge});return}let{path:Oe,submission:Ue,error:Ne}=bR(!0,Se,fe);if(Ne){vn(z,K,Ne,{flushSync:ge});return}let yt=t.getContext?await t.getContext():new hR,ut=(fe&&fe.preventScrollReset)===!0;if(Ue&&Vn(Ue.formMethod)){await De(z,K,Oe,be,yt,Te.active,ge,ut,Ue,fe&&fe.unstable_defaultShouldRevalidate);return}oe.set(z,{routeId:K,path:Oe}),await mr(z,K,Oe,be,yt,Te.active,ge,ut,Ue)}async function De(z,K,Z,fe,ge,ke,Se,be,Te,Oe){rn(),oe.delete(z);let Ue=x.fetchers.get(z);vt(z,dF(Te,Ue),{flushSync:Se});let Ne=new AbortController,yt=cl(t.history,Z,Ne.signal,Te);if(ke){let ht=await xi(fe,new URL(yt.url).pathname,yt.signal,z);if(ht.type==="aborted")return;if(ht.type==="error"){vn(z,K,ht.error,{flushSync:Se});return}else if(ht.matches)fe=ht.matches;else{vn(z,K,Gr(404,{pathname:Z}),{flushSync:Se});return}}let ut=qf(fe,Z);if(!ut.route.action&&!ut.route.lazy){let ht=Gr(405,{method:Te.formMethod,pathname:Z,routeId:K});vn(z,K,ht,{flushSync:Se});return}q.set(z,Ne);let on=X,an=wl(l,c,yt,fe,ut,o,ge),sn=await Ot(yt,an,ge,z),dt=sn[ut.route.id];if(!dt){for(let ht of an)if(sn[ht.route.id]){dt=sn[ht.route.id];break}}if(yt.signal.aborted){q.get(z)===Ne&&q.delete(z);return}if(ye.has(z)){if(Wa(dt)||_r(dt)){vt(z,gi(void 0));return}}else{if(Wa(dt))if(q.delete(z),pe>on){vt(z,gi(void 0));return}else return V.add(z),vt(z,Hc(Te)),He(yt,dt,!1,{fetcherSubmission:Te,preventScrollReset:be});if(_r(dt)){vn(z,K,dt.error);return}}let xn=x.navigation.location||x.location,er=cl(t.history,xn,Ne.signal),Zt=f||d,ro=x.navigation.state!=="idle"?oa(Zt,x.navigation.location,h):x.matches;et(ro,"Didn't find any matches after fetcher action");let br=++X;P.set(z,br);let oo=Hc(Te,dt.data);x.fetchers.set(z,oo);let{dsMatches:Dr,revalidatingFetchers:Yo}=SR(er,ge,l,c,t.history,x,ro,Te,xn,o,!1,D,J,ye,oe,V,Zt,h,t.patchRoutesOnNavigation!=null,[ut.route.id,dt],Oe);Yo.filter(ht=>ht.key!==z).forEach(ht=>{let wa=ht.key,Xu=x.fetchers.get(wa),Fl=Hc(void 0,Xu?Xu.data:void 0);x.fetchers.set(wa,Fl),Ee(wa),ht.controller&&q.set(wa,ht.controller)}),Ie({fetchers:new Map(x.fetchers)});let Ea=()=>Yo.forEach(ht=>Ee(ht.key));Ne.signal.addEventListener("abort",Ea);let{loaderResults:Ta,fetcherResults:ft}=await Wt(Dr,Yo,er,ge);if(Ne.signal.aborted)return;if(Ne.signal.removeEventListener("abort",Ea),P.delete(z),q.delete(z),Yo.forEach(ht=>q.delete(ht.key)),x.fetchers.has(z)){let ht=gi(dt.data);x.fetchers.set(z,ht)}let hn=Af(Ta);if(hn)return He(er,hn.result,!1,{preventScrollReset:be});if(hn=Af(ft),hn)return V.add(hn.key),He(er,hn.result,!1,{preventScrollReset:be});let{loaderData:io,errors:Mn}=xR(x,ro,Ta,void 0,Yo,ft);no(br),x.navigation.state==="loading"&&br>pe?(et(L,"Expected pending action"),$&&$.abort(),rt(x.navigation.location,{matches:ro,loaderData:io,errors:Mn,fetchers:new Map(x.fetchers)})):(Ie({errors:Mn,loaderData:_R(x.loaderData,io,ro,Mn),fetchers:new Map(x.fetchers)}),D=!1)}async function mr(z,K,Z,fe,ge,ke,Se,be,Te){let Oe=x.fetchers.get(z);vt(z,Hc(Te,Oe?Oe.data:void 0),{flushSync:Se});let Ue=new AbortController,Ne=cl(t.history,Z,Ue.signal);if(ke){let dt=await xi(fe,new URL(Ne.url).pathname,Ne.signal,z);if(dt.type==="aborted")return;if(dt.type==="error"){vn(z,K,dt.error,{flushSync:Se});return}else if(dt.matches)fe=dt.matches;else{vn(z,K,Gr(404,{pathname:Z}),{flushSync:Se});return}}let yt=qf(fe,Z);q.set(z,Ue);let ut=X,on=wl(l,c,Ne,fe,yt,o,ge),sn=(await Ot(Ne,on,ge,z))[yt.route.id];if(q.get(z)===Ue&&q.delete(z),!Ne.signal.aborted){if(ye.has(z)){vt(z,gi(void 0));return}if(Wa(sn))if(pe>ut){vt(z,gi(void 0));return}else{V.add(z),await He(Ne,sn,!1,{preventScrollReset:be});return}if(_r(sn)){vn(z,K,sn.error);return}vt(z,gi(sn.data))}}async function He(z,K,Z,{submission:fe,fetcherSubmission:ge,preventScrollReset:ke,replace:Se}={}){Z||(H?.resolve(),H=null),K.response.headers.has("X-Remix-Revalidate")&&(D=!0);let be=K.response.headers.get("Location");et(be,"Expected a Location header on the redirect Response"),be=AR(be,new URL(z.url),h,t.history);let Te=Cu(x.location,be,{_isRedirect:!0});if(n){let on=!1;if(K.response.headers.has("X-Remix-Reload-Document"))on=!0;else if(AS(be)){const an=jO(be,!0);on=an.origin!==e.location.origin||eo(an.pathname,h)==null}if(on){Se?e.location.replace(be):e.location.assign(be);return}}$=null;let Oe=Se===!0||K.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Ue,formAction:Ne,formEncType:yt}=x.navigation;!fe&&!ge&&Ue&&Ne&&yt&&(fe=kR(x.navigation));let ut=fe||ge;if(H$.has(K.response.status)&&ut&&Vn(ut.formMethod))await Vt(Oe,Te,{submission:{...ut,formAction:be},preventScrollReset:ke||A,enableViewTransition:Z?ee:void 0});else{let on=xy(Te,fe);await Vt(Oe,Te,{overrideNavigation:on,fetcherSubmission:ge,preventScrollReset:ke||A,enableViewTransition:Z?ee:void 0})}}async function Ot(z,K,Z,fe){let ge,ke={};try{ge=await Q$(m,z,K,fe,Z,!1)}catch(Se){return K.filter(be=>be.shouldLoad).forEach(be=>{ke[be.route.id]={type:"error",error:Se}}),ke}if(z.signal.aborted)return ke;if(!Vn(z.method))for(let Se of K){if(ge[Se.route.id]?.type==="error")break;!ge.hasOwnProperty(Se.route.id)&&!x.loaderData.hasOwnProperty(Se.route.id)&&(!x.errors||!x.errors.hasOwnProperty(Se.route.id))&&Se.shouldCallHandler()&&(ge[Se.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Se.route.id}`)})}for(let[Se,be]of Object.entries(ge))if(aF(be)){let Te=be.result;ke[Se]={type:"redirect",response:eF(Te,z,Se,K,h)}}else ke[Se]=await Z$(be);return ke}async function Wt(z,K,Z,fe){let ge=Ot(Z,z,fe,null),ke=Promise.all(K.map(async Te=>{if(Te.matches&&Te.match&&Te.request&&Te.controller){let Ue=(await Ot(Te.request,Te.matches,fe,Te.key))[Te.match.route.id];return{[Te.key]:Ue}}else return Promise.resolve({[Te.key]:{type:"error",error:Gr(404,{pathname:Te.path})}})})),Se=await ge,be=(await ke).reduce((Te,Oe)=>Object.assign(Te,Oe),{});return{loaderResults:Se,fetcherResults:be}}function rn(){D=!0,oe.forEach((z,K)=>{q.has(K)&&J.add(K),Ee(K)})}function vt(z,K,Z={}){x.fetchers.set(z,K),Ie({fetchers:new Map(x.fetchers)},{flushSync:(Z&&Z.flushSync)===!0})}function vn(z,K,Z,fe={}){let ge=ia(x.matches,K);Pr(z),Ie({errors:{[ge.route.id]:Z},fetchers:new Map(x.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function yr(z){return de.set(z,(de.get(z)||0)+1),ye.has(z)&&ye.delete(z),x.fetchers.get(z)||j$}function Pt(z,K){Ee(z,K?.reason),vt(z,gi(null))}function Pr(z){let K=x.fetchers.get(z);q.has(z)&&!(K&&K.state==="loading"&&P.has(z))&&Ee(z),oe.delete(z),P.delete(z),V.delete(z),ye.delete(z),J.delete(z),x.fetchers.delete(z)}function vr(z){let K=(de.get(z)||0)-1;K<=0?(de.delete(z),ye.add(z)):de.set(z,K),Ie({fetchers:new Map(x.fetchers)})}function Ee(z,K){let Z=q.get(z);Z&&(Z.abort(K),q.delete(z))}function ot(z){for(let K of z){let Z=yr(K),fe=gi(Z.data);x.fetchers.set(K,fe)}}function mt(){let z=[],K=!1;for(let Z of V){let fe=x.fetchers.get(Z);et(fe,`Expected fetcher: ${Z}`),fe.state==="loading"&&(V.delete(Z),z.push(Z),K=!0)}return ot(z),K}function no(z){let K=[];for(let[Z,fe]of P)if(fe0}function bs(z,K){let Z=x.blockers.get(z)||Bc;return we.get(z)!==K&&we.set(z,K),Z}function Yu(z){x.blockers.delete(z),we.delete(z)}function Go(z,K){let Z=x.blockers.get(z)||Bc;et(Z.state==="unblocked"&&K.state==="blocked"||Z.state==="blocked"&&K.state==="blocked"||Z.state==="blocked"&&K.state==="proceeding"||Z.state==="blocked"&&K.state==="unblocked"||Z.state==="proceeding"&&K.state==="unblocked",`Invalid blocker state transition: ${Z.state} -> ${K.state}`);let fe=new Map(x.blockers);fe.set(z,K),Ie({blockers:fe})}function va({currentLocation:z,nextLocation:K,historyAction:Z}){if(we.size===0)return;we.size>1&&mn(!1,"A router only supports one blocker at a time");let fe=Array.from(we.entries()),[ge,ke]=fe[fe.length-1],Se=x.blockers.get(ge);if(!(Se&&Se.state==="proceeding")&&ke({currentLocation:z,nextLocation:K,historyAction:Z}))return ge}function Ri(z){let K=Gr(404,{pathname:z}),Z=f||d,{matches:fe,route:ge}=wf(Z);return{notFoundMatches:fe,route:ge,error:K}}function qo(z,K,Z){if(b=z,w=K,T=Z||null,!_&&x.navigation===Ry){_=!0;let fe=Wu(x.location,x.matches);fe!=null&&Ie({restoreScrollPosition:fe})}return()=>{b=null,w=null,T=null}}function ba(z,K){return T&&T(z,K.map(fe=>h$(fe,x.loaderData)))||z.key}function Sa(z,K){if(b&&w){let Z=ba(z,K);b[Z]=w()}}function Wu(z,K){if(b){let Z=ba(z,K),fe=b[Z];if(typeof fe=="number")return fe}return null}function Ca(z,K,Z){if(t.patchRoutesOnNavigation)if(z){if(Object.keys(z[0].params).length>0)return{active:!0,matches:Jc(K,Z,h,!0)}}else return{active:!0,matches:Jc(K,Z,h,!0)||[]};return{active:!1,matches:null}}async function xi(z,K,Z,fe){if(!t.patchRoutesOnNavigation)return{type:"success",matches:z};let ge=z;for(;;){let ke=f==null,Se=f||d,be=c;try{await t.patchRoutesOnNavigation({signal:Z,path:K,matches:ge,fetcherKey:fe,patch:(Ue,Ne)=>{Z.aborted||CR(Ue,Ne,Se,be,l,!1)}})}catch(Ue){return{type:"error",error:Ue,partialMatches:ge}}finally{ke&&!Z.aborted&&(d=[...d])}if(Z.aborted)return{type:"aborted"};let Te=oa(Se,K,h),Oe=null;if(Te){if(Object.keys(Te[0].params).length===0)return{type:"success",matches:Te};if(Oe=Jc(Se,K,h,!0),!(Oe&&ge.lengthZ.route.id===K[fe].route.id)}function Mp(z){c={},f=Eu(z,l,void 0,c)}function Qu(z,K,Z=!1){let fe=f==null;CR(z,K,f||d,c,l,Z),fe&&(d=[...d],Ie({}))}return U={get basename(){return h},get future(){return y},get state(){return x},get routes(){return d},get window(){return e},initialize:$e,subscribe:We,enableScrollRestoration:qo,navigate:Re,fetch:Yt,revalidate:Rt,createHref:z=>t.history.createHref(z),encodeLocation:z=>t.history.encodeLocation(z),getFetcher:yr,resetFetcher:Pt,deleteFetcher:vr,dispose:Fe,getBlocker:bs,deleteBlocker:Yu,patchRoutes:Qu,_internalFetchControllers:q,_internalSetRoutes:Mp,_internalSetStateDoNotUseOrYouWillBreakYourApp(z){Ie(z)}},t.unstable_instrumentations&&(U=M$(U,t.unstable_instrumentations.map(z=>z.router).filter(Boolean))),U}function K$(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function Tv(t,e,n,o,a,l){let c,d;if(a){c=[];for(let h of e)if(c.push(h),h.route.id===a){d=h;break}}else c=e,d=e[e.length-1];let f=Tp(o||".",Ep(c),eo(t.pathname,n)||t.pathname,l==="path");if(o==null&&(f.search=t.search,f.hash=t.hash),(o==null||o===""||o===".")&&d){let h=_S(f.search);if(d.route.index&&!h)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&h){let m=new URLSearchParams(f.search),y=m.getAll("index");m.delete("index"),y.filter(C=>C).forEach(C=>m.append("index",C));let v=m.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=R$({basename:n,pathname:f.pathname})),Fo(f)}function bR(t,e,n){if(!n||!K$(n))return{path:e};if(n.formMethod&&!cF(n.formMethod))return{path:e,error:Gr(405,{method:n.formMethod})};let o=()=>({path:e,error:Gr(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=oI(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Vn(l))return o();let y=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[C,b])=>`${v}${C}=${b} `,""):String(n.body);return{path:e,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:y}}}else if(n.formEncType==="application/json"){if(!Vn(l))return o();try{let y=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:y,text:void 0}}}catch{return o()}}}et(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=Rv(n.formData),f=n.formData;else if(n.body instanceof FormData)d=Rv(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=RR(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=RR(d)}catch{return o()}let h={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Vn(h.formMethod))return{path:e,submission:h};let m=ya(e);return t&&m.search&&_S(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Fo(m),submission:h}}function SR(t,e,n,o,a,l,c,d,f,h,m,y,v,C,b,T,w,_,k,R,N){let M=R?_r(R[1])?R[1].error:R[1].data:void 0,U=a.createURL(l.location),x=a.createURL(f),L;if(m&&l.errors){let W=Object.keys(l.errors)[0];L=c.findIndex(D=>D.route.id===W)}else if(R&&_r(R[1])){let W=R[0];L=c.findIndex(D=>D.route.id===W)-1}let H=R?R[1].statusCode:void 0,A=H&&H>=400,$={currentUrl:U,currentParams:l.matches[0]?.params||{},nextUrl:x,nextParams:c[0].params,...d,actionResult:M,actionStatus:H},ee=Ku(c),re=c.map((W,D)=>{let{route:J}=W,q=null;if(L!=null&&D>L?q=!1:J.lazy?q=!0:RS(J)?m?q=wv(J,l.loaderData,l.errors):V$(l.loaderData,l.matches[D],W)&&(q=!0):q=!1,q!==null)return Av(n,o,t,ee,W,h,e,q);let X=!1;typeof N=="boolean"?X=N:A?X=!1:(y||U.pathname+U.search===x.pathname+x.search||U.search!==x.search||G$(l.matches[D],W))&&(X=!0);let pe={...$,defaultShouldRevalidate:X},P=au(W,pe);return Av(n,o,t,ee,W,h,e,P,pe,N)}),le=[];return b.forEach((W,D)=>{if(m||!c.some(de=>de.route.id===W.routeId)||C.has(D))return;let J=l.fetchers.get(D),q=J&&J.state!=="idle"&&J.data===void 0,X=oa(w,W.path,_);if(!X){if(k&&q)return;le.push({key:D,routeId:W.routeId,path:W.path,matches:null,match:null,request:null,controller:null});return}if(T.has(D))return;let pe=qf(X,W.path),P=new AbortController,V=cl(a,W.path,P.signal),oe=null;if(v.has(D))v.delete(D),oe=wl(n,o,V,X,pe,h,e);else if(q)y&&(oe=wl(n,o,V,X,pe,h,e));else{let de;typeof N=="boolean"?de=N:A?de=!1:de=y;let ye={...$,defaultShouldRevalidate:de};au(pe,ye)&&(oe=wl(n,o,V,X,pe,h,e,ye))}oe&&le.push({key:D,routeId:W.routeId,path:W.path,matches:oe,match:pe,request:V,controller:P})}),{dsMatches:re,revalidatingFetchers:le}}function RS(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function wv(t,e,n){if(t.lazy)return!0;if(!RS(t))return!1;let o=e!=null&&t.id in e,a=n!=null&&n[t.id]!==void 0;return!o&&a?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!o&&!a}function V$(t,e,n){let o=!e||n.route.id!==e.route.id,a=!t.hasOwnProperty(n.route.id);return o||a}function G$(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function au(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function CR(t,e,n,o,a,l){let c;if(t){let h=o[t];et(h,`No route found to patch children into: routeId = ${t}`),h.children||(h.children=[]),c=h.children}else c=n;let d=[],f=[];if(e.forEach(h=>{let m=c.find(y=>ZO(h,y));m?f.push({existingRoute:m,newRoute:h}):d.push(h)}),d.length>0){let h=Eu(d,a,[t||"_","patch",String(c?.length||"0")],o);c.push(...h)}if(l&&f.length>0)for(let h=0;he.children?.some(a=>ZO(n,a))):!1}var ER=new WeakMap,eI=({key:t,route:e,manifest:n,mapRouteProperties:o})=>{let a=n[e.id];if(et(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let l=a.lazy[t];if(!l)return;let c=ER.get(a);c||(c={},ER.set(a,c));let d=c[t];if(d)return d;let f=(async()=>{let h=c$(t),y=a[t]!==void 0&&t!=="hasErrorBoundary";if(h)mn(!h,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),c[t]=Promise.resolve();else if(y)mn(!1,`Route "${a.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let v=await l();v!=null&&(Object.assign(a,{[t]:v}),Object.assign(a,o(a)))}typeof a.lazy=="object"&&(a.lazy[t]=void 0,Object.values(a.lazy).every(v=>v===void 0)&&(a.lazy=void 0))})();return c[t]=f,f},TR=new WeakMap;function q$(t,e,n,o,a){let l=n[t.id];if(et(l,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let m=TR.get(l);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let y=(async()=>{et(typeof t.lazy=="function","No lazy route function found");let v=await t.lazy(),C={};for(let b in v){let T=v[b];if(T===void 0)continue;let w=d$(b),k=l[b]!==void 0&&b!=="hasErrorBoundary";w?mn(!w,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):k?mn(!k,`Route "${l.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):C[b]=T}Object.assign(l,C),Object.assign(l,{...o(l),lazy:void 0})})();return TR.set(l,y),y.catch(()=>{}),{lazyRoutePromise:y,lazyHandlerPromise:y}}let c=Object.keys(t.lazy),d=[],f;for(let m of c){if(a&&a.includes(m))continue;let y=eI({key:m,route:t,manifest:n,mapRouteProperties:o});y&&(d.push(y),m===e&&(f=y))}let h=d.length>0?Promise.all(d).then(()=>{}):void 0;return h?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:f}}async function wR(t){let e=t.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(e.map(a=>a.resolve()))).forEach((a,l)=>{n[e[l].route.id]=a}),n}async function Y$(t){return t.matches.some(e=>e.route.middleware)?tI(t,()=>wR(t)):wR(t)}function tI(t,e){return W$(t,e,o=>{if(lF(o))throw o;return o},oF,n);function n(o,a,l){if(l)return Promise.resolve(Object.assign(l.value,{[a]:{type:"error",result:o}}));{let{matches:c}=t,d=Math.min(Math.max(c.findIndex(h=>h.route.id===a),0),Math.max(c.findIndex(h=>h.shouldCallHandler()),0)),f=ia(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:o}})}}}async function W$(t,e,n,o,a){let{matches:l,request:c,params:d,context:f,unstable_pattern:h}=t,m=l.flatMap(v=>v.route.middleware?v.route.middleware.map(C=>[v.route.id,C]):[]);return await nI({request:c,params:d,context:f,unstable_pattern:h},m,e,n,o,a)}async function nI(t,e,n,o,a,l,c=0){let{request:d}=t;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=e[c];if(!f)return await n();let[h,m]=f,y,v=async()=>{if(y)throw new Error("You may only call `next()` once per middleware");try{return y={value:await nI(t,e,n,o,a,l,c+1)},y.value}catch(C){return y={value:await l(C,h,y)},y.value}};try{let C=await m(t,v),b=C!=null?o(C):void 0;return a(b)?b:y?b??y.value:(y={value:await v()},y.value)}catch(C){return await l(C,h,y)}}function rI(t,e,n,o,a){let l=eI({key:"middleware",route:o.route,manifest:e,mapRouteProperties:t}),c=q$(o.route,Vn(n.method)?"action":"loader",e,t,a);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Av(t,e,n,o,a,l,c,d,f=null,h){let m=!1,y=rI(t,e,n,a,l);return{...a,_lazyPromises:y,shouldLoad:d,shouldRevalidateArgs:f,shouldCallHandler(v){return m=!0,f?typeof h=="boolean"?au(a,{...f,defaultShouldRevalidate:h}):typeof v=="boolean"?au(a,{...f,defaultShouldRevalidate:v}):au(a,f):d},resolve(v){let{lazy:C,loader:b,middleware:T}=a.route,w=m||d||v&&!Vn(n.method)&&(C||b),_=T&&T.length>0&&!b&&!C;return w&&(Vn(n.method)||!_)?X$({request:n,unstable_pattern:o,match:a,lazyHandlerPromise:y?.handler,lazyRoutePromise:y?.route,handlerOverride:v,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function wl(t,e,n,o,a,l,c,d=null){return o.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:rI(t,e,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Av(t,e,n,Ku(o),f,l,c,!0,d))}async function Q$(t,e,n,o,a,l){n.some(h=>h._lazyPromises?.middleware)&&await Promise.all(n.map(h=>h._lazyPromises?.middleware));let c={request:e,unstable_pattern:Ku(n),params:n[0].params,context:a,matches:n},f=await t({...c,fetcherKey:o,runClientMiddleware:h=>{let m=c;return tI(m,()=>h({...m,fetcherKey:o,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(h=>[h._lazyPromises?.handler,h._lazyPromises?.route]))}catch{}return f}async function X$({request:t,unstable_pattern:e,match:n,lazyHandlerPromise:o,lazyRoutePromise:a,handlerOverride:l,scopedContext:c}){let d,f,h=Vn(t.method),m=h?"action":"loader",y=v=>{let C,b=new Promise((_,k)=>C=k);f=()=>C(),t.signal.addEventListener("abort",f);let T=_=>typeof v!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):v({request:t,unstable_pattern:e,params:n.params,context:c},..._!==void 0?[_]:[]),w=(async()=>{try{return{type:"data",result:await(l?l(k=>T(k)):T())}}catch(_){return{type:"error",result:_}}})();return Promise.race([w,b])};try{let v=h?n.route.action:n.route.loader;if(o||a)if(v){let C,[b]=await Promise.all([y(v).catch(T=>{C=T}),o,a]);if(C!==void 0)throw C;d=b}else{await o;let C=h?n.route.action:n.route.loader;if(C)[d]=await Promise.all([y(C),a]);else if(m==="action"){let b=new URL(t.url),T=b.pathname+b.search;throw Gr(405,{method:t.method,pathname:T,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(v)d=await y(v);else{let C=new URL(t.url),b=C.pathname+C.search;throw Gr(404,{pathname:b})}}catch(v){return{type:"error",result:v}}finally{f&&t.signal.removeEventListener("abort",f)}return d}async function J$(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function Z$(t){let{result:e,type:n}=t;if(xS(e)){let o;try{o=await J$(e)}catch(a){return{type:"error",error:a}}return n==="error"?{type:"error",error:new Fu(e.status,e.statusText,o),statusCode:e.status,headers:e.headers}:{type:"data",data:o,statusCode:e.status,headers:e.headers}}return n==="error"?IR(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:rF(e),statusCode:Tu(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:Tu(e)?e.status:void 0}:IR(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function eF(t,e,n,o,a){let l=t.headers.get("Location");if(et(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!AS(l)){let c=o.slice(0,o.findIndex(d=>d.route.id===n)+1);l=Tv(new URL(e.url),c,a,l),t.headers.set("Location",l)}return t}function AR(t,e,n,o){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(AS(t)){let l=t,c=l.startsWith("//")?new URL(e.protocol+l):new URL(l);if(a.includes(c.protocol))throw new Error("Invalid redirect location");let d=eo(c.pathname,n)!=null;if(c.origin===e.origin&&d)return c.pathname+c.search+c.hash}try{let l=o.createURL(t);if(a.includes(l.protocol))throw new Error("Invalid redirect location")}catch{}return t}function cl(t,e,n,o){let a=t.createURL(oI(e)).toString(),l={signal:n};if(o&&Vn(o.formMethod)){let{formMethod:c,formEncType:d}=o;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(o.json)):d==="text/plain"?l.body=o.text:d==="application/x-www-form-urlencoded"&&o.formData?l.body=Rv(o.formData):l.body=o.formData}return new Request(a,l)}function Rv(t){let e=new URLSearchParams;for(let[n,o]of t.entries())e.append(n,typeof o=="string"?o:o.name);return e}function RR(t){let e=new FormData;for(let[n,o]of t.entries())e.append(n,o);return e}function tF(t,e,n,o=!1,a=!1){let l={},c=null,d,f=!1,h={},m=n&&_r(n[1])?n[1].error:void 0;return t.forEach(y=>{if(!(y.route.id in e))return;let v=y.route.id,C=e[v];if(et(!Wa(C),"Cannot handle redirect results in processLoaderData"),_r(C)){let b=C.error;if(m!==void 0&&(b=m,m=void 0),c=c||{},a)c[v]=b;else{let T=ia(t,v);c[T.route.id]==null&&(c[T.route.id]=b)}o||(l[v]=JO),f||(f=!0,d=Tu(C.error)?C.error.status:500),C.headers&&(h[v]=C.headers)}else l[v]=C.data,C.statusCode&&C.statusCode!==200&&!f&&(d=C.statusCode),C.headers&&(h[v]=C.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:h}}function xR(t,e,n,o,a,l){let{loaderData:c,errors:d}=tF(e,n,o);return a.filter(f=>!f.matches||f.matches.some(h=>h.shouldLoad)).forEach(f=>{let{key:h,match:m,controller:y}=f;if(y&&y.signal.aborted)return;let v=l[h];if(et(v,"Did not find corresponding fetcher result"),_r(v)){let C=ia(t.matches,m?.route.id);d&&d[C.route.id]||(d={...d,[C.route.id]:v.error}),t.fetchers.delete(h)}else if(Wa(v))et(!1,"Unhandled fetcher revalidation redirect");else{let C=gi(v.data);t.fetchers.set(h,C)}}),{loaderData:c,errors:d}}function _R(t,e,n,o){let a=Object.entries(e).filter(([,l])=>l!==JO).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!e.hasOwnProperty(c)&&t.hasOwnProperty(c)&&l.route.loader&&(a[c]=t[c]),o&&o.hasOwnProperty(c))break}return a}function OR(t){return t?_r(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function ia(t,e){return(e?t.slice(0,t.findIndex(o=>o.route.id===e)+1):[...t]).reverse().find(o=>o.route.hasErrorBoundary===!0)||t[0]}function wf(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function Gr(t,{pathname:e,routeId:n,method:o,type:a,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return t===400?(c="Bad Request",o&&e&&n?d=`You made a ${o} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(d="Unable to encode submission body")):t===403?(c="Forbidden",d=`Route "${n}" does not match URL "${e}"`):t===404?(c="Not Found",d=`No route matches URL "${e}"`):t===405&&(c="Method Not Allowed",o&&e&&n?d=`You made a ${o.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:o&&(d=`Invalid request method "${o.toUpperCase()}"`)),new Fu(t||500,c,new Error(d),!0)}function Af(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[o,a]=e[n];if(Wa(a))return{key:o,result:a}}}function oI(t){let e=typeof t=="string"?ya(t):t;return Fo({...e,hash:""})}function nF(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function rF(t){return new Fu(t.init?.status??500,t.init?.statusText??"Internal Server Error",t.data)}function oF(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&iF(n))}function iF(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function aF(t){return xS(t.result)&&QO.has(t.result.status)}function _r(t){return t.type==="error"}function Wa(t){return(t&&t.type)==="redirect"}function IR(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function xS(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function sF(t){return QO.has(t)}function lF(t){return xS(t)&&sF(t.status)&&t.headers.has("Location")}function cF(t){return B$.has(t.toUpperCase())}function Vn(t){return U$.has(t.toUpperCase())}function _S(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function qf(t,e){let n=typeof e=="string"?ya(e).search:e.search;if(t[t.length-1].route.index&&_S(n||""))return t[t.length-1];let o=VO(t);return o[o.length-1]}function kR(t){let{formMethod:e,formAction:n,formEncType:o,text:a,formData:l,json:c}=t;if(!(!e||!n||!o)){if(a!=null)return{formMethod:e,formAction:n,formEncType:o,formData:void 0,json:void 0,text:a};if(l!=null)return{formMethod:e,formAction:n,formEncType:o,formData:l,json:void 0,text:void 0};if(c!==void 0)return{formMethod:e,formAction:n,formEncType:o,formData:void 0,json:c,text:void 0}}}function xy(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function uF(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Hc(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function dF(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function gi(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function fF(t,e){try{let n=t.sessionStorage.getItem(XO);if(n){let o=JSON.parse(n);for(let[a,l]of Object.entries(o||{}))l&&Array.isArray(l)&&e.set(a,new Set(l||[]))}}catch{}}function hF(t,e){if(e.size>0){let n={};for(let[o,a]of e)n[o]=[...a];try{t.sessionStorage.setItem(XO,JSON.stringify(n))}catch(o){mn(!1,`Failed to save applied view transitions in sessionStorage (${o}).`)}}}function MR(){let t,e,n=new Promise((o,a)=>{t=async l=>{o(l);try{await n}catch{}},e=async l=>{a(l);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var vs=E.createContext(null);vs.displayName="DataRouter";var Vu=E.createContext(null);Vu.displayName="DataRouterState";var iI=E.createContext(!1);function pF(){return E.useContext(iI)}var OS=E.createContext({isTransitioning:!1});OS.displayName="ViewTransition";var aI=E.createContext(new Map);aI.displayName="Fetchers";var gF=E.createContext(null);gF.displayName="Await";var Nr=E.createContext(null);Nr.displayName="Navigation";var wp=E.createContext(null);wp.displayName="Location";var wo=E.createContext({outlet:null,matches:[],isDataRoute:!1});wo.displayName="Route";var IS=E.createContext(null);IS.displayName="RouteError";var sI="REACT_ROUTER_ERROR",mF="REDIRECT",yF="ROUTE_ERROR_RESPONSE";function vF(t){if(t.startsWith(`${sI}:${mF}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function bF(t){if(t.startsWith(`${sI}:${yF}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new Fu(e.status,e.statusText,e.data)}catch{}}function SF(t,{relative:e}={}){et(jl(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:o}=E.useContext(Nr),{hash:a,pathname:l,search:c}=Gu(t,{relative:e}),d=l;return n!=="/"&&(d=l==="/"?n:$o([n,l])),o.createHref({pathname:d,search:c,hash:a})}function jl(){return E.useContext(wp)!=null}function Ko(){return et(jl(),"useLocation() may be used only in the context of a component."),E.useContext(wp).location}var lI="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cI(t){E.useContext(Nr).static||E.useLayoutEffect(t)}function uI(){let{isDataRoute:t}=E.useContext(wo);return t?DF():CF()}function CF(){et(jl(),"useNavigate() may be used only in the context of a component.");let t=E.useContext(vs),{basename:e,navigator:n}=E.useContext(Nr),{matches:o}=E.useContext(wo),{pathname:a}=Ko(),l=JSON.stringify(Ep(o)),c=E.useRef(!1);return cI(()=>{c.current=!0}),E.useCallback((f,h={})=>{if(mn(c.current,lI),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Tp(f,JSON.parse(l),a,h.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:$o([e,m.pathname])),(h.replace?n.replace:n.push)(m,h.state,h)},[e,n,l,a,t])}var EF=E.createContext(null);function TF(t){let e=E.useContext(wo).outlet;return E.useMemo(()=>e&&E.createElement(EF.Provider,{value:t},e),[e,t])}function Gu(t,{relative:e}={}){let{matches:n}=E.useContext(wo),{pathname:o}=Ko(),a=JSON.stringify(Ep(n));return E.useMemo(()=>Tp(t,JSON.parse(a),o,e==="path"),[t,a,o,e])}function wF(t,e,n,o,a){et(jl(),"useRoutes() may be used only in the context of a component.");let{navigator:l}=E.useContext(Nr),{matches:c}=E.useContext(wo),d=c[c.length-1],f=d?d.params:{},h=d?d.pathname:"/",m=d?d.pathnameBase:"/",y=d&&d.route;{let k=y&&y.path||"";fI(h,!y||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${h}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. Please change the parent to .`)}let v=Ko(),C;C=v;let b=C.pathname||"/",T=b;if(m!=="/"){let k=m.replace(/^\//,"").split("/");T="/"+b.replace(/^\//,"").split("/").slice(k.length).join("/")}let w=oa(t,{pathname:T});return mn(y||w!=null,`No routes matched location "${C.pathname}${C.search}${C.hash}" `),mn(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${C.pathname}${C.search}${C.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`),OF(w&&w.map(k=>Object.assign({},k,{params:Object.assign({},f,k.params),pathname:$o([m,l.encodeLocation?l.encodeLocation(k.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?m:$o([m,l.encodeLocation?l.encodeLocation(k.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),c,n,o,a)}function AF(){let t=PF(),e=Tu(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,o="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:o},l={padding:"2px 4px",backgroundColor:o},c=null;return console.error("Error handled by React Router default ErrorBoundary:",t),c=E.createElement(E.Fragment,null,E.createElement("p",null,"💿 Hey developer 👋"),E.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",E.createElement("code",{style:l},"ErrorBoundary")," or"," ",E.createElement("code",{style:l},"errorElement")," prop on your route.")),E.createElement(E.Fragment,null,E.createElement("h2",null,"Unexpected Application Error!"),E.createElement("h3",{style:{fontStyle:"italic"}},e),n?E.createElement("pre",{style:a},n):null,c)}var RF=E.createElement(AF,null),dI=class extends E.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=bF(t.digest);n&&(t=n)}let e=t!==void 0?E.createElement(wo.Provider,{value:this.props.routeContext},E.createElement(IS.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?E.createElement(xF,{error:t},e):e}};dI.contextType=iI;var _y=new WeakMap;function xF({children:t,error:e}){let{basename:n}=E.useContext(Nr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let o=vF(e.digest);if(o){let a=_y.get(e);if(a)throw a;let l=qO(o.location,n);if(GO&&!_y.get(e))if(l.isExternal||o.reloadDocument)window.location.href=l.absoluteURL||l.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(l.to,{replace:o.replace}));throw _y.set(e,c),c}return E.createElement("meta",{httpEquiv:"refresh",content:`0;url=${l.absoluteURL||l.to}`})}}return t}function _F({routeContext:t,match:e,children:n}){let o=E.useContext(vs);return o&&o.static&&o.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=e.route.id),E.createElement(wo.Provider,{value:t},n)}function OF(t,e=[],n=null,o=null,a=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let l=t,c=n?.errors;if(c!=null){let m=l.findIndex(y=>y.route.id&&c?.[y.route.id]!==void 0);et(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,m+1))}let d=!1,f=-1;if(n)for(let m=0;m=0?l=l.slice(0,f+1):l=[l[0]];break}}}let h=n&&o?(m,y)=>{o(m,{location:n.location,params:n.matches?.[0]?.params??{},unstable_pattern:Ku(n.matches),errorInfo:y})}:void 0;return l.reduceRight((m,y,v)=>{let C,b=!1,T=null,w=null;n&&(C=c&&y.route.id?c[y.route.id]:void 0,T=y.route.errorElement||RF,d&&(f<0&&v===0?(fI("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,w=null):f===v&&(b=!0,w=y.route.hydrateFallbackElement||null)));let _=e.concat(l.slice(0,v+1)),k=()=>{let R;return C?R=T:b?R=w:y.route.Component?R=E.createElement(y.route.Component,null):y.route.element?R=y.route.element:R=m,E.createElement(_F,{match:y,routeContext:{outlet:m,matches:_,isDataRoute:n!=null},children:R})};return n&&(y.route.ErrorBoundary||y.route.errorElement||v===0)?E.createElement(dI,{location:n.location,revalidation:n.revalidation,component:T,error:C,children:k(),routeContext:{outlet:null,matches:_,isDataRoute:!0},onError:h}):k()},null)}function kS(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function IF(t){let e=E.useContext(vs);return et(e,kS(t)),e}function kF(t){let e=E.useContext(Vu);return et(e,kS(t)),e}function MF(t){let e=E.useContext(wo);return et(e,kS(t)),e}function MS(t){let e=MF(t),n=e.matches[e.matches.length-1];return et(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function NF(){return MS("useRouteId")}function PF(){let t=E.useContext(IS),e=kF("useRouteError"),n=MS("useRouteError");return t!==void 0?t:e.errors?.[n]}function DF(){let{router:t}=IF("useNavigate"),e=MS("useNavigate"),n=E.useRef(!1);return cI(()=>{n.current=!0}),E.useCallback(async(a,l={})=>{mn(n.current,lI),n.current&&(typeof a=="number"?await t.navigate(a):await t.navigate(a,{fromRouteId:e,...l}))},[t,e])}var NR={};function fI(t,e,n){!e&&!NR[t]&&(NR[t]=!0,mn(!1,n))}var PR={};function DR(t,e){!t&&!PR[e]&&(PR[e]=!0,console.warn(e))}var LF="useOptimistic",LR=Xf[LF],UF=()=>{};function zF(t){return LR?LR(t):[t,UF]}function BF(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&mn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:E.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&mn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:E.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&mn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:E.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var HF=["HydrateFallback","hydrateFallbackElement"],jF=class{constructor(){this.status="pending",this.promise=new Promise((t,e)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",e(n))}})}};function $F({router:t,flushSync:e,onError:n,unstable_useTransitions:o}){o=pF()||o;let[l,c]=E.useState(t.state),[d,f]=zF(l),[h,m]=E.useState(),[y,v]=E.useState({isTransitioning:!1}),[C,b]=E.useState(),[T,w]=E.useState(),[_,k]=E.useState(),R=E.useRef(new Map),N=E.useCallback((L,{deletedFetchers:H,newErrors:A,flushSync:$,viewTransitionOpts:ee})=>{A&&n&&Object.values(A).forEach(le=>n(le,{location:L.location,params:L.matches[0]?.params??{},unstable_pattern:Ku(L.matches)})),L.fetchers.forEach((le,W)=>{le.data!==void 0&&R.current.set(W,le.data)}),H.forEach(le=>R.current.delete(le)),DR($===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let re=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(DR(ee==null||re,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!ee||!re){e&&$?e(()=>c(L)):o===!1?c(L):E.startTransition(()=>{o===!0&&f(le=>UR(le,L)),c(L)});return}if(e&&$){e(()=>{T&&(C?.resolve(),T.skipTransition()),v({isTransitioning:!0,flushSync:!0,currentLocation:ee.currentLocation,nextLocation:ee.nextLocation})});let le=t.window.document.startViewTransition(()=>{e(()=>c(L))});le.finished.finally(()=>{e(()=>{b(void 0),w(void 0),m(void 0),v({isTransitioning:!1})})}),e(()=>w(le));return}T?(C?.resolve(),T.skipTransition(),k({state:L,currentLocation:ee.currentLocation,nextLocation:ee.nextLocation})):(m(L),v({isTransitioning:!0,flushSync:!1,currentLocation:ee.currentLocation,nextLocation:ee.nextLocation}))},[t.window,e,T,C,o,f,n]);E.useLayoutEffect(()=>t.subscribe(N),[t,N]),E.useEffect(()=>{y.isTransitioning&&!y.flushSync&&b(new jF)},[y]),E.useEffect(()=>{if(C&&h&&t.window){let L=h,H=C.promise,A=t.window.document.startViewTransition(async()=>{o===!1?c(L):E.startTransition(()=>{o===!0&&f($=>UR($,L)),c(L)}),await H});A.finished.finally(()=>{b(void 0),w(void 0),m(void 0),v({isTransitioning:!1})}),w(A)}},[h,C,t.window,o,f]),E.useEffect(()=>{C&&h&&d.location.key===h.location.key&&C.resolve()},[C,T,d.location,h]),E.useEffect(()=>{!y.isTransitioning&&_&&(m(_.state),v({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}),k(void 0))},[y.isTransitioning,_]);let M=E.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:L=>t.navigate(L),push:(L,H,A)=>t.navigate(L,{state:H,preventScrollReset:A?.preventScrollReset}),replace:(L,H,A)=>t.navigate(L,{replace:!0,state:H,preventScrollReset:A?.preventScrollReset})}),[t]),U=t.basename||"/",x=E.useMemo(()=>({router:t,navigator:M,static:!1,basename:U,onError:n}),[t,M,U,n]);return E.createElement(E.Fragment,null,E.createElement(vs.Provider,{value:x},E.createElement(Vu.Provider,{value:d},E.createElement(aI.Provider,{value:R.current},E.createElement(OS.Provider,{value:y},E.createElement(VF,{basename:U,location:d.location,navigationType:d.historyAction,navigator:M,unstable_useTransitions:o},E.createElement(FF,{routes:t.routes,future:t.future,state:d,onError:n})))))),null)}function UR(t,e){return{...t,navigation:e.navigation.state!=="idle"?e.navigation:t.navigation,revalidation:e.revalidation!=="idle"?e.revalidation:t.revalidation,actionData:e.navigation.state!=="submitting"?e.actionData:t.actionData,fetchers:e.fetchers}}var FF=E.memo(KF);function KF({routes:t,future:e,state:n,onError:o}){return wF(t,void 0,n,o,e)}function xv({to:t,replace:e,state:n,relative:o}){et(jl()," may be used only in the context of a component.");let{static:a}=E.useContext(Nr);mn(!a," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:l}=E.useContext(wo),{pathname:c}=Ko(),d=uI(),f=Tp(t,Ep(l),c,o==="path"),h=JSON.stringify(f);return E.useEffect(()=>{d(JSON.parse(h),{replace:e,state:n,relative:o})},[d,h,o,e,n]),null}function NS(t){return TF(t.context)}function VF({basename:t="/",children:e=null,location:n,navigationType:o="POP",navigator:a,static:l=!1,unstable_useTransitions:c}){et(!jl(),"You cannot render a inside another . You should never have more than one in your app.");let d=t.replace(/^\/*/,"/"),f=E.useMemo(()=>({basename:d,navigator:a,static:l,unstable_useTransitions:c,future:{}}),[d,a,l,c]);typeof n=="string"&&(n=ya(n));let{pathname:h="/",search:m="",hash:y="",state:v=null,key:C="default"}=n,b=E.useMemo(()=>{let T=eo(h,d);return T==null?null:{location:{pathname:T,search:m,hash:y,state:v,key:C},navigationType:o}},[d,h,m,y,v,C,o]);return mn(b!=null,` is not able to match the URL "${h}${m}${y}" because it does not start with the basename, so the won't render anything.`),b==null?null:E.createElement(Nr.Provider,{value:f},E.createElement(wp.Provider,{children:e,value:b}))}var Yf="get",Wf="application/x-www-form-urlencoded";function Ap(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function GF(t){return Ap(t)&&t.tagName.toLowerCase()==="button"}function qF(t){return Ap(t)&&t.tagName.toLowerCase()==="form"}function YF(t){return Ap(t)&&t.tagName.toLowerCase()==="input"}function WF(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function QF(t,e){return t.button===0&&(!e||e==="_self")&&!WF(t)}var Rf=null;function XF(){if(Rf===null)try{new FormData(document.createElement("form"),0),Rf=!1}catch{Rf=!0}return Rf}var JF=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Oy(t){return t!=null&&!JF.has(t)?(mn(!1,`"${t}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${Wf}"`),null):t}function ZF(t,e){let n,o,a,l,c;if(qF(t)){let d=t.getAttribute("action");o=d?eo(d,e):null,n=t.getAttribute("method")||Yf,a=Oy(t.getAttribute("enctype"))||Wf,l=new FormData(t)}else if(GF(t)||YF(t)&&(t.type==="submit"||t.type==="image")){let d=t.form;if(d==null)throw new Error('Cannot submit a