diff --git a/assets/Latin-Merriweather-Bold-IIXuWTHu.woff2 b/assets/Latin-Merriweather-Bold-IIXuWTHu.woff2 new file mode 100644 index 00000000..b71dc5a0 Binary files /dev/null and b/assets/Latin-Merriweather-Bold-IIXuWTHu.woff2 differ diff --git a/assets/Latin-Merriweather-BoldItalic-lANwydSD.woff2 b/assets/Latin-Merriweather-BoldItalic-lANwydSD.woff2 new file mode 100644 index 00000000..36d3abfc Binary files /dev/null and b/assets/Latin-Merriweather-BoldItalic-lANwydSD.woff2 differ diff --git a/assets/Latin-Merriweather-Italic-DTbnHiv6.woff2 b/assets/Latin-Merriweather-Italic-DTbnHiv6.woff2 new file mode 100644 index 00000000..09916326 Binary files /dev/null and b/assets/Latin-Merriweather-Italic-DTbnHiv6.woff2 differ diff --git a/assets/Latin-Merriweather-Light-8OcT7uuF.woff2 b/assets/Latin-Merriweather-Light-8OcT7uuF.woff2 new file mode 100644 index 00000000..a0eadc33 Binary files /dev/null and b/assets/Latin-Merriweather-Light-8OcT7uuF.woff2 differ diff --git a/assets/Latin-Merriweather-LightItalic-B_O6_0Zw.woff2 b/assets/Latin-Merriweather-LightItalic-B_O6_0Zw.woff2 new file mode 100644 index 00000000..5112dab4 Binary files /dev/null and b/assets/Latin-Merriweather-LightItalic-B_O6_0Zw.woff2 differ diff --git a/assets/Latin-Merriweather-Regular-BwwdRmdN.woff2 b/assets/Latin-Merriweather-Regular-BwwdRmdN.woff2 new file mode 100644 index 00000000..9a9bd644 Binary files /dev/null and b/assets/Latin-Merriweather-Regular-BwwdRmdN.woff2 differ diff --git a/assets/hero-9qBhH4BY.jpg b/assets/hero-9qBhH4BY.jpg new file mode 100644 index 00000000..62320c42 Binary files /dev/null and b/assets/hero-9qBhH4BY.jpg differ diff --git a/assets/index-BjnsaegK.js b/assets/index-BjnsaegK.js new file mode 100644 index 00000000..60f1ed2c --- /dev/null +++ b/assets/index-BjnsaegK.js @@ -0,0 +1,601 @@ +var BL=Object.defineProperty;var HL=(e,t,n)=>t in e?BL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>(HL(e,typeof t!="symbol"?t+"":t,n),n),Hp=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)};var O=(e,t,n)=>(Hp(e,t,"read from private field"),n?n.call(e):t.get(e)),ge=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},ue=(e,t,n,r)=>(Hp(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);var Sd=(e,t,n,r)=>({set _(i){ue(e,t,i,n)},get _(){return O(e,t,r)}}),Me=(e,t,n)=>(Hp(e,t,"access private method"),n);function WL(e,t){for(var n=0;nr[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();var Fo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function qL(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var oC={exports:{}},m0={},sC={exports:{}},Te={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Vc=Symbol.for("react.element"),GL=Symbol.for("react.portal"),KL=Symbol.for("react.fragment"),YL=Symbol.for("react.strict_mode"),QL=Symbol.for("react.profiler"),XL=Symbol.for("react.provider"),ZL=Symbol.for("react.context"),JL=Symbol.for("react.forward_ref"),eO=Symbol.for("react.suspense"),tO=Symbol.for("react.memo"),nO=Symbol.for("react.lazy"),Y_=Symbol.iterator;function rO(e){return e===null||typeof e!="object"?null:(e=Y_&&e[Y_]||e["@@iterator"],typeof e=="function"?e:null)}var aC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},lC=Object.assign,uC={};function yl(e,t,n){this.props=e,this.context=t,this.refs=uC,this.updater=n||aC}yl.prototype.isReactComponent={};yl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};yl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cC(){}cC.prototype=yl.prototype;function S1(e,t,n){this.props=e,this.context=t,this.refs=uC,this.updater=n||aC}var w1=S1.prototype=new cC;w1.constructor=S1;lC(w1,yl.prototype);w1.isPureReactComponent=!0;var Q_=Array.isArray,dC=Object.prototype.hasOwnProperty,b1={current:null},fC={key:!0,ref:!0,__self:!0,__source:!0};function hC(e,t,n){var r,i={},o=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(o=""+t.key),t)dC.call(t,r)&&!fC.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1>>1,N=U[X];if(0>>1;Xi(re,q))Ki(he,re)?(U[X]=he,U[K]=q,X=K):(U[X]=re,U[G]=q,X=G);else if(Ki(he,q))U[X]=he,U[K]=q,X=K;else break e}}return W}function i(U,W){var q=U.sortIndex-W.sortIndex;return q!==0?q:U.id-W.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],c=1,d=null,f=3,h=!1,g=!1,y=!1,_=typeof setTimeout=="function"?setTimeout:null,m=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function v(U){for(var W=n(u);W!==null;){if(W.callback===null)r(u);else if(W.startTime<=U)r(u),W.sortIndex=W.expirationTime,t(l,W);else break;W=n(u)}}function x(U){if(y=!1,v(U),!g)if(n(l)!==null)g=!0,H(S);else{var W=n(u);W!==null&&Q(x,W.startTime-U)}}function S(U,W){g=!1,y&&(y=!1,m(C),C=-1),h=!0;var q=f;try{for(v(W),d=n(l);d!==null&&(!(d.expirationTime>W)||U&&!M());){var X=d.callback;if(typeof X=="function"){d.callback=null,f=d.priorityLevel;var N=X(d.expirationTime<=W);W=e.unstable_now(),typeof N=="function"?d.callback=N:d===n(l)&&r(l),v(W)}else r(l);d=n(l)}if(d!==null)var B=!0;else{var G=n(u);G!==null&&Q(x,G.startTime-W),B=!1}return B}finally{d=null,f=q,h=!1}}var w=!1,E=null,C=-1,T=5,A=-1;function M(){return!(e.unstable_now()-AU||125X?(U.sortIndex=q,t(u,U),n(l)===null&&U===n(u)&&(y?(m(C),C=-1):y=!0,Q(x,q-X))):(U.sortIndex=N,t(l,U),g||h||(g=!0,H(S))),U},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(U){var W=f;return function(){var q=f;f=W;try{return U.apply(this,arguments)}finally{f=q}}}})(yC);mC.exports=yC;var gO=mC.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var vC=z,$n=gO;function J(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Im=Object.prototype.hasOwnProperty,mO=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Z_={},J_={};function yO(e){return Im.call(J_,e)?!0:Im.call(Z_,e)?!1:mO.test(e)?J_[e]=!0:(Z_[e]=!0,!1)}function vO(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function _O(e,t,n,r){if(t===null||typeof t>"u"||vO(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function en(e,t,n,r,i,o,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=s}var Ot={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ot[e]=new en(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ot[t]=new en(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ot[e]=new en(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ot[e]=new en(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ot[e]=new en(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ot[e]=new en(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ot[e]=new en(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ot[e]=new en(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ot[e]=new en(e,5,!1,e.toLowerCase(),null,!1,!1)});var C1=/[\-:]([a-z])/g;function A1(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(C1,A1);Ot[t]=new en(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(C1,A1);Ot[t]=new en(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(C1,A1);Ot[t]=new en(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ot[e]=new en(e,1,!1,e.toLowerCase(),null,!1,!1)});Ot.xlinkHref=new en("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ot[e]=new en(e,1,!1,e.toLowerCase(),null,!0,!0)});function R1(e,t,n,r){var i=Ot.hasOwnProperty(t)?Ot[t]:null;(i!==null?i.type!==0:r||!(2a||i[s]!==o[a]){var l=` +`+i[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{Gp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?fu(e):""}function xO(e){switch(e.tag){case 5:return fu(e.type);case 16:return fu("Lazy");case 13:return fu("Suspense");case 19:return fu("SuspenseList");case 0:case 2:case 15:return e=Kp(e.type,!1),e;case 11:return e=Kp(e.type.render,!1),e;case 1:return e=Kp(e.type,!0),e;default:return""}}function Um(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ta:return"Fragment";case ea:return"Portal";case Dm:return"Profiler";case $1:return"StrictMode";case jm:return"Suspense";case Fm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case SC:return(e.displayName||"Context")+".Consumer";case xC:return(e._context.displayName||"Context")+".Provider";case T1:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case k1:return t=e.displayName||null,t!==null?t:Um(e.type)||"Memo";case Oi:t=e._payload,e=e._init;try{return Um(e(t))}catch{}}return null}function SO(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Um(t);case 8:return t===$1?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function go(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function bC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function wO(e){var t=bC(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(s){r=""+s,o.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ed(e){e._valueTracker||(e._valueTracker=wO(e))}function EC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=bC(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Vf(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Vm(e,t){var n=t.checked;return nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function tx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=go(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function CC(e,t){t=t.checked,t!=null&&R1(e,"checked",t,!1)}function zm(e,t){CC(e,t);var n=go(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Bm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Bm(e,t.type,go(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nx(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Bm(e,t,n){(t!=="number"||Vf(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var hu=Array.isArray;function _a(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i"+t.valueOf().toString()+"",t=Cd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Eu={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},bO=["Webkit","ms","Moz","O"];Object.keys(Eu).forEach(function(e){bO.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Eu[t]=Eu[e]})});function TC(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Eu.hasOwnProperty(e)&&Eu[e]?(""+t).trim():t+"px"}function kC(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=TC(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var EO=nt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qm(e,t){if(t){if(EO[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function Gm(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Km=null;function M1(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ym=null,xa=null,Sa=null;function ox(e){if(e=Hc(e)){if(typeof Ym!="function")throw Error(J(280));var t=e.stateNode;t&&(t=S0(t),Ym(e.stateNode,e.type,t))}}function MC(e){xa?Sa?Sa.push(e):Sa=[e]:xa=e}function NC(){if(xa){var e=xa,t=Sa;if(Sa=xa=null,ox(e),t)for(e=0;e>>=0,e===0?32:31-(PO(e)/IO|0)|0}var Ad=64,Rd=4194304;function pu(e){switch(e&-e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Wf(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,o=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~i;a!==0?r=pu(a):(o&=s,o!==0&&(r=pu(o)))}else s=n&~i,s!==0?r=pu(s):o!==0&&(r=pu(o));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,o=t&-t,i>=o||i===16&&(o&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function zc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-pr(t),e[t]=n}function UO(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Au),px=" ",gx=!1;function ZC(e,t){switch(e){case"keyup":return pP.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function JC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var na=!1;function mP(e,t){switch(e){case"compositionend":return JC(t);case"keypress":return t.which!==32?null:(gx=!0,px);case"textInput":return e=t.data,e===px&&gx?null:e;default:return null}}function yP(e,t){if(na)return e==="compositionend"||!F1&&ZC(e,t)?(e=QC(),hf=I1=Yi=null,na=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=_x(n)}}function rA(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?rA(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function iA(){for(var e=window,t=Vf();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Vf(e.document)}return t}function U1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function AP(e){var t=iA(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&rA(n.ownerDocument.documentElement,n)){if(r!==null&&U1(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,o=Math.min(r.start,i);r=r.end===void 0?o:Math.min(r.end,i),!e.extend&&o>r&&(i=r,r=o,o=i),i=xx(n,o);var s=xx(n,r);i&&s&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),o>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ra=null,ty=null,$u=null,ny=!1;function Sx(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ny||ra==null||ra!==Vf(r)||(r=ra,"selectionStart"in r&&U1(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$u&&Xu($u,r)||($u=r,r=Kf(ty,"onSelect"),0sa||(e.current=ly[sa],ly[sa]=null,sa--)}function He(e,t){sa++,ly[sa]=e.current,e.current=t}var mo={},Vt=wo(mo),dn=wo(!1),fs=mo;function Ka(e,t){var n=e.type.contextTypes;if(!n)return mo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},o;for(o in n)i[o]=t[o];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function fn(e){return e=e.childContextTypes,e!=null}function Qf(){Ke(dn),Ke(Vt)}function $x(e,t,n){if(Vt.current!==mo)throw Error(J(168));He(Vt,t),He(dn,n)}function hA(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(J(108,SO(e)||"Unknown",i));return nt({},n,r)}function Xf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mo,fs=Vt.current,He(Vt,e),He(dn,dn.current),!0}function Tx(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=hA(e,t,fs),r.__reactInternalMemoizedMergedChildContext=e,Ke(dn),Ke(Vt),He(Vt,e)):Ke(dn),He(dn,n)}var ii=null,w0=!1,lg=!1;function pA(e){ii===null?ii=[e]:ii.push(e)}function jP(e){w0=!0,pA(e)}function bo(){if(!lg&&ii!==null){lg=!0;var e=0,t=je;try{var n=ii;for(je=1;e>=s,i-=s,oi=1<<32-pr(t)+i|n<C?(T=E,E=null):T=E.sibling;var A=f(m,E,v[C],x);if(A===null){E===null&&(E=T);break}e&&E&&A.alternate===null&&t(m,E),p=o(A,p,C),w===null?S=A:w.sibling=A,w=A,E=T}if(C===v.length)return n(m,E),Xe&&Mo(m,C),S;if(E===null){for(;CC?(T=E,E=null):T=E.sibling;var M=f(m,E,A.value,x);if(M===null){E===null&&(E=T);break}e&&E&&M.alternate===null&&t(m,E),p=o(M,p,C),w===null?S=M:w.sibling=M,w=M,E=T}if(A.done)return n(m,E),Xe&&Mo(m,C),S;if(E===null){for(;!A.done;C++,A=v.next())A=d(m,A.value,x),A!==null&&(p=o(A,p,C),w===null?S=A:w.sibling=A,w=A);return Xe&&Mo(m,C),S}for(E=r(m,E);!A.done;C++,A=v.next())A=h(E,m,C,A.value,x),A!==null&&(e&&A.alternate!==null&&E.delete(A.key===null?C:A.key),p=o(A,p,C),w===null?S=A:w.sibling=A,w=A);return e&&E.forEach(function(R){return t(m,R)}),Xe&&Mo(m,C),S}function _(m,p,v,x){if(typeof v=="object"&&v!==null&&v.type===ta&&v.key===null&&(v=v.props.children),typeof v=="object"&&v!==null){switch(v.$$typeof){case bd:e:{for(var S=v.key,w=p;w!==null;){if(w.key===S){if(S=v.type,S===ta){if(w.tag===7){n(m,w.sibling),p=i(w,v.props.children),p.return=m,m=p;break e}}else if(w.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Oi&&Ix(S)===w.type){n(m,w.sibling),p=i(w,v.props),p.ref=Gl(m,w,v),p.return=m,m=p;break e}n(m,w);break}else t(m,w);w=w.sibling}v.type===ta?(p=is(v.props.children,m.mode,x,v.key),p.return=m,m=p):(x=Sf(v.type,v.key,v.props,null,m.mode,x),x.ref=Gl(m,p,v),x.return=m,m=x)}return s(m);case ea:e:{for(w=v.key;p!==null;){if(p.key===w)if(p.tag===4&&p.stateNode.containerInfo===v.containerInfo&&p.stateNode.implementation===v.implementation){n(m,p.sibling),p=i(p,v.children||[]),p.return=m,m=p;break e}else{n(m,p);break}else t(m,p);p=p.sibling}p=mg(v,m.mode,x),p.return=m,m=p}return s(m);case Oi:return w=v._init,_(m,p,w(v._payload),x)}if(hu(v))return g(m,p,v,x);if(zl(v))return y(m,p,v,x);Od(m,v)}return typeof v=="string"&&v!==""||typeof v=="number"?(v=""+v,p!==null&&p.tag===6?(n(m,p.sibling),p=i(p,v),p.return=m,m=p):(n(m,p),p=gg(v,m.mode,x),p.return=m,m=p),s(m)):n(m,p)}return _}var Qa=wA(!0),bA=wA(!1),Wc={},Dr=wo(Wc),tc=wo(Wc),nc=wo(Wc);function zo(e){if(e===Wc)throw Error(J(174));return e}function Y1(e,t){switch(He(nc,t),He(tc,e),He(Dr,Wc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Wm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Wm(t,e)}Ke(Dr),He(Dr,t)}function Xa(){Ke(Dr),Ke(tc),Ke(nc)}function EA(e){zo(nc.current);var t=zo(Dr.current),n=Wm(t,e.type);t!==n&&(He(tc,e),He(Dr,n))}function Q1(e){tc.current===e&&(Ke(Dr),Ke(tc))}var Je=wo(0);function rh(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ug=[];function X1(){for(var e=0;en?n:4,e(!0);var r=cg.transition;cg.transition={};try{e(!1),t()}finally{je=n,cg.transition=r}}function UA(){return Yn().memoizedState}function zP(e,t,n){var r=so(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},VA(e))zA(t,n);else if(n=vA(e,t,n,r),n!==null){var i=Xt();gr(n,e,r,i),BA(n,t,r)}}function BP(e,t,n){var r=so(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(VA(e))zA(t,i);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var s=t.lastRenderedState,a=o(s,n);if(i.hasEagerState=!0,i.eagerState=a,yr(a,s)){var l=t.interleaved;l===null?(i.next=i,G1(t)):(i.next=l.next,l.next=i),t.interleaved=i;return}}catch{}finally{}n=vA(e,t,i,r),n!==null&&(i=Xt(),gr(n,e,r,i),BA(n,t,r))}}function VA(e){var t=e.alternate;return e===et||t!==null&&t===et}function zA(e,t){Tu=ih=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function BA(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,L1(e,n)}}var oh={readContext:Kn,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useInsertionEffect:Pt,useLayoutEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useMutableSource:Pt,useSyncExternalStore:Pt,useId:Pt,unstable_isNewReconciler:!1},HP={readContext:Kn,useCallback:function(e,t){return br().memoizedState=[e,t===void 0?null:t],e},useContext:Kn,useEffect:jx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,yf(4194308,4,PA.bind(null,t,e),n)},useLayoutEffect:function(e,t){return yf(4194308,4,e,t)},useInsertionEffect:function(e,t){return yf(4,2,e,t)},useMemo:function(e,t){var n=br();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=br();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=zP.bind(null,et,e),[r.memoizedState,e]},useRef:function(e){var t=br();return e={current:e},t.memoizedState=e},useState:Dx,useDebugValue:n2,useDeferredValue:function(e){return br().memoizedState=e},useTransition:function(){var e=Dx(!1),t=e[0];return e=VP.bind(null,e[1]),br().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=et,i=br();if(Xe){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),Rt===null)throw Error(J(349));ps&30||RA(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,jx(TA.bind(null,r,o,e),[e]),r.flags|=2048,oc(9,$A.bind(null,r,o,n,t),void 0,null),n},useId:function(){var e=br(),t=Rt.identifierPrefix;if(Xe){var n=si,r=oi;n=(r&~(1<<32-pr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=rc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Mr]=t,e[ec]=r,ZA(e,t,!1,!1),t.stateNode=e;e:{switch(s=Gm(n,r),n){case"dialog":We("cancel",e),We("close",e),i=r;break;case"iframe":case"object":case"embed":We("load",e),i=r;break;case"video":case"audio":for(i=0;iJa&&(t.flags|=128,r=!0,Kl(o,!1),t.lanes=4194304)}else{if(!r)if(e=rh(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Kl(o,!0),o.tail===null&&o.tailMode==="hidden"&&!s.alternate&&!Xe)return It(t),null}else 2*lt()-o.renderingStartTime>Ja&&n!==1073741824&&(t.flags|=128,r=!0,Kl(o,!1),t.lanes=4194304);o.isBackwards?(s.sibling=t.child,t.child=s):(n=o.last,n!==null?n.sibling=s:t.child=s,o.last=s)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=lt(),t.sibling=null,n=Je.current,He(Je,r?n&1|2:n&1),t):(It(t),null);case 22:case 23:return l2(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?En&1073741824&&(It(t),t.subtreeFlags&6&&(t.flags|=8192)):It(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function ZP(e,t){switch(z1(t),t.tag){case 1:return fn(t.type)&&Qf(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xa(),Ke(dn),Ke(Vt),X1(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Q1(t),null;case 13:if(Ke(Je),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Ya()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ke(Je),null;case 4:return Xa(),null;case 10:return q1(t.type._context),null;case 22:case 23:return l2(),null;case 24:return null;default:return null}}var Id=!1,Ut=!1,JP=typeof WeakSet=="function"?WeakSet:Set,ce=null;function ca(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){it(e,t,r)}else n.current=null}function xy(e,t,n){try{n()}catch(r){it(e,t,r)}}var Gx=!1;function eI(e,t){if(ry=qf,e=iA(),U1(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var h;d!==n||i!==0&&d.nodeType!==3||(a=s+i),d!==o||r!==0&&d.nodeType!==3||(l=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(h=d.firstChild)!==null;)f=d,d=h;for(;;){if(d===e)break t;if(f===n&&++u===i&&(a=s),f===o&&++c===r&&(l=s),(h=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=h}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(iy={focusedElem:e,selectionRange:n},qf=!1,ce=t;ce!==null;)if(t=ce,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ce=e;else for(;ce!==null;){t=ce;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var y=g.memoizedProps,_=g.memoizedState,m=t.stateNode,p=m.getSnapshotBeforeUpdate(t.elementType===t.type?y:ir(t.type,y),_);m.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var v=t.stateNode.containerInfo;v.nodeType===1?v.textContent="":v.nodeType===9&&v.documentElement&&v.removeChild(v.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(x){it(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,ce=e;break}ce=t.return}return g=Gx,Gx=!1,g}function ku(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,o!==void 0&&xy(t,n,o)}i=i.next}while(i!==r)}}function C0(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Sy(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function tR(e){var t=e.alternate;t!==null&&(e.alternate=null,tR(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Mr],delete t[ec],delete t[ay],delete t[IP],delete t[DP])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function nR(e){return e.tag===5||e.tag===3||e.tag===4}function Kx(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nR(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function wy(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Yf));else if(r!==4&&(e=e.child,e!==null))for(wy(e,t,n),e=e.sibling;e!==null;)wy(e,t,n),e=e.sibling}function by(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(by(e,t,n),e=e.sibling;e!==null;)by(e,t,n),e=e.sibling}var Mt=null,sr=!1;function Ti(e,t,n){for(n=n.child;n!==null;)rR(e,t,n),n=n.sibling}function rR(e,t,n){if(Ir&&typeof Ir.onCommitFiberUnmount=="function")try{Ir.onCommitFiberUnmount(y0,n)}catch{}switch(n.tag){case 5:Ut||ca(n,t);case 6:var r=Mt,i=sr;Mt=null,Ti(e,t,n),Mt=r,sr=i,Mt!==null&&(sr?(e=Mt,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Mt.removeChild(n.stateNode));break;case 18:Mt!==null&&(sr?(e=Mt,n=n.stateNode,e.nodeType===8?ag(e.parentNode,n):e.nodeType===1&&ag(e,n),Yu(e)):ag(Mt,n.stateNode));break;case 4:r=Mt,i=sr,Mt=n.stateNode.containerInfo,sr=!0,Ti(e,t,n),Mt=r,sr=i;break;case 0:case 11:case 14:case 15:if(!Ut&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var o=i,s=o.destroy;o=o.tag,s!==void 0&&(o&2||o&4)&&xy(n,t,s),i=i.next}while(i!==r)}Ti(e,t,n);break;case 1:if(!Ut&&(ca(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){it(n,t,a)}Ti(e,t,n);break;case 21:Ti(e,t,n);break;case 22:n.mode&1?(Ut=(r=Ut)||n.memoizedState!==null,Ti(e,t,n),Ut=r):Ti(e,t,n);break;default:Ti(e,t,n)}}function Yx(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new JP),t.forEach(function(r){var i=uI.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function nr(e,t){var n=t.deletions;if(n!==null)for(var r=0;ri&&(i=s),r&=~o}if(r=i,r=lt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*nI(r/1960))-r,10e?16:e,Qi===null)var r=!1;else{if(e=Qi,Qi=null,lh=0,Oe&6)throw Error(J(331));var i=Oe;for(Oe|=4,ce=e.current;ce!==null;){var o=ce,s=o.child;if(ce.flags&16){var a=o.deletions;if(a!==null){for(var l=0;llt()-s2?rs(e,0):o2|=n),hn(e,t)}function dR(e,t){t===0&&(e.mode&1?(t=Rd,Rd<<=1,!(Rd&130023424)&&(Rd=4194304)):t=1);var n=Xt();e=hi(e,t),e!==null&&(zc(e,t,n),hn(e,n))}function lI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dR(e,n)}function uI(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(J(314))}r!==null&&r.delete(t),dR(e,n)}var fR;fR=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||dn.current)cn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return cn=!1,QP(e,t,n);cn=!!(e.flags&131072)}else cn=!1,Xe&&t.flags&1048576&&gA(t,Jf,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;vf(e,t),e=t.pendingProps;var i=Ka(t,Vt.current);ba(t,n),i=J1(null,t,r,e,i,n);var o=e2();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,fn(r)?(o=!0,Xf(t)):o=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,K1(t),i.updater=b0,t.stateNode=i,i._reactInternals=t,hy(t,r,e,n),t=my(null,t,r,!0,o,n)):(t.tag=0,Xe&&o&&V1(t),Gt(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(vf(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=dI(r),e=ir(r,e),i){case 0:t=gy(null,t,r,e,n);break e;case 1:t=Hx(null,t,r,e,n);break e;case 11:t=zx(null,t,r,e,n);break e;case 14:t=Bx(null,t,r,ir(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ir(r,i),gy(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ir(r,i),Hx(e,t,r,i,n);case 3:e:{if(YA(t),e===null)throw Error(J(387));r=t.pendingProps,o=t.memoizedState,i=o.element,_A(e,t),nh(t,r,null,n);var s=t.memoizedState;if(r=s.element,o.isDehydrated)if(o={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){i=Za(Error(J(423)),t),t=Wx(e,t,r,n,i);break e}else if(r!==i){i=Za(Error(J(424)),t),t=Wx(e,t,r,n,i);break e}else for(Cn=ro(t.stateNode.containerInfo.firstChild),Rn=t,Xe=!0,lr=null,n=bA(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ya(),r===i){t=pi(e,t,n);break e}Gt(e,t,r,n)}t=t.child}return t;case 5:return EA(t),e===null&&cy(t),r=t.type,i=t.pendingProps,o=e!==null?e.memoizedProps:null,s=i.children,oy(r,i)?s=null:o!==null&&oy(r,o)&&(t.flags|=32),KA(e,t),Gt(e,t,s,n),t.child;case 6:return e===null&&cy(t),null;case 13:return QA(e,t,n);case 4:return Y1(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qa(t,null,r,n):Gt(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ir(r,i),zx(e,t,r,i,n);case 7:return Gt(e,t,t.pendingProps,n),t.child;case 8:return Gt(e,t,t.pendingProps.children,n),t.child;case 12:return Gt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,o=t.memoizedProps,s=i.value,He(eh,r._currentValue),r._currentValue=s,o!==null)if(yr(o.value,s)){if(o.children===i.children&&!dn.current){t=pi(e,t,n);break e}}else for(o=t.child,o!==null&&(o.return=t);o!==null;){var a=o.dependencies;if(a!==null){s=o.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(o.tag===1){l=ui(-1,n&-n),l.tag=2;var u=o.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}o.lanes|=n,l=o.alternate,l!==null&&(l.lanes|=n),dy(o.return,n,t),a.lanes|=n;break}l=l.next}}else if(o.tag===10)s=o.type===t.type?null:o.child;else if(o.tag===18){if(s=o.return,s===null)throw Error(J(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),dy(s,n,t),s=o.sibling}else s=o.child;if(s!==null)s.return=o;else for(s=o;s!==null;){if(s===t){s=null;break}if(o=s.sibling,o!==null){o.return=s.return,s=o;break}s=s.return}o=s}Gt(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,ba(t,n),i=Kn(i),r=r(i),t.flags|=1,Gt(e,t,r,n),t.child;case 14:return r=t.type,i=ir(r,t.pendingProps),i=ir(r.type,i),Bx(e,t,r,i,n);case 15:return qA(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:ir(r,i),vf(e,t),t.tag=1,fn(r)?(e=!0,Xf(t)):e=!1,ba(t,n),SA(t,r,i),hy(t,r,i,n),my(null,t,r,!0,e,n);case 19:return XA(e,t,n);case 22:return GA(e,t,n)}throw Error(J(156,t.tag))};function hR(e,t){return FC(e,t)}function cI(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(e,t,n,r){return new cI(e,t,n,r)}function c2(e){return e=e.prototype,!(!e||!e.isReactComponent)}function dI(e){if(typeof e=="function")return c2(e)?1:0;if(e!=null){if(e=e.$$typeof,e===T1)return 11;if(e===k1)return 14}return 2}function ao(e,t){var n=e.alternate;return n===null?(n=Hn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Sf(e,t,n,r,i,o){var s=2;if(r=e,typeof e=="function")c2(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ta:return is(n.children,i,o,t);case $1:s=8,i|=8;break;case Dm:return e=Hn(12,n,t,i|2),e.elementType=Dm,e.lanes=o,e;case jm:return e=Hn(13,n,t,i),e.elementType=jm,e.lanes=o,e;case Fm:return e=Hn(19,n,t,i),e.elementType=Fm,e.lanes=o,e;case wC:return R0(n,i,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case xC:s=10;break e;case SC:s=9;break e;case T1:s=11;break e;case k1:s=14;break e;case Oi:s=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=Hn(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function is(e,t,n,r){return e=Hn(7,e,r,t),e.lanes=n,e}function R0(e,t,n,r){return e=Hn(22,e,r,t),e.elementType=wC,e.lanes=n,e.stateNode={isHidden:!1},e}function gg(e,t,n){return e=Hn(6,e,null,t),e.lanes=n,e}function mg(e,t,n){return t=Hn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function fI(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Qp(0),this.expirationTimes=Qp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qp(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function d2(e,t,n,r,i,o,s,a,l){return e=new fI(e,t,n,a,l),t===1?(t=1,o===!0&&(t|=8)):t=0,o=Hn(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},K1(o),e}function hI(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(yR)}catch(e){console.error(e)}}yR(),gC.exports=kn;var vR=gC.exports;const vI=xi(vR);var rS=vR;Pm.createRoot=rS.createRoot,Pm.hydrateRoot=rS.hydrateRoot;function _I(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var _R={exports:{}};const xI={},SI=Object.freeze(Object.defineProperty({__proto__:null,default:xI},Symbol.toStringTag,{value:"Module"})),wI=qL(SI);(function(e,t){(function(n,r){e.exports=r()})(Fo,function(){var n=n||function(r,i){var o;if(typeof window<"u"&&window.crypto&&(o=window.crypto),typeof self<"u"&&self.crypto&&(o=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window<"u"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Fo<"u"&&Fo.crypto&&(o=Fo.crypto),!o&&typeof _I=="function")try{o=wI}catch{}var s=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function p(){}return function(v){var x;return p.prototype=v,x=new p,p.prototype=null,x}}(),l={},u=l.lib={},c=u.Base=function(){return{extend:function(p){var v=a(this);return p&&v.mixIn(p),(!v.hasOwnProperty("init")||this.init===v.init)&&(v.init=function(){v.$super.init.apply(this,arguments)}),v.init.prototype=v,v.$super=this,v},create:function(){var p=this.extend();return p.init.apply(p,arguments),p},init:function(){},mixIn:function(p){for(var v in p)p.hasOwnProperty(v)&&(this[v]=p[v]);p.hasOwnProperty("toString")&&(this.toString=p.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),d=u.WordArray=c.extend({init:function(p,v){p=this.words=p||[],v!=i?this.sigBytes=v:this.sigBytes=p.length*4},toString:function(p){return(p||h).stringify(this)},concat:function(p){var v=this.words,x=p.words,S=this.sigBytes,w=p.sigBytes;if(this.clamp(),S%4)for(var E=0;E>>2]>>>24-E%4*8&255;v[S+E>>>2]|=C<<24-(S+E)%4*8}else for(var T=0;T>>2]=x[T>>>2];return this.sigBytes+=w,this},clamp:function(){var p=this.words,v=this.sigBytes;p[v>>>2]&=4294967295<<32-v%4*8,p.length=r.ceil(v/4)},clone:function(){var p=c.clone.call(this);return p.words=this.words.slice(0),p},random:function(p){for(var v=[],x=0;x>>2]>>>24-w%4*8&255;S.push((E>>>4).toString(16)),S.push((E&15).toString(16))}return S.join("")},parse:function(p){for(var v=p.length,x=[],S=0;S>>3]|=parseInt(p.substr(S,2),16)<<24-S%8*4;return new d.init(x,v/2)}},g=f.Latin1={stringify:function(p){for(var v=p.words,x=p.sigBytes,S=[],w=0;w>>2]>>>24-w%4*8&255;S.push(String.fromCharCode(E))}return S.join("")},parse:function(p){for(var v=p.length,x=[],S=0;S>>2]|=(p.charCodeAt(S)&255)<<24-S%4*8;return new d.init(x,v)}},y=f.Utf8={stringify:function(p){try{return decodeURIComponent(escape(g.stringify(p)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(p){return g.parse(unescape(encodeURIComponent(p)))}},_=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new d.init,this._nDataBytes=0},_append:function(p){typeof p=="string"&&(p=y.parse(p)),this._data.concat(p),this._nDataBytes+=p.sigBytes},_process:function(p){var v,x=this._data,S=x.words,w=x.sigBytes,E=this.blockSize,C=E*4,T=w/C;p?T=r.ceil(T):T=r.max((T|0)-this._minBufferSize,0);var A=T*E,M=r.min(A*4,w);if(A){for(var R=0;R>>7)^(T<<14|T>>>18)^T>>>3,M=d[C-2],R=(M<<15|M>>>17)^(M<<13|M>>>19)^M>>>10;d[C]=A+d[C-7]+R+d[C-16]}var k=x&S^~x&w,D=_&m^_&p^m&p,P=(_<<30|_>>>2)^(_<<19|_>>>13)^(_<<10|_>>>22),H=(x<<26|x>>>6)^(x<<21|x>>>11)^(x<<7|x>>>25),Q=E+H+k+c[C]+d[C],U=P+D;E=w,w=S,S=x,x=v+Q|0,v=p,p=m,m=_,_=Q+U|0}y[0]=y[0]+_|0,y[1]=y[1]+m|0,y[2]=y[2]+p|0,y[3]=y[3]+v|0,y[4]=y[4]+x|0,y[5]=y[5]+S|0,y[6]=y[6]+w|0,y[7]=y[7]+E|0},_doFinalize:function(){var h=this._data,g=h.words,y=this._nDataBytes*8,_=h.sigBytes*8;return g[_>>>5]|=128<<24-_%32,g[(_+64>>>9<<4)+14]=r.floor(y/4294967296),g[(_+64>>>9<<4)+15]=y,h.sigBytes=g.length*4,this._process(),this._hash},clone:function(){var h=a.clone.call(this);return h._hash=this._hash.clone(),h}});i.SHA256=a._createHelper(f),i.HmacSHA256=a._createHmacHelper(f)}(Math),n.SHA256})})(xR);var EI=xR.exports;const CI=xi(EI);var SR={exports:{}};(function(e,t){(function(n,r){e.exports=r(N0)})(Fo,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,s=r.enc;s.Base64={stringify:function(l){var u=l.words,c=l.sigBytes,d=this._map;l.clamp();for(var f=[],h=0;h>>2]>>>24-h%4*8&255,y=u[h+1>>>2]>>>24-(h+1)%4*8&255,_=u[h+2>>>2]>>>24-(h+2)%4*8&255,m=g<<16|y<<8|_,p=0;p<4&&h+p*.75>>6*(3-p)&63));var v=d.charAt(64);if(v)for(;f.length%4;)f.push(v);return f.join("")},parse:function(l){var u=l.length,c=this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var f=0;f>>6-h%4*2,_=g|y;d[f>>>2]|=_<<24-f%4*8,f++}return o.create(d,f)}}(),n.enc.Base64})})(SR);var AI=SR.exports;const iS=xi(AI);var wR={exports:{}};(function(e,t){(function(n,r){e.exports=r(N0)})(Fo,function(n){return n.enc.Utf8})})(wR);var RI=wR.exports;const $I=xi(RI);function $y(e){this.message=e}$y.prototype=new Error,$y.prototype.name="InvalidCharacterError";var oS=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new $y("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,o=0,s="";r=t.charAt(o++);~r&&(n=i%4?64*n+r:r,i++%4)?s+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return s};function TI(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(n){return decodeURIComponent(oS(n).replace(/(.)/g,function(r,i){var o=i.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}(t)}catch{return oS(t)}}function dh(e){this.message=e}function kI(e,t){if(typeof e!="string")throw new dh("Invalid token specified");var n=(t=t||{}).header===!0?0:1;try{return JSON.parse(TI(e.split(".")[n]))}catch(r){throw new dh("Invalid token specified: "+r.message)}}dh.prototype=new Error,dh.prototype.name="InvalidTokenError";var MI={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},Er,Cr,fh=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(fh||{});(e=>{function t(){Er=3,Cr=MI}e.reset=t;function n(i){if(!(0<=i&&i<=4))throw new Error("Invalid log level");Er=i}e.setLevel=n;function r(i){Cr=i}e.setLogger=r})(fh||(fh={}));var be=class{constructor(e){this._name=e}debug(...e){Er>=4&&Cr.debug(be._format(this._name,this._method),...e)}info(...e){Er>=3&&Cr.info(be._format(this._name,this._method),...e)}warn(...e){Er>=2&&Cr.warn(be._format(this._name,this._method),...e)}error(...e){Er>=1&&Cr.error(be._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new be(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){Er>=4&&Cr.debug(be._format(e),...t)}static info(e,...t){Er>=3&&Cr.info(be._format(e),...t)}static warn(e,...t){Er>=2&&Cr.warn(be._format(e),...t)}static error(e,...t){Er>=1&&Cr.error(be._format(e),...t)}};fh.reset();var NI="10000000-1000-4000-8000-100000000000",Lr=class{static _randomWord(){return bI.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return NI.replace(/[018]/g,t=>(+t^Lr._randomWord()&15>>+t/4).toString(16)).replace(/-/g,"")}static generateCodeVerifier(){return Lr.generateUUIDv4()+Lr.generateUUIDv4()+Lr.generateUUIDv4()}static generateCodeChallenge(e){try{const t=CI(e);return iS.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(t){throw be.error("CryptoUtils.generateCodeChallenge",t),t}}static generateBasicAuth(e,t){const n=$I.parse([e,t].join(":"));return iS.stringify(n)}},Ii=class{constructor(e){this._name=e,this._logger=new be(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},Ty=class{static decode(e){try{return kI(e)}catch(t){throw be.error("JwtUtils.decode",t),t}}},sS=class{static center({...e}){var t,n,r;return e.width==null&&(e.width=(t=[800,720,600,480].find(i=>i<=window.outerWidth/1.618))!=null?t:360),(n=e.left)!=null||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),e.height!=null&&((r=e.top)!=null||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter(([,t])=>t!=null).map(([t,n])=>`${t}=${typeof n!="boolean"?n:n?"yes":"no"}`).join(",")}},qn=class extends Ii{constructor(){super(...arguments),this._logger=new be(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-qn.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=qn.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=qn.getEpochTime()+e;if(this.expiration===n&&this._timerHandle){t.debug("skipping since already initialized for expiration at",this.expiration);return}this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,r*1e3)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},ky=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,"http://127.0.0.1")[t==="fragment"?"hash":"search"];return new URLSearchParams(r.slice(1))}},My=";",ys=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw be.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=(n=e.error_description)!=null?n:null,this.error_uri=(r=e.error_uri)!=null?r:null,this.state=e.userState,this.session_state=(i=e.session_state)!=null?i:null,this.url_state=e.url_state}},g2=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},LI=class{constructor(e){this._logger=new be("AccessTokenEvents"),this._expiringTimer=new qn("Access token expiring"),this._expiredTimer=new qn("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&e.expires_in!==void 0){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let i=n-this._expiringNotificationTimeInSeconds;i<=0&&(i=1),t.debug("registering expiring timer, raising in",i,"seconds"),this._expiringTimer.init(i)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},OI=class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new be("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=s=>{s.origin===this._frame_origin&&s.source===this._frame.contentWindow&&(s.data==="error"?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):s.data==="changed"?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(s.data+" message from check session op iframe"))};const o=new URL(n);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise(e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)})}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{!this._frame.contentWindow||!this._session_state||this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,this._intervalInSeconds*1e3)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},bR=class{constructor(){this._logger=new be("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},m2=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new be("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,o=setTimeout(()=>i.abort(),n*1e3);try{return await fetch(e,{...t,signal:i.signal})}catch(s){throw s instanceof DOMException&&s.name==="AbortError"?new g2("Network timed out"):s}finally{clearTimeout(o)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);let o;try{r.debug("url:",e),o=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(l){throw r.error("Network Error"),l}r.debug("HTTP response received, status",o.status);const s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find(l=>s.startsWith(l))&&r.throw(new Error(`Invalid response Content-Type: ${s??"undefined"}, from URL: ${e}`)),o.ok&&this._jwtHandler&&(s!=null&&s.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let a;try{a=await o.json()}catch(l){throw r.error("Error parsing JSON response",l),o.ok?l:new Error(`${o.statusText} (${o.status})`)}if(!o.ok)throw r.error("Error from server:",a),a.error?new ys(a):new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`);return a}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};n!==void 0&&(s.Authorization="Basic "+n),this.appendExtraHeaders(s);let a;try{o.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:s,body:t,timeoutInSeconds:r,credentials:i})}catch(d){throw o.error("Network error"),d}o.debug("HTTP response received, status",a.status);const l=a.headers.get("Content-Type");if(l&&!this._contentTypes.find(d=>l.startsWith(d)))throw new Error(`Invalid response Content-Type: ${l??"undefined"}, from URL: ${e}`);const u=await a.text();let c={};if(u)try{c=JSON.parse(u)}catch(d){throw o.error("Error parsing JSON response",d),a.ok?d:new Error(`${a.statusText} (${a.status})`)}if(!a.ok)throw o.error("Error from server:",c),c.error?new ys(c,t):new Error(`${a.statusText} (${a.status}): ${JSON.stringify(c)}`);return c}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];n.length!==0&&n.forEach(i=>{if(r.includes(i.toLocaleLowerCase())){t.warn("Protected header could not be overridden",i,r);return}const o=typeof this._extraHeaders[i]=="function"?this._extraHeaders[i]():this._extraHeaders[i];o&&o!==""&&(e[i]=o)})}},PI=class{constructor(e){this._settings=e,this._logger=new be("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new m2(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),r[e]===void 0){if(t===!0){n.warn("Metadata does not contain optional property");return}n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}},ER=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new be("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){return this._logger.create(`get('${e}')`),e=this._prefix+e,await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n{const r=this._logger.create("_getClaimsFromJwt");try{const i=Ty.decode(n);return r.debug("JWT decoding successful"),i}catch(i){throw r.error("Error parsing JWT response"),i}},this._jsonService=new m2(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}},CR=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new be("TokenClient"),this._jsonService=new m2(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const o=this._logger.create("exchangeCode");n||o.throw(new Error("A client_id is required")),t||o.throw(new Error("A redirect_uri is required")),i.code||o.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[c,d]of Object.entries(i))d!=null&&s.set(c,d);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw o.throw(new Error("A client_secret is required")),null;a=Lr.generateBasicAuth(n,r);break;case"client_secret_post":s.append("client_id",n),r&&s.append("client_secret",r);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),u}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const o=this._logger.create("exchangeCredentials");t||o.throw(new Error("A client_id is required"));const s=new URLSearchParams({grant_type:e,scope:r});for(const[c,d]of Object.entries(i))d!=null&&s.set(c,d);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Lr.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),u}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const o=this._logger.create("exchangeRefreshToken");t||o.throw(new Error("A client_id is required")),i.refresh_token||o.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:e});for(const[c,d]of Object.entries(i))Array.isArray(d)?d.forEach(f=>s.append(c,f)):d!=null&&s.set(c,d);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=Lr.generateBasicAuth(t,n);break;case"client_secret_post":s.append("client_id",t),n&&s.append("client_secret",n);break}const l=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const u=await this._jsonService.postForm(l,{body:s,basicAuth:a,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),u}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${(t=e.token_type_hint)!=null?t:"default token type"}`);const i=new URLSearchParams;for(const[o,s]of Object.entries(e))s!=null&&i.set(o,s);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},BI=class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new be("ResponseValidator"),this._userInfoService=new zI(this._settings,this._metadataService),this._tokenClient=new CR(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t==null?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&e.id_token&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){var n,r;const i=this._logger.create("validateRefreshResponse");e.userState=t.data,(n=e.session_state)!=null||(e.session_state=t.session_state),(r=e.scope)!=null||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const o=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,o),i.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new ys(e)}_processSigninState(e,t){var n;const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,e.url_state=t.url_state,(n=e.scope)!=null||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new ys(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token){r.debug("not loading user info");return}r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=Ty.decode((n=e.id_token)!=null?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const o=Ty.decode(t);i.sub!==o.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==o.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==o.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&o.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}},el=class{constructor(e){this.id=e.id||Lr.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=qn.getEpochTime(),this.request_type=e.request_type,this.url_state=e.url_state}toStorageString(){return new be("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,url_state:this.url_state})}static fromStorageString(e){return be.createStatic("State","fromStorageString"),new el(JSON.parse(e))}static async clearStaleState(e,t){const n=be.createStatic("State","clearStaleState"),r=qn.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let o=0;op.searchParams.append("resource",S));for(const[x,S]of Object.entries({response_mode:a,...m,...g}))S!=null&&p.searchParams.append(x,S.toString());this.url=p.href}},WI="openid",yg=class{constructor(e){if(this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.state){const t=decodeURIComponent(this.state).split(My);this.state=t[0],t.length>1&&(this.url_state=t.slice(1).join(My))}this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-qn.getEpochTime()}set expires_in(e){typeof e=="string"&&(e=Number(e)),e!==void 0&&e>=0&&(this.expires_at=Math.floor(e)+qn.getEpochTime())}get isOpenId(){var e;return((e=this.scope)==null?void 0:e.split(" ").includes(WI))||!!this.id_token}},qI=class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:o,client_id:s}){if(this._logger=new be("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(e);n&&a.searchParams.append("id_token_hint",n),s&&a.searchParams.append("client_id",s),r&&(a.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new el({data:t,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[l,u]of Object.entries({...i}))u!=null&&a.searchParams.append(l,u.toString());this.url=a.href}},GI=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},KI=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],YI=["sub","iss","aud","exp","iat"],QI=class{constructor(e){this._settings=e,this._logger=new be("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let n;Array.isArray(this._settings.filterProtocolClaims)?n=this._settings.filterProtocolClaims:n=KI;for(const r of n)YI.includes(r)||delete t[r]}return t}mergeClaims(e,t){const n={...e};for(const[r,i]of Object.entries(t))for(const o of Array.isArray(i)?i:[i]){const s=n[r];s===void 0?n[r]=o:Array.isArray(s)?s.includes(o)||s.push(o):n[r]!==o&&(typeof o=="object"&&this._settings.mergeClaims?n[r]=this.mergeClaims(s,o):n[r]=[s,o])}return n}},XI=class{constructor(e,t){this._logger=new be("OidcClient"),this.settings=e instanceof Ny?e:new Ny(e),this.metadataService=t??new PI(this.settings),this._claimsService=new QI(this.settings),this._validator=new BI(this.settings,this.metadataService,this._claimsService),this._tokenClient=new CR(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:o,skipUserInfo:s,nonce:a,url_state:l,response_type:u=this.settings.response_type,scope:c=this.settings.scope,redirect_uri:d=this.settings.redirect_uri,prompt:f=this.settings.prompt,display:h=this.settings.display,max_age:g=this.settings.max_age,ui_locales:y=this.settings.ui_locales,acr_values:_=this.settings.acr_values,resource:m=this.settings.resource,response_mode:p=this.settings.response_mode,extraQueryParams:v=this.settings.extraQueryParams,extraTokenParams:x=this.settings.extraTokenParams}){const S=this._logger.create("createSigninRequest");if(u!=="code")throw new Error("Only the Authorization Code flow (with PKCE) is supported");const w=await this.metadataService.getAuthorizationEndpoint();S.debug("Received authorization endpoint",w);const E=new HI({url:w,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:d,response_type:u,scope:c,state_data:e,url_state:l,prompt:f,display:h,max_age:g,ui_locales:y,id_token_hint:i,login_hint:o,acr_values:_,resource:m,request:t,request_uri:n,extraQueryParams:v,extraTokenParams:x,request_type:r,response_mode:p,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const C=E.state;return await this.settings.stateStore.set(C.id,C.toStorageString()),E}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new yg(ky.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:y2.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),o=new yg(new URLSearchParams);return Object.assign(o,i),await this._validator.validateCredentialsResponse(o,n),o}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let i;if(this.settings.refreshTokenAllowedScope===void 0)i=e.scope;else{const a=this.settings.refreshTokenAllowedScope.split(" ");i=(((n=e.scope)==null?void 0:n.split(" "))||[]).filter(u=>a.includes(u)).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:i,timeoutInSeconds:t}),s=new yg(new URLSearchParams);return Object.assign(s,o),r.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...e,scope:i}),s}async createSignoutRequest({state:e,id_token_hint:t,client_id:n,request_type:r,post_logout_redirect_uri:i=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const s=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw s.throw(new Error("No end session endpoint")),null;s.debug("Received end session endpoint",a),!n&&i&&!t&&(n=this.settings.client_id);const l=new qI({url:a,id_token_hint:t,client_id:n,post_logout_redirect_uri:i,state_data:e,extraQueryParams:o,request_type:r});await this.clearStaleState();const u=l.state;return u&&(s.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),l}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new GI(ky.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new ys(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:el.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),el.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},ZI=class{constructor(e){this._userManager=e,this._logger=new be("SessionMonitor"),this._start=async t=>{const n=t.session_state;if(!n)return;const r=this._logger.create("_start");if(t.profile?(this._sub=t.profile.sub,this._sid=t.profile.sid,r.debug("session_state",n,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",n,", anonymous user")),this._checkSessionIFrame){this._checkSessionIFrame.start(n);return}try{const i=await this._userManager.metadataService.getCheckSessionIframe();if(i){r.debug("initializing check session iframe");const o=this._userManager.settings.client_id,s=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,l=new OI(this._callback,o,i,s,a);await l.load(),this._checkSessionIFrame=l,l.start(n)}else r.warn("no check session iframe found in the metadata")}catch(i){r.error("Error from getCheckSessionIframe:",i instanceof Error?i.message:i)}},this._stop=()=>{const t=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const n=setInterval(async()=>{clearInterval(n);try{const r=await this._userManager.querySessionStatus();if(r){const i={session_state:r.session_state,profile:r.sub&&r.sid?{sub:r.sub,sid:r.sid}:null};this._start(i)}}catch(r){t.error("error from querySessionStatus",r instanceof Error?r.message:r)}},1e3)}},this._callback=async()=>{const t=this._logger.create("_callback");try{const n=await this._userManager.querySessionStatus();let r=!0;n&&this._checkSessionIFrame?n.sub===this._sub?(r=!1,this._checkSessionIFrame.start(n.session_state),n.sid===this._sid?t.debug("same sub still logged in at OP, restarting check session iframe; session_state",n.session_state):(t.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",n.session_state),this._userManager.events._raiseUserSessionChanged())):t.debug("different subject signed into OP",n.sub):t.debug("subject no longer signed into OP"),r?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():t.debug("no change in session detected, no event to raise")}catch(n){this._sub&&(t.debug("Error calling queryCurrentSigninSession; raising signed out event",n),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch(t=>{this._logger.error(t)})}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const t=await this._userManager.querySessionStatus();if(t){const n={session_state:t.session_state,profile:t.sub&&t.sid?{sub:t.sub,sid:t.sid}:null};this._start(n)}}}},wf=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=(t=e.session_state)!=null?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState,this.url_state=e.url_state}get expires_in(){if(this.expires_at!==void 0)return this.expires_at-qn.getEpochTime()}set expires_in(e){e!==void 0&&(this.expires_at=Math.floor(e)+qn.getEpochTime())}get expired(){const e=this.expires_in;if(e!==void 0)return e<=0}get scopes(){var e,t;return(t=(e=this.scope)==null?void 0:e.split(" "))!=null?t:[]}toStorageString(){return new be("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return be.createStatic("User","fromStorageString"),new wf(JSON.parse(e))}},aS="oidc-client",AR=class{constructor(){this._abort=new Ii("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise((i,o)=>{const s=a=>{var l;const u=a.data,c=(l=e.scriptOrigin)!=null?l:window.location.origin;if(!(a.origin!==c||(u==null?void 0:u.source)!==aS)){try{const d=ky.readParams(u.url,e.response_mode).get("state");if(d||t.warn("no state found in response url"),a.source!==this._window&&d!==e.state)return}catch{this._dispose(),o(new Error("Invalid response from window"))}i(u)}};window.addEventListener("message",s,!1),this._disposeHandlers.add(()=>window.removeEventListener("message",s,!1)),this._disposeHandlers.add(this._abort.addHandler(a=>{this._dispose(),o(a)}))});return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:aS,url:t,keepOpen:n},r)}},RR={location:!1,toolbar:!1,height:640,closePopupWindowAfterInSeconds:-1},$R="_blank",JI=60,eD=2,TR=10,tD=class extends Ny{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=RR,popupWindowTarget:i=$R,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:l=e.iframeScriptOrigin,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:c=TR,automaticSilentRenew:d=!0,validateSubOnSilentRenew:f=!0,includeIdTokenInSilentRenew:h=!1,monitorSession:g=!1,monitorAnonymousSession:y=!1,checkSessionIntervalInSeconds:_=eD,query_status_response_type:m="code",stopCheckSessionOnError:p=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:x=!1,includeIdTokenInSilentSignout:S=!1,accessTokenExpiringNotificationTimeInSeconds:w=JI,userStore:E}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=o,this.redirectTarget=s,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=l,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=c,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=f,this.includeIdTokenInSilentRenew=h,this.monitorSession=g,this.monitorAnonymousSession=y,this.checkSessionIntervalInSeconds=_,this.stopCheckSessionOnError=p,this.query_status_response_type=m,this.revokeTokenTypes=v,this.revokeTokensOnSignout=x,this.includeIdTokenInSilentSignout=S,this.accessTokenExpiringNotificationTimeInSeconds=w,E)this.userStore=E;else{const C=typeof window<"u"?window.sessionStorage:new bR;this.userStore=new ER({store:C})}}},Ly=class extends AR{constructor({silentRequestTimeoutInSeconds:e=TR}){super(),this._logger=new be("IFrameWindow"),this._timeoutInSeconds=e,this._frame=Ly.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout(()=>this._abort.raise(new g2("IFrame timed out without a response")),this._timeoutInSeconds*1e3);return this._disposeHandlers.add(()=>clearTimeout(t)),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",t=>{var n;const r=t.target;(n=r.parentNode)==null||n.removeChild(r),this._abort.raise(new Error("IFrame removed from DOM"))},!0),(e=this._frame.contentWindow)==null||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},nD=class{constructor(e){this._settings=e,this._logger=new be("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new Ly({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),Ly.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},rD=500,iD=1e3,lS=class extends AR{constructor({popupWindowTarget:e=$R,popupWindowFeatures:t={}}){super(),this._logger=new be("PopupWindow");const n=sS.center({...RR,...t});this._window=window.open(void 0,e,sS.serialize(n)),t.closePopupWindowAfterInSeconds&&t.closePopupWindowAfterInSeconds>0&&setTimeout(()=>{if(!this._window||typeof this._window.closed!="boolean"||this._window.closed){this._abort.raise(new Error("Popup blocked by user"));return}this.close()},t.closePopupWindowAfterInSeconds*iD)}async navigate(e){var t;(t=this._window)==null||t.focus();const n=setInterval(()=>{(!this._window||this._window.closed)&&this._abort.raise(new Error("Popup closed by user"))},rD);return this._disposeHandlers.add(()=>clearInterval(n)),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},oD=class{constructor(e){this._settings=e,this._logger=new be("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new lS({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,{keepOpen:t=!1}){this._logger.create("callback"),lS.notifyOpener(e,t)}},sD=class{constructor(e){this._settings=e,this._logger=new be("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;t==="top"&&(r=(n=window.top)!=null?n:window.self);const i=r.location[e].bind(r.location);let o;return{navigate:async s=>{this._logger.create("navigate");const a=new Promise((l,u)=>{o=u});return i(s.url),await a},close:()=>{this._logger.create("close"),o==null||o(new Error("Redirect aborted")),r.stop()}}}async callback(){}},aD=class extends LI{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new be("UserManagerEvents"),this._userLoaded=new Ii("User loaded"),this._userUnloaded=new Ii("User unloaded"),this._silentRenewError=new Ii("Silent renew error"),this._userSignedIn=new Ii("User signed in"),this._userSignedOut=new Ii("User signed out"),this._userSessionChanged=new Ii("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},lD=class{constructor(e){this._userManager=e,this._logger=new be("SilentRenewService"),this._isStarted=!1,this._retryTimer=new qn("Retry Silent Renew"),this._tokenExpiring=async()=>{const t=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),t.debug("silent token renewal successful")}catch(n){if(n instanceof g2){t.warn("ErrorTimeout from signinSilent:",n,"retry in 5s"),this._retryTimer.init(5);return}t.error("Error from signinSilent:",n),this._userManager.events._raiseSilentRenewError(n)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},uD=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},cD=class{constructor(e,t,n,r){this._logger=new be("UserManager"),this.settings=new tD(e),this._client=new XI(e),this._redirectNavigator=t??new sD(this.settings),this._popupNavigator=n??new oD(this.settings),this._iframeNavigator=r??new nD(this.settings),this._events=new aD(this.settings),this._silentRenewService=new lD(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new ZI(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const o=await this._buildUser(i);return o.profile&&o.profile.sub?r.info("success, signed in subject",o.profile.sub):r.info("no subject"),o}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_redirect_uri;o||t.throw(new Error("No popup_redirect_uri configured"));const s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...i},s);return a&&(a.profile&&a.profile.sub?t.info("success, signed in subject",a.profile.sub):t.info("no subject")),a}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,resource:i,...o}=e;let s=await this._loadUser();if(s!=null&&s.refresh_token){n.debug("using refresh token");const c=new uD(s,i);return await this._useRefreshToken(c)}const a=this.settings.silent_redirect_uri;a||n.throw(new Error("No silent_redirect_uri configured"));let l;s&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",s.profile.sub),l=s.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return s=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?s==null?void 0:s.id_token:void 0,...o},u,l),s&&((t=s.profile)!=null&&t.sub?n.info("success, signed in subject",s.profile.sub):n.info("no subject")),s}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new wf({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),a=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?o==null?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},s);try{const l=await this._client.processSigninResponse(a.url);return t.debug("got signin response"),l.session_state&&l.profile.sub?(t.info("success for subject",l.profile.sub),{session_state:l.session_state,sub:l.profile.sub,sid:l.profile.sid}):(t.info("success, user not authenticated"),null)}catch(l){if(this.settings.monitorAnonymousSession&&l instanceof ys)switch(l.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:l.session_state}}throw l}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(r){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),r}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new wf(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new ys({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,o=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:o==null?void 0:{},...i},s),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,{keepOpen:t}),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const o=e.id_token_hint||i&&i.id_token;o&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=o),await this.removeUser(),r.debug("user removed, creating signout request");const s=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:s.url,state:(n=s.state)==null?void 0:n.id,scriptOrigin:this.settings.iframeScriptOrigin})}catch(i){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),i}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,o=this.settings.includeIdTokenInSilentSignout?(t=await this._loadUser())==null?void 0:t.id_token:void 0,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...i},a),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter(i=>typeof e[i]=="string");if(!r.length){n.debug("no need to revoke due to no token(s)");return}for(const i of r)await this._client.revokeToken(e[i],i),n.info(`${i} revoked successfully`),i!=="access_token"&&(e[i]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),wf.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},v2=b.createContext(void 0);v2.displayName="AuthContext";var dD={isLoading:!0,isAuthenticated:!1},fD=(e,t)=>{switch(t.type){case"INITIALISED":case"USER_LOADED":return{...e,user:t.user,isLoading:!1,isAuthenticated:t.user?!t.user.expired:!1,error:void 0};case"USER_UNLOADED":return{...e,user:void 0,isAuthenticated:!1};case"NAVIGATOR_INIT":return{...e,isLoading:!0,activeNavigator:t.method};case"NAVIGATOR_CLOSE":return{...e,isLoading:!1,activeNavigator:void 0};case"ERROR":return{...e,isLoading:!1,error:t.error};default:return{...e,isLoading:!1,error:new Error(`unknown type ${t.type}`)}}},hD=(e=window.location)=>{let t=new URLSearchParams(e.search);return!!((t.get("code")||t.get("error"))&&t.get("state")||(t=new URLSearchParams(e.hash.replace("#","?")),(t.get("code")||t.get("error"))&&t.get("state")))},pD=e=>t=>t instanceof Error?t:new Error(e),gD=pD("Login failed"),mD=["clearStaleState","querySessionStatus","revokeTokens","startSilentRenew","stopSilentRenew"],yD=["signinPopup","signinSilent","signinRedirect","signinResourceOwnerCredentials","signoutPopup","signoutRedirect","signoutSilent"],vg=e=>()=>{throw new Error(`UserManager#${e} was called from an unsupported context. If this is a server-rendered page, defer this call with useEffect() or pass a custom UserManager implementation.`)},vD=typeof window>"u"?null:cD,_D=e=>{const{children:t,onSigninCallback:n,skipSigninCallback:r,onRemoveUser:i,onSignoutRedirect:o,onSignoutPopup:s,implementation:a=vD,userManager:l,...u}=e,[c]=z.useState(()=>l??(a?new a(u):{settings:u})),[d,f]=z.useReducer(fD,dD),h=z.useMemo(()=>Object.assign({settings:c.settings,events:c.events},Object.fromEntries(mD.map(v=>{var x,S;return[v,(S=(x=c[v])==null?void 0:x.bind(c))!=null?S:vg(v)]})),Object.fromEntries(yD.map(v=>[v,c[v]?async x=>{f({type:"NAVIGATOR_INIT",method:v});try{return await c[v](x)}catch(S){return f({type:"ERROR",error:S}),null}finally{f({type:"NAVIGATOR_CLOSE"})}}:vg(v)]))),[c]),g=z.useRef(!1);z.useEffect(()=>{!c||g.current||(g.current=!0,(async()=>{let v=null;try{hD()&&!r&&(v=await c.signinCallback(),n&&await n(v)),v=v||await c.getUser(),f({type:"INITIALISED",user:v})}catch(x){f({type:"ERROR",error:gD(x)})}})())},[c,r,n]),z.useEffect(()=>{if(!c)return;const v=w=>{f({type:"USER_LOADED",user:w})};c.events.addUserLoaded(v);const x=()=>{f({type:"USER_UNLOADED"})};c.events.addUserUnloaded(x);const S=w=>{f({type:"ERROR",error:w})};return c.events.addSilentRenewError(S),()=>{c.events.removeUserLoaded(v),c.events.removeUserUnloaded(x),c.events.removeSilentRenewError(S)}},[c]);const y=z.useCallback(c?()=>c.removeUser().then(i):vg("removeUser"),[c,i]),_=z.useCallback(v=>h.signoutRedirect(v).then(o),[h.signoutRedirect,o]),m=z.useCallback(v=>h.signoutPopup(v).then(s),[h.signoutPopup,s]),p=z.useCallback(v=>h.signoutSilent(v),[h.signoutSilent]);return b.createElement(v2.Provider,{value:{...d,...h,removeUser:y,signoutRedirect:_,signoutPopup:m,signoutSilent:p}},t)},xD=()=>{const e=b.useContext(v2);return e||console.warn("AuthProvider context is undefined, please verify you are calling useAuth() as child of a component."),e};/** + * @remix-run/router v1.15.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function ac(){return ac=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function kR(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wD(){return Math.random().toString(36).substr(2,8)}function cS(e,t){return{usr:e.state,key:e.key,idx:t}}function Oy(e,t,n,r){return n===void 0&&(n=null),ac({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?xl(t):t,{state:n,key:t&&t.key||r||wD()})}function hh(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function xl(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function bD(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:o=!1}=r,s=i.history,a=Xi.Pop,l=null,u=c();u==null&&(u=0,s.replaceState(ac({},s.state,{idx:u}),""));function c(){return(s.state||{idx:null}).idx}function d(){a=Xi.Pop;let _=c(),m=_==null?null:_-u;u=_,l&&l({action:a,location:y.location,delta:m})}function f(_,m){a=Xi.Push;let p=Oy(y.location,_,m);n&&n(p,_),u=c()+1;let v=cS(p,u),x=y.createHref(p);try{s.pushState(v,"",x)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;i.location.assign(x)}o&&l&&l({action:a,location:y.location,delta:1})}function h(_,m){a=Xi.Replace;let p=Oy(y.location,_,m);n&&n(p,_),u=c();let v=cS(p,u),x=y.createHref(p);s.replaceState(v,"",x),o&&l&&l({action:a,location:y.location,delta:0})}function g(_){let m=i.location.origin!=="null"?i.location.origin:i.location.href,p=typeof _=="string"?_:hh(_);return p=p.replace(/ $/,"%20"),tt(m,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,m)}let y={get action(){return a},get location(){return e(i,s)},listen(_){if(l)throw new Error("A history only accepts one active listener");return i.addEventListener(uS,d),l=_,()=>{i.removeEventListener(uS,d),l=null}},createHref(_){return t(i,_)},createURL:g,encodeLocation(_){let m=g(_);return{pathname:m.pathname,search:m.search,hash:m.hash}},push:f,replace:h,go(_){return s.go(_)}};return y}var dS;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(dS||(dS={}));function ED(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?xl(t):t,i=tl(r.pathname||"/",n);if(i==null)return null;let o=MR(e);CD(o);let s=null;for(let a=0;s==null&&a{let l={relativePath:a===void 0?o.path||"":a,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};l.relativePath.startsWith("/")&&(tt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=lo([r,l.relativePath]),c=n.concat(l);o.children&&o.children.length>0&&(tt(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),MR(o.children,t,c,u)),!(o.path==null&&!o.index)&&t.push({path:u,score:ND(u,o.index),routesMeta:c})};return e.forEach((o,s)=>{var a;if(o.path===""||!((a=o.path)!=null&&a.includes("?")))i(o,s);else for(let l of NR(o.path))i(o,s,l)}),t}function NR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return i?[o,""]:[o];let s=NR(r.join("/")),a=[];return a.push(...s.map(l=>l===""?o:[o,l].join("/"))),i&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function CD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const AD=/^:[\w-]+$/,RD=3,$D=2,TD=1,kD=10,MD=-2,fS=e=>e==="*";function ND(e,t){let n=e.split("/"),r=n.length;return n.some(fS)&&(r+=MD),t&&(r+=$D),n.filter(i=>!fS(i)).reduce((i,o)=>i+(AD.test(o)?RD:o===""?TD:kD),r)}function LD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function OD(e,t){let{routesMeta:n}=e,r={},i="/",o=[];for(let s=0;s{let{paramName:f,isOptional:h}=c;if(f==="*"){let y=a[d]||"";s=o.slice(0,o.length-y.length).replace(/(.)\/+$/,"$1")}const g=a[d];return h&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:o,pathnameBase:s,pattern:e}}function PD(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),kR(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function ID(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return kR(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function tl(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function DD(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?xl(e):e;return{pathname:n?n.startsWith("/")?n:jD(n,t):t,search:VD(r),hash:zD(i)}}function jD(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function _g(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function FD(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function _2(e,t){let n=FD(e);return t?n.map((r,i)=>i===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function x2(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=xl(e):(i=ac({},e),tt(!i.pathname||!i.pathname.includes("?"),_g("?","pathname","search",i)),tt(!i.pathname||!i.pathname.includes("#"),_g("#","pathname","hash",i)),tt(!i.search||!i.search.includes("#"),_g("#","search","hash",i)));let o=e===""||i.pathname==="",s=o?"/":i.pathname,a;if(s==null)a=n;else{let d=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),d-=1;i.pathname=f.join("/")}a=d>=0?t[d]:"/"}let l=DD(i,a),u=s&&s!=="/"&&s.endsWith("/"),c=(o||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const lo=e=>e.join("/").replace(/\/\/+/g,"/"),UD=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),VD=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,zD=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function BD(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const LR=["post","put","patch","delete"];new Set(LR);const HD=["get",...LR];new Set(HD);/** + * React Router v6.22.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function lc(){return lc=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),z.useCallback(function(u,c){if(c===void 0&&(c={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let d=x2(u,JSON.parse(s),o,c.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:lo([t,d.pathname])),(c.replace?r.replace:r.push)(d,c.state,c)},[t,r,s,o,e])}const GD=z.createContext(null);function KD(e){let t=z.useContext(Vr).outlet;return t&&z.createElement(GD.Provider,{value:e},t)}function YD(){let{matches:e}=z.useContext(Vr),t=e[e.length-1];return t?t.params:{}}function I0(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=z.useContext(wi),{matches:i}=z.useContext(Vr),{pathname:o}=Rs(),s=JSON.stringify(_2(i,r.v7_relativeSplatPath));return z.useMemo(()=>x2(e,JSON.parse(s),o,n==="path"),[e,s,o,n])}function QD(e,t){return XD(e,t)}function XD(e,t,n,r){Sl()||tt(!1);let{navigator:i}=z.useContext(wi),{matches:o}=z.useContext(Vr),s=o[o.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Rs(),c;if(t){var d;let _=typeof t=="string"?xl(t):t;l==="/"||(d=_.pathname)!=null&&d.startsWith(l)||tt(!1),c=_}else c=u;let f=c.pathname||"/",h=f;if(l!=="/"){let _=l.replace(/^\//,"").split("/");h="/"+f.replace(/^\//,"").split("/").slice(_.length).join("/")}let g=ED(e,{pathname:h}),y=nj(g&&g.map(_=>Object.assign({},_,{params:Object.assign({},a,_.params),pathname:lo([l,i.encodeLocation?i.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:lo([l,i.encodeLocation?i.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),o,n,r);return t&&y?z.createElement(O0.Provider,{value:{location:lc({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Xi.Pop}},y):y}function ZD(){let e=sj(),t=BD(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},t),n?z.createElement("pre",{style:i},n):null,null)}const JD=z.createElement(ZD,null);class ej extends z.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,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?z.createElement(Vr.Provider,{value:this.props.routeContext},z.createElement(PR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function tj(e){let{routeContext:t,match:n,children:r}=e,i=z.useContext(L0);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),z.createElement(Vr.Provider,{value:t},r)}function nj(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var o;if((o=n)!=null&&o.errors)e=n.matches;else return null}let s=e,a=(i=n)==null?void 0:i.errors;if(a!=null){let c=s.findIndex(d=>d.route.id&&(a==null?void 0:a[d.route.id]));c>=0||tt(!1),s=s.slice(0,Math.min(s.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((c,d,f)=>{let h,g=!1,y=null,_=null;n&&(h=a&&d.route.id?a[d.route.id]:void 0,y=d.route.errorElement||JD,l&&(u<0&&f===0?(lj("route-fallback",!1),g=!0,_=null):u===f&&(g=!0,_=d.route.hydrateFallbackElement||null)));let m=t.concat(s.slice(0,f+1)),p=()=>{let v;return h?v=y:g?v=_:d.route.Component?v=z.createElement(d.route.Component,null):d.route.element?v=d.route.element:v=c,z.createElement(tj,{match:d,routeContext:{outlet:c,matches:m,isDataRoute:n!=null},children:v})};return n&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?z.createElement(ej,{location:n.location,revalidation:n.revalidation,component:y,error:h,children:p(),routeContext:{outlet:null,matches:m,isDataRoute:!0}}):p()},null)}var DR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(DR||{}),ph=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ph||{});function rj(e){let t=z.useContext(L0);return t||tt(!1),t}function ij(e){let t=z.useContext(OR);return t||tt(!1),t}function oj(e){let t=z.useContext(Vr);return t||tt(!1),t}function jR(e){let t=oj(),n=t.matches[t.matches.length-1];return n.route.id||tt(!1),n.route.id}function sj(){var e;let t=z.useContext(PR),n=ij(ph.UseRouteError),r=jR(ph.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function aj(){let{router:e}=rj(DR.UseNavigateStable),t=jR(ph.UseNavigateStable),n=z.useRef(!1);return IR(()=>{n.current=!0}),z.useCallback(function(i,o){o===void 0&&(o={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,lc({fromRouteId:t},o)))},[e,t])}const hS={};function lj(e,t,n){!t&&!hS[e]&&(hS[e]=!0)}function uj(e){let{to:t,replace:n,state:r,relative:i}=e;Sl()||tt(!1);let{future:o,static:s}=z.useContext(wi),{matches:a}=z.useContext(Vr),{pathname:l}=Rs(),u=P0(),c=x2(t,_2(a,o.v7_relativeSplatPath),l,i==="path"),d=JSON.stringify(c);return z.useEffect(()=>u(JSON.parse(d),{replace:n,state:r,relative:i}),[u,d,i,n,r]),null}function cj(e){return KD(e.context)}function Lo(e){tt(!1)}function dj(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Xi.Pop,navigator:o,static:s=!1,future:a}=e;Sl()&&tt(!1);let l=t.replace(/^\/*/,"/"),u=z.useMemo(()=>({basename:l,navigator:o,static:s,future:lc({v7_relativeSplatPath:!1},a)}),[l,a,o,s]);typeof r=="string"&&(r=xl(r));let{pathname:c="/",search:d="",hash:f="",state:h=null,key:g="default"}=r,y=z.useMemo(()=>{let _=tl(c,l);return _==null?null:{location:{pathname:_,search:d,hash:f,state:h,key:g},navigationType:i}},[l,c,d,f,h,g,i]);return y==null?null:z.createElement(wi.Provider,{value:u},z.createElement(O0.Provider,{children:n,value:y}))}function fj(e){let{children:t,location:n}=e;return QD(Iy(t),n)}new Promise(()=>{});function Iy(e,t){t===void 0&&(t=[]);let n=[];return z.Children.forEach(e,(r,i)=>{if(!z.isValidElement(r))return;let o=[...t,i];if(r.type===z.Fragment){n.push.apply(n,Iy(r.props.children,o));return}r.type!==Lo&&tt(!1),!r.props.index||!r.props.children||tt(!1);let s={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(s.children=Iy(r.props.children,o)),n.push(s)}),n}/** + * React Router DOM v6.22.3 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */function gh(){return gh=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function hj(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pj(e,t){return e.button===0&&(!t||t==="_self")&&!hj(e)}const gj=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],mj=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],yj="6";try{window.__reactRouterVersion=yj}catch{}const vj=z.createContext({isTransitioning:!1}),_j="startTransition",pS=lO[_j];function xj(e){let{basename:t,children:n,future:r,window:i}=e,o=z.useRef();o.current==null&&(o.current=SD({window:i,v5Compat:!0}));let s=o.current,[a,l]=z.useState({action:s.action,location:s.location}),{v7_startTransition:u}=r||{},c=z.useCallback(d=>{u&&pS?pS(()=>l(d)):l(d)},[l,u]);return z.useLayoutEffect(()=>s.listen(c),[s,c]),z.createElement(dj,{basename:t,children:n,location:a.location,navigationType:a.action,navigator:s,future:r})}const Sj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",wj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,UR=z.forwardRef(function(t,n){let{onClick:r,relative:i,reloadDocument:o,replace:s,state:a,target:l,to:u,preventScrollReset:c,unstable_viewTransition:d}=t,f=FR(t,gj),{basename:h}=z.useContext(wi),g,y=!1;if(typeof u=="string"&&wj.test(u)&&(g=u,Sj))try{let v=new URL(window.location.href),x=u.startsWith("//")?new URL(v.protocol+u):new URL(u),S=tl(x.pathname,h);x.origin===v.origin&&S!=null?u=S+x.search+x.hash:y=!0}catch{}let _=WD(u,{relative:i}),m=Ej(u,{replace:s,state:a,target:l,preventScrollReset:c,relative:i,unstable_viewTransition:d});function p(v){r&&r(v),v.defaultPrevented||m(v)}return z.createElement("a",gh({},f,{href:g||_,onClick:y||o?r:p,ref:n,target:l}))}),bf=z.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:i=!1,className:o="",end:s=!1,style:a,to:l,unstable_viewTransition:u,children:c}=t,d=FR(t,mj),f=I0(l,{relative:d.relative}),h=Rs(),g=z.useContext(OR),{navigator:y,basename:_}=z.useContext(wi),m=g!=null&&Cj(f)&&u===!0,p=y.encodeLocation?y.encodeLocation(f).pathname:f.pathname,v=h.pathname,x=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;i||(v=v.toLowerCase(),x=x?x.toLowerCase():null,p=p.toLowerCase()),x&&_&&(x=tl(x,_)||x);const S=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let w=v===p||!s&&v.startsWith(p)&&v.charAt(S)==="/",E=x!=null&&(x===p||!s&&x.startsWith(p)&&x.charAt(p.length)==="/"),C={isActive:w,isPending:E,isTransitioning:m},T=w?r:void 0,A;typeof o=="function"?A=o(C):A=[o,w?"active":null,E?"pending":null,m?"transitioning":null].filter(Boolean).join(" ");let M=typeof a=="function"?a(C):a;return z.createElement(UR,gh({},d,{"aria-current":T,className:A,ref:n,style:M,to:l,unstable_viewTransition:u}),typeof c=="function"?c(C):c)});var Dy;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Dy||(Dy={}));var gS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(gS||(gS={}));function bj(e){let t=z.useContext(L0);return t||tt(!1),t}function Ej(e,t){let{target:n,replace:r,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a}=t===void 0?{}:t,l=P0(),u=Rs(),c=I0(e,{relative:s});return z.useCallback(d=>{if(pj(d,n)){d.preventDefault();let f=r!==void 0?r:hh(u)===hh(c);l(e,{replace:f,state:i,preventScrollReset:o,relative:s,unstable_viewTransition:a})}},[u,l,c,r,i,n,e,o,s,a])}function Cj(e,t){t===void 0&&(t={});let n=z.useContext(vj);n==null&&tt(!1);let{basename:r}=bj(Dy.useViewTransitionState),i=I0(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=tl(n.currentLocation.pathname,r)||n.currentLocation.pathname,s=tl(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Py(i.pathname,s)!=null||Py(i.pathname,o)!=null}var VR={};function Aj(e){const t=new Error(e);if(t.stack===void 0)try{throw t}catch{}return t}var Rj=Aj,Ae=Rj;function $j(e){return!!e&&typeof e.then=="function"}var Ge=$j;function Tj(e,t){if(e!=null)return e;throw Ae(t??"Got unexpected null or undefined")}var Ze=Tj;function Ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class D0{getValue(){throw Ae("BaseLoadable")}toPromise(){throw Ae("BaseLoadable")}valueMaybe(){throw Ae("BaseLoadable")}valueOrThrow(){throw Ae(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw Ae("BaseLoadable")}promiseOrThrow(){throw Ae(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw Ae("BaseLoadable")}errorOrThrow(){throw Ae(`Loadable expected error, but in "${this.state}" state`)}is(t){return t.state===this.state&&t.contents===this.contents}map(t){throw Ae("BaseLoadable")}}class kj extends D0{constructor(t){super(),Ce(this,"state","hasValue"),Ce(this,"contents",void 0),this.contents=t}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(t){try{const n=t(this.contents);return Ge(n)?vs(n):nl(n)?n:qc(n)}catch(n){return Ge(n)?vs(n.next(()=>this.map(t))):j0(n)}}}class Mj extends D0{constructor(t){super(),Ce(this,"state","hasError"),Ce(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(t){return this}}class zR extends D0{constructor(t){super(),Ce(this,"state","loading"),Ce(this,"contents",void 0),this.contents=t}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(t){return vs(this.contents.then(n=>{const r=t(n);if(nl(r)){const i=r;switch(i.state){case"hasValue":return i.contents;case"hasError":throw i.contents;case"loading":return i.contents}}return r}).catch(n=>{if(Ge(n))return n.then(()=>this.map(t).contents);throw n}))}}function qc(e){return Object.freeze(new kj(e))}function j0(e){return Object.freeze(new Mj(e))}function vs(e){return Object.freeze(new zR(e))}function BR(){return Object.freeze(new zR(new Promise(()=>{})))}function Nj(e){return e.every(t=>t.state==="hasValue")?qc(e.map(t=>t.contents)):e.some(t=>t.state==="hasError")?j0(Ze(e.find(t=>t.state==="hasError"),"Invalid loadable passed to loadableAll").contents):vs(Promise.all(e.map(t=>t.contents)))}function HR(e){const n=(Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(i=>e[i])).map(i=>nl(i)?i:Ge(i)?vs(i):qc(i)),r=Nj(n);return Array.isArray(e)?r:r.map(i=>Object.getOwnPropertyNames(e).reduce((o,s,a)=>({...o,[s]:i[a]}),{}))}function nl(e){return e instanceof D0}const Lj={of:e=>Ge(e)?vs(e):nl(e)?e:qc(e),error:e=>j0(e),loading:()=>BR(),all:HR,isLoadable:nl};var $s={loadableWithValue:qc,loadableWithError:j0,loadableWithPromise:vs,loadableLoading:BR,loadableAll:HR,isLoadable:nl,RecoilLoadable:Lj},Oj=$s.loadableWithValue,Pj=$s.loadableWithError,Ij=$s.loadableWithPromise,Dj=$s.loadableLoading,jj=$s.loadableAll,Fj=$s.isLoadable,Uj=$s.RecoilLoadable,Gc=Object.freeze({__proto__:null,loadableWithValue:Oj,loadableWithError:Pj,loadableWithPromise:Ij,loadableLoading:Dj,loadableAll:jj,isLoadable:Fj,RecoilLoadable:Uj});const jy={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0,RECOIL_GKS_ENABLED:new Set(["recoil_hamt_2020","recoil_sync_external_store","recoil_suppress_rerender_in_callback","recoil_memory_managament_2020"])};function Vj(e,t){var n,r;const i=(n=VR[e])===null||n===void 0||(r=n.toLowerCase())===null||r===void 0?void 0:r.trim();if(i==null||i==="")return;if(!["true","false"].includes(i))throw Ae(`process.env.${e} value must be 'true', 'false', or empty: ${i}`);t(i==="true")}function zj(e,t){var n;const r=(n=VR[e])===null||n===void 0?void 0:n.trim();r==null||r===""||t(r.split(/\s*,\s*|\s+/))}function Bj(){var e;typeof process>"u"||((e=process)===null||e===void 0?void 0:e.env)!=null&&(Vj("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",t=>{jy.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=t}),zj("RECOIL_GKS_ENABLED",t=>{t.forEach(n=>{jy.RECOIL_GKS_ENABLED.add(n)})}))}Bj();var wl=jy;function F0(e){return wl.RECOIL_GKS_ENABLED.has(e)}F0.setPass=e=>{wl.RECOIL_GKS_ENABLED.add(e)};F0.setFail=e=>{wl.RECOIL_GKS_ENABLED.delete(e)};F0.clear=()=>{wl.RECOIL_GKS_ENABLED.clear()};var Ve=F0;function Hj(e,t,{error:n}={}){return null}var Wj=Hj,S2=Wj,xg,Sg,wg;const qj=(xg=b.createMutableSource)!==null&&xg!==void 0?xg:b.unstable_createMutableSource,WR=(Sg=b.useMutableSource)!==null&&Sg!==void 0?Sg:b.unstable_useMutableSource,qR=(wg=b.useSyncExternalStore)!==null&&wg!==void 0?wg:b.unstable_useSyncExternalStore;function Gj(){var e;const{ReactCurrentDispatcher:t,ReactCurrentOwner:n}=b.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;return((e=t==null?void 0:t.current)!==null&&e!==void 0?e:n.currentDispatcher).useSyncExternalStore!=null}function Kj(){return Ve("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:Ve("recoil_sync_external_store")&&qR!=null?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:Ve("recoil_mutable_source")&&WR!=null&&typeof window<"u"&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?Ve("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:Ve("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}}function Yj(){return!1}var Kc={createMutableSource:qj,useMutableSource:WR,useSyncExternalStore:qR,currentRendererSupportsUseSyncExternalStore:Gj,reactMode:Kj,isFastRefreshEnabled:Yj};class w2{constructor(t){Ce(this,"key",void 0),this.key=t}toJSON(){return{key:this.key}}}class GR extends w2{}class KR extends w2{}function Qj(e){return e instanceof GR||e instanceof KR}var U0={AbstractRecoilValue:w2,RecoilState:GR,RecoilValueReadOnly:KR,isRecoilValue:Qj},Xj=U0.AbstractRecoilValue,Zj=U0.RecoilState,Jj=U0.RecoilValueReadOnly,eF=U0.isRecoilValue,rl=Object.freeze({__proto__:null,AbstractRecoilValue:Xj,RecoilState:Zj,RecoilValueReadOnly:Jj,isRecoilValue:eF});function tF(e,t){return function*(){let n=0;for(const r of e)yield t(r,n++)}()}var V0=tF;class YR{}const nF=new YR,_s=new Map,b2=new Map;function rF(e){return V0(e,t=>Ze(b2.get(t)))}function iF(e){if(_s.has(e)){const t=`Duplicate atom key "${e}". This is a FATAL ERROR in + production. But it is safe to ignore this warning if it occurred because of + hot module replacement.`;console.warn(t)}}function oF(e){wl.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&iF(e.key),_s.set(e.key,e);const t=e.set==null?new rl.RecoilValueReadOnly(e.key):new rl.RecoilState(e.key);return b2.set(e.key,t),t}class QR extends Error{}function sF(e){const t=_s.get(e);if(t==null)throw new QR(`Missing definition for RecoilValue: "${e}""`);return t}function aF(e){return _s.get(e)}const mh=new Map;function lF(e){var t;if(!Ve("recoil_memory_managament_2020"))return;const n=_s.get(e);if(n!=null&&(t=n.shouldDeleteConfigOnRelease)!==null&&t!==void 0&&t.call(n)){var r;_s.delete(e),(r=XR(e))===null||r===void 0||r(),mh.delete(e)}}function uF(e,t){Ve("recoil_memory_managament_2020")&&(t===void 0?mh.delete(e):mh.set(e,t))}function XR(e){return mh.get(e)}var yn={nodes:_s,recoilValues:b2,registerNode:oF,getNode:sF,getNodeMaybe:aF,deleteNodeConfigIfPossible:lF,setConfigDeletionHandler:uF,getConfigDeletionHandler:XR,recoilValuesForKeys:rF,NodeMissingError:QR,DefaultValue:YR,DEFAULT_VALUE:nF};function cF(e,t){t()}var dF={enqueueExecution:cF};function fF(e,t){return t={exports:{}},e(t,t.exports),t.exports}var hF=fF(function(e){var t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(j){return typeof j}:function(j){return j&&typeof Symbol=="function"&&j.constructor===Symbol&&j!==Symbol.prototype?"symbol":typeof j},n={},r=5,i=Math.pow(2,r),o=i-1,s=i/2,a=i/4,l={},u=function(I){return function(){return I}},c=n.hash=function(j){var I=typeof j>"u"?"undefined":t(j);if(I==="number")return j;I!=="string"&&(j+="");for(var Z=0,se=0,ae=j.length;se>1&1431655765,I=(I&858993459)+(I>>2&858993459),I=I+(I>>4)&252645135,I+=I>>8,I+=I>>16,I&127},f=function(I,Z){return Z>>>I&o},h=function(I){return 1<=Z;)ae[Se--]=ae[Se];return ae[Z]=se,ae}for(var ye=0,ve=0,Re=new Array(fe+1);ye>>=1;return Se[Z]=se,M(I,ve+1,Se)},D=function(I,Z,se,ae){for(var fe=new Array(Z-1),Se=0,ye=0,ve=0,Re=ae.length;ve1?T(I,this.hash,Re):Re[0]}var Qe=ae();return Qe===l?this:(++ye.value,P(I,se,this.hash,this,fe,C(I,fe,Se,Qe)))},q=function(I,Z,se,ae,fe,Se,ye){var ve=this.mask,Re=this.children,Qe=f(se,fe),tn=h(Qe),bt=g(ve,tn),Pn=ve&tn,tr=Pn?Re[bt]:w,Vs=tr._modify(I,Z,se+r,ae,fe,Se,ye);if(tr===Vs)return this;var xd=Q(I,this),Ul=ve,Vl=void 0;if(Pn&&E(Vs)){if(Ul&=~tn,!Ul)return w;if(Re.length<=2&&R(Re[bt^1]))return Re[bt^1];Vl=_(xd,bt,Re)}else if(!Pn&&!E(Vs)){if(Re.length>=s)return k(I,Qe,Vs,ve,Re);Ul|=tn,Vl=m(xd,bt,Vs,Re)}else Vl=y(xd,bt,Vs,Re);return xd?(this.mask=Ul,this.children=Vl,this):A(I,Ul,Vl)},X=function(I,Z,se,ae,fe,Se,ye){var ve=this.size,Re=this.children,Qe=f(se,fe),tn=Re[Qe],bt=(tn||w)._modify(I,Z,se+r,ae,fe,Se,ye);if(tn===bt)return this;var Pn=Q(I,this),tr=void 0;if(E(tn)&&!E(bt))++ve,tr=y(Pn,Qe,bt,Re);else if(!E(tn)&&E(bt)){if(--ve,ve<=a)return D(I,ve,Qe,Re);tr=y(Pn,Qe,w,Re)}else tr=y(Pn,Qe,bt,Re);return Pn?(this.size=ve,this.children=tr,this):M(I,ve,tr)};w._modify=function(j,I,Z,se,ae,fe,Se){var ye=se();return ye===l?w:(++Se.value,C(j,ae,fe,ye))};function N(j,I,Z,se,ae){this._editable=j,this._edit=I,this._config=Z,this._root=se,this._size=ae}N.prototype.setTree=function(j,I){return this._editable?(this._root=j,this._size=I,this):j===this._root?this:new N(this._editable,this._edit,this._config,j,I)};var B=n.tryGetHash=function(j,I,Z,se){for(var ae=se._root,fe=0,Se=se._config.keyEq;;)switch(ae.type){case p:return Se(Z,ae.key)?ae.value:j;case v:{if(I===ae.hash)for(var ye=ae.children,ve=0,Re=ye.length;ve{n.set(i,t(r,i))}),n}var yh=_F;function xF(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}}function SF(e){return{nodeDeps:yh(e.nodeDeps,t=>new Set(t)),nodeToNodeSubscriptions:yh(e.nodeToNodeSubscriptions,t=>new Set(t))}}function bg(e,t,n,r){const{nodeDeps:i,nodeToNodeSubscriptions:o}=n,s=i.get(e);if(s&&r&&s!==r.nodeDeps.get(e))return;i.set(e,t);const a=s==null?t:Lu(t,s);for(const l of a)o.has(l)||o.set(l,new Set),Ze(o.get(l)).add(e);if(s){const l=Lu(s,t);for(const u of l){if(!o.has(u))return;const c=Ze(o.get(u));c.delete(e),c.size===0&&o.delete(u)}}}function wF(e,t,n,r){var i,o,s,a;const l=n.getState();r===l.currentTree.version||r===((i=l.nextTree)===null||i===void 0?void 0:i.version)||((o=l.previousTree)===null||o===void 0||o.version);const u=n.getGraph(r);if(bg(e,t,u),r===((s=l.previousTree)===null||s===void 0?void 0:s.version)){const d=n.getGraph(l.currentTree.version);bg(e,t,d,u)}if(r===((a=l.previousTree)===null||a===void 0?void 0:a.version)||r===l.currentTree.version){var c;const d=(c=l.nextTree)===null||c===void 0?void 0:c.version;if(d!==void 0){const f=n.getGraph(d);bg(e,t,f,u)}}}var Yc={cloneGraph:SF,graph:xF,saveDepsToStore:wF};let bF=0;const EF=()=>bF++;let CF=0;const AF=()=>CF++;let RF=0;const $F=()=>RF++;var z0={getNextTreeStateVersion:EF,getNextStoreID:AF,getNextComponentID:$F};const{persistentMap:mS}=yF,{graph:TF}=Yc,{getNextTreeStateVersion:ZR}=z0;function JR(){const e=ZR();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:mS(),nonvalidatedAtoms:mS()}}function kF(){const e=JR();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,TF()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}}var e$={makeEmptyTreeState:JR,makeEmptyStoreState:kF,getNextTreeStateVersion:ZR};class t${}function MF(){return new t$}var B0={RetentionZone:t$,retentionZone:MF};function NF(e,t){const n=new Set(e);return n.add(t),n}function LF(e,t){const n=new Set(e);return n.delete(t),n}function OF(e,t,n){const r=new Map(e);return r.set(t,n),r}function PF(e,t,n){const r=new Map(e);return r.set(t,n(r.get(t))),r}function IF(e,t){const n=new Map(e);return n.delete(t),n}function DF(e,t){const n=new Map(e);return t.forEach(r=>n.delete(r)),n}var n$={setByAddingToSet:NF,setByDeletingFromSet:LF,mapBySettingInMap:OF,mapByUpdatingInMap:PF,mapByDeletingFromMap:IF,mapByDeletingMultipleFromMap:DF};function*jF(e,t){let n=0;for(const r of e)t(r,n++)&&(yield r)}var A2=jF;function FF(e,t){return new Proxy(e,{get:(r,i)=>(!(i in r)&&i in t&&(r[i]=t[i]()),r[i]),ownKeys:r=>Object.keys(r)})}var r$=FF;const{getNode:Qc,getNodeMaybe:UF,recoilValuesForKeys:yS}=yn,{RetentionZone:vS}=B0,{setByAddingToSet:VF}=n$,zF=Object.freeze(new Set);class BF extends Error{}function HF(e,t,n){if(!Ve("recoil_memory_managament_2020"))return()=>{};const{nodesRetainedByZone:r}=e.getState().retention;function i(o){let s=r.get(o);s||r.set(o,s=new Set),s.add(t)}if(n instanceof vS)i(n);else if(Array.isArray(n))for(const o of n)i(o);return()=>{if(!Ve("recoil_memory_managament_2020"))return;const{retention:o}=e.getState();function s(a){const l=o.nodesRetainedByZone.get(a);l==null||l.delete(t),l&&l.size===0&&o.nodesRetainedByZone.delete(a)}if(n instanceof vS)s(n);else if(Array.isArray(n))for(const a of n)s(a)}}function R2(e,t,n,r){const i=e.getState();if(i.nodeCleanupFunctions.has(n))return;const o=Qc(n),s=HF(e,n,o.retainedBy),a=o.init(e,t,r);i.nodeCleanupFunctions.set(n,()=>{a(),s()})}function WF(e,t,n){R2(e,e.getState().currentTree,t,n)}function qF(e,t){var n;const r=e.getState();(n=r.nodeCleanupFunctions.get(t))===null||n===void 0||n(),r.nodeCleanupFunctions.delete(t)}function GF(e,t,n){return R2(e,t,n,"get"),Qc(n).get(e,t)}function i$(e,t,n){return Qc(n).peek(e,t)}function KF(e,t,n){var r;const i=UF(t);return i==null||(r=i.invalidate)===null||r===void 0||r.call(i,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,n),dirtyAtoms:VF(e.dirtyAtoms,t)}}function YF(e,t,n,r){const i=Qc(n);if(i.set==null)throw new BF(`Attempt to set read-only RecoilValue: ${n}`);const o=i.set;return R2(e,t,n,"set"),o(e,t,r)}function QF(e,t,n){const r=e.getState(),i=e.getGraph(t.version),o=Qc(n).nodeType;return r$({type:o},{loadable:()=>i$(e,t,n),isActive:()=>r.knownAtoms.has(n)||r.knownSelectors.has(n),isSet:()=>o==="selector"?!1:t.atomValues.has(n),isModified:()=>t.dirtyAtoms.has(n),deps:()=>{var s;return yS((s=i.nodeDeps.get(n))!==null&&s!==void 0?s:[])},subscribers:()=>{var s,a;return{nodes:yS(A2(o$(e,t,new Set([n])),l=>l!==n)),components:V0((s=(a=r.nodeToComponentSubscriptions.get(n))===null||a===void 0?void 0:a.values())!==null&&s!==void 0?s:[],([l])=>({name:l}))}}})}function o$(e,t,n){const r=new Set,i=Array.from(n),o=e.getGraph(t.version);for(let a=i.pop();a;a=i.pop()){var s;r.add(a);const l=(s=o.nodeToNodeSubscriptions.get(a))!==null&&s!==void 0?s:zF;for(const u of l)r.has(u)||i.push(u)}return r}var Eo={getNodeLoadable:GF,peekNodeLoadable:i$,setNodeValue:YF,initializeNode:WF,cleanUpNode:qF,setUnvalidatedAtomValue_DEPRECATED:KF,peekNodeInfo:QF,getDownstreamNodes:o$};let s$=null;function XF(e){s$=e}function ZF(){var e;(e=s$)===null||e===void 0||e()}var a$={setInvalidateMemoizedSnapshot:XF,invalidateMemoizedSnapshot:ZF};const{getDownstreamNodes:JF,getNodeLoadable:l$,setNodeValue:e8}=Eo,{getNextComponentID:t8}=z0,{getNode:n8,getNodeMaybe:u$}=yn,{DefaultValue:$2}=yn,{reactMode:r8}=Kc,{AbstractRecoilValue:i8,RecoilState:o8,RecoilValueReadOnly:s8,isRecoilValue:a8}=rl,{invalidateMemoizedSnapshot:l8}=a$;function u8(e,{key:t},n=e.getState().currentTree){var r,i;const o=e.getState();n.version===o.currentTree.version||n.version===((r=o.nextTree)===null||r===void 0?void 0:r.version)||(n.version,(i=o.previousTree)===null||i===void 0||i.version);const s=l$(e,n,t);return s.state==="loading"&&s.contents.catch(()=>{}),s}function c8(e,t){const n=e.clone();return t.forEach((r,i)=>{r.state==="hasValue"&&r.contents instanceof $2?n.delete(i):n.set(i,r)}),n}function d8(e,t,{key:n},r){if(typeof r=="function"){const i=l$(e,t,n);if(i.state==="loading"){const o=`Tried to set atom or selector "${n}" using an updater function while the current state is pending, this is not currently supported.`;throw Ae(o)}else if(i.state==="hasError")throw i.contents;return r(i.contents)}else return r}function f8(e,t,n){if(n.type==="set"){const{recoilValue:i,valueOrUpdater:o}=n,s=d8(e,t,i,o),a=e8(e,t,i.key,s);for(const[l,u]of a.entries())Fy(t,l,u)}else if(n.type==="setLoadable"){const{recoilValue:{key:i},loadable:o}=n;Fy(t,i,o)}else if(n.type==="markModified"){const{recoilValue:{key:i}}=n;t.dirtyAtoms.add(i)}else if(n.type==="setUnvalidated"){var r;const{recoilValue:{key:i},unvalidatedValue:o}=n,s=u$(i);s==null||(r=s.invalidate)===null||r===void 0||r.call(s,t),t.atomValues.delete(i),t.nonvalidatedAtoms.set(i,o),t.dirtyAtoms.add(i)}else S2(`Unknown action ${n.type}`)}function Fy(e,t,n){n.state==="hasValue"&&n.contents instanceof $2?e.atomValues.delete(t):e.atomValues.set(t,n),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function c$(e,t){e.replaceState(n=>{const r=d$(n);for(const i of t)f8(e,r,i);return f$(e,r),l8(),r})}function H0(e,t){if(Ou.length){const n=Ou[Ou.length-1];let r=n.get(e);r||n.set(e,r=[]),r.push(t)}else c$(e,[t])}const Ou=[];function h8(){const e=new Map;return Ou.push(e),()=>{for(const[t,n]of e)c$(t,n);Ou.pop()}}function d$(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function f$(e,t){const n=JF(e,t,t.dirtyAtoms);for(const o of n){var r,i;(r=u$(o))===null||r===void 0||(i=r.invalidate)===null||i===void 0||i.call(r,t)}}function h$(e,t,n){H0(e,{type:"set",recoilValue:t,valueOrUpdater:n})}function p8(e,t,n){if(n instanceof $2)return h$(e,t,n);H0(e,{type:"setLoadable",recoilValue:t,loadable:n})}function g8(e,t){H0(e,{type:"markModified",recoilValue:t})}function m8(e,t,n){H0(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:n})}function y8(e,{key:t},n,r=null){const i=t8(),o=e.getState();o.nodeToComponentSubscriptions.has(t)||o.nodeToComponentSubscriptions.set(t,new Map),Ze(o.nodeToComponentSubscriptions.get(t)).set(i,[r??"",n]);const s=r8();if(s.early&&(s.mode==="LEGACY"||s.mode==="MUTABLE_SOURCE")){const a=e.getState().nextTree;a&&a.dirtyAtoms.has(t)&&n(a)}return{release:()=>{const a=e.getState(),l=a.nodeToComponentSubscriptions.get(t);l===void 0||!l.has(i)||(l.delete(i),l.size===0&&a.nodeToComponentSubscriptions.delete(t))}}}function v8(e,t){var n;const{currentTree:r}=e.getState(),i=n8(t.key);(n=i.clearCache)===null||n===void 0||n.call(i,e,r)}var zr={RecoilValueReadOnly:s8,AbstractRecoilValue:i8,RecoilState:o8,getRecoilValueAsLoadable:u8,setRecoilValue:h$,setRecoilValueLoadable:p8,markRecoilValueModified:g8,setUnvalidatedRecoilValue:m8,subscribeToRecoilValue:y8,isRecoilValue:a8,applyAtomValueWrites:c8,batchStart:h8,writeLoadableToTreeState:Fy,invalidateDownstreams:f$,copyTreeState:d$,refreshRecoilValue:v8};function _8(e,t,n){const r=e.entries();let i=r.next();for(;!i.done;){const o=i.value;if(t.call(n,o[1],o[0],e))return!0;i=r.next()}return!1}var x8=_8;const{cleanUpNode:S8}=Eo,{deleteNodeConfigIfPossible:w8,getNode:p$}=yn,{RetentionZone:g$}=B0,b8=12e4,m$=new Set;function y$(e,t){const n=e.getState(),r=n.currentTree;if(n.nextTree)return;const i=new Set;for(const s of t)if(s instanceof g$)for(const a of R8(n,s))i.add(a);else i.add(s);const o=E8(e,i);for(const s of o)A8(e,r,s)}function E8(e,t){const n=e.getState(),r=n.currentTree,i=e.getGraph(r.version),o=new Set,s=new Set;return a(t),o;function a(l){const u=new Set,c=C8(e,r,l,o,s);for(const g of c){var d;if(p$(g).retainedBy==="recoilRoot"){s.add(g);continue}if(((d=n.retention.referenceCounts.get(g))!==null&&d!==void 0?d:0)>0){s.add(g);continue}if(v$(g).some(_=>n.retention.referenceCounts.get(_))){s.add(g);continue}const y=i.nodeToNodeSubscriptions.get(g);if(y&&x8(y,_=>s.has(_))){s.add(g);continue}o.add(g),u.add(g)}const f=new Set;for(const g of u)for(const y of(h=i.nodeDeps.get(g))!==null&&h!==void 0?h:m$){var h;o.has(y)||f.add(y)}f.size&&a(f)}}function C8(e,t,n,r,i){const o=e.getGraph(t.version),s=[],a=new Set;for(;n.size>0;)l(Ze(n.values().next().value));return s;function l(u){if(r.has(u)||i.has(u)){n.delete(u);return}if(a.has(u))return;const c=o.nodeToNodeSubscriptions.get(u);if(c)for(const d of c)l(d);a.add(u),n.delete(u),s.push(u)}}function A8(e,t,n){if(!Ve("recoil_memory_managament_2020"))return;S8(e,n);const r=e.getState();r.knownAtoms.delete(n),r.knownSelectors.delete(n),r.nodeTransactionSubscriptions.delete(n),r.retention.referenceCounts.delete(n);const i=v$(n);for(const l of i){var o;(o=r.retention.nodesRetainedByZone.get(l))===null||o===void 0||o.delete(n)}t.atomValues.delete(n),t.dirtyAtoms.delete(n),t.nonvalidatedAtoms.delete(n);const s=r.graphsByVersion.get(t.version);if(s){const l=s.nodeDeps.get(n);if(l!==void 0){s.nodeDeps.delete(n);for(const u of l){var a;(a=s.nodeToNodeSubscriptions.get(u))===null||a===void 0||a.delete(n)}}s.nodeToNodeSubscriptions.delete(n)}w8(n)}function R8(e,t){var n;return(n=e.retention.nodesRetainedByZone.get(t))!==null&&n!==void 0?n:m$}function v$(e){const t=p$(e).retainedBy;return t===void 0||t==="components"||t==="recoilRoot"?[]:t instanceof g$?[t]:t}function $8(e,t){const n=e.getState();n.nextTree?n.retention.retainablesToCheckForRelease.add(t):y$(e,new Set([t]))}function T8(e,t,n){var r;if(!Ve("recoil_memory_managament_2020"))return;const i=e.getState().retention.referenceCounts,o=((r=i.get(t))!==null&&r!==void 0?r:0)+n;o===0?_$(e,t):i.set(t,o)}function _$(e,t){if(!Ve("recoil_memory_managament_2020"))return;e.getState().retention.referenceCounts.delete(t),$8(e,t)}function k8(e){if(!Ve("recoil_memory_managament_2020"))return;const t=e.getState();y$(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()}function M8(e){return e===void 0?"recoilRoot":e}var Ts={SUSPENSE_TIMEOUT_MS:b8,updateRetainCount:T8,updateRetainCountToZero:_$,releaseScheduledRetainablesNow:k8,retainedByOptionWithDefault:M8};const{unstable_batchedUpdates:N8}=vI;var L8={unstable_batchedUpdates:N8};const{unstable_batchedUpdates:O8}=L8;var P8={unstable_batchedUpdates:O8};const{batchStart:I8}=zr,{unstable_batchedUpdates:D8}=P8;let T2=D8||(e=>e());const j8=e=>{T2=e},F8=()=>T2,U8=e=>{T2(()=>{let t=()=>{};try{t=I8(),e()}finally{t()}})};var W0={getBatcher:F8,setBatcher:j8,batchUpdates:U8};function*V8(e){for(const t of e)for(const n of t)yield n}var x$=V8;const S$=typeof Window>"u"||typeof window>"u",z8=e=>!S$&&(e===window||e instanceof Window),B8=typeof navigator<"u"&&navigator.product==="ReactNative";var q0={isSSR:S$,isReactNative:B8,isWindow:z8};function H8(e,t){let n;return(...r)=>{n||(n={});const i=t(...r);return Object.hasOwnProperty.call(n,i)||(n[i]=e(...r)),n[i]}}function W8(e,t){let n,r;return(...i)=>{const o=t(...i);return n===o||(n=o,r=e(...i)),r}}function q8(e,t){let n,r;return[(...s)=>{const a=t(...s);return n===a||(n=a,r=e(...s)),r},()=>{n=null}]}var G8={memoizeWithArgsHash:H8,memoizeOneWithArgsHash:W8,memoizeOneWithArgsHashAndInvalidation:q8};const{batchUpdates:Uy}=W0,{initializeNode:K8,peekNodeInfo:Y8}=Eo,{graph:Q8}=Yc,{getNextStoreID:X8}=z0,{DEFAULT_VALUE:Z8,recoilValues:_S,recoilValuesForKeys:xS}=yn,{AbstractRecoilValue:J8,getRecoilValueAsLoadable:e9,setRecoilValue:SS,setUnvalidatedRecoilValue:t9}=zr,{updateRetainCount:Ef}=Ts,{setInvalidateMemoizedSnapshot:n9}=a$,{getNextTreeStateVersion:r9,makeEmptyStoreState:i9}=e$,{isSSR:o9}=q0,{memoizeOneWithArgsHashAndInvalidation:s9}=G8;class G0{constructor(t,n){Ce(this,"_store",void 0),Ce(this,"_refCount",1),Ce(this,"getLoadable",r=>(this.checkRefCount_INTERNAL(),e9(this._store,r))),Ce(this,"getPromise",r=>(this.checkRefCount_INTERNAL(),this.getLoadable(r).toPromise())),Ce(this,"getNodes_UNSTABLE",r=>{if(this.checkRefCount_INTERNAL(),(r==null?void 0:r.isModified)===!0){if((r==null?void 0:r.isInitialized)===!1)return[];const s=this._store.getState().currentTree;return xS(s.dirtyAtoms)}const i=this._store.getState().knownAtoms,o=this._store.getState().knownSelectors;return(r==null?void 0:r.isInitialized)==null?_S.values():r.isInitialized===!0?xS(x$([i,o])):A2(_S.values(),({key:s})=>!i.has(s)&&!o.has(s))}),Ce(this,"getInfo_UNSTABLE",({key:r})=>(this.checkRefCount_INTERNAL(),Y8(this._store,this._store.getState().currentTree,r))),Ce(this,"map",r=>{this.checkRefCount_INTERNAL();const i=new Vy(this,Uy);return r(i),i}),Ce(this,"asyncMap",async r=>{this.checkRefCount_INTERNAL();const i=new Vy(this,Uy);return i.retain(),await r(i),i.autoRelease_INTERNAL(),i}),this._store={storeID:X8(),parentStoreID:n,getState:()=>t,replaceState:r=>{t.currentTree=r(t.currentTree)},getGraph:r=>{const i=t.graphsByVersion;if(i.has(r))return Ze(i.get(r));const o=Q8();return i.set(r,o),o},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw Ae("Cannot subscribe to Snapshots")}};for(const r of this._store.getState().knownAtoms)K8(this._store,r,"get"),Ef(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0,this._refCount++;let t=!1;return()=>{t||(t=!0,this._release())}}autoRelease_INTERNAL(){o9||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,this._refCount===0){if(this._store.getState().nodeCleanupFunctions.forEach(t=>t()),this._store.getState().nodeCleanupFunctions.clear(),!Ve("recoil_memory_managament_2020"))return}else this._refCount<0}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){Ve("recoil_memory_managament_2020")&&this._refCount<=0}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function w$(e,t,n=!1){const r=e.getState(),i=n?r9():t.version;return{currentTree:{version:n?i:t.version,stateID:n?i:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(r.knownAtoms),knownSelectors:new Set(r.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(i,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(V0(r.nodeCleanupFunctions.entries(),([o])=>[o,()=>{}]))}}function a9(e){const t=new G0(i9());return e!=null?t.map(e):t}const[wS,b$]=s9((e,t)=>{var n;const r=e.getState(),i=t==="latest"?(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree:Ze(r.previousTree);return new G0(w$(e,i),e.storeID)},(e,t)=>{var n,r;return String(t)+String(e.storeID)+String((n=e.getState().nextTree)===null||n===void 0?void 0:n.version)+String(e.getState().currentTree.version)+String((r=e.getState().previousTree)===null||r===void 0?void 0:r.version)});n9(b$);function l9(e,t="latest"){const n=wS(e,t);return n.isRetained()?n:(b$(),wS(e,t))}class Vy extends G0{constructor(t,n){super(w$(t.getStore_INTERNAL(),t.getStore_INTERNAL().getState().currentTree,!0),t.getStoreID()),Ce(this,"_batch",void 0),Ce(this,"set",(r,i)=>{this.checkRefCount_INTERNAL();const o=this.getStore_INTERNAL();this._batch(()=>{Ef(o,r.key,1),SS(this.getStore_INTERNAL(),r,i)})}),Ce(this,"reset",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();this._batch(()=>{Ef(i,r.key,1),SS(this.getStore_INTERNAL(),r,Z8)})}),Ce(this,"setUnvalidatedAtomValues_DEPRECATED",r=>{this.checkRefCount_INTERNAL();const i=this.getStore_INTERNAL();Uy(()=>{for(const[o,s]of r.entries())Ef(i,o,1),t9(i,new J8(o),s)})}),this._batch=n}}var K0={Snapshot:G0,MutableSnapshot:Vy,freshSnapshot:a9,cloneSnapshot:l9},u9=K0.Snapshot,c9=K0.MutableSnapshot,d9=K0.freshSnapshot,f9=K0.cloneSnapshot,Y0=Object.freeze({__proto__:null,Snapshot:u9,MutableSnapshot:c9,freshSnapshot:d9,cloneSnapshot:f9});function h9(...e){const t=new Set;for(const n of e)for(const r of n)t.add(r);return t}var p9=h9;const{useRef:g9}=b;function m9(e){const t=g9(e);return t.current===e&&typeof e=="function"&&(t.current=e()),t}var bS=m9;const{getNextTreeStateVersion:y9,makeEmptyStoreState:E$}=e$,{cleanUpNode:v9,getDownstreamNodes:_9,initializeNode:x9,setNodeValue:S9,setUnvalidatedAtomValue_DEPRECATED:w9}=Eo,{graph:b9}=Yc,{cloneGraph:E9}=Yc,{getNextStoreID:C$}=z0,{createMutableSource:Eg,reactMode:A$}=Kc,{applyAtomValueWrites:C9}=zr,{releaseScheduledRetainablesNow:R$}=Ts,{freshSnapshot:A9}=Y0,{useCallback:R9,useContext:$$,useEffect:zy,useMemo:$9,useRef:T9,useState:k9}=b;function Ql(){throw Ae("This component must be used inside a component.")}const T$=Object.freeze({storeID:C$(),getState:Ql,replaceState:Ql,getGraph:Ql,subscribeToTransactions:Ql,addTransactionMetadata:Ql});let By=!1;function ES(e){if(By)throw Ae("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");const t=e.getState();if(t.nextTree===null){Ve("recoil_memory_managament_2020")&&Ve("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&R$(e);const n=t.currentTree.version,r=y9();t.nextTree={...t.currentTree,version:r,stateID:r,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(r,E9(Ze(t.graphsByVersion.get(n))))}}const k$=b.createContext({current:T$}),Q0=()=>$$(k$),M$=b.createContext(null);function M9(){return $$(M$)}function k2(e,t,n){const r=_9(e,n,n.dirtyAtoms);for(const i of r){const o=t.nodeToComponentSubscriptions.get(i);if(o)for(const[s,[a,l]]of o)l(n)}}function N$(e){const t=e.getState(),n=t.currentTree,r=n.dirtyAtoms;if(r.size){for(const[i,o]of t.nodeTransactionSubscriptions)if(r.has(i))for(const[s,a]of o)a(e);for(const[i,o]of t.transactionSubscriptions)o(e);(!A$().early||t.suspendedComponentResolvers.size>0)&&(k2(e,t,n),t.suspendedComponentResolvers.forEach(i=>i()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(i=>i(n)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function N9(e){const t=e.getState();t.commitDepth++;try{const{nextTree:n}=t;if(n==null)return;t.previousTree=t.currentTree,t.currentTree=n,t.nextTree=null,N$(e),t.previousTree!=null?t.graphsByVersion.delete(t.previousTree.version):S2("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,Ve("recoil_memory_managament_2020")&&n==null&&R$(e)}finally{t.commitDepth--}}function L9({setNotifyBatcherOfChange:e}){const t=Q0(),[,n]=k9([]);return e(()=>n({})),zy(()=>(e(()=>n({})),()=>{e(()=>{})}),[e]),zy(()=>{dF.enqueueExecution("Batcher",()=>{N9(t.current)})}),null}function O9(e,t){const n=E$();return t({set:(r,i)=>{const o=n.currentTree,s=S9(e,o,r.key,i),a=new Set(s.keys()),l=o.nonvalidatedAtoms.clone();for(const u of a)l.delete(u);n.currentTree={...o,dirtyAtoms:p9(o.dirtyAtoms,a),atomValues:C9(o.atomValues,s),nonvalidatedAtoms:l}},setUnvalidatedAtomValues:r=>{r.forEach((i,o)=>{n.currentTree=w9(n.currentTree,o,i)})}}),n}function P9(e){const t=A9(e),n=t.getStore_INTERNAL().getState();return t.retain(),n.nodeCleanupFunctions.forEach(r=>r()),n.nodeCleanupFunctions.clear(),n}let CS=0;function I9({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:n,children:r}){let i;const o=h=>{const g=i.current.graphsByVersion;if(g.has(h))return Ze(g.get(h));const y=b9();return g.set(h,y),y},s=(h,g)=>{if(g==null){const{transactionSubscriptions:y}=d.current.getState(),_=CS++;return y.set(_,h),{release:()=>{y.delete(_)}}}else{const{nodeTransactionSubscriptions:y}=d.current.getState();y.has(g)||y.set(g,new Map);const _=CS++;return Ze(y.get(g)).set(_,h),{release:()=>{const m=y.get(g);m&&(m.delete(_),m.size===0&&y.delete(g))}}}},a=h=>{ES(d.current);for(const g of Object.keys(h))Ze(d.current.getState().nextTree).transactionMetadata[g]=h[g]},l=h=>{ES(d.current);const g=Ze(i.current.nextTree);let y;try{By=!0,y=h(g)}finally{By=!1}y!==g&&(i.current.nextTree=y,A$().early&&k2(d.current,i.current,y),Ze(u.current)())},u=T9(null),c=R9(h=>{u.current=h},[u]),d=bS(()=>n??{storeID:C$(),getState:()=>i.current,replaceState:l,getGraph:o,subscribeToTransactions:s,addTransactionMetadata:a});n!=null&&(d.current=n),i=bS(()=>e!=null?O9(d.current,e):t!=null?P9(t):E$());const f=$9(()=>Eg==null?void 0:Eg(i,()=>i.current.currentTree.version),[i]);return zy(()=>{const h=d.current;for(const g of new Set(h.getState().knownAtoms))x9(h,g,"get");return()=>{for(const g of h.getState().knownAtoms)v9(h,g)}},[d]),b.createElement(k$.Provider,{value:d},b.createElement(M$.Provider,{value:f},b.createElement(L9,{setNotifyBatcherOfChange:c}),r))}function D9(e){const{override:t,...n}=e,r=Q0();return t===!1&&r.current!==T$?e.children:b.createElement(I9,n)}function j9(){return Q0().current.storeID}var bi={RecoilRoot:D9,useStoreRef:Q0,useRecoilMutableSource:M9,useRecoilStoreID:j9,notifyComponents_FOR_TESTING:k2,sendEndOfBatchNotifications_FOR_TESTING:N$};function F9(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0,r=e.length;n{t.current=e}),t.current}var L$=B9;const{useStoreRef:H9}=bi,{SUSPENSE_TIMEOUT_MS:W9}=Ts,{updateRetainCount:Xl}=Ts,{RetentionZone:q9}=B0,{useEffect:G9,useRef:K9}=b,{isSSR:AS}=q0;function Y9(e){if(Ve("recoil_memory_managament_2020"))return Q9(e)}function Q9(e){const n=(Array.isArray(e)?e:[e]).map(s=>s instanceof q9?s:s.key),r=H9();G9(()=>{if(!Ve("recoil_memory_managament_2020"))return;const s=r.current;if(i.current&&!AS)window.clearTimeout(i.current),i.current=null;else for(const a of n)Xl(s,a,1);return()=>{for(const a of n)Xl(s,a,-1)}},[r,...n]);const i=K9(),o=L$(n);if(!AS&&(o===void 0||!U9(o,n))){const s=r.current;for(const a of n)Xl(s,a,1);if(o)for(const a of o)Xl(s,a,-1);i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{i.current=null;for(const a of n)Xl(s,a,-1)},W9)}}var M2=Y9;function X9(){return""}var Xc=X9;const{batchUpdates:Z9}=W0,{DEFAULT_VALUE:O$}=yn,{currentRendererSupportsUseSyncExternalStore:J9,reactMode:bl,useMutableSource:e7,useSyncExternalStore:t7}=Kc,{useRecoilMutableSource:n7,useStoreRef:Br}=bi,{AbstractRecoilValue:Hy,getRecoilValueAsLoadable:Zc,setRecoilValue:vh,setUnvalidatedRecoilValue:r7,subscribeToRecoilValue:il}=zr,{useCallback:pn,useEffect:ol,useMemo:P$,useRef:Pu,useState:N2}=b,{setByAddingToSet:i7}=n$,{isSSR:o7}=q0;function L2(e,t,n){if(e.state==="hasValue")return e.contents;throw e.state==="loading"?new Promise(i=>{const o=n.current.getState().suspendedComponentResolvers;o.add(i),o7&&Ge(e.contents)&&e.contents.finally(()=>{o.delete(i)})}):e.state==="hasError"?e.contents:Ae(`Invalid value of loadable atom "${t.key}"`)}function s7(){const e=Xc(),t=Br(),[,n]=N2([]),r=Pu(new Set);r.current=new Set;const i=Pu(new Set),o=Pu(new Map),s=pn(l=>{const u=o.current.get(l);u&&(u.release(),o.current.delete(l))},[o]),a=pn((l,u)=>{o.current.has(u)&&n([])},[]);return ol(()=>{const l=t.current;Lu(r.current,i.current).forEach(u=>{if(o.current.has(u))return;const c=il(l,new Hy(u),f=>a(f,u),e);o.current.set(u,c),l.getState().nextTree?l.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a(l.getState(),u)}):a(l.getState(),u)}),Lu(i.current,r.current).forEach(u=>{s(u)}),i.current=r.current}),ol(()=>{const l=o.current;return Lu(r.current,new Set(l.keys())).forEach(u=>{const c=il(t.current,new Hy(u),d=>a(d,u),e);l.set(u,c)}),()=>l.forEach((u,c)=>s(c))},[e,t,s,a]),P$(()=>{function l(g){return y=>{vh(t.current,g,y)}}function u(g){return()=>vh(t.current,g,O$)}function c(g){var y;r.current.has(g.key)||(r.current=i7(r.current,g.key));const _=t.current.getState();return Zc(t.current,g,bl().early&&(y=_.nextTree)!==null&&y!==void 0?y:_.currentTree)}function d(g){const y=c(g);return L2(y,g,t)}function f(g){return[d(g),l(g)]}function h(g){return[c(g),l(g)]}return{getRecoilValue:d,getRecoilValueLoadable:c,getRecoilState:f,getRecoilStateLoadable:h,getSetRecoilState:l,getResetRecoilState:u}},[r,t])}const a7={current:0};function l7(e){const t=Br(),n=Xc(),r=pn(()=>{var a;const l=t.current,u=l.getState(),c=bl().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return{loadable:Zc(l,e,c),key:e.key}},[t,e]),i=pn(a=>{let l;return()=>{var u,c;const d=a();return(u=l)!==null&&u!==void 0&&u.loadable.is(d.loadable)&&((c=l)===null||c===void 0?void 0:c.key)===d.key?l:(l=d,d)}},[]),o=P$(()=>i(r),[r,i]),s=pn(a=>{const l=t.current;return il(l,e,a,n).release},[t,e,n]);return t7(s,o,o).loadable}function u7(e){const t=Br(),n=pn(()=>{var u;const c=t.current,d=c.getState(),f=bl().early&&(u=d.nextTree)!==null&&u!==void 0?u:d.currentTree;return Zc(c,e,f)},[t,e]),r=pn(()=>n(),[n]),i=Xc(),o=pn((u,c)=>{const d=t.current;return il(d,e,()=>{if(!Ve("recoil_suppress_rerender_in_callback"))return c();const h=n();l.current.is(h)||c(),l.current=h},i).release},[t,e,i,n]),s=n7();if(s==null)throw Ae("Recoil hooks must be used in components contained within a component.");const a=e7(s,r,o),l=Pu(a);return ol(()=>{l.current=a}),a}function Wy(e){const t=Br(),n=Xc(),r=pn(()=>{var l;const u=t.current,c=u.getState(),d=bl().early&&(l=c.nextTree)!==null&&l!==void 0?l:c.currentTree;return Zc(u,e,d)},[t,e]),i=pn(()=>({loadable:r(),key:e.key}),[r,e.key]),o=pn(l=>{const u=i();return l.loadable.is(u.loadable)&&l.key===u.key?l:u},[i]);ol(()=>{const l=il(t.current,e,u=>{a(o)},n);return a(o),l.release},[n,e,t,o]);const[s,a]=N2(i);return s.key!==e.key?i().loadable:s.loadable}function c7(e){const t=Br(),[,n]=N2([]),r=Xc(),i=pn(()=>{var a;const l=t.current,u=l.getState(),c=bl().early&&(a=u.nextTree)!==null&&a!==void 0?a:u.currentTree;return Zc(l,e,c)},[t,e]),o=i(),s=Pu(o);return ol(()=>{s.current=o}),ol(()=>{const a=t.current,l=a.getState(),u=il(a,e,d=>{var f;if(!Ve("recoil_suppress_rerender_in_callback"))return n([]);const h=i();(f=s.current)!==null&&f!==void 0&&f.is(h)||n(h),s.current=h},r);if(l.nextTree)a.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s.current=null,n([])});else{var c;if(!Ve("recoil_suppress_rerender_in_callback"))return n([]);const d=i();(c=s.current)!==null&&c!==void 0&&c.is(d)||n(d),s.current=d}return u.release},[r,i,e,t]),o}function O2(e){return Ve("recoil_memory_managament_2020")&&M2(e),{TRANSITION_SUPPORT:Wy,SYNC_EXTERNAL_STORE:J9()?l7:Wy,MUTABLE_SOURCE:u7,LEGACY:c7}[bl().mode](e)}function I$(e){const t=Br(),n=O2(e);return L2(n,e,t)}function X0(e){const t=Br();return pn(n=>{vh(t.current,e,n)},[t,e])}function d7(e){const t=Br();return pn(()=>{vh(t.current,e,O$)},[t,e])}function f7(e){return[I$(e),X0(e)]}function h7(e){return[O2(e),X0(e)]}function p7(){const e=Br();return(t,n={})=>{Z9(()=>{e.current.addTransactionMetadata(n),t.forEach((r,i)=>r7(e.current,new Hy(i),r))})}}function D$(e){return Ve("recoil_memory_managament_2020")&&M2(e),Wy(e)}function j$(e){const t=Br(),n=D$(e);return L2(n,e,t)}function g7(e){return[j$(e),X0(e)]}var m7={recoilComponentGetRecoilValueCount_FOR_TESTING:a7,useRecoilInterface:s7,useRecoilState:f7,useRecoilStateLoadable:h7,useRecoilValue:I$,useRecoilValueLoadable:O2,useResetRecoilState:d7,useSetRecoilState:X0,useSetUnvalidatedAtomValues:p7,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:D$,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:j$,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:g7};function y7(e,t){const n=new Map;for(const[r,i]of e)t(i,r)&&n.set(r,i);return n}var v7=y7;function _7(e,t){const n=new Set;for(const r of e)t(r)&&n.add(r);return n}var x7=_7;function S7(...e){const t=new Map;for(let n=0;nt.current.subscribeToTransactions(e).release,[e,t])}function TS(e){const t=e.atomValues.toMap(),n=yh(v7(t,(r,i)=>{const s=F$(i).persistence_UNSTABLE;return s!=null&&s.type!=="none"&&r.state==="hasValue"}),r=>r.contents);return w7(e.nonvalidatedAtoms.toMap(),n)}function k7(e){J0(Z0(t=>{let n=t.getState().previousTree;const r=t.getState().currentTree;n||(n=t.getState().currentTree);const i=TS(r),o=TS(n),s=yh(C7,l=>{var u,c,d,f;return{persistence_UNSTABLE:{type:(u=(c=l.persistence_UNSTABLE)===null||c===void 0?void 0:c.type)!==null&&u!==void 0?u:"none",backButton:(d=(f=l.persistence_UNSTABLE)===null||f===void 0?void 0:f.backButton)!==null&&d!==void 0?d:!1}}}),a=x7(r.dirtyAtoms,l=>i.has(l)||o.has(l));e({atomValues:i,previousAtomValues:o,atomInfo:s,modifiedAtoms:a,transactionMetadata:{...r.transactionMetadata}})},[e]))}function M7(e){J0(Z0(t=>{const n=_h(t,"latest"),r=_h(t,"previous");e({snapshot:n,previousSnapshot:r})},[e]))}function N7(){const e=P2(),[t,n]=T7(()=>_h(e.current)),r=L$(t),i=RS(),o=RS();if(J0(Z0(a=>n(_h(a)),[])),U$(()=>{const a=t.retain();if(i.current&&!$S){var l;window.clearTimeout(i.current),i.current=null,(l=o.current)===null||l===void 0||l.call(o),o.current=null}return()=>{window.setTimeout(a,10)}},[t]),r!==t&&!$S){if(i.current){var s;window.clearTimeout(i.current),i.current=null,(s=o.current)===null||s===void 0||s.call(o),o.current=null}o.current=t.retain(),i.current=window.setTimeout(()=>{var a;i.current=null,(a=o.current)===null||a===void 0||a.call(o),o.current=null},$7)}return t}function V$(e,t){var n;const r=e.getState(),i=(n=r.nextTree)!==null&&n!==void 0?n:r.currentTree,o=t.getStore_INTERNAL().getState().currentTree;b7(()=>{const s=new Set;for(const u of[i.atomValues.keys(),o.atomValues.keys()])for(const c of u){var a,l;((a=i.atomValues.get(c))===null||a===void 0?void 0:a.contents)!==((l=o.atomValues.get(c))===null||l===void 0?void 0:l.contents)&&F$(c).shouldRestoreFromSnapshots&&s.add(c)}s.forEach(u=>{R7(e,new A7(u),o.atomValues.has(u)?Ze(o.atomValues.get(u)):E7)}),e.replaceState(u=>({...u,stateID:t.getID()}))})}function L7(){const e=P2();return Z0(t=>V$(e.current,t),[e])}var z$={useRecoilSnapshot:N7,gotoSnapshot:V$,useGotoRecoilSnapshot:L7,useRecoilTransactionObserver:M7,useTransactionObservation_DEPRECATED:k7,useTransactionSubscription_DEPRECATED:J0};const{peekNodeInfo:O7}=Eo,{useStoreRef:P7}=bi;function I7(){const e=P7();return({key:t})=>O7(e.current,e.current.getState().currentTree,t)}var D7=I7;const{reactMode:j7}=Kc,{RecoilRoot:F7,useStoreRef:U7}=bi,{useMemo:V7}=b;function z7(){j7().mode==="MUTABLE_SOURCE"&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode. Please consider upgrading to recoil_sync_external_store mode.");const e=U7().current;return V7(()=>{function t({children:n}){return b.createElement(F7,{store_INTERNAL:e},n)}return t},[e])}var B7=z7;const{loadableWithValue:H7}=Gc,{initializeNode:W7}=Eo,{DEFAULT_VALUE:q7,getNode:G7}=yn,{copyTreeState:K7,getRecoilValueAsLoadable:Y7,invalidateDownstreams:Q7,writeLoadableToTreeState:X7}=zr;function kS(e){return G7(e.key).nodeType==="atom"}class Z7{constructor(t,n){Ce(this,"_store",void 0),Ce(this,"_treeState",void 0),Ce(this,"_changes",void 0),Ce(this,"get",r=>{if(this._changes.has(r.key))return this._changes.get(r.key);if(!kS(r))throw Ae("Reading selectors within atomicUpdate is not supported");const i=Y7(this._store,r,this._treeState);if(i.state==="hasValue")return i.contents;throw i.state==="hasError"?i.contents:Ae(`Expected Recoil atom ${r.key} to have a value, but it is in a loading state.`)}),Ce(this,"set",(r,i)=>{if(!kS(r))throw Ae("Setting selectors within atomicUpdate is not supported");if(typeof i=="function"){const o=this.get(r);this._changes.set(r.key,i(o))}else W7(this._store,r.key,"set"),this._changes.set(r.key,i)}),Ce(this,"reset",r=>{this.set(r,q7)}),this._store=t,this._treeState=n,this._changes=new Map}newTreeState_INTERNAL(){if(this._changes.size===0)return this._treeState;const t=K7(this._treeState);for(const[n,r]of this._changes)X7(t,n,H7(r));return Q7(this._store,t),t}}function J7(e){return t=>{e.replaceState(n=>{const r=new Z7(e,n);return t(r),r.newTreeState_INTERNAL()})}}var eU={atomicUpdater:J7},tU=eU.atomicUpdater,B$=Object.freeze({__proto__:null,atomicUpdater:tU});function nU(e,t){if(!e)throw new Error(t)}var rU=nU,mu=rU;const{atomicUpdater:iU}=B$,{batchUpdates:oU}=W0,{DEFAULT_VALUE:sU}=yn,{useStoreRef:aU}=bi,{refreshRecoilValue:lU,setRecoilValue:MS}=zr,{cloneSnapshot:uU}=Y0,{gotoSnapshot:cU}=z$,{useCallback:dU}=b;class H${}const fU=new H$;function W$(e,t,n,r){let i=fU,o;if(oU(()=>{const a="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback you want to create. Please see the docs at recoiljs.org for details.";if(typeof t!="function")throw Ae(a);const l=r$({...r??{},set:(c,d)=>MS(e,c,d),reset:c=>MS(e,c,sU),refresh:c=>lU(e,c),gotoSnapshot:c=>cU(e,c),transact_UNSTABLE:c=>iU(e)(c)},{snapshot:()=>{const c=uU(e);return o=c.retain(),c}}),u=t(l);if(typeof u!="function")throw Ae(a);i=u(...n)}),i instanceof H$&&mu(!1),Ge(i))i=i.finally(()=>{var a;(a=o)===null||a===void 0||a()});else{var s;(s=o)===null||s===void 0||s()}return i}function hU(e,t){const n=aU();return dU((...r)=>W$(n.current,e,r),t!=null?[...t,n]:void 0)}var q$={recoilCallback:W$,useRecoilCallback:hU};const{useStoreRef:pU}=bi,{refreshRecoilValue:gU}=zr,{useCallback:mU}=b;function yU(e){const t=pU();return mU(()=>{const n=t.current;gU(n,e)},[e,t])}var vU=yU;const{atomicUpdater:_U}=B$,{useStoreRef:xU}=bi,{useMemo:SU}=b;function wU(e,t){const n=xU();return SU(()=>(...r)=>{_U(n.current)(o=>{e(o)(...r)})},t!=null?[...t,n]:void 0)}var bU=wU;class EU{constructor(t){Ce(this,"value",void 0),this.value=t}}var CU={WrappedValue:EU},AU=CU.WrappedValue,G$=Object.freeze({__proto__:null,WrappedValue:AU});const{isFastRefreshEnabled:RU}=Kc;class NS extends Error{}class $U{constructor(t){var n,r,i;Ce(this,"_name",void 0),Ce(this,"_numLeafs",void 0),Ce(this,"_root",void 0),Ce(this,"_onHit",void 0),Ce(this,"_onSet",void 0),Ce(this,"_mapNodeValue",void 0),this._name=t==null?void 0:t.name,this._numLeafs=0,this._root=null,this._onHit=(n=t==null?void 0:t.onHit)!==null&&n!==void 0?n:()=>{},this._onSet=(r=t==null?void 0:t.onSet)!==null&&r!==void 0?r:()=>{},this._mapNodeValue=(i=t==null?void 0:t.mapNodeValue)!==null&&i!==void 0?i:o=>o}size(){return this._numLeafs}root(){return this._root}get(t,n){var r;return(r=this.getLeafNode(t,n))===null||r===void 0?void 0:r.value}getLeafNode(t,n){if(this._root==null)return;let r=this._root;for(;r;){if(n==null||n.onNodeVisit(r),r.type==="leaf")return this._onHit(r),r;const i=this._mapNodeValue(t(r.nodeKey));r=r.branches.get(i)}}set(t,n,r){const i=()=>{var o,s,a,l;let u,c;for(const[_,m]of t){var d,f,h;const p=this._root;if((p==null?void 0:p.type)==="leaf")throw this.invalidCacheError();const v=u;if(u=v?v.branches.get(c):p,u=(d=u)!==null&&d!==void 0?d:{type:"branch",nodeKey:_,parent:v,branches:new Map,branchKey:c},u.type!=="branch"||u.nodeKey!==_)throw this.invalidCacheError();v==null||v.branches.set(c,u),r==null||(f=r.onNodeVisit)===null||f===void 0||f.call(r,u),c=this._mapNodeValue(m),this._root=(h=this._root)!==null&&h!==void 0?h:u}const g=u?(o=u)===null||o===void 0?void 0:o.branches.get(c):this._root;if(g!=null&&(g.type!=="leaf"||g.branchKey!==c))throw this.invalidCacheError();const y={type:"leaf",value:n,parent:u,branchKey:c};(s=u)===null||s===void 0||s.branches.set(c,y),this._root=(a=this._root)!==null&&a!==void 0?a:y,this._numLeafs++,this._onSet(y),r==null||(l=r.onNodeVisit)===null||l===void 0||l.call(r,y)};try{i()}catch(o){if(o instanceof NS)this.clear(),i();else throw o}}delete(t){const n=this.root();if(!n)return!1;if(t===n)return this._root=null,this._numLeafs=0,!0;let r=t.parent,i=t.branchKey;for(;r;){var o;if(r.branches.delete(i),r===n)return r.branches.size===0?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;i=(o=r)===null||o===void 0?void 0:o.branchKey,r=r.parent}for(;r!==n;r=r.parent)if(r==null)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){const t=RU()?"Possible Fast Refresh module reload detected. This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values. This happens when selectors do not return consistent values for the same input dependency values. That may also be caused when using Fast Refresh to change a selector implementation. Resetting cache.";throw S2(t+(this._name!=null?` - ${this._name}`:"")),new NS}}var TU={TreeCache:$U},kU=TU.TreeCache,K$=Object.freeze({__proto__:null,TreeCache:kU});class MU{constructor(t){var n;Ce(this,"_maxSize",void 0),Ce(this,"_size",void 0),Ce(this,"_head",void 0),Ce(this,"_tail",void 0),Ce(this,"_map",void 0),Ce(this,"_keyMapper",void 0),this._maxSize=t.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=(n=t.mapKey)!==null&&n!==void 0?n:r=>r}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(t){return this._map.has(this._keyMapper(t))}get(t){const n=this._keyMapper(t),r=this._map.get(n);if(r)return this.set(t,r.value),r.value}set(t,n){const r=this._keyMapper(t);this._map.get(r)&&this.delete(t);const o=this.head(),s={key:t,right:o,left:null,value:n};o?o.left=s:this._tail=s,this._map.set(r,s),this._head=s,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){const t=this.tail();t&&this.delete(t.key)}delete(t){const n=this._keyMapper(t);if(!this._size||!this._map.has(n))return;const r=Ze(this._map.get(n)),i=r.right,o=r.left;i&&(i.left=r.left),o&&(o.right=r.right),r===this.head()&&(this._head=i),r===this.tail()&&(this._tail=o),this._map.delete(n),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}var NU={LRUCache:MU},LU=NU.LRUCache,Y$=Object.freeze({__proto__:null,LRUCache:LU});const{LRUCache:OU}=Y$,{TreeCache:PU}=K$;function IU({name:e,maxSize:t,mapNodeValue:n=r=>r}){const r=new OU({maxSize:t}),i=new PU({name:e,mapNodeValue:n,onHit:o=>{r.set(o,!0)},onSet:o=>{const s=r.tail();r.set(o,!0),s&&i.size()>t&&i.delete(s.key)}});return i}var LS=IU;function rr(e,t,n){if(typeof e=="string"&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((t==null?void 0:t.allowFunctions)!==!0)throw Ae("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(e===null)return"null";if(typeof e!="object"){var r;return(r=JSON.stringify(e))!==null&&r!==void 0?r:""}if(Ge(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((i,o)=>rr(i,t,o.toString()))}]`;if(typeof e.toJSON=="function")return rr(e.toJSON(n),t,n);if(e instanceof Map){const i={};for(const[o,s]of e)i[typeof o=="string"?o:rr(o,t)]=s;return rr(i,t,n)}return e instanceof Set?rr(Array.from(e).sort((i,o)=>rr(i,t).localeCompare(rr(o,t))),t,n):Symbol!==void 0&&e[Symbol.iterator]!=null&&typeof e[Symbol.iterator]=="function"?rr(Array.from(e),t,n):`{${Object.keys(e).filter(i=>e[i]!==void 0).sort().map(i=>`${rr(i,t)}:${rr(e[i],t,i)}`).join(",")}}`}function DU(e,t={allowFunctions:!1}){return rr(e,t)}var ep=DU;const{TreeCache:jU}=K$,Fd={equality:"reference",eviction:"keep-all",maxSize:1/0};function FU({equality:e=Fd.equality,eviction:t=Fd.eviction,maxSize:n=Fd.maxSize}=Fd,r){const i=UU(e);return VU(t,n,i,r)}function UU(e){switch(e){case"reference":return t=>t;case"value":return t=>ep(t)}throw Ae(`Unrecognized equality policy ${e}`)}function VU(e,t,n,r){switch(e){case"keep-all":return new jU({name:r,mapNodeValue:n});case"lru":return LS({name:r,maxSize:Ze(t),mapNodeValue:n});case"most-recent":return LS({name:r,maxSize:1,mapNodeValue:n})}throw Ae(`Unrecognized eviction policy ${e}`)}var zU=FU;function BU(e){return()=>null}var HU={startPerfBlock:BU};const{isLoadable:WU,loadableWithError:Ud,loadableWithPromise:qU,loadableWithValue:Cg}=Gc,{WrappedValue:Q$}=G$,{getNodeLoadable:Vd,peekNodeLoadable:GU,setNodeValue:KU}=Eo,{saveDepsToStore:YU}=Yc,{DEFAULT_VALUE:QU,getConfigDeletionHandler:XU,getNode:ZU,registerNode:OS}=yn,{isRecoilValue:JU}=rl,{markRecoilValueModified:PS}=zr,{retainedByOptionWithDefault:eV}=Ts,{recoilCallback:tV}=q$,{startPerfBlock:nV}=HU;class X${}const Zl=new X$,Jl=[],zd=new Map,rV=(()=>{let e=0;return()=>e++})();function Z$(e){let t=null;const{key:n,get:r,cachePolicy_UNSTABLE:i}=e,o=e.set!=null?e.set:void 0,s=new Set,a=zU(i??{equality:"reference",eviction:"keep-all"},n),l=eV(e.retainedBy_UNSTABLE),u=new Map;let c=0;function d(){return!Ve("recoil_memory_managament_2020")||c>0}function f(N){return N.getState().knownSelectors.add(n),c++,()=>{c--}}function h(){return XU(n)!==void 0&&!d()}function g(N,B,G,re,K){H(B,re,K),y(N,G)}function y(N,B){D(N,B)&&k(N),m(B,!0)}function _(N,B){D(N,B)&&(Ze(A(N)).stateVersions.clear(),m(B,!1))}function m(N,B){const G=zd.get(N);if(G!=null){for(const re of G)PS(re,Ze(t));B&&zd.delete(N)}}function p(N,B){let G=zd.get(B);G==null&&zd.set(B,G=new Set),G.add(N)}function v(N,B,G,re,K,he){return B.then(me=>{if(!d())throw k(N),Zl;const le=Cg(me);return g(N,G,K,le,re),me}).catch(me=>{if(!d())throw k(N),Zl;if(Ge(me))return x(N,me,G,re,K,he);const le=Ud(me);throw g(N,G,K,le,re),me})}function x(N,B,G,re,K,he){return B.then(me=>{if(!d())throw k(N),Zl;he.loadingDepKey!=null&&he.loadingDepPromise===B?G.atomValues.set(he.loadingDepKey,Cg(me)):N.getState().knownSelectors.forEach(we=>{G.atomValues.delete(we)});const le=E(N,G);if(le&&le.state!=="loading"){if((D(N,K)||A(N)==null)&&y(N,K),le.state==="hasValue")return le.contents;throw le.contents}if(!D(N,K)){const we=T(N,G);if(we!=null)return we.loadingLoadable.contents}const[$e,De]=w(N,G,K);if($e.state!=="loading"&&g(N,G,K,$e,De),$e.state==="hasError")throw $e.contents;return $e.contents}).catch(me=>{if(me instanceof X$)throw Zl;if(!d())throw k(N),Zl;const le=Ud(me);throw g(N,G,K,le,re),me})}function S(N,B,G,re){var K,he,me,le;if(D(N,re)||B.version===((K=N.getState())===null||K===void 0||(he=K.currentTree)===null||he===void 0?void 0:he.version)||B.version===((me=N.getState())===null||me===void 0||(le=me.nextTree)===null||le===void 0?void 0:le.version)){var $e,De,we;YU(n,G,N,($e=(De=N.getState())===null||De===void 0||(we=De.nextTree)===null||we===void 0?void 0:we.version)!==null&&$e!==void 0?$e:N.getState().currentTree.version)}for(const ke of G)s.add(ke)}function w(N,B,G){const re=nV(n);let K=!0,he=!0;const me=()=>{re(),he=!1};let le,$e=!1,De;const we={loadingDepKey:null,loadingDepPromise:null},ke=new Map;function Pe({key:wt}){const ht=Vd(N,B,wt);switch(ke.set(wt,ht),K||(S(N,B,new Set(ke.keys()),G),_(N,G)),ht.state){case"hasValue":return ht.contents;case"hasError":throw ht.contents;case"loading":throw we.loadingDepKey=wt,we.loadingDepPromise=ht.contents,ht.contents}throw Ae("Invalid Loadable state")}const On=wt=>(...ht)=>{if(he)throw Ae("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated. It can be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return t==null&&mu(!1),tV(N,wt,ht,{node:t})};try{le=r({get:Pe,getCallback:On}),le=JU(le)?Pe(le):le,WU(le)&&(le.state==="hasError"&&($e=!0),le=le.contents),Ge(le)?le=v(N,le,B,ke,G,we).finally(me):me(),le=le instanceof Q$?le.value:le}catch(wt){le=wt,Ge(le)?le=x(N,le,B,ke,G,we).finally(me):($e=!0,me())}return $e?De=Ud(le):Ge(le)?De=qU(le):De=Cg(le),K=!1,R(N,G,ke),S(N,B,new Set(ke.keys()),G),[De,ke]}function E(N,B){let G=B.atomValues.get(n);if(G!=null)return G;const re=new Set;try{G=a.get(he=>(typeof he!="string"&&mu(!1),Vd(N,B,he).contents),{onNodeVisit:he=>{he.type==="branch"&&he.nodeKey!==n&&re.add(he.nodeKey)}})}catch(he){throw Ae(`Problem with cache lookup for selector "${n}": ${he.message}`)}if(G){var K;B.atomValues.set(n,G),S(N,B,re,(K=A(N))===null||K===void 0?void 0:K.executionID)}return G}function C(N,B){const G=E(N,B);if(G!=null)return k(N),G;const re=T(N,B);if(re!=null){var K;return((K=re.loadingLoadable)===null||K===void 0?void 0:K.state)==="loading"&&p(N,re.executionID),re.loadingLoadable}const he=rV(),[me,le]=w(N,B,he);return me.state==="loading"?(M(N,he,me,le,B),p(N,he)):(k(N),H(B,me,le)),me}function T(N,B){const G=x$([u.has(N)?[Ze(u.get(N))]:[],V0(A2(u,([K])=>K!==N),([,K])=>K)]);function re(K){for(const[he,me]of K)if(!Vd(N,B,he).is(me))return!0;return!1}for(const K of G){if(K.stateVersions.get(B.version)||!re(K.depValuesDiscoveredSoFarDuringAsyncWork))return K.stateVersions.set(B.version,!0),K;K.stateVersions.set(B.version,!1)}}function A(N){return u.get(N)}function M(N,B,G,re,K){u.set(N,{depValuesDiscoveredSoFarDuringAsyncWork:re,executionID:B,loadingLoadable:G,stateVersions:new Map([[K.version,!0]])})}function R(N,B,G){if(D(N,B)){const re=A(N);re!=null&&(re.depValuesDiscoveredSoFarDuringAsyncWork=G)}}function k(N){u.delete(N)}function D(N,B){var G;return B===((G=A(N))===null||G===void 0?void 0:G.executionID)}function P(N){return Array.from(N.entries()).map(([B,G])=>[B,G.contents])}function H(N,B,G){N.atomValues.set(n,B);try{a.set(P(G),B)}catch(re){throw Ae(`Problem with setting cache for selector "${n}": ${re.message}`)}}function Q(N){if(Jl.includes(n)){const B=`Recoil selector has circular dependencies: ${Jl.slice(Jl.indexOf(n)).join(" → ")}`;return Ud(Ae(B))}Jl.push(n);try{return N()}finally{Jl.pop()}}function U(N,B){const G=B.atomValues.get(n);return G??a.get(re=>{var K;return typeof re!="string"&&mu(!1),(K=GU(N,B,re))===null||K===void 0?void 0:K.contents})}function W(N,B){return Q(()=>C(N,B))}function q(N){N.atomValues.delete(n)}function X(N,B){t==null&&mu(!1);for(const re of s){var G;const K=ZU(re);(G=K.clearCache)===null||G===void 0||G.call(K,N,B)}s.clear(),q(B),a.clear(),PS(N,t)}return o!=null?t=OS({key:n,nodeType:"selector",peek:U,get:W,set:(B,G,re)=>{let K=!1;const he=new Map;function me({key:we}){if(K)throw Ae("Recoil: Async selector sets are not currently supported.");const ke=Vd(B,G,we);if(ke.state==="hasValue")return ke.contents;if(ke.state==="loading"){const Pe=`Getting value of asynchronous atom or selector "${we}" in a pending state while setting selector "${n}" is not yet supported.`;throw Ae(Pe)}else throw ke.contents}function le(we,ke){if(K)throw Ae("Recoil: Async selector sets are not currently supported.");const Pe=typeof ke=="function"?ke(me(we)):ke;KU(B,G,we.key,Pe).forEach((wt,ht)=>he.set(ht,wt))}function $e(we){le(we,QU)}const De=o({set:le,get:me,reset:$e},re);if(De!==void 0)throw Ge(De)?Ae("Recoil: Async selector sets are not currently supported."):Ae("Recoil: selector set should be a void function.");return K=!0,he},init:f,invalidate:q,clearCache:X,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l}):t=OS({key:n,nodeType:"selector",peek:U,get:W,init:f,invalidate:q,clearCache:X,shouldDeleteConfigOnRelease:h,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}Z$.value=e=>new Q$(e);var sl=Z$;const{isLoadable:iV,loadableWithError:Ag,loadableWithPromise:Rg,loadableWithValue:Bs}=Gc,{WrappedValue:J$}=G$,{peekNodeInfo:oV}=Eo,{DEFAULT_VALUE:Io,DefaultValue:Di,getConfigDeletionHandler:eT,registerNode:sV,setConfigDeletionHandler:aV}=yn,{isRecoilValue:lV}=rl,{getRecoilValueAsLoadable:uV,markRecoilValueModified:cV,setRecoilValue:IS,setRecoilValueLoadable:dV}=zr,{retainedByOptionWithDefault:fV}=Ts,eu=e=>e instanceof J$?e.value:e;function hV(e){const{key:t,persistence_UNSTABLE:n}=e,r=fV(e.retainedBy_UNSTABLE);let i=0;function o(p){return Rg(p.then(v=>(s=Bs(v),v)).catch(v=>{throw s=Ag(v),v}))}let s=Ge(e.default)?o(e.default):iV(e.default)?e.default.state==="loading"?o(e.default.contents):e.default:Bs(eu(e.default));s.contents;let a;const l=new Map;function u(p){return p}function c(p,v){const x=v.then(S=>{var w,E;return((E=((w=p.getState().nextTree)!==null&&w!==void 0?w:p.getState().currentTree).atomValues.get(t))===null||E===void 0?void 0:E.contents)===x&&IS(p,m,S),S}).catch(S=>{var w,E;throw((E=((w=p.getState().nextTree)!==null&&w!==void 0?w:p.getState().currentTree).atomValues.get(t))===null||E===void 0?void 0:E.contents)===x&&dV(p,m,Ag(S)),S});return x}function d(p,v,x){var S;i++;const w=()=>{var A;i--,(A=l.get(p))===null||A===void 0||A.forEach(M=>M()),l.delete(p)};if(p.getState().knownAtoms.add(t),s.state==="loading"){const A=()=>{var M;((M=p.getState().nextTree)!==null&&M!==void 0?M:p.getState().currentTree).atomValues.has(t)||cV(p,m)};s.contents.finally(A)}const E=(S=e.effects)!==null&&S!==void 0?S:e.effects_UNSTABLE;if(E!=null){let A=function(q){if(D&&q.key===t){const X=k;return X instanceof Di?f(p,v):Ge(X)?Rg(X.then(N=>N instanceof Di?s.toPromise():N)):Bs(X)}return uV(p,q)},M=function(q){return A(q).toPromise()},R=function(q){var X;const N=oV(p,(X=p.getState().nextTree)!==null&&X!==void 0?X:p.getState().currentTree,q.key);return D&&q.key===t&&!(k instanceof Di)?{...N,isSet:!0,loadable:A(q)}:N},k=Io,D=!0,P=!1,H=null;const Q=q=>X=>{if(D){const N=A(m),B=N.state==="hasValue"?N.contents:Io;k=typeof X=="function"?X(B):X,Ge(k)&&(k=k.then(G=>(H={effect:q,value:G},G)))}else{if(Ge(X))throw Ae("Setting atoms to async values is not implemented.");typeof X!="function"&&(H={effect:q,value:eu(X)}),IS(p,m,typeof X=="function"?N=>{const B=eu(X(N));return H={effect:q,value:B},B}:eu(X))}},U=q=>()=>Q(q)(Io),W=q=>X=>{var N;const{release:B}=p.subscribeToTransactions(G=>{var re;let{currentTree:K,previousTree:he}=G.getState();he||(he=K);const me=(re=K.atomValues.get(t))!==null&&re!==void 0?re:s;if(me.state==="hasValue"){var le,$e,De,we;const ke=me.contents,Pe=(le=he.atomValues.get(t))!==null&&le!==void 0?le:s,On=Pe.state==="hasValue"?Pe.contents:Io;(($e=H)===null||$e===void 0?void 0:$e.effect)!==q||((De=H)===null||De===void 0?void 0:De.value)!==ke?X(ke,On,!K.atomValues.has(t)):((we=H)===null||we===void 0?void 0:we.effect)===q&&(H=null)}},t);l.set(p,[...(N=l.get(p))!==null&&N!==void 0?N:[],B])};for(const q of E)try{const X=q({node:m,storeID:p.storeID,parentStoreID_UNSTABLE:p.parentStoreID,trigger:x,setSelf:Q(q),resetSelf:U(q),onSet:W(q),getPromise:M,getLoadable:A,getInfo_UNSTABLE:R});if(X!=null){var C;l.set(p,[...(C=l.get(p))!==null&&C!==void 0?C:[],X])}}catch(X){k=X,P=!0}if(D=!1,!(k instanceof Di)){var T;const q=P?Ag(k):Ge(k)?Rg(c(p,k)):Bs(eu(k));q.contents,v.atomValues.set(t,q),(T=p.getState().nextTree)===null||T===void 0||T.atomValues.set(t,q)}}return w}function f(p,v){var x,S;return(x=(S=v.atomValues.get(t))!==null&&S!==void 0?S:a)!==null&&x!==void 0?x:s}function h(p,v){if(v.atomValues.has(t))return Ze(v.atomValues.get(t));if(v.nonvalidatedAtoms.has(t)){if(a!=null)return a;if(n==null)return s;const x=v.nonvalidatedAtoms.get(t),S=n.validator(x,Io);return a=S instanceof Di?s:Bs(S),a}else return s}function g(){a=void 0}function y(p,v,x){if(v.atomValues.has(t)){const S=Ze(v.atomValues.get(t));if(S.state==="hasValue"&&x===S.contents)return new Map}else if(!v.nonvalidatedAtoms.has(t)&&x instanceof Di)return new Map;return a=void 0,new Map().set(t,Bs(x))}function _(){return eT(t)!==void 0&&i<=0}const m=sV({key:t,nodeType:"atom",peek:f,get:h,set:y,init:d,invalidate:g,shouldDeleteConfigOnRelease:_,dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:r});return m}function I2(e){const{...t}=e,n="default"in e?e.default:new Promise(()=>{});return lV(n)?pV({...t,default:n}):hV({...t,default:n})}function pV(e){const t=I2({...e,default:Io,persistence_UNSTABLE:e.persistence_UNSTABLE===void 0?void 0:{...e.persistence_UNSTABLE,validator:r=>r instanceof Di?r:Ze(e.persistence_UNSTABLE).validator(r,Io)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),n=sl({key:`${e.key}__withFallback`,get:({get:r})=>{const i=r(t);return i instanceof Di?e.default:i},set:({set:r},i)=>r(t,i),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return aV(n.key,eT(e.key)),n}I2.value=e=>new J$(e);var tT=I2;class gV{constructor(t){var n;Ce(this,"_map",void 0),Ce(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=(n=t==null?void 0:t.mapKey)!==null&&n!==void 0?n:r=>r}size(){return this._map.size}has(t){return this._map.has(this._keyMapper(t))}get(t){return this._map.get(this._keyMapper(t))}set(t,n){this._map.set(this._keyMapper(t),n)}delete(t){this._map.delete(this._keyMapper(t))}clear(){this._map.clear()}}var mV={MapCache:gV},yV=mV.MapCache,vV=Object.freeze({__proto__:null,MapCache:yV});const{LRUCache:DS}=Y$,{MapCache:_V}=vV,Bd={equality:"reference",eviction:"none",maxSize:1/0};function xV({equality:e=Bd.equality,eviction:t=Bd.eviction,maxSize:n=Bd.maxSize}=Bd){const r=SV(e);return wV(t,n,r)}function SV(e){switch(e){case"reference":return t=>t;case"value":return t=>ep(t)}throw Ae(`Unrecognized equality policy ${e}`)}function wV(e,t,n){switch(e){case"keep-all":return new _V({mapKey:n});case"lru":return new DS({mapKey:n,maxSize:Ze(t)});case"most-recent":return new DS({mapKey:n,maxSize:1})}throw Ae(`Unrecognized eviction policy ${e}`)}var nT=xV;const{setConfigDeletionHandler:bV}=yn;function EV(e){var t,n;const r=nT({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return i=>{var o,s;const a=r.get(i);if(a!=null)return a;const{cachePolicyForParams_UNSTABLE:l,...u}=e,c="default"in e?e.default:new Promise(()=>{}),d=tT({...u,key:`${e.key}__${(o=ep(i))!==null&&o!==void 0?o:"void"}`,default:typeof c=="function"?c(i):c,retainedBy_UNSTABLE:typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(i):e.retainedBy_UNSTABLE,effects:typeof e.effects=="function"?e.effects(i):typeof e.effects_UNSTABLE=="function"?e.effects_UNSTABLE(i):(s=e.effects)!==null&&s!==void 0?s:e.effects_UNSTABLE});return r.set(i,d),bV(d.key,()=>{r.delete(i)}),d}}var CV=EV;const{setConfigDeletionHandler:AV}=yn;let RV=0;function $V(e){var t,n;const r=nT({equality:(t=(n=e.cachePolicyForParams_UNSTABLE)===null||n===void 0?void 0:n.equality)!==null&&t!==void 0?t:"value",eviction:"keep-all"});return i=>{var o;let s;try{s=r.get(i)}catch(f){throw Ae(`Problem with cache lookup for selector ${e.key}: ${f.message}`)}if(s!=null)return s;const a=`${e.key}__selectorFamily/${(o=ep(i,{allowFunctions:!0}))!==null&&o!==void 0?o:"void"}/${RV++}`,l=f=>e.get(i)(f),u=e.cachePolicy_UNSTABLE,c=typeof e.retainedBy_UNSTABLE=="function"?e.retainedBy_UNSTABLE(i):e.retainedBy_UNSTABLE;let d;if(e.set!=null){const f=e.set;d=sl({key:a,get:l,set:(g,y)=>f(i)(g,y),cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c})}else d=sl({key:a,get:l,cachePolicy_UNSTABLE:u,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:c});return r.set(i,d),AV(d.key,()=>{r.delete(i)}),d}}var Co=$V;const TV=Co({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}});function kV(e){return TV(e)}var MV=kV;const NV=Co({key:"__error",get:e=>()=>{throw Ae(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}});function LV(e){return NV(e)}var OV=LV;function PV(e){return e}var IV=PV;const{loadableWithError:rT,loadableWithPromise:iT,loadableWithValue:oT}=Gc;function tp(e,t){const n=Array(t.length).fill(void 0),r=Array(t.length).fill(void 0);for(const[i,o]of t.entries())try{n[i]=e(o)}catch(s){r[i]=s}return[n,r]}function DV(e){return e!=null&&!Ge(e)}function np(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function qy(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((n,r,i)=>({...n,[r]:t[i]}),{})}function Ca(e,t,n){const r=n.map((i,o)=>i==null?oT(t[o]):Ge(i)?iT(i):rT(i));return qy(e,r)}function jV(e,t){return t.map((n,r)=>n===void 0?e[r]:n)}const FV=Co({key:"__waitForNone",get:e=>({get:t})=>{const n=np(e),[r,i]=tp(t,n);return Ca(e,r,i)},dangerouslyAllowMutability:!0}),UV=Co({key:"__waitForAny",get:e=>({get:t})=>{const n=np(e),[r,i]=tp(t,n);return i.some(o=>!Ge(o))?Ca(e,r,i):new Promise(o=>{for(const[s,a]of i.entries())Ge(a)&&a.then(l=>{r[s]=l,i[s]=void 0,o(Ca(e,r,i))}).catch(l=>{i[s]=l,o(Ca(e,r,i))})})},dangerouslyAllowMutability:!0}),VV=Co({key:"__waitForAll",get:e=>({get:t})=>{const n=np(e),[r,i]=tp(t,n);if(i.every(s=>s==null))return qy(e,r);const o=i.find(DV);if(o!=null)throw o;return Promise.all(i).then(s=>qy(e,jV(r,s)))},dangerouslyAllowMutability:!0}),zV=Co({key:"__waitForAllSettled",get:e=>({get:t})=>{const n=np(e),[r,i]=tp(t,n);return i.every(o=>!Ge(o))?Ca(e,r,i):Promise.all(i.map((o,s)=>Ge(o)?o.then(a=>{r[s]=a,i[s]=void 0}).catch(a=>{r[s]=void 0,i[s]=a}):null)).then(()=>Ca(e,r,i))},dangerouslyAllowMutability:!0}),BV=Co({key:"__noWait",get:e=>({get:t})=>{try{return sl.value(oT(t(e)))}catch(n){return sl.value(Ge(n)?iT(n):rT(n))}},dangerouslyAllowMutability:!0});var HV={waitForNone:FV,waitForAny:UV,waitForAll:VV,waitForAllSettled:zV,noWait:BV};const{RecoilLoadable:WV}=Gc,{DefaultValue:qV}=yn,{RecoilRoot:GV,useRecoilStoreID:KV}=bi,{isRecoilValue:YV}=rl,{retentionZone:QV}=B0,{freshSnapshot:XV}=Y0,{useRecoilState:ZV,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:JV,useRecoilStateLoadable:ez,useRecoilValue:tz,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:nz,useRecoilValueLoadable:rz,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:iz,useResetRecoilState:oz,useSetRecoilState:sz}=m7,{useGotoRecoilSnapshot:az,useRecoilSnapshot:lz,useRecoilTransactionObserver:uz}=z$,{useRecoilCallback:cz}=q$,{noWait:dz,waitForAll:fz,waitForAllSettled:hz,waitForAny:pz,waitForNone:gz}=HV;var D2={DefaultValue:qV,isRecoilValue:YV,RecoilLoadable:WV,RecoilEnv:wl,RecoilRoot:GV,useRecoilStoreID:KV,useRecoilBridgeAcrossReactRoots_UNSTABLE:B7,atom:tT,selector:sl,atomFamily:CV,selectorFamily:Co,constSelector:MV,errorSelector:OV,readOnlySelector:IV,noWait:dz,waitForNone:gz,waitForAny:pz,waitForAll:fz,waitForAllSettled:hz,useRecoilValue:tz,useRecoilValueLoadable:rz,useRecoilState:ZV,useRecoilStateLoadable:ez,useSetRecoilState:sz,useResetRecoilState:oz,useGetRecoilValueInfo_UNSTABLE:D7,useRecoilRefresher_UNSTABLE:vU,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:iz,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:nz,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:JV,useRecoilCallback:cz,useRecoilTransaction_UNSTABLE:bU,useGotoRecoilSnapshot:az,useRecoilSnapshot:lz,useRecoilTransactionObserver_UNSTABLE:uz,snapshot_UNSTABLE:XV,useRetain:M2,retentionZone:QV},mz=D2.RecoilRoot,sT=D2.atom,jS=D2.useRecoilState,Jc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},al=typeof window>"u"||"Deno"in globalThis;function Un(){}function yz(e,t){return typeof e=="function"?e(t):e}function Gy(e){return typeof e=="number"&&e>=0&&e!==1/0}function aT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function FS(e,t){const{type:n="all",exact:r,fetchStatus:i,predicate:o,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==j2(s,t.options))return!1}else if(!cc(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||i&&i!==t.state.fetchStatus||o&&!o(t))}function US(e,t){const{exact:n,status:r,predicate:i,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(uc(t.options.mutationKey)!==uc(o))return!1}else if(!cc(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function j2(e,t){return((t==null?void 0:t.queryKeyHashFn)||uc)(e)}function uc(e){return JSON.stringify(e,(t,n)=>Yy(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function cc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!cc(e[n],t[n])):!1}function lT(e,t){if(e===t)return e;const n=VS(e)&&VS(t);if(n||Yy(e)&&Yy(t)){const r=n?e:Object.keys(e),i=r.length,o=n?t:Object.keys(t),s=o.length,a=n?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function Qy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?lT(e,t):t}function _z(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function xz(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var F2=Symbol(),Yo,Bi,La,QE,Sz=(QE=class extends Jc{constructor(){super();ge(this,Yo,void 0);ge(this,Bi,void 0);ge(this,La,void 0);ue(this,La,t=>{if(!al&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){O(this,Bi)||this.setEventListener(O(this,La))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Bi))==null||t.call(this),ue(this,Bi,void 0))}setEventListener(t){var n;ue(this,La,t),(n=O(this,Bi))==null||n.call(this),ue(this,Bi,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){O(this,Yo)!==t&&(ue(this,Yo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof O(this,Yo)=="boolean"?O(this,Yo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Yo=new WeakMap,Bi=new WeakMap,La=new WeakMap,QE),U2=new Sz,Oa,Hi,Pa,XE,wz=(XE=class extends Jc{constructor(){super();ge(this,Oa,!0);ge(this,Hi,void 0);ge(this,Pa,void 0);ue(this,Pa,t=>{if(!al&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){O(this,Hi)||this.setEventListener(O(this,Pa))}onUnsubscribe(){var t;this.hasListeners()||((t=O(this,Hi))==null||t.call(this),ue(this,Hi,void 0))}setEventListener(t){var n;ue(this,Pa,t),(n=O(this,Hi))==null||n.call(this),ue(this,Hi,t(this.setOnline.bind(this)))}setOnline(t){O(this,Oa)!==t&&(ue(this,Oa,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return O(this,Oa)}},Oa=new WeakMap,Hi=new WeakMap,Pa=new WeakMap,XE),xh=new wz;function bz(e){return Math.min(1e3*2**e,3e4)}function V2(e){return(e??"online")==="online"?xh.isOnline():!0}var uT=class{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function $g(e){return e instanceof uT}function cT(e){let t=!1,n=0,r=!1,i,o,s;const a=new Promise((_,m)=>{o=_,s=m}),l=_=>{var m;r||(h(new uT(_)),(m=e.abort)==null||m.call(e))},u=()=>{t=!0},c=()=>{t=!1},d=()=>!U2.isFocused()||e.networkMode!=="always"&&!xh.isOnline(),f=_=>{var m;r||(r=!0,(m=e.onSuccess)==null||m.call(e,_),i==null||i(),o(_))},h=_=>{var m;r||(r=!0,(m=e.onError)==null||m.call(e,_),i==null||i(),s(_))},g=()=>new Promise(_=>{var m;i=p=>{const v=r||!d();return v&&_(p),v},(m=e.onPause)==null||m.call(e)}).then(()=>{var _;i=void 0,r||(_=e.onContinue)==null||_.call(e)}),y=()=>{if(r)return;let _;try{_=e.fn()}catch(m){_=Promise.reject(m)}Promise.resolve(_).then(f).catch(m=>{var w;if(r)return;const p=e.retry??(al?0:3),v=e.retryDelay??bz,x=typeof v=="function"?v(n,m):v,S=p===!0||typeof p=="number"&&n{if(d())return g()}).then(()=>{t?h(m):y()})})};return V2(e.networkMode)?y():g().then(y),{promise:a,cancel:l,continue:()=>(i==null?void 0:i())?a:Promise.resolve(),cancelRetry:u,continueRetry:c}}function Ez(){let e=[],t=0,n=f=>{f()},r=f=>{f()},i=f=>setTimeout(f,0);const o=f=>{i=f},s=f=>{let h;t++;try{h=f()}finally{t--,t||u()}return h},a=f=>{t?e.push(f):i(()=>{n(f)})},l=f=>(...h)=>{a(()=>{f(...h)})},u=()=>{const f=e;e=[],f.length&&i(()=>{r(()=>{f.forEach(h=>{n(h)})})})};return{batch:s,batchCalls:l,schedule:a,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{r=f},setScheduler:o}}var Nt=Ez(),Qo,ZE,dT=(ZE=class{constructor(){ge(this,Qo,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Gy(this.gcTime)&&ue(this,Qo,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(al?1/0:5*60*1e3))}clearGcTimeout(){O(this,Qo)&&(clearTimeout(O(this,Qo)),ue(this,Qo,void 0))}},Qo=new WeakMap,ZE),Ia,Da,jn,Wt,Et,Tc,Xo,or,Yr,JE,Cz=(JE=class extends dT{constructor(t){super();ge(this,or);ge(this,Ia,void 0);ge(this,Da,void 0);ge(this,jn,void 0);ge(this,Wt,void 0);ge(this,Et,void 0);ge(this,Tc,void 0);ge(this,Xo,void 0);ue(this,Xo,!1),ue(this,Tc,t.defaultOptions),this.setOptions(t.options),ue(this,Et,[]),ue(this,jn,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,ue(this,Ia,t.state||Az(this.options)),this.state=O(this,Ia),this.scheduleGc()}get meta(){return this.options.meta}setOptions(t){this.options={...O(this,Tc),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!O(this,Et).length&&this.state.fetchStatus==="idle"&&O(this,jn).remove(this)}setData(t,n){const r=Qy(this.state.data,t,this.options);return Me(this,or,Yr).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Me(this,or,Yr).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,i;const n=(r=O(this,Wt))==null?void 0:r.promise;return(i=O(this,Wt))==null||i.cancel(t),n?n.then(Un).catch(Un):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(O(this,Ia))}isActive(){return O(this,Et).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?O(this,Et).some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!aT(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=O(this,Et).find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,Wt))==null||n.continue()}onOnline(){var n;const t=O(this,Et).find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=O(this,Wt))==null||n.continue()}addObserver(t){O(this,Et).includes(t)||(O(this,Et).push(t),this.clearGcTimeout(),O(this,jn).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){O(this,Et).includes(t)&&(ue(this,Et,O(this,Et).filter(n=>n!==t)),O(this,Et).length||(O(this,Wt)&&(O(this,Xo)?O(this,Wt).cancel({revert:!0}):O(this,Wt).cancelRetry()),this.scheduleGc()),O(this,jn).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return O(this,Et).length}invalidate(){this.state.isInvalidated||Me(this,or,Yr).call(this,{type:"invalidate"})}fetch(t,n){var u,c,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(O(this,Wt))return O(this,Wt).continueRetry(),O(this,Wt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const f=O(this,Et).find(h=>h.options.queryFn);f&&this.setOptions(f.options)}const r=new AbortController,i={queryKey:this.queryKey,meta:this.meta},o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(ue(this,Xo,!0),r.signal)})};o(i);const s=()=>!this.options.queryFn||this.options.queryFn===F2?Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)):(ue(this,Xo,!1),this.options.persister?this.options.persister(this.options.queryFn,i,this):this.options.queryFn(i)),a={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:s};o(a),(u=this.options.behavior)==null||u.onFetch(a,this),ue(this,Da,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((c=a.fetchOptions)==null?void 0:c.meta))&&Me(this,or,Yr).call(this,{type:"fetch",meta:(d=a.fetchOptions)==null?void 0:d.meta});const l=f=>{var h,g,y,_;$g(f)&&f.silent||Me(this,or,Yr).call(this,{type:"error",error:f}),$g(f)||((g=(h=O(this,jn).config).onError)==null||g.call(h,f,this),(_=(y=O(this,jn).config).onSettled)==null||_.call(y,this.state.data,f,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return ue(this,Wt,cT({fn:a.fetchFn,abort:r.abort.bind(r),onSuccess:f=>{var h,g,y,_;if(f===void 0){l(new Error(`${this.queryHash} data is undefined`));return}this.setData(f),(g=(h=O(this,jn).config).onSuccess)==null||g.call(h,f,this),(_=(y=O(this,jn).config).onSettled)==null||_.call(y,f,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:l,onFail:(f,h)=>{Me(this,or,Yr).call(this,{type:"failed",failureCount:f,error:h})},onPause:()=>{Me(this,or,Yr).call(this,{type:"pause"})},onContinue:()=>{Me(this,or,Yr).call(this,{type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode})),O(this,Wt).promise}},Ia=new WeakMap,Da=new WeakMap,jn=new WeakMap,Wt=new WeakMap,Et=new WeakMap,Tc=new WeakMap,Xo=new WeakMap,or=new WeakSet,Yr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...fT(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const i=t.error;return $g(i)&&i.revert&&O(this,Da)?{...O(this,Da),fetchStatus:"idle"}:{...r,error:i,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Nt.batch(()=>{O(this,Et).forEach(r=>{r.onQueryUpdate()}),O(this,jn).notify({query:this,type:"updated",action:t})})},JE);function fT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:V2(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Az(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Ar,eC,Rz=(eC=class extends Jc{constructor(t={}){super();ge(this,Ar,void 0);this.config=t,ue(this,Ar,new Map)}build(t,n,r){const i=n.queryKey,o=n.queryHash??j2(i,n);let s=this.get(o);return s||(s=new Cz({cache:this,queryKey:i,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){O(this,Ar).has(t.queryHash)||(O(this,Ar).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=O(this,Ar).get(t.queryHash);n&&(t.destroy(),n===t&&O(this,Ar).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Nt.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return O(this,Ar).get(t)}getAll(){return[...O(this,Ar).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>FS(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>FS(t,r)):n}notify(t){Nt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Nt.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Nt.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ar=new WeakMap,eC),Rr,kc,wn,ja,$r,Mi,tC,$z=(tC=class extends dT{constructor(t){super();ge(this,$r);ge(this,Rr,void 0);ge(this,kc,void 0);ge(this,wn,void 0);ge(this,ja,void 0);this.mutationId=t.mutationId,ue(this,kc,t.defaultOptions),ue(this,wn,t.mutationCache),ue(this,Rr,[]),this.state=t.state||Tz(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...O(this,kc),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){O(this,Rr).includes(t)||(O(this,Rr).push(t),this.clearGcTimeout(),O(this,wn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){ue(this,Rr,O(this,Rr).filter(n=>n!==t)),this.scheduleGc(),O(this,wn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){O(this,Rr).length||(this.state.status==="pending"?this.scheduleGc():O(this,wn).remove(this))}continue(){var t;return((t=O(this,ja))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var i,o,s,a,l,u,c,d,f,h,g,y,_,m,p,v,x,S,w,E;const n=()=>(ue(this,ja,cT({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(C,T)=>{Me(this,$r,Mi).call(this,{type:"failed",failureCount:C,error:T})},onPause:()=>{Me(this,$r,Mi).call(this,{type:"pause"})},onContinue:()=>{Me(this,$r,Mi).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),O(this,ja).promise),r=this.state.status==="pending";try{if(!r){Me(this,$r,Mi).call(this,{type:"pending",variables:t}),await((o=(i=O(this,wn).config).onMutate)==null?void 0:o.call(i,t,this));const T=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));T!==this.state.context&&Me(this,$r,Mi).call(this,{type:"pending",context:T,variables:t})}const C=await n();return await((u=(l=O(this,wn).config).onSuccess)==null?void 0:u.call(l,C,t,this.state.context,this)),await((d=(c=this.options).onSuccess)==null?void 0:d.call(c,C,t,this.state.context)),await((h=(f=O(this,wn).config).onSettled)==null?void 0:h.call(f,C,null,this.state.variables,this.state.context,this)),await((y=(g=this.options).onSettled)==null?void 0:y.call(g,C,null,t,this.state.context)),Me(this,$r,Mi).call(this,{type:"success",data:C}),C}catch(C){try{throw await((m=(_=O(this,wn).config).onError)==null?void 0:m.call(_,C,t,this.state.context,this)),await((v=(p=this.options).onError)==null?void 0:v.call(p,C,t,this.state.context)),await((S=(x=O(this,wn).config).onSettled)==null?void 0:S.call(x,void 0,C,this.state.variables,this.state.context,this)),await((E=(w=this.options).onSettled)==null?void 0:E.call(w,void 0,C,t,this.state.context)),C}finally{Me(this,$r,Mi).call(this,{type:"error",error:C})}}}},Rr=new WeakMap,kc=new WeakMap,wn=new WeakMap,ja=new WeakMap,$r=new WeakSet,Mi=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!V2(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Nt.batch(()=>{O(this,Rr).forEach(r=>{r.onMutationUpdate(t)}),O(this,wn).notify({mutation:this,type:"updated",action:t})})},tC);function Tz(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Fn,Mc,Zo,nC,kz=(nC=class extends Jc{constructor(t={}){super();ge(this,Fn,void 0);ge(this,Mc,void 0);ge(this,Zo,void 0);this.config=t,ue(this,Fn,[]),ue(this,Mc,0)}build(t,n,r){const i=new $z({mutationCache:this,mutationId:++Sd(this,Mc)._,options:t.defaultMutationOptions(n),state:r});return this.add(i),i}add(t){O(this,Fn).push(t),this.notify({type:"added",mutation:t})}remove(t){ue(this,Fn,O(this,Fn).filter(n=>n!==t)),this.notify({type:"removed",mutation:t})}clear(){Nt.batch(()=>{O(this,Fn).forEach(t=>{this.remove(t)})})}getAll(){return O(this,Fn)}find(t){const n={exact:!0,...t};return O(this,Fn).find(r=>US(n,r))}findAll(t={}){return O(this,Fn).filter(n=>US(t,n))}notify(t){Nt.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){return ue(this,Zo,(O(this,Zo)??Promise.resolve()).then(()=>{const t=O(this,Fn).filter(n=>n.state.isPaused);return Nt.batch(()=>t.reduce((n,r)=>n.then(()=>r.continue().catch(Un)),Promise.resolve()))}).then(()=>{ue(this,Zo,void 0)})),O(this,Zo)}},Fn=new WeakMap,Mc=new WeakMap,Zo=new WeakMap,nC);function Mz(e){return{onFetch:(t,n)=>{const r=async()=>{var g,y,_,m,p;const i=t.options,o=(_=(y=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:y.fetchMore)==null?void 0:_.direction,s=((m=t.state.data)==null?void 0:m.pages)||[],a=((p=t.state.data)==null?void 0:p.pageParams)||[],l={pages:[],pageParams:[]};let u=!1;const c=v=>{Object.defineProperty(v,"signal",{enumerable:!0,get:()=>(t.signal.aborted?u=!0:t.signal.addEventListener("abort",()=>{u=!0}),t.signal)})},d=t.options.queryFn&&t.options.queryFn!==F2?t.options.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`)),f=async(v,x,S)=>{if(u)return Promise.reject();if(x==null&&v.pages.length)return Promise.resolve(v);const w={queryKey:t.queryKey,pageParam:x,direction:S?"backward":"forward",meta:t.options.meta};c(w);const E=await d(w),{maxPages:C}=t.options,T=S?xz:_z;return{pages:T(v.pages,E,C),pageParams:T(v.pageParams,x,C)}};let h;if(o&&s.length){const v=o==="backward",x=v?Nz:BS,S={pages:s,pageParams:a},w=x(i,S);h=await f(S,w,v)}else{h=await f(l,a[0]??i.initialPageParam);const v=e??s.length;for(let x=1;x{var i,o;return(o=(i=t.options).persister)==null?void 0:o.call(i,r,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=r}}}function BS(e,{pages:t,pageParams:n}){const r=t.length-1;return e.getNextPageParam(t[r],t,n[r],n)}function Nz(e,{pages:t,pageParams:n}){var r;return(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n)}var rt,Wi,qi,Fa,Ua,Gi,Va,za,rC,Lz=(rC=class{constructor(e={}){ge(this,rt,void 0);ge(this,Wi,void 0);ge(this,qi,void 0);ge(this,Fa,void 0);ge(this,Ua,void 0);ge(this,Gi,void 0);ge(this,Va,void 0);ge(this,za,void 0);ue(this,rt,e.queryCache||new Rz),ue(this,Wi,e.mutationCache||new kz),ue(this,qi,e.defaultOptions||{}),ue(this,Fa,new Map),ue(this,Ua,new Map),ue(this,Gi,0)}mount(){Sd(this,Gi)._++,O(this,Gi)===1&&(ue(this,Va,U2.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,rt).onFocus())})),ue(this,za,xh.subscribe(async e=>{e&&(await this.resumePausedMutations(),O(this,rt).onOnline())})))}unmount(){var e,t;Sd(this,Gi)._--,O(this,Gi)===0&&((e=O(this,Va))==null||e.call(this),ue(this,Va,void 0),(t=O(this,za))==null||t.call(this),ue(this,za,void 0))}isFetching(e){return O(this,rt).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return O(this,Wi).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,rt).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=O(this,rt).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(n.staleTime)&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return O(this,rt).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),i=O(this,rt).get(r.queryHash),o=i==null?void 0:i.state.data,s=yz(t,o);if(s!==void 0)return O(this,rt).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return Nt.batch(()=>O(this,rt).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=O(this,rt).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=O(this,rt);Nt.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=O(this,rt),r={type:"active",...e};return Nt.batch(()=>(n.findAll(e).forEach(i=>{i.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=Nt.batch(()=>O(this,rt).findAll(e).map(i=>i.cancel(n)));return Promise.all(r).then(Un).catch(Un)}invalidateQueries(e={},t={}){return Nt.batch(()=>{if(O(this,rt).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=Nt.batch(()=>O(this,rt).findAll(e).filter(i=>!i.isDisabled()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(Un)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Un)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=O(this,rt).build(this,t);return n.isStaleByTime(t.staleTime)?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Un).catch(Un)}fetchInfiniteQuery(e){return e.behavior=Mz(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Un).catch(Un)}resumePausedMutations(){return xh.isOnline()?O(this,Wi).resumePausedMutations():Promise.resolve()}getQueryCache(){return O(this,rt)}getMutationCache(){return O(this,Wi)}getDefaultOptions(){return O(this,qi)}setDefaultOptions(e){ue(this,qi,e)}setQueryDefaults(e,t){O(this,Fa).set(uc(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...O(this,Fa).values()];let n={};return t.forEach(r=>{cc(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){O(this,Ua).set(uc(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...O(this,Ua).values()];let n={};return t.forEach(r=>{cc(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...O(this,qi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=j2(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.enabled!==!0&&t.queryFn===F2&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...O(this,qi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){O(this,rt).clear(),O(this,Wi).clear()}},rt=new WeakMap,Wi=new WeakMap,qi=new WeakMap,Fa=new WeakMap,Ua=new WeakMap,Gi=new WeakMap,Va=new WeakMap,za=new WeakMap,rC),sn,ze,Nc,qt,Jo,Ba,Tr,Lc,Ha,Wa,es,ts,Ki,qa,ns,yu,Oc,Xy,Pc,Zy,Ic,Jy,Dc,ev,jc,tv,Fc,nv,Uc,rv,g0,hT,iC,Oz=(iC=class extends Jc{constructor(t,n){super();ge(this,ns);ge(this,Oc);ge(this,Pc);ge(this,Ic);ge(this,Dc);ge(this,jc);ge(this,Fc);ge(this,Uc);ge(this,g0);ge(this,sn,void 0);ge(this,ze,void 0);ge(this,Nc,void 0);ge(this,qt,void 0);ge(this,Jo,void 0);ge(this,Ba,void 0);ge(this,Tr,void 0);ge(this,Lc,void 0);ge(this,Ha,void 0);ge(this,Wa,void 0);ge(this,es,void 0);ge(this,ts,void 0);ge(this,Ki,void 0);ge(this,qa,new Set);this.options=n,ue(this,sn,t),ue(this,Tr,null),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(O(this,ze).addObserver(this),HS(O(this,ze),this.options)?Me(this,ns,yu).call(this):this.updateResult(),Me(this,Dc,ev).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return iv(O(this,ze),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return iv(O(this,ze),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Me(this,jc,tv).call(this),Me(this,Fc,nv).call(this),O(this,ze).removeObserver(this)}setOptions(t,n){const r=this.options,i=O(this,ze);if(this.options=O(this,sn).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");Me(this,Uc,rv).call(this),O(this,ze).setOptions(this.options),r._defaulted&&!Ky(this.options,r)&&O(this,sn).getQueryCache().notify({type:"observerOptionsUpdated",query:O(this,ze),observer:this});const o=this.hasListeners();o&&WS(O(this,ze),i,this.options,r)&&Me(this,ns,yu).call(this),this.updateResult(n),o&&(O(this,ze)!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&Me(this,Oc,Xy).call(this);const s=Me(this,Pc,Zy).call(this);o&&(O(this,ze)!==i||this.options.enabled!==r.enabled||s!==O(this,Ki))&&Me(this,Ic,Jy).call(this,s)}getOptimisticResult(t){const n=O(this,sn).getQueryCache().build(O(this,sn),t),r=this.createResult(n,t);return Iz(this,r)&&(ue(this,qt,r),ue(this,Ba,this.options),ue(this,Jo,O(this,ze).state)),r}getCurrentResult(){return O(this,qt)}trackResult(t,n){const r={};return Object.keys(t).forEach(i=>{Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(i),n==null||n(i),t[i])})}),r}trackProp(t){O(this,qa).add(t)}getCurrentQuery(){return O(this,ze)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=O(this,sn).defaultQueryOptions(t),r=O(this,sn).getQueryCache().build(O(this,sn),n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Me(this,ns,yu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),O(this,qt)))}createResult(t,n){var E;const r=O(this,ze),i=this.options,o=O(this,qt),s=O(this,Jo),a=O(this,Ba),u=t!==r?t.state:O(this,Nc),{state:c}=t;let d={...c},f=!1,h;if(n._optimisticResults){const C=this.hasListeners(),T=!C&&HS(t,n),A=C&&WS(t,r,n,i);(T||A)&&(d={...d,...fT(c.data,t.options)}),n._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:g,errorUpdatedAt:y,status:_}=d;if(n.select&&d.data!==void 0)if(o&&d.data===(s==null?void 0:s.data)&&n.select===O(this,Lc))h=O(this,Ha);else try{ue(this,Lc,n.select),h=n.select(d.data),h=Qy(o==null?void 0:o.data,h,n),ue(this,Ha,h),ue(this,Tr,null)}catch(C){ue(this,Tr,C)}else h=d.data;if(n.placeholderData!==void 0&&h===void 0&&_==="pending"){let C;if(o!=null&&o.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))C=o.data;else if(C=typeof n.placeholderData=="function"?n.placeholderData((E=O(this,Wa))==null?void 0:E.state.data,O(this,Wa)):n.placeholderData,n.select&&C!==void 0)try{C=n.select(C),ue(this,Tr,null)}catch(T){ue(this,Tr,T)}C!==void 0&&(_="success",h=Qy(o==null?void 0:o.data,C,n),f=!0)}O(this,Tr)&&(g=O(this,Tr),h=O(this,Ha),y=Date.now(),_="error");const m=d.fetchStatus==="fetching",p=_==="pending",v=_==="error",x=p&&m,S=h!==void 0;return{status:_,fetchStatus:d.fetchStatus,isPending:p,isSuccess:_==="success",isError:v,isInitialLoading:x,isLoading:x,data:h,dataUpdatedAt:d.dataUpdatedAt,error:g,errorUpdatedAt:y,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>u.dataUpdateCount||d.errorUpdateCount>u.errorUpdateCount,isFetching:m,isRefetching:m&&!p,isLoadingError:v&&!S,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:v&&S,isStale:z2(t,n),refetch:this.refetch}}updateResult(t){const n=O(this,qt),r=this.createResult(O(this,ze),this.options);if(ue(this,Jo,O(this,ze).state),ue(this,Ba,this.options),O(this,Jo).data!==void 0&&ue(this,Wa,O(this,ze)),Ky(r,n))return;ue(this,qt,r);const i={},o=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!O(this,qa).size)return!0;const l=new Set(a??O(this,qa));return this.options.throwOnError&&l.add("error"),Object.keys(O(this,qt)).some(u=>{const c=u;return O(this,qt)[c]!==n[c]&&l.has(c)})};(t==null?void 0:t.listeners)!==!1&&o()&&(i.listeners=!0),Me(this,g0,hT).call(this,{...i,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Me(this,Dc,ev).call(this)}},sn=new WeakMap,ze=new WeakMap,Nc=new WeakMap,qt=new WeakMap,Jo=new WeakMap,Ba=new WeakMap,Tr=new WeakMap,Lc=new WeakMap,Ha=new WeakMap,Wa=new WeakMap,es=new WeakMap,ts=new WeakMap,Ki=new WeakMap,qa=new WeakMap,ns=new WeakSet,yu=function(t){Me(this,Uc,rv).call(this);let n=O(this,ze).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Un)),n},Oc=new WeakSet,Xy=function(){if(Me(this,jc,tv).call(this),al||O(this,qt).isStale||!Gy(this.options.staleTime))return;const n=aT(O(this,qt).dataUpdatedAt,this.options.staleTime)+1;ue(this,es,setTimeout(()=>{O(this,qt).isStale||this.updateResult()},n))},Pc=new WeakSet,Zy=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(O(this,ze)):this.options.refetchInterval)??!1},Ic=new WeakSet,Jy=function(t){Me(this,Fc,nv).call(this),ue(this,Ki,t),!(al||this.options.enabled===!1||!Gy(O(this,Ki))||O(this,Ki)===0)&&ue(this,ts,setInterval(()=>{(this.options.refetchIntervalInBackground||U2.isFocused())&&Me(this,ns,yu).call(this)},O(this,Ki)))},Dc=new WeakSet,ev=function(){Me(this,Oc,Xy).call(this),Me(this,Ic,Jy).call(this,Me(this,Pc,Zy).call(this))},jc=new WeakSet,tv=function(){O(this,es)&&(clearTimeout(O(this,es)),ue(this,es,void 0))},Fc=new WeakSet,nv=function(){O(this,ts)&&(clearInterval(O(this,ts)),ue(this,ts,void 0))},Uc=new WeakSet,rv=function(){const t=O(this,sn).getQueryCache().build(O(this,sn),this.options);if(t===O(this,ze))return;const n=O(this,ze);ue(this,ze,t),ue(this,Nc,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},g0=new WeakSet,hT=function(t){Nt.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(O(this,qt))}),O(this,sn).getQueryCache().notify({query:O(this,ze),type:"observerResultsUpdated"})})},iC);function Pz(e,t){return t.enabled!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function HS(e,t){return Pz(e,t)||e.state.data!==void 0&&iv(e,t,t.refetchOnMount)}function iv(e,t,n){if(t.enabled!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&z2(e,t)}return!1}function WS(e,t,n,r){return(e!==t||r.enabled===!1)&&(!n.suspense||e.state.status!=="error")&&z2(e,n)}function z2(e,t){return t.enabled!==!1&&e.isStaleByTime(t.staleTime)}function Iz(e,t){return!Ky(e.getCurrentResult(),t)}var pT=z.createContext(void 0),Dz=e=>{const t=z.useContext(pT);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jz=({client:e,children:t})=>(z.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),$.jsx(pT.Provider,{value:e,children:t})),gT=z.createContext(!1),Fz=()=>z.useContext(gT);gT.Provider;function Uz(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Vz=z.createContext(Uz()),zz=()=>z.useContext(Vz);function Bz(e,t){return typeof e=="function"?e(...t):!!e}var Hz=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},Wz=e=>{z.useEffect(()=>{e.clearReset()},[e])},qz=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&Bz(n,[e.error,r]),Gz=e=>{e.suspense&&typeof e.staleTime!="number"&&(e.staleTime=1e3)},Kz=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Yz=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Qz(e,t,n){const r=Dz(n),i=Fz(),o=zz(),s=r.defaultQueryOptions(e);s._optimisticResults=i?"isRestoring":"optimistic",Gz(s),Hz(s,o),Wz(o);const[a]=z.useState(()=>new t(r,s)),l=a.getOptimisticResult(s);if(z.useSyncExternalStore(z.useCallback(u=>{const c=i?()=>{}:a.subscribe(Nt.batchCalls(u));return a.updateResult(),c},[a,i]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),z.useEffect(()=>{a.setOptions(s,{listeners:!1})},[s,a]),Kz(s,l))throw Yz(s,a,o);if(qz({result:l,errorResetBoundary:o,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw l.error;return s.notifyOnChangeProps?l:a.trackResult(l)}function mT(e,t){return Qz(e,Oz,t)}const yT="Starter App",Xz="This field is required.",vT=8,Zz=`Password must be at least ${vT} characters long`,_T={required:Xz},Jz={..._T,minLength:{value:vT,message:Zz}},eB="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%3e%3cpath%20fill='none'%20d='M0%200h24v24H0z'/%3e%3cpath%20d='M22%2012c0-5.52-4.48-10-10-10S2%206.48%202%2012c0%204.84%203.44%208.87%208%209.8V15H8v-3h2V9.5C10%207.57%2011.57%206%2013.5%206H16v3h-2c-.55%200-1%20.45-1%201v2h3v3h-3v6.95c5.05-.5%209-4.76%209-9.95z'/%3e%3c/svg%3e",tB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M8.273%203.063c-.958.045-1.612.198-2.184.423a4.41%204.41%200%200%200-1.592%201.04%204.409%204.409%200%200%200-1.035%201.596c-.222.572-.372%201.227-.414%202.185-.042.958-.052%201.266-.047%203.71.005%202.444.016%202.75.062%203.71.046.958.198%201.612.423%202.184a4.41%204.41%200%200%200%201.04%201.592%204.4%204.4%200%200%200%201.597%201.035c.572.221%201.227.372%202.185.414.958.042%201.266.052%203.71.047%202.443-.005%202.75-.016%203.71-.061.96-.046%201.611-.199%202.183-.423a4.411%204.411%200%200%200%201.592-1.04%204.41%204.41%200%200%200%201.035-1.597c.222-.572.372-1.227.414-2.184.042-.96.052-1.268.047-3.711-.005-2.444-.016-2.75-.061-3.71-.046-.96-.198-1.612-.423-2.184a4.418%204.418%200%200%200-1.04-1.592%204.4%204.4%200%200%200-1.597-1.035c-.572-.221-1.227-.372-2.185-.414-.958-.041-1.266-.052-3.71-.047-2.444.005-2.75.015-3.71.062m.105%2016.27c-.878-.038-1.354-.184-1.672-.306a2.802%202.802%200%200%201-1.036-.671%202.772%202.772%200%200%201-.675-1.034c-.124-.317-.272-.793-.313-1.67-.045-.95-.054-1.234-.06-3.637-.004-2.403.005-2.687.046-3.636.038-.877.184-1.354.306-1.671.162-.421.357-.72.672-1.036a2.778%202.778%200%200%201%201.033-.675c.317-.124.793-.272%201.67-.313.95-.045%201.234-.054%203.637-.06%202.402-.005%202.687.004%203.637.046.876.038%201.354.183%201.67.306.421.162.72.357%201.037.671.316.315.511.613.675%201.034.124.317.271.792.313%201.67.045.95.055%201.234.06%203.636.004%202.402-.004%202.688-.046%203.636-.038.878-.184%201.354-.306%201.672a2.79%202.79%200%200%201-.672%201.036%202.78%202.78%200%200%201-1.033.675c-.317.124-.794.271-1.67.313-.95.045-1.234.054-3.637.06-2.403.005-2.687-.005-3.636-.046M15.715%207.19a1.08%201.08%200%201%200%202.16-.004%201.08%201.08%200%200%200-2.16.004m-8.336%204.819a4.62%204.62%200%201%200%209.242-.018%204.62%204.62%200%200%200-9.242.018M9%2012.006a3%203%200%201%201%206-.012%203%203%200%200%201-6%20.012'/%3e%3c/svg%3e",nB="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%3e%3ccircle%20cx='6.18'%20cy='17.82'%20r='2.18'/%3e%3cpath%20d='M4%204.44v2.83c7.03%200%2012.73%205.7%2012.73%2012.73h2.83c0-8.59-6.97-15.56-15.56-15.56zm0%205.66v2.83c3.9%200%207.07%203.17%207.07%207.07h2.83c0-5.47-4.43-9.9-9.9-9.9z'/%3e%3c/svg%3e",rB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.912%207.925v.527A11.562%2011.562%200%200%201%208.265%2020.098%2011.443%2011.443%200%200%201%202%2018.265c.328.017.657.017.985%200a8.132%208.132%200%200%200%205.093-1.698%204.092%204.092%200%200%201-3.786-2.852c.255.062.518.091.781.085.36-.002.72-.047%201.07-.136a4.109%204.109%200%200%201-3.21-4.024c.566.32%201.202.494%201.851.51a4.126%204.126%200%200%201-1.34-5.518%2011.613%2011.613%200%200%200%208.488%204.295%204.397%204.397%200%200%201-.119-.934%204.092%204.092%200%200%201%204.092-4.092%204.04%204.04%200%200%201%203.005%201.29%207.929%207.929%200%200%200%202.53-1c-.3.953-.94%201.763-1.8%202.274A7.725%207.725%200%200%200%2022%205.803a8.489%208.489%200%200%201-2.088%202.122Z'%20fill-rule='evenodd'/%3e%3c/svg%3e",iB="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19.816%205.389a2.469%202.469%200%200%201%201.766%201.746c.291%201.598.43%203.22.417%204.843a25.867%2025.867%200%200%201-.417%204.794%202.468%202.468%200%200%201-1.766%201.795c-2.593.318-5.204.46-7.816.429a58.411%2058.411%200%200%201-7.816-.429%202.469%202.469%200%200%201-1.766-1.746%2025.879%2025.879%200%200%201-.417-4.843%2025.85%2025.85%200%200%201%20.417-4.793%202.468%202.468%200%200%201%201.766-1.796c2.594-.3%205.205-.427%207.816-.379a58.413%2058.413%200%200%201%207.816.379ZM9.95%209.046v5.864l5.233-2.932L9.95%209.046Z'/%3e%3c/svg%3e",oB="/comet-starter/img/logo.png",sB=()=>{const e=t=>{t.preventDefault(),window.scrollTo(0,0)};return $.jsxs("footer",{className:"usa-footer",children:[$.jsx("div",{className:"grid-container usa-footer__return-to-top",children:$.jsx("a",{href:"/#",onClick:t=>{e(t)},children:"Return to top"})}),$.jsx("div",{className:"usa-footer__primary-section",children:$.jsx("nav",{className:"usa-footer__nav","aria-label":"Footer navigation",children:$.jsxs("ul",{className:"grid-row grid-gap",children:[$.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:$.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),$.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:$.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),$.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:$.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),$.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:$.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})}),$.jsx("li",{className:` + mobile-lg:grid-col-4 + desktop:grid-col-auto + usa-footer__primary-content + `,children:$.jsx("a",{className:"usa-footer__primary-link",href:"/#",children:""})})]})})}),$.jsx("div",{className:"usa-footer__secondary-section",children:$.jsx("div",{className:"grid-container",children:$.jsxs("div",{className:"grid-row grid-gap",children:[$.jsxs("div",{className:` + usa-footer__logo + grid-row + mobile-lg:grid-col-6 mobile-lg:grid-gap-2 + `,children:[$.jsx("div",{className:"mobile-lg:grid-col-auto",children:$.jsx("img",{className:"usa-footer__logo-img",src:oB,alt:"US Flag"})}),$.jsx("div",{className:"mobile-lg:grid-col-auto",children:$.jsx("p",{className:"usa-footer__logo-heading",children:yT})})]}),$.jsxs("div",{className:"usa-footer__contact-links mobile-lg:grid-col-6",children:[$.jsxs("div",{className:"usa-footer__social-links grid-row grid-gap-1",children:[$.jsx("div",{className:"grid-col-auto",children:$.jsx("a",{className:"usa-social-link",href:"/#",children:$.jsx("img",{className:"usa-social-link__icon",src:eB,alt:"Facebook"})})}),$.jsx("div",{className:"grid-col-auto",children:$.jsx("a",{className:"usa-social-link",href:"/#",children:$.jsx("img",{className:"usa-social-link__icon",src:rB,alt:"Twitter"})})}),$.jsx("div",{className:"grid-col-auto",children:$.jsx("a",{className:"usa-social-link",href:"/#",children:$.jsx("img",{className:"usa-social-link__icon",src:iB,alt:"YouTube"})})}),$.jsx("div",{className:"grid-col-auto",children:$.jsx("a",{className:"usa-social-link",href:"/#",children:$.jsx("img",{className:"usa-social-link__icon",src:tB,alt:"Instagram"})})}),$.jsx("div",{className:"grid-col-auto",children:$.jsx("a",{className:"usa-social-link",href:"/#",children:$.jsx("img",{className:"usa-social-link__icon",src:nB,alt:"RSS"})})})]}),$.jsx("h2",{className:"usa-footer__contact-heading",children:""}),$.jsx("address",{className:"usa-footer__address",children:$.jsxs("div",{className:"usa-footer__contact-info grid-row grid-gap",children:[$.jsx("div",{className:"grid-col-auto",children:$.jsx("a",{href:"tel:1-800-555-5555",children:" <(800) 555-GOVT> "})}),$.jsx("div",{className:"grid-col-auto",children:$.jsx("a",{href:"mailto:",children:""})})]})})]})]})})})]})},aB=e=>e&&typeof e=="object"&&e.nodeType===1;var Ao=(e,t)=>{if(typeof e!="string")return[];(!t||!aB(t))&&(t=window.document);const n=t.querySelectorAll(e);return Array.prototype.slice.call(n)};/* +object-assign +(c) Sindre Sorhus +@license MIT +*/var qS=Object.getOwnPropertySymbols,lB=Object.prototype.hasOwnProperty,uB=Object.prototype.propertyIsEnumerable;function cB(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function dB(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(r.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(o){i[o]=o}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var ed=dB()?Object.assign:function(e,t){for(var n,r=cB(e),i,o=1;o-1?e.split(KS).map(function(s){return ST({type:s},o)}):(o.type=e,[o])};var YS=function(e,t){var n=e[t];return delete e[t],n},H2=function(t,n){const r=Object.keys(t).reduce(function(i,o){var s=vB(o,t[o]);return i.concat(s)},[]);return ST({add:function(o){r.forEach(function(s){o.addEventListener(s.type,s.delegate,s.options)})},remove:function(o){r.forEach(function(s){o.removeEventListener(s.type,s.delegate,s.options)})}},n)};const _B=ed,xB=H2,QS=(...e)=>function(n=document.body){e.forEach(r=>{typeof this[r]=="function"&&this[r].call(this,n)})};var Jn=(e,t)=>xB(e,_B({on:QS("init","add"),off:QS("teardown","remove")},t));const XS="aria-expanded",SB="aria-controls",ZS="hidden";var wT=(e,t)=>{let n=t;typeof n!="boolean"&&(n=e.getAttribute(XS)==="false"),e.setAttribute(XS,n);const r=e.getAttribute(SB),i=document.getElementById(r);if(!i)throw new Error(`No toggle target found with id: "${r}"`);return n?i.removeAttribute(ZS):i.setAttribute(ZS,""),n};function wB(e,t=window,n=document.documentElement){const r=e.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(t.innerHeight||n.clientHeight)&&r.right<=(t.innerWidth||n.clientWidth)}var bT=wB,td={CLICK:"click"},_r={prefix:"usa"};const ET=Ao,bB=Jn,JS=wT,EB=bT,{CLICK:CB}=td,{prefix:Sh}=_r,wh=`.${Sh}-accordion, .${Sh}-accordion--bordered`,AB=`.${Sh}-banner__button`,Iu=`.${Sh}-accordion__button[aria-controls]:not(${AB})`,ew="aria-expanded",RB="data-allow-multiple",CT=e=>ET(Iu,e).filter(n=>n.closest(wh)===e),Du=(e,t)=>{const n=e.closest(wh);let r=t;if(!n)throw new Error(`${Iu} is missing outer ${wh}`);r=JS(e,t);const i=n.hasAttribute(RB);r&&!i&&CT(n).forEach(o=>{o!==e&&JS(o,!1)})},$B=e=>Du(e,!0),TB=e=>Du(e,!1),kB=bB({[CB]:{[Iu](){Du(this),this.getAttribute(ew)==="true"&&(EB(this)||this.scrollIntoView())}}},{init(e){ET(Iu,e).forEach(t=>{const n=t.getAttribute(ew)==="true";Du(t,n)})},ACCORDION:wh,BUTTON:Iu,show:$B,hide:TB,toggle:Du,getButtons:CT});var MB=kB;const tw=xi(MB),NB=Jn,LB=Ao,{CLICK:OB}=td,{prefix:AT}=_r,RT=wT,$T=`.${AT}-banner__header`,TT=`${AT}-banner__header--expanded`,ov=`${$T} [aria-controls]`,PB=function(t){t.preventDefault();const n=t.target.closest(ov);RT(n),this.closest($T).classList.toggle(TT)};var IB=NB({[OB]:{[ov]:PB}},{init(e){LB(ov,e).forEach(t=>{const n=t.getAttribute(TT)==="true";RT(t,n)})}});const nw=xi(IB),DB="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAAsBAMAAAAncaPMAAAAAXNSR0IArs4c6QAAABtQTFRF////4EAg2z8g2z8f2z4f2j4fHjSyHjOxHTOxQEYPwgAAAIdJREFUeNrNkUENxDAMBEOhFJaCKZiCKZhCKBj2ebV3rdR71+pIq+Qxj1GyqjJ3U8VlHkc07hFm0awBYe91juq6MSI0yhSAEgkzJ4TMKiXyzFw3pgR9lmIBJlqj2AmBedf+IycExmlKZVzvZEJ4A0oBrjBl/m6PCy95B3fFAN6YuQPxhbcB4QMkEj04wQXD5wAAAABJRU5ErkJggg==",jB="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%3e%3ctitle%3eicon-https%3c/title%3e%3cpath%20fill='%23719F2A'%20fill-rule='evenodd'%20d='M32%200c17.673%200%2032%2014.327%2032%2032%200%2017.673-14.327%2032-32%2032C14.327%2064%200%2049.673%200%2032%200%2014.327%2014.327%200%2032%200zm0%201.208C14.994%201.208%201.208%2014.994%201.208%2032S14.994%2062.792%2032%2062.792%2062.792%2049.006%2062.792%2032%2049.006%201.208%2032%201.208zm0%2018.886a7.245%207.245%200%200%201%207.245%207.245v3.103h.52c.86%200%201.557.698%201.557%201.558v9.322c0%20.86-.697%201.558-1.557%201.558h-15.53c-.86%200-1.557-.697-1.557-1.558V32c0-.86.697-1.558%201.557-1.558h.52V27.34A7.245%207.245%200%200%201%2032%2020.094zm0%203.103a4.142%204.142%200%200%200-4.142%204.142v3.103h8.284V27.34A4.142%204.142%200%200%200%2032%2023.197z'/%3e%3c/svg%3e",FB="data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%3e%3ctitle%3eicon-dot-gov%3c/title%3e%3cpath%20fill='%232378C3'%20fill-rule='evenodd'%20d='m32%200c17.7%200%2032%2014.3%2032%2032s-14.3%2032-32%2032-32-14.3-32-32%2014.3-32%2032-32zm0%201.2c-17%200-30.8%2013.8-30.8%2030.8s13.8%2030.8%2030.8%2030.8%2030.8-13.8%2030.8-30.8-13.8-30.8-30.8-30.8zm11.4%2038.9c.5%200%20.9.4.9.8v1.6h-24.6v-1.6c0-.5.4-.8.9-.8zm-17.1-12.3v9.8h1.6v-9.8h3.3v9.8h1.6v-9.8h3.3v9.8h1.6v-9.8h3.3v9.8h.8c.5%200%20.9.4.9.8v.8h-21.4v-.8c0-.5.4-.8.9-.8h.8v-9.8zm5.7-8.2%2012.3%204.9v1.6h-1.6c0%20.5-.4.8-.9.8h-19.6c-.5%200-.9-.4-.9-.8h-1.6v-1.6s12.3-4.9%2012.3-4.9z'/%3e%3c/svg%3e";var UB=function(t,n=500){let r=null;return(...i)=>{window.clearTimeout(r),r=window.setTimeout(()=>{t.apply(this,i)},n)}};const VB=Ao,zB=Jn,BB=UB,{prefix:rp}=_r,W2=`${rp}-character-count`,Tg=`.${W2}`,sv=`.${rp}-character-count__field`,rw=`.${rp}-character-count__message`,av="The content is too long.",kT=`${rp}-character-count__status--invalid`,q2=`${W2}__status`,G2=`${W2}__sr-status`,HB=`.${q2}`,WB=`.${G2}`,K2="characters allowed",Y2=e=>{const t=e.closest(Tg);if(!t)throw new Error(`${sv} is missing outer ${Tg}`);const n=t.querySelector(rw);if(!n)throw new Error(`${Tg} is missing inner ${rw}`);return{characterCountEl:t,messageEl:n}},qB=e=>{const{characterCountEl:t}=Y2(e),n=e.getAttribute("maxlength");n&&(e.removeAttribute("maxlength"),t.setAttribute("data-maxlength",n))},MT=e=>{const t=document.createElement("div"),n=document.createElement("div"),i=`${e.dataset.maxlength} ${K2}`;t.classList.add(`${q2}`,"usa-hint"),n.classList.add(`${G2}`,"usa-sr-only"),t.setAttribute("aria-hidden",!0),n.setAttribute("aria-live","polite"),t.textContent=i,n.textContent=i,e.append(t,n)},NT=(e,t)=>{let n="";if(e===0)n=`${t} ${K2}`;else{const r=Math.abs(t-e),i=`character${r===1?"":"s"}`,o=e>t?"over limit":"left";n=`${r} ${i} ${o}`}return n},GB=BB((e,t)=>{const n=e;n.textContent=t},1e3),iw=e=>{const{characterCountEl:t}=Y2(e),n=e.value.length,r=parseInt(t.getAttribute("data-maxlength"),10),i=t.querySelector(HB),o=t.querySelector(WB),s=NT(n,r);if(!r)return;const a=n&&n>r;i.textContent=s,GB(o,s),a&&!e.validationMessage&&e.setCustomValidity(av),!a&&e.validationMessage===av&&e.setCustomValidity(""),i.classList.toggle(kT,a)},KB=e=>{const{characterCountEl:t,messageEl:n}=Y2(e);n.classList.add("usa-sr-only"),n.removeAttribute("aria-live"),qB(e),MT(t)};zB({input:{[sv](){iw(this)}}},{init(e){VB(sv,e).forEach(t=>KB(t))},MESSAGE_INVALID_CLASS:kT,VALIDATION_MESSAGE:av,STATUS_MESSAGE_CLASS:q2,STATUS_MESSAGE_SR_ONLY_CLASS:G2,DEFAULT_STATUS_LABEL:K2,createStatusMessages:MT,getCountMessage:NT,updateCountMessage:iw});var Q2={exports:{}},YB={exports:{}};(function(e,t){(function(){var n={polyfill:o,keys:{3:"Cancel",6:"Help",8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",28:"Convert",29:"NonConvert",30:"Accept",31:"ModeChange",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",41:"Select",42:"Print",43:"Execute",44:"PrintScreen",45:"Insert",46:"Delete",48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],91:"OS",93:"ContextMenu",144:"NumLock",145:"ScrollLock",181:"VolumeMute",182:"VolumeDown",183:"VolumeUp",186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"'],224:"Meta",225:"AltGraph",246:"Attn",247:"CrSel",248:"ExSel",249:"EraseEof",250:"Play",251:"ZoomOut"}},r;for(r=1;r<25;r++)n.keys[111+r]="F"+r;var i="";for(r=65;r<91;r++)i=String.fromCharCode(r),n.keys[r]=[i.toLowerCase(),i.toUpperCase()];function o(){if(!("KeyboardEvent"in window)||"key"in KeyboardEvent.prototype)return!1;var s={get:function(a){var l=n.keys[this.which||this.keyCode];return Array.isArray(l)&&(l=l[+this.shiftKey]),l}};return Object.defineProperty(KeyboardEvent.prototype,"key",s),s}e.exports=n})()})(YB);const lv={Alt:"altKey",Control:"ctrlKey",Ctrl:"ctrlKey",Shift:"shiftKey"},LT="+",QB=function(e,t){var n=e.key;if(t)for(var r in lv)e[lv[r]]===!0&&(n=[r,n].join(LT));return n};Q2.exports=function(t){const n=Object.keys(t).some(function(r){return r.indexOf(LT)>-1});return function(r){var i=QB(r,n);return[i,i.toLowerCase()].reduce(function(o,s){return s in t&&(o=t[i].call(this,r)),o},void 0)}};Q2.exports.MODIFIERS=lv;var ip=Q2.exports;const XB=Ao,ZB=e=>e&&typeof e=="object"&&e.nodeType===1;var ks=(e,t)=>{const n=XB(e,t);return typeof e!="string"||ZB(t)&&t.matches(e)&&n.push(t),n},OT={exports:{}};(function(e){OT.exports=e()})(function(){var e={_entity:/[&<>"'/]/g,_entities:{"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},getEntity:function(t){return e._entities[t]},escapeHTML:function(t){for(var n="",r=0;r1?n-1:0),i=1;i{},Fr=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},Tt=e=>{const t=e.closest(ai);if(!t)throw new Error(`Element is missing outer ${ai}`);const n=t.querySelector(sH),r=t.querySelector(Cf),i=t.querySelector(aH),o=t.querySelector(uH),s=t.querySelector(zT),a=t.querySelector(lH),l=t.querySelector(VT),u=t.querySelector(UT),c=t.classList.contains(Ms),d=t.dataset.disableFiltering==="true";return{comboBoxEl:t,selectEl:n,inputEl:r,listEl:i,statusEl:o,focusedOptionEl:s,selectedOptionEl:a,toggleListBtnEl:l,clearInputBtnEl:u,isPristine:c,disableFiltering:d}},BT=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=Tt(e);r.hidden=!0,r.disabled=!0,n.disabled=!0,t.disabled=!0},fH=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=Tt(e);r.hidden=!0,r.setAttribute("aria-disabled",!0),n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},hH=e=>{const{inputEl:t,toggleListBtnEl:n,clearInputBtnEl:r}=Tt(e);r.hidden=!1,r.disabled=!1,n.disabled=!1,t.disabled=!1},sw=e=>{const t=e.closest(ai);if(t.dataset.enhanced)return;const n=t.querySelector("select");if(!n)throw new Error(`${ai} is missing inner select`);const r=n.id,i=document.querySelector(`label[for="${r}"]`),o=`${r}--list`,s=`${r}-label`,a=`${r}--assistiveHint`,l=[],{defaultValue:u}=t.dataset,{placeholder:c}=t.dataset;let d;if(c&&l.push({placeholder:c}),u)for(let h=0,g=n.options.length;h{if(n.hasAttribute(h)){const g=n.getAttribute(h);l.push({[h]:g}),n.removeAttribute(h)}});const f=document.createElement("input");if(f.setAttribute("id",r),f.setAttribute("aria-owns",o),f.setAttribute("aria-controls",o),f.setAttribute("aria-autocomplete","list"),f.setAttribute("aria-describedby",a),f.setAttribute("aria-expanded","false"),f.setAttribute("autocapitalize","off"),f.setAttribute("autocomplete","off"),f.setAttribute("class",IT),f.setAttribute("type","text"),f.setAttribute("role","combobox"),l.forEach(h=>Object.keys(h).forEach(g=>{const y=ow.escapeHTML`${h[g]}`;f.setAttribute(g,y)})),t.insertAdjacentElement("beforeend",f),t.insertAdjacentHTML("beforeend",ow.escapeHTML` + + + +   + + + + +
+ + When autocomplete results are available use up and down arrows to review and enter to select. + Touch device users, explore by touch or with swipe gestures. + `),d){const{inputEl:h}=Tt(t);Fr(n,d.value),Fr(h,d.text),t.classList.add(Ms)}n.disabled&&(BT(t),n.disabled=!1),n.hasAttribute("aria-disabled")&&(fH(t),n.removeAttribute("aria-disabled")),t.dataset.enhanced="true"},nd=(e,t,{skipFocus:n,preventScroll:r}={})=>{const{inputEl:i,listEl:o,focusedOptionEl:s}=Tt(e);if(s&&(s.classList.remove(xs),s.setAttribute("tabIndex","-1")),t){if(i.setAttribute("aria-activedescendant",t.id),t.setAttribute("tabIndex","0"),t.classList.add(xs),!r){const a=t.offsetTop+t.offsetHeight,l=o.scrollTop+o.offsetHeight;a>l&&(o.scrollTop=a-o.offsetHeight),t.offsetTop{const r=o=>o.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");let i=e.replace(/{{(.*?)}}/g,(o,s)=>{const a=s.trim(),l=n[a];if(a!=="query"&&l){const u=new RegExp(l,"i"),c=t.match(u);return c?r(c[1]):""}return r(t)});return i=`^(?:${i})$`,new RegExp(i,"i")},ll=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r,listEl:i,statusEl:o,isPristine:s,disableFiltering:a}=Tt(e);let l,u;const c=`${i.id}--option-`,d=(r.value||"").toLowerCase(),f=t.dataset.filter||cH,h=HT(f,d,t.dataset),g=[];for(let v=0,x=n.options.length;v{const S=`${c}${x}`,w=[dc];let E="-1",C="false";S===l&&(w.push(jT,xs),E="0",C="true"),!l&&x===0&&(w.push(xs),E="0");const T=document.createElement("li");return T.setAttribute("aria-setsize",g.length),T.setAttribute("aria-posinset",x+1),T.setAttribute("aria-selected",C),T.setAttribute("id",S),T.setAttribute("class",w.join(" ")),T.setAttribute("tabindex",E),T.setAttribute("role","option"),T.setAttribute("data-value",v.value),T.textContent=v.text,T}),m=document.createElement("li");m.setAttribute("class",`${dc}--no-results`),m.textContent="No results found",i.hidden=!1,y?(i.innerHTML="",_.forEach(v=>i.insertAdjacentElement("beforeend",v))):(i.innerHTML="",i.insertAdjacentElement("beforeend",m)),r.setAttribute("aria-expanded","true"),o.textContent=y?`${y} result${y>1?"s":""} available.`:"No results.";let p;s&&l?p=i.querySelector(`#${l}`):a&&u&&(p=i.querySelector(`#${u}`)),p&&nd(i,p,{skipFocus:!0})},Ss=e=>{const{inputEl:t,listEl:n,statusEl:r,focusedOptionEl:i}=Tt(e);r.innerHTML="",t.setAttribute("aria-expanded","false"),t.setAttribute("aria-activedescendant",""),i&&i.classList.remove(xs),n.scrollTop=0,n.hidden=!0},J2=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=Tt(e);Fr(n,e.dataset.value),Fr(r,e.textContent),t.classList.add(Ms),Ss(t),r.focus()},pH=e=>{const{comboBoxEl:t,listEl:n,selectEl:r,inputEl:i}=Tt(e),o=!n.hidden;r.value&&Fr(r),i.value&&Fr(i),t.classList.remove(Ms),o&&ll(t),i.focus()},e5=e=>{const{comboBoxEl:t,selectEl:n,inputEl:r}=Tt(e),i=n.value,o=(r.value||"").toLowerCase();if(i)for(let s=0,a=n.options.length;s{const{comboBoxEl:t,selectEl:n,inputEl:r,statusEl:i}=Tt(e);i.textContent="";const o=(r.value||"").toLowerCase();if(o)for(let s=0,a=n.options.length;s{const{comboBoxEl:t,inputEl:n}=Tt(e.target);Ss(t),e5(t),n.focus()},aw=e=>{const{comboBoxEl:t,listEl:n}=Tt(e.target);n.hidden&&ll(t);const r=n.querySelector(zT)||n.querySelector(Af);r&&nd(t,r),e.preventDefault()},yH=e=>{const{comboBoxEl:t,listEl:n}=Tt(e.target),r=!n.hidden;gH(t),r&&Ss(t),e.preventDefault()},lw=e=>{const t=e.target,n=t.nextSibling;n&&nd(t,n),e.preventDefault()},vH=e=>{J2(e.target),e.preventDefault()},_H=e=>{J2(e.target),e.preventDefault()},uw=e=>{const{comboBoxEl:t,listEl:n,focusedOptionEl:r}=Tt(e.target),i=r&&r.previousSibling,o=!n.hidden;nd(t,i),o&&e.preventDefault(),i||Ss(t)},xH=e=>{e.classList.contains(xs)||nd(e,e,{preventScroll:!0})},SH=e=>{const{comboBoxEl:t,listEl:n,inputEl:r}=Tt(e);n.hidden?ll(t):Ss(t),r.focus()},wH=e=>{const{comboBoxEl:t,listEl:n}=Tt(e);n.hidden&&ll(t)},bH=eH({[nH]:{[Cf](){this.disabled||wH(this)},[VT](){this.disabled||SH(this)},[Af](){this.disabled||J2(this)},[UT](){this.disabled||pH(this)}},focusout:{[ai](e){this.contains(e.relatedTarget)||(e5(this),Ss(this))}},keydown:{[ai]:kg({Escape:mH}),[Cf]:kg({Enter:yH,ArrowDown:aw,Down:aw}),[Af]:kg({ArrowUp:uw,Up:uw,ArrowDown:lw,Down:lw,Enter:_H," ":vH,"Shift+Tab":dH})},input:{[Cf](){this.closest(ai).classList.remove(Ms),ll(this)}},mouseover:{[Af](){xH(this)}}},{init(e){JB(ai,e).forEach(t=>{sw(t)})},getComboBoxContext:Tt,enhanceComboBox:sw,generateDynamicRegExp:HT,disable:BT,enable:hH,displayList:ll,hideList:Ss,COMBO_BOX_CLASS:xr});var EH=bH,WT=(e=document)=>e.activeElement;function CH(){return typeof navigator<"u"&&(navigator.userAgent.match(/(iPod|iPhone|iPad)/g)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream}var AH=CH;const To=ip,RH=Jn,$H=Ao,TH=ks,{prefix:kH}=_r,{CLICK:MH}=td,NH=WT,LH=AH,Aa=op,Ei=`${kH}-date-picker`,OH=`${Ei}__wrapper`,PH=`${Ei}--initialized`,qT=`${Ei}--active`,GT=`${Ei}__internal-input`,KT=`${Ei}__external-input`,YT=`${Ei}__button`,ct=`${Ei}__calendar`,QT=`${Ei}__status`,er=`${ct}__date`,XT=`${er}--focused`,IH=`${er}--selected`,DH=`${er}--previous-month`,ZT=`${er}--current-month`,jH=`${er}--next-month`,FH=`${er}--range-date`,UH=`${er}--today`,VH=`${er}--range-date-start`,zH=`${er}--range-date-end`,BH=`${er}--within-range`,JT=`${ct}__previous-year`,ek=`${ct}__previous-month`,tk=`${ct}__next-year`,nk=`${ct}__next-month`,rk=`${ct}__month-selection`,ik=`${ct}__year-selection`,sp=`${ct}__month`,t5=`${sp}--focused`,HH=`${sp}--selected`,ap=`${ct}__year`,n5=`${ap}--focused`,WH=`${ap}--selected`,ok=`${ct}__previous-year-chunk`,sk=`${ct}__next-year-chunk`,ak=`${ct}__date-picker`,lk=`${ct}__month-picker`,uk=`${ct}__year-picker`,bh=`${ct}__table`,qH=`${ct}__row`,Ks=`${ct}__cell`,Hd=`${Ks}--center-items`,GH=`${ct}__month-label`,KH=`${ct}__day-of-week`,ws=`.${Ei}`,ck=`.${YT}`,YH=`.${GT}`,Rf=`.${KT}`,Eh=`.${ct}`,QH=`.${QT}`,cw=`.${er}`,El=`.${XT}`,XH=`.${ZT}`,r5=`.${JT}`,i5=`.${ek}`,o5=`.${tk}`,s5=`.${nk}`,dk=`.${ik}`,fk=`.${rk}`,uv=`.${sp}`,Ch=`.${ap}`,a5=`.${ok}`,l5=`.${sk}`,Cl=`.${ak}`,ZH=`.${lk}`,u5=`.${uk}`,lp=`.${t5}`,Al=`.${n5}`,dw="Please enter a valid date",cv=["January","February","March","April","May","June","July","August","September","October","November","December"],JH=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],eW=13,kr=12,tW="0000-01-01",up="MM/DD/YYYY",hk="YYYY-MM-DD",nW=":not([disabled])",c5=(...e)=>e.map(t=>t+nW).join(", "),rW=c5(r5,i5,dk,fk,o5,s5,El),iW=c5(lp),oW=c5(a5,l5,Al),d5=(e,t)=>(t!==e.getMonth()&&e.setDate(0),e),Ah=(e,t,n)=>{const r=new Date(0);return r.setFullYear(e,t,n),r},f5=()=>{const e=new Date,t=e.getDate(),n=e.getMonth(),r=e.getFullYear();return Ah(r,n,t)},h5=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth(),1),t},pk=e=>{const t=new Date(0);return t.setFullYear(e.getFullYear(),e.getMonth()+1,0),t},os=(e,t)=>{const n=new Date(e.getTime());return n.setDate(n.getDate()+t),n},p5=(e,t)=>os(e,-t),gk=(e,t)=>os(e,t*7),sW=(e,t)=>gk(e,-t),mk=e=>{const t=e.getDay();return p5(e,t)},aW=e=>{const t=e.getDay();return os(e,6-t)},rd=(e,t)=>{const n=new Date(e.getTime()),r=(n.getMonth()+12+t)%12;return n.setMonth(n.getMonth()+t),d5(n,r),n},g5=(e,t)=>rd(e,-t),m5=(e,t)=>rd(e,t*12),yk=(e,t)=>m5(e,-t),ul=(e,t)=>{const n=new Date(e.getTime());return n.setMonth(t),d5(n,t),n},uo=(e,t)=>{const n=new Date(e.getTime()),r=n.getMonth();return n.setFullYear(t),d5(n,r),n},lW=(e,t)=>{let n=e;return t{let n=e;return t>e&&(n=t),new Date(n.getTime())},vk=(e,t)=>e&&t&&e.getFullYear()===t.getFullYear(),Do=(e,t)=>vk(e,t)&&e.getMonth()===t.getMonth(),Ni=(e,t)=>Do(e,t)&&e.getDate()===t.getDate(),Nn=(e,t,n)=>{let r=e;return en&&(r=n),new Date(r.getTime())},dv=(e,t,n)=>e>=t&&(!n||e<=n),cW=(e,t,n)=>pk(e)n,Mg=(e,t,n)=>pk(ul(e,11))n,ar=(e,t=hk,n=!1)=>{let r,i,o,s,a;if(e){let l,u,c;if(t===up?[l,u,c]=e.split("/"):[c,l,u]=e.split("-"),c&&(a=parseInt(c,10),!Number.isNaN(a)&&(s=a,n&&(s=Math.max(0,s),c.length<3)))){const d=f5().getFullYear();s=d-d%10**c.length+a}if(l&&(a=parseInt(l,10),Number.isNaN(a)||(i=a,n&&(i=Math.max(1,i),i=Math.min(12,i)))),i&&u&&s!=null&&(a=parseInt(u,10),!Number.isNaN(a)&&(o=a,n))){const d=Ah(s,i,0).getDate();o=Math.max(1,o),o=Math.min(d,o)}i&&o&&s!=null&&(r=Ah(s,i-1,o))}return r},cl=(e,t=hk)=>{const n=(s,a)=>`0000${s}`.slice(-a),r=e.getMonth()+1,i=e.getDate(),o=e.getFullYear();return t===up?[n(r,2),n(i,2),n(o,4)].join("/"):[n(o,4),n(r,2),n(i,2)].join("-")},y5=(e,t)=>{const n=[];let r=[],i=0;for(;i{o.insertAdjacentElement("beforeend",s)}),n.push(o)}return n},v5=e=>{const t=document.createElement("tbody");return e.forEach(n=>{t.insertAdjacentElement("beforeend",n)}),t},fv=(e,t="")=>{const n=e;n.value=t;const r=new CustomEvent("change",{bubbles:!0,cancelable:!0,detail:{value:t}});n.dispatchEvent(r)},Fe=e=>{const t=e.closest(ws);if(!t)throw new Error(`Element is missing outer ${ws}`);const n=t.querySelector(YH),r=t.querySelector(Rf),i=t.querySelector(Eh),o=t.querySelector(ck),s=t.querySelector(QH),a=t.querySelector(Ch),l=ar(r.value,up,!0),u=ar(n.value),c=ar(i.dataset.value),d=ar(t.dataset.minDate),f=ar(t.dataset.maxDate),h=ar(t.dataset.rangeDate),g=ar(t.dataset.defaultDate);if(d&&f&&d>f)throw new Error("Minimum date cannot be after maximum date");return{calendarDate:c,minDate:d,toggleBtnEl:o,selectedDate:u,maxDate:f,firstYearChunkEl:a,datePickerEl:t,inputDate:l,internalInputEl:n,externalInputEl:r,calendarEl:i,rangeDate:h,defaultDate:g,statusEl:s}},_k=e=>{const{externalInputEl:t,toggleBtnEl:n}=Fe(e);n.disabled=!0,t.disabled=!0},xk=e=>{const{externalInputEl:t,toggleBtnEl:n}=Fe(e);n.setAttribute("aria-disabled",!0),t.setAttribute("aria-disabled",!0)},dW=e=>{const{externalInputEl:t,toggleBtnEl:n}=Fe(e);n.disabled=!1,t.disabled=!1},_5=e=>{const{externalInputEl:t,minDate:n,maxDate:r}=Fe(e),i=t.value;let o=!1;if(i){o=!0;const s=i.split("/"),[a,l,u]=s.map(c=>{let d;const f=parseInt(c,10);return Number.isNaN(f)||(d=f),d});if(a&&l&&u!=null){const c=Ah(u,a-1,l);c.getMonth()===a-1&&c.getDate()===l&&c.getFullYear()===u&&s[2].length===4&&dv(c,n,r)&&(o=!1)}}return o},Rh=e=>{const{externalInputEl:t}=Fe(e),n=_5(t);n&&!t.validationMessage&&t.setCustomValidity(dw),!n&&t.validationMessage===dw&&t.setCustomValidity("")},fW=e=>{const{internalInputEl:t,inputDate:n}=Fe(e);let r="";n&&!_5(e)&&(r=cl(n)),t.value!==r&&fv(t,r)},x5=(e,t)=>{const n=ar(t);if(n){const r=cl(n,up),{datePickerEl:i,internalInputEl:o,externalInputEl:s}=Fe(e);fv(o,t),fv(s,r),Rh(i)}},hW=e=>{const t=e.closest(ws),{defaultValue:n}=t.dataset,r=t.querySelector("input");if(!r)throw new Error(`${ws} is missing inner input`);r.value&&(r.value="");const i=ar(t.dataset.minDate||r.getAttribute("min"));t.dataset.minDate=i?cl(i):tW;const o=ar(t.dataset.maxDate||r.getAttribute("max"));o&&(t.dataset.maxDate=cl(o));const s=document.createElement("div");s.classList.add(OH);const a=r.cloneNode();a.classList.add(KT),a.type="text",s.appendChild(a),s.insertAdjacentHTML("beforeend",Aa.escapeHTML` + + +
`),r.setAttribute("aria-hidden","true"),r.setAttribute("tabindex","-1"),r.style.display="none",r.classList.add(GT),r.removeAttribute("id"),r.removeAttribute("name"),r.required=!1,t.appendChild(s),t.classList.add(PH),n&&x5(t,n),r.disabled&&(_k(t),r.disabled=!1),r.hasAttribute("aria-disabled")&&(xk(t),r.removeAttribute("aria-disabled"))},Sr=(e,t)=>{const{datePickerEl:n,calendarEl:r,statusEl:i,selectedDate:o,maxDate:s,minDate:a,rangeDate:l}=Fe(e),u=f5();let c=t||u;const d=r.hidden,f=os(c,0),h=c.getMonth(),g=c.getFullYear(),y=g5(c,1),_=rd(c,1),m=cl(c),p=h5(c),v=Do(c,a),x=Do(c,s),S=o||c,w=l&&lW(S,l),E=l&&uW(S,l),C=l&&os(w,1),T=l&&p5(E,1),A=cv[h],M=N=>{const B=[er],G=N.getDate(),re=N.getMonth(),K=N.getFullYear(),he=N.getDay(),me=cl(N);let le="-1";const $e=!dv(N,a,s),De=Ni(N,o);Do(N,y)&&B.push(DH),Do(N,f)&&B.push(ZT),Do(N,_)&&B.push(jH),De&&B.push(IH),Ni(N,u)&&B.push(UH),l&&(Ni(N,l)&&B.push(FH),Ni(N,w)&&B.push(VH),Ni(N,E)&&B.push(zH),dv(N,C,T)&&B.push(BH)),Ni(N,f)&&(le="0",B.push(XT));const we=cv[re],ke=JH[he],Pe=document.createElement("button");return Pe.setAttribute("type","button"),Pe.setAttribute("tabindex",le),Pe.setAttribute("class",B.join(" ")),Pe.setAttribute("data-day",G),Pe.setAttribute("data-month",re+1),Pe.setAttribute("data-year",K),Pe.setAttribute("data-value",me),Pe.setAttribute("aria-label",Aa.escapeHTML`${G} ${we} ${K} ${ke}`),Pe.setAttribute("aria-selected",De?"true":"false"),$e===!0&&(Pe.disabled=!0),Pe.textContent=G,Pe};c=mk(p);const R=[];for(;R.length<28||c.getMonth()===h||R.length%7!==0;)R.push(M(c)),c=os(c,1);const k=y5(R,7),D=r.cloneNode();D.dataset.value=m,D.style.top=`${n.offsetHeight}px`,D.hidden=!1,D.innerHTML=Aa.escapeHTML` +
+
+
+ +
+
+ +
+
+ + +
+
+ +
+
+ +
+
+
+ `;const P=document.createElement("table");P.setAttribute("class",bh);const H=document.createElement("thead");P.insertAdjacentElement("beforeend",H);const Q=document.createElement("tr");H.insertAdjacentElement("beforeend",Q);const U={Sunday:"S",Monday:"M",Tuesday:"T",Wednesday:"W",Thursday:"Th",Friday:"Fr",Saturday:"S"};Object.keys(U).forEach(N=>{const B=document.createElement("th");B.setAttribute("class",KH),B.setAttribute("scope","col"),B.setAttribute("aria-label",N),B.textContent=U[N],Q.insertAdjacentElement("beforeend",B)});const W=v5(k);P.insertAdjacentElement("beforeend",W),D.querySelector(Cl).insertAdjacentElement("beforeend",P),r.parentNode.replaceChild(D,r),n.classList.add(qT);const X=[];return Ni(o,f)&&X.push("Selected date"),d?(X.push("You can navigate by day using left and right arrows","Weeks by using up and down arrows","Months by using page up and page down keys","Years by using shift plus page up and shift plus page down","Home and end keys navigate to the beginning and end of a week"),i.textContent=""):X.push(`${A} ${g}`),i.textContent=X.join(". "),D},pW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e);let o=yk(n,1);o=Nn(o,r,i);const s=Sr(t,o);let a=s.querySelector(r5);a.disabled&&(a=s.querySelector(Cl)),a.focus()},gW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e);let o=g5(n,1);o=Nn(o,r,i);const s=Sr(t,o);let a=s.querySelector(i5);a.disabled&&(a=s.querySelector(Cl)),a.focus()},mW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e);let o=rd(n,1);o=Nn(o,r,i);const s=Sr(t,o);let a=s.querySelector(s5);a.disabled&&(a=s.querySelector(Cl)),a.focus()},yW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e);let o=m5(n,1);o=Nn(o,r,i);const s=Sr(t,o);let a=s.querySelector(o5);a.disabled&&(a=s.querySelector(Cl)),a.focus()},cp=e=>{const{datePickerEl:t,calendarEl:n,statusEl:r}=Fe(e);t.classList.remove(qT),n.hidden=!0,r.textContent=""},vW=e=>{if(e.disabled)return;const{datePickerEl:t,externalInputEl:n}=Fe(e);x5(e,e.dataset.value),cp(t),n.focus()},_W=e=>{if(e.disabled)return;const{calendarEl:t,inputDate:n,minDate:r,maxDate:i,defaultDate:o}=Fe(e);if(t.hidden){const s=Nn(n||o||f5(),r,i);Sr(t,s).querySelector(El).focus()}else cp(e)},Sk=e=>{const{calendarEl:t,inputDate:n,minDate:r,maxDate:i}=Fe(e);if(!t.hidden&&n){const s=Nn(n,r,i);Sr(t,s)}},S5=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:i,minDate:o,maxDate:s}=Fe(e),a=i.getMonth(),l=t??a,u=cv.map((y,_)=>{const m=ul(i,_),p=cW(m,o,s);let v="-1";const x=[sp],S=_===a;_===l&&(v="0",x.push(t5)),S&&x.push(HH);const w=document.createElement("button");return w.setAttribute("type","button"),w.setAttribute("tabindex",v),w.setAttribute("class",x.join(" ")),w.setAttribute("data-value",_),w.setAttribute("data-label",y),w.setAttribute("aria-selected",S?"true":"false"),p===!0&&(w.disabled=!0),w.textContent=y,w}),c=document.createElement("div");c.setAttribute("tabindex","-1"),c.setAttribute("class",lk);const d=document.createElement("table");d.setAttribute("class",bh),d.setAttribute("role","presentation");const f=y5(u,3),h=v5(f);d.insertAdjacentElement("beforeend",h),c.insertAdjacentElement("beforeend",d);const g=n.cloneNode();return g.insertAdjacentElement("beforeend",c),n.parentNode.replaceChild(g,n),r.textContent="Select a month.",g},xW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e),o=parseInt(e.dataset.value,10);let s=ul(n,o);s=Nn(s,r,i),Sr(t,s).querySelector(El).focus()},id=(e,t)=>{const{calendarEl:n,statusEl:r,calendarDate:i,minDate:o,maxDate:s}=Fe(e),a=i.getFullYear(),l=t??a;let u=l;u-=u%kr,u=Math.max(0,u);const c=Mg(uo(i,u-1),o,s),d=Mg(uo(i,u+kr),o,s),f=[];let h=u;for(;f.length{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e),o=t.querySelector(Al);let a=parseInt(o.textContent,10)-kr;a=Math.max(0,a);const l=uo(n,a),u=Nn(l,r,i),c=id(t,u.getFullYear());let d=c.querySelector(a5);d.disabled&&(d=c.querySelector(u5)),d.focus()},wW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e),o=t.querySelector(Al);let a=parseInt(o.textContent,10)+kr;a=Math.max(0,a);const l=uo(n,a),u=Nn(l,r,i),c=id(t,u.getFullYear());let d=c.querySelector(l5);d.disabled&&(d=c.querySelector(u5)),d.focus()},bW=e=>{if(e.disabled)return;const{calendarEl:t,calendarDate:n,minDate:r,maxDate:i}=Fe(e),o=parseInt(e.innerHTML,10);let s=uo(n,o);s=Nn(s,r,i),Sr(t,s).querySelector(El).focus()},EW=e=>{const{datePickerEl:t,externalInputEl:n}=Fe(e.target);cp(t),n.focus(),e.preventDefault()},Hr=e=>t=>{const{calendarEl:n,calendarDate:r,minDate:i,maxDate:o}=Fe(t.target),s=e(r),a=Nn(s,i,o);Ni(r,a)||Sr(n,a).querySelector(El).focus(),t.preventDefault()},fw=Hr(e=>sW(e,1)),hw=Hr(e=>gk(e,1)),pw=Hr(e=>p5(e,1)),gw=Hr(e=>os(e,1)),CW=Hr(e=>mk(e)),AW=Hr(e=>aW(e)),RW=Hr(e=>rd(e,1)),$W=Hr(e=>g5(e,1)),TW=Hr(e=>m5(e,1)),kW=Hr(e=>yk(e,1)),MW=e=>{if(e.disabled)return;const t=e.closest(Eh),n=t.dataset.value,r=e.dataset.value;if(r===n)return;const i=ar(r);Sr(t,i).querySelector(El).focus()},Ro=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:i,calendarDate:o,minDate:s,maxDate:a}=Fe(n),l=ul(o,r);let u=e(r);u=Math.max(0,Math.min(11,u));const c=ul(o,u),d=Nn(c,s,a);Do(l,d)||S5(i,d.getMonth()).querySelector(lp).focus(),t.preventDefault()},mw=Ro(e=>e-3),yw=Ro(e=>e+3),vw=Ro(e=>e-1),_w=Ro(e=>e+1),NW=Ro(e=>e-e%3),LW=Ro(e=>e+2-e%3),OW=Ro(()=>11),PW=Ro(()=>0),IW=e=>{if(e.disabled||e.classList.contains(t5))return;const t=parseInt(e.dataset.value,10);S5(e,t).querySelector(lp).focus()},$o=e=>t=>{const n=t.target,r=parseInt(n.dataset.value,10),{calendarEl:i,calendarDate:o,minDate:s,maxDate:a}=Fe(n),l=uo(o,r);let u=e(r);u=Math.max(0,u);const c=uo(o,u),d=Nn(c,s,a);vk(l,d)||id(i,d.getFullYear()).querySelector(Al).focus(),t.preventDefault()},xw=$o(e=>e-3),Sw=$o(e=>e+3),ww=$o(e=>e-1),bw=$o(e=>e+1),DW=$o(e=>e-e%3),jW=$o(e=>e+2-e%3),FW=$o(e=>e-kr),UW=$o(e=>e+kr),VW=e=>{if(e.disabled||e.classList.contains(n5))return;const t=parseInt(e.dataset.value,10);id(e,t).querySelector(Al).focus()},w5=e=>{const t=n=>{const{calendarEl:r}=Fe(n),i=$H(e,r),o=0,s=i.length-1,a=i[o],l=i[s],u=i.indexOf(NH());return{focusableElements:i,isNotFound:u===-1,firstTabStop:a,isFirstTab:u===o,lastTabStop:l,isLastTab:u===s}};return{tabAhead(n){const{firstTabStop:r,isLastTab:i,isNotFound:o}=t(n.target);(i||o)&&(n.preventDefault(),r.focus())},tabBack(n){const{lastTabStop:r,isFirstTab:i,isNotFound:o}=t(n.target);(i||o)&&(n.preventDefault(),r.focus())}}},Ng=w5(rW),Ew=w5(iW),Cw=w5(oW),wk={[MH]:{[ck](){_W(this)},[cw](){vW(this)},[uv](){xW(this)},[Ch](){bW(this)},[i5](){gW(this)},[s5](){mW(this)},[r5](){pW(this)},[o5](){yW(this)},[a5](){SW(this)},[l5](){wW(this)},[fk](){S5(this).querySelector(lp).focus()},[dk](){id(this).querySelector(Al).focus()}},keyup:{[Eh](e){const t=this.dataset.keydownKeyCode;`${e.keyCode}`!==t&&e.preventDefault()}},keydown:{[Rf](e){e.keyCode===eW&&Rh(this)},[cw]:To({Up:fw,ArrowUp:fw,Down:hw,ArrowDown:hw,Left:pw,ArrowLeft:pw,Right:gw,ArrowRight:gw,Home:CW,End:AW,PageDown:RW,PageUp:$W,"Shift+PageDown":TW,"Shift+PageUp":kW,Tab:Ng.tabAhead}),[Cl]:To({Tab:Ng.tabAhead,"Shift+Tab":Ng.tabBack}),[uv]:To({Up:mw,ArrowUp:mw,Down:yw,ArrowDown:yw,Left:vw,ArrowLeft:vw,Right:_w,ArrowRight:_w,Home:NW,End:LW,PageDown:OW,PageUp:PW}),[ZH]:To({Tab:Ew.tabAhead,"Shift+Tab":Ew.tabBack}),[Ch]:To({Up:xw,ArrowUp:xw,Down:Sw,ArrowDown:Sw,Left:ww,ArrowLeft:ww,Right:bw,ArrowRight:bw,Home:DW,End:jW,PageDown:UW,PageUp:FW}),[u5]:To({Tab:Cw.tabAhead,"Shift+Tab":Cw.tabBack}),[Eh](e){this.dataset.keydownKeyCode=e.keyCode},[ws](e){To({Escape:EW})(e)}},focusout:{[Rf](){Rh(this)},[ws](e){this.contains(e.relatedTarget)||cp(this)}},input:{[Rf](){fW(this),Sk(this)}}};LH()||(wk.mouseover={[XH](){MW(this)},[uv](){IW(this)},[Ch](){VW(this)}});const zW=RH(wk,{init(e){TH(ws,e).forEach(t=>{hW(t)})},getDatePickerContext:Fe,disable:_k,ariaDisable:xk,enable:dW,isDateInputInvalid:_5,setCalendarValue:x5,validateDateInput:Rh,renderCalendar:Sr,updateCalendarIfVisible:Sk});var BW=zW;const HW=Jn,WW=Ao,qW=ks,{prefix:bk}=_r,{getDatePickerContext:Ek,isDateInputInvalid:Ck,updateCalendarIfVisible:Ak}=BW,GW=`${bk}-date-picker`,b5=`${bk}-date-range-picker`,Rk=`${b5}__range-start`,$k=`${b5}__range-end`,Lg=`.${GW}`,Ra=`.${b5}`,Tk=`.${Rk}`,kk=`.${$k}`,KW="0000-01-01",Mk=e=>{const t=e.closest(Ra);if(!t)throw new Error(`Element is missing outer ${Ra}`);const n=t.querySelector(Tk),r=t.querySelector(kk);return{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}},Nk=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=Mk(e),{internalInputEl:i}=Ek(n),o=i.value;o&&!Ck(i)?(r.dataset.minDate=o,r.dataset.rangeDate=o,r.dataset.defaultDate=o):(r.dataset.minDate=t.dataset.minDate||"",r.dataset.rangeDate="",r.dataset.defaultDate=""),Ak(r)},Lk=e=>{const{dateRangePickerEl:t,rangeStartEl:n,rangeEndEl:r}=Mk(e),{internalInputEl:i}=Ek(r),o=i.value;o&&!Ck(i)?(n.dataset.maxDate=o,n.dataset.rangeDate=o,n.dataset.defaultDate=o):(n.dataset.maxDate=t.dataset.maxDate||"",n.dataset.rangeDate="",n.dataset.defaultDate=""),Ak(n)},YW=e=>{const t=e.closest(Ra),[n,r]=WW(Lg,t);if(!n)throw new Error(`${Ra} is missing inner two '${Lg}' elements`);if(!r)throw new Error(`${Ra} is missing second '${Lg}' element`);n.classList.add(Rk),r.classList.add($k),t.dataset.minDate||(t.dataset.minDate=KW);const{minDate:i}=t.dataset;n.dataset.minDate=i,r.dataset.minDate=i;const{maxDate:o}=t.dataset;o&&(n.dataset.maxDate=o,r.dataset.maxDate=o),Nk(t),Lk(t)};HW({"input change":{[Tk](){Nk(this)},[kk](){Lk(this)}}},{init(e){qW(Ra,e).forEach(t=>{YW(t)})}});const Aw=ks,QW=Jn,$h=op,{prefix:vn}=_r,fc=`${vn}-file-input`,hc=`.${fc}`,Ok=`${vn}-file-input__input`,E5=`${vn}-file-input__target`,Pk=`.${Ok}`,XW=`${vn}-file-input__box`,Ik=`${vn}-file-input__instructions`,Dk=`${vn}-file-input__preview`,jk=`${vn}-file-input__preview-heading`,dp=`${vn}-file-input--disabled`,ZW=`${vn}-file-input__choose`,Fk=`${vn}-file-input__accepted-files-message`,Rw=`${vn}-file-input__drag-text`,Og=`${vn}-file-input--drag`,$w="is-loading",hv="has-invalid-file",Rl=`${vn}-file-input__preview-image`,JW=`${Rl}--generic`,eq=`${Rl}--pdf`,tq=`${Rl}--word`,nq=`${Rl}--video`,rq=`${Rl}--excel`,Uk=`${vn}-sr-only`,Hs="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";let pv=!0,gv="",mv="";const od=e=>{const t=e.closest(hc);if(!t)throw new Error(`Element is missing outer ${hc}`);const n=t.querySelector(Pk);return{dropZoneEl:t,inputEl:n}},iq=e=>{const{dropZoneEl:t,inputEl:n}=od(e);n.disabled=!0,t.classList.add(dp)},oq=e=>{const{dropZoneEl:t}=od(e);t.classList.add(dp)},sq=e=>{const{dropZoneEl:t,inputEl:n}=od(e);n.disabled=!1,t.classList.remove(dp),t.removeAttribute("aria-disabled")},aq=e=>{const t=e.charCodeAt(0);return t===32?"-":t>=65&&t<=90?`img_${e.toLowerCase()}`:`__${t.toString(16).slice(-4)}`},lq=e=>e.replace(/[^a-z0-9]/g,aq),uq=e=>`${e}-${Math.floor(Date.now().toString()/1e3)}`,Vk=e=>e.hasAttribute("multiple")?"files":"file",cq=e=>{const t=document.createElement("div"),n=document.createElement("div"),r=document.createElement("div");return e.classList.remove(fc),e.classList.add(Ok),t.classList.add(fc),r.classList.add(XW),n.classList.add(E5),n.prepend(r),e.parentNode.insertBefore(n,e),e.parentNode.insertBefore(t,n),n.appendChild(e),t.appendChild(n),n},dq=e=>{const t=e.closest(hc),n=Vk(e),r=document.createElement("div"),i=`Drag ${n} here or`,o="choose from folder";return gv=`${i} ${o}`,r.classList.add(Ik),r.setAttribute("aria-hidden","true"),e.setAttribute("aria-label",gv),r.innerHTML=$h.escapeHTML`${i} ${o}`,e.parentNode.insertBefore(r,e),(/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.querySelector(`.${Rw}`).outerHTML=""),r},fq=e=>{const t=document.createElement("div"),n=Vk(e),r=e.closest(hc),i=e.closest(`.${E5}`);mv=`No ${n} selected.`,t.classList.add(Uk),t.setAttribute("aria-live","polite"),t.textContent=mv,r.insertBefore(t,i)},hq=e=>{const t=e.hasAttribute("aria-disabled")||e.hasAttribute("disabled"),n=cq(e),r=dq(e),{dropZoneEl:i}=od(e);return t?i.classList.add(dp):fq(e),{instructions:r,dropTarget:n}},zk=(e,t)=>{const n=e.querySelectorAll(`.${Dk}`),r=e.querySelector(`.${jk}`),i=e.querySelector(`.${Fk}`),o=s=>{s.parentNode.removeChild(s)};r&&(r.outerHTML=""),i&&(i.outerHTML="",e.classList.remove(hv)),n!==null&&(t&&t.removeAttribute("hidden"),Array.prototype.forEach.call(n,o))},pq=(e,t,n)=>{const r=e;let i=mv;t.length===1?i=`You have selected the file: ${n}`:t.length>1&&(i=`You have selected ${t.length} files: ${n.join(", ")}`),setTimeout(()=>{r.textContent=i},1e3)},gq=(e,t)=>{const n=document.createElement("div"),r=e.closest(`.${E5}`),i=r.querySelector(`.${Ik}`);let o="Change file",s="";t.length===1?s=$h.escapeHTML`Selected file ${o}`:t.length>1&&(o="Change files",s=$h.escapeHTML`${t.length} files selected ${o}`),i.setAttribute("hidden","true"),n.classList.add(jk),n.innerHTML=s,r.insertBefore(n,i),e.setAttribute("aria-label",o)},mq=(e,t,n,r)=>{const i=e.target.files,s=r.closest(`.${fc}`).querySelector(`.${Uk}`),a=[];zk(r,n);for(let l=0;l