tempest.games 0.2.9 โ†’ 0.2.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,109 +0,0 @@
1
- var iC=Object.defineProperty;var sC=(e,t,n)=>t in e?iC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var w=(e,t,n)=>sC(e,typeof t!="symbol"?t+"":t,n);function rC(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const a in s)if(a!=="default"&&!(a in e)){const u=Object.getOwnPropertyDescriptor(s,a);u&&Object.defineProperty(e,a,u.get?u:{enumerable:!0,get:()=>s[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(a){if(a.ep)return;a.ep=!0;const u=n(a);fetch(a.href,u)}})();function aC(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bh={exports:{}},_o={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var A0;function oC(){if(A0)return _o;A0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,a,u){var c=null;if(u!==void 0&&(c=""+u),a.key!==void 0&&(c=""+a.key),"key"in a){u={};for(var d in a)d!=="key"&&(u[d]=a[d])}else u=a;return a=u.ref,{$$typeof:e,type:s,key:c,ref:a!==void 0?a:null,props:u}}return _o.Fragment=t,_o.jsx=n,_o.jsxs=n,_o}var T0;function lC(){return T0||(T0=1,bh.exports=oC()),bh.exports}var U=lC(),vh={exports:{}},ye={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var E0;function uC(){if(E0)return ye;E0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function v(T){return T===null||typeof T!="object"?null:(T=g&&T[g]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,E={};function M(T,q,Y){this.props=T,this.context=q,this.refs=E,this.updater=Y||S}M.prototype.isReactComponent={},M.prototype.setState=function(T,q){if(typeof T!="object"&&typeof T!="function"&&T!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,T,q,"setState")},M.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function k(){}k.prototype=M.prototype;function $(T,q,Y){this.props=T,this.context=q,this.refs=E,this.updater=Y||S}var C=$.prototype=new k;C.constructor=$,A(C,M.prototype),C.isPureReactComponent=!0;var G=Array.isArray,z={H:null,A:null,T:null,S:null,V:null},te=Object.prototype.hasOwnProperty;function ie(T,q,Y,Q,ae,xe){return Y=xe.ref,{$$typeof:e,type:T,key:q,ref:Y!==void 0?Y:null,props:xe}}function ne(T,q){return ie(T.type,q,void 0,void 0,void 0,T.props)}function ee(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function me(T){var q={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(Y){return q[Y]})}var ve=/\/+/g;function ke(T,q){return typeof T=="object"&&T!==null&&T.key!=null?me(""+T.key):q.toString(36)}function Ge(){}function _e(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(Ge,Ge):(T.status="pending",T.then(function(q){T.status==="pending"&&(T.status="fulfilled",T.value=q)},function(q){T.status==="pending"&&(T.status="rejected",T.reason=q)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function X(T,q,Y,Q,ae){var xe=typeof T;(xe==="undefined"||xe==="boolean")&&(T=null);var re=!1;if(T===null)re=!0;else switch(xe){case"bigint":case"string":case"number":re=!0;break;case"object":switch(T.$$typeof){case e:case t:re=!0;break;case y:return re=T._init,X(re(T._payload),q,Y,Q,ae)}}if(re)return ae=ae(T),re=Q===""?"."+ke(T,0):Q,G(ae)?(Y="",re!=null&&(Y=re.replace(ve,"$&/")+"/"),X(ae,q,Y,"",function(rn){return rn})):ae!=null&&(ee(ae)&&(ae=ne(ae,Y+(ae.key==null||T&&T.key===ae.key?"":(""+ae.key).replace(ve,"$&/")+"/")+re)),q.push(ae)),1;re=0;var Xe=Q===""?".":Q+":";if(G(T))for(var De=0;De<T.length;De++)Q=T[De],xe=Xe+ke(Q,De),re+=X(Q,q,Y,xe,ae);else if(De=v(T),typeof De=="function")for(T=De.call(T),De=0;!(Q=T.next()).done;)Q=Q.value,xe=Xe+ke(Q,De++),re+=X(Q,q,Y,xe,ae);else if(xe==="object"){if(typeof T.then=="function")return X(_e(T),q,Y,Q,ae);throw q=String(T),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return re}function L(T,q,Y){if(T==null)return T;var Q=[],ae=0;return X(T,Q,"","",function(xe){return q.call(Y,xe,ae++)}),Q}function I(T){if(T._status===-1){var q=T._result;q=q(),q.then(function(Y){(T._status===0||T._status===-1)&&(T._status=1,T._result=Y)},function(Y){(T._status===0||T._status===-1)&&(T._status=2,T._result=Y)}),T._status===-1&&(T._status=0,T._result=q)}if(T._status===1)return T._result.default;throw T._result}var F=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function J(){}return ye.Children={map:L,forEach:function(T,q,Y){L(T,function(){q.apply(this,arguments)},Y)},count:function(T){var q=0;return L(T,function(){q++}),q},toArray:function(T){return L(T,function(q){return q})||[]},only:function(T){if(!ee(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},ye.Component=M,ye.Fragment=n,ye.Profiler=a,ye.PureComponent=$,ye.StrictMode=s,ye.Suspense=h,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,ye.__COMPILER_RUNTIME={__proto__:null,c:function(T){return z.H.useMemoCache(T)}},ye.cache=function(T){return function(){return T.apply(null,arguments)}},ye.cloneElement=function(T,q,Y){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var Q=A({},T.props),ae=T.key,xe=void 0;if(q!=null)for(re in q.ref!==void 0&&(xe=void 0),q.key!==void 0&&(ae=""+q.key),q)!te.call(q,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&q.ref===void 0||(Q[re]=q[re]);var re=arguments.length-2;if(re===1)Q.children=Y;else if(1<re){for(var Xe=Array(re),De=0;De<re;De++)Xe[De]=arguments[De+2];Q.children=Xe}return ie(T.type,ae,void 0,void 0,xe,Q)},ye.createContext=function(T){return T={$$typeof:c,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:u,_context:T},T},ye.createElement=function(T,q,Y){var Q,ae={},xe=null;if(q!=null)for(Q in q.key!==void 0&&(xe=""+q.key),q)te.call(q,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(ae[Q]=q[Q]);var re=arguments.length-2;if(re===1)ae.children=Y;else if(1<re){for(var Xe=Array(re),De=0;De<re;De++)Xe[De]=arguments[De+2];ae.children=Xe}if(T&&T.defaultProps)for(Q in re=T.defaultProps,re)ae[Q]===void 0&&(ae[Q]=re[Q]);return ie(T,xe,void 0,void 0,null,ae)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(T){return{$$typeof:d,render:T}},ye.isValidElement=ee,ye.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:I}},ye.memo=function(T,q){return{$$typeof:p,type:T,compare:q===void 0?null:q}},ye.startTransition=function(T){var q=z.T,Y={};z.T=Y;try{var Q=T(),ae=z.S;ae!==null&&ae(Y,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(J,F)}catch(xe){F(xe)}finally{z.T=q}},ye.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},ye.use=function(T){return z.H.use(T)},ye.useActionState=function(T,q,Y){return z.H.useActionState(T,q,Y)},ye.useCallback=function(T,q){return z.H.useCallback(T,q)},ye.useContext=function(T){return z.H.useContext(T)},ye.useDebugValue=function(){},ye.useDeferredValue=function(T,q){return z.H.useDeferredValue(T,q)},ye.useEffect=function(T,q,Y){var Q=z.H;if(typeof Y=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Q.useEffect(T,q)},ye.useId=function(){return z.H.useId()},ye.useImperativeHandle=function(T,q,Y){return z.H.useImperativeHandle(T,q,Y)},ye.useInsertionEffect=function(T,q){return z.H.useInsertionEffect(T,q)},ye.useLayoutEffect=function(T,q){return z.H.useLayoutEffect(T,q)},ye.useMemo=function(T,q){return z.H.useMemo(T,q)},ye.useOptimistic=function(T,q){return z.H.useOptimistic(T,q)},ye.useReducer=function(T,q,Y){return z.H.useReducer(T,q,Y)},ye.useRef=function(T){return z.H.useRef(T)},ye.useState=function(T){return z.H.useState(T)},ye.useSyncExternalStore=function(T,q,Y){return z.H.useSyncExternalStore(T,q,Y)},ye.useTransition=function(){return z.H.useTransition()},ye.version="19.1.0",ye}var R0;function dm(){return R0||(R0=1,vh.exports=uC()),vh.exports}var j=dm();const Un=aC(j),Gx=rC({__proto__:null,default:Un},[j]),{NODE_ENV:cC}=globalThis.env??{},fC=cC==="development";function Nu(){}function dC(e,t){if(fC){const n=j.useRef(Nu);j.useEffect(()=>{let s=n.current;if(s===Nu)s=e()??Nu,n.current=s;else return()=>{s(),n.current=Nu}},t)}else j.useEffect(e,t)}function ac(e){dC(e,[])}function Dc(e=Math.random){return e().toString(36).slice(2)}class lp extends Promise{constructor(n){let s,a;super((u,c)=>{s=u,a=c});w(this,"fate");w(this,"resolve");w(this,"reject");w(this,"done",!1);this.resolve=s,this.reject=a,this.use(n instanceof Promise?n:new Promise(n))}pass(n,s){n===this.fate&&(this.resolve(s),this.done=!0)}fail(n,s){n===this.fate&&(this.reject(s),this.done=!0)}use(n){if(n instanceof Promise){const s=n;this.fate=s,s.then(a=>{this.pass(s,a)},a=>{this.fail(s,a)})}else this.resolve(n),this.fate=void 0}}function hC(e){return Object.entries(e)}const pC=(e,t,n=vn.STORE)=>Wx(n,{key:`${e.key}:JSON`,get:({get:s})=>t.toJson(s(e)),set:({set:s},a)=>{s(e,t.fromJson(a))}}),Ta=e=>JSON.parse(e),Nn=e=>JSON.stringify(e);function ge(e){for(;e.child!==null;)e=e.child;return e}class hm{constructor(t){w(this,"_buffer");w(this,"_index",0);let n;typeof t=="number"?n=t:n=t.length,this._buffer=Array.from({length:n})}get buffer(){return this._buffer}get index(){return this._index}add(t){this._buffer[this._index]=t,this._index=(this._index+1)%this._buffer.length}copy(){const t=new hm([...this._buffer]);return t._index=this._index,t}}const mC={atom_family:"atom",molecule_family:"molecule",mutable_atom_family:"mutable_atom",readonly_held_selector_family:"readonly_held_selector",readonly_pure_selector_family:"readonly_pure_selector",writable_held_selector_family:"writable_held_selector",writable_pure_selector_family:"writable_pure_selector"};function yC(e,t){const n=Nn(t),s=`${e.key}(${n})`,a=mC[e.type],u={key:s,type:a};return Object.assign(u,{family:{key:e.key,subKey:n}}),Object.assign(u,{counterfeit:!0}),u}function ha(e){const t={key:e.key,type:e.type};return"family"in e&&(t.family=e.family),t}function Ht(e){return a_(vn.STORE,e)}function Pn(...e){return e.length===2?Di(vn.STORE,...e):Di(vn.STORE,...e)}const Sh=e=>(t,n,s,a,...u)=>{console[e](`${t} ${n} "${s}" ${a}`,...u)},gC={error:Sh("error"),info:Sh("info"),warn:Sh("warn")};class bC{constructor(t,n,s=gC){w(this,"logLevel");w(this,"filter");w(this,"logger");w(this,"error",(...t)=>{var s;const n=((s=this.filter)==null?void 0:s.call(this,...t))??!0;this.logLevel!==null&&(n===!0?this.logger.error(...t):n!==!1&&this.logger.error(...n))});w(this,"info",(...t)=>{var s;const n=((s=this.filter)==null?void 0:s.call(this,...t))??!0;this.logLevel==="info"&&(n===!0?this.logger.info(...t):n!==!1&&this.logger.info(...n))});w(this,"warn",(...t)=>{var s;const n=((s=this.filter)==null?void 0:s.call(this,...t))??!0;this.logLevel!=="error"&&this.logLevel!==null&&(n===!0?this.logger.warn(...t):n!==!1&&this.logger.warn(...n))});this.logLevel=t,this.filter=n,this.logger=s}}function Ui(e){return Wx(vn.STORE,e)}function In(...e){e.length===2?Tt(vn.STORE,...e):Tt(vn.STORE,...e)}function vC(e,t,n=Dc()){return e_(vn.STORE,e,t,n)}function SC(e){return rw(vn.STORE,e)}function xC(e,t=Dc()){return mm(vn.STORE,e,t)}class nn{constructor(t,n){w(this,"a");w(this,"b");w(this,"cardinality");w(this,"relations",new Map);w(this,"contents",new Map);w(this,"isAType");w(this,"isBType");w(this,"isContent");w(this,"makeContentKey",(t,n)=>`${t}:${n}`);w(this,"warn");var s,a;if(this.a=t.between[0],this.b=t.between[1],this.cardinality=t.cardinality,n!=null&&n.externalStore||(this.relations=new Map((s=t.relations)==null?void 0:s.map(([u,c])=>[u,new Set(c)])),this.contents=new Map(t.contents)),this.isAType=(n==null?void 0:n.isAType)??null,this.isBType=(n==null?void 0:n.isBType)??null,this.isContent=(n==null?void 0:n.isContent)??null,n!=null&&n.makeContentKey&&(this.makeContentKey=n.makeContentKey),n!=null&&n.externalStore){const u=n.externalStore;this.has=(c,d)=>u.has(c,d),this.addRelation=(c,d)=>{u.addRelation(c,d)},this.deleteRelation=(c,d)=>{u.deleteRelation(c,d)},this.replaceRelationsSafely=(c,d)=>{u.replaceRelationsSafely(c,d)},this.replaceRelationsUnsafely=(c,d)=>{u.replaceRelationsUnsafely(c,d)},this.getRelatedKeys=c=>u.getRelatedKeys(c),u.getContent&&(this.getContentInternal=c=>u.getContent(c),this.setContent=(c,d)=>{u.setContent(c,d)},this.deleteContent=c=>{u.deleteContent(c)});for(const[c,d]of t.relations??[]){let h=(a=this.isAType)!=null&&a.call(this,c)?c:void 0,p=h===void 0?c:void 0;for(const y of d)h??(h=y),p??(p=y),this.addRelation(h,p)}for(const[c,d]of t.contents??[])this.setContent(c,d)}n!=null&&n.warn&&(this.warn=n.warn)}getRelatedKeys(t){return this.relations.get(t)}addRelation(t,n){let s=this.relations.get(t),a=this.relations.get(n);s?s.add(n):(s=new Set([n]),this.relations.set(t,s)),a?a.add(t):(a=new Set([t]),this.relations.set(n,a))}deleteRelation(t,n){const s=this.relations.get(t);if(s){s.delete(n),s.size===0&&this.relations.delete(t);const a=this.relations.get(n);a&&(a.delete(t),a.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(t,n){this.relations.set(t,new Set(n));for(const s of n){const a=new Set().add(t);this.relations.set(s,a)}}replaceRelationsSafely(t,n){var c;const s=this.relations.get(t);let a=(c=this.isAType)!=null&&c.call(this,t)?t:void 0,u=a===void 0?t:void 0;if(s)for(const d of s){a??(a=d),u??(u=d);const h=this.relations.get(d);h&&(h.size===1?this.relations.delete(d):h.delete(t),this.contents.delete(this.makeContentKey(a,u)))}this.relations.set(t,new Set(n));for(const d of n){let h=this.relations.get(d);h?h.add(t):(h=new Set().add(t),this.relations.set(d,h))}}getContentInternal(t){return this.contents.get(t)}setContent(t,n){this.contents.set(t,n)}deleteContent(t){this.contents.delete(t)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([t,n])=>[t,[...n]]),contents:[...this.contents.entries()]}}set(...t){let n,s,a;switch(t.length){case 1:{const u=t[0];n=u[this.a],s=u[this.b],a=void 0;break}case 2:{const u=t[0];typeof u=="string"?[n,s]=t:(n=u[this.a],s=u[this.b],a=t[1]);break}default:{n=t[0],s=t[1],a=t[2];break}}switch(this.cardinality){case"1:1":{const u=this.getRelatedKey(n);u&&u!==s&&this.delete(n,u)}case"1:n":{const u=this.getRelatedKey(s);u&&u!==n&&this.delete(u,s)}break}if(a){const u=this.makeContentKey(n,s);this.setContent(u,a)}return this.addRelation(n,s),this}delete(t,n){n=typeof n=="string"?n:t[this.b];const s=typeof t=="string"?t:t[this.a];if(s===void 0&&typeof n=="string"){const a=this.getRelatedKeys(n);if(a)for(const u of a)this.delete(u,n)}if(typeof s=="string"&&n===void 0){const a=this.getRelatedKeys(s);if(a)for(const u of a)this.delete(s,u)}if(typeof s=="string"&&typeof n=="string"){this.deleteRelation(s,n);const a=this.makeContentKey(s,n);this.deleteContent(a)}return this}getRelatedKey(t){var s;const n=this.getRelatedKeys(t);if(n){n.size>1&&((s=this.warn)==null||s.call(this,`${n.size} related keys were found for key "${t}": (${[...n].map(u=>`"${u}"`).join(", ")}). Only one related key was expected.`));let a;for(const u of n){a=u;break}return a}}replaceRelations(t,n,s){const a=!Array.isArray(n),u=a?Object.keys(n):n;if(s!=null&&s.reckless?this.replaceRelationsUnsafely(t,u):this.replaceRelationsSafely(t,u),a)for(const c of u){const d=this.makeContentKey(t,c),h=n[c];this.setContent(d,h)}return this}getContent(t,n){const s=this.makeContentKey(t,n);return this.getContentInternal(s)}getRelationEntries(t){const n=t[this.a],s=t[this.b];if(n!==void 0&&s===void 0){const a=this.getRelatedKeys(n);if(a)return[...a].map(u=>[u,this.getContent(n,u)])}if(n===void 0&&s!==void 0){const a=this.getRelatedKeys(s);if(a)return[...a].map(u=>[u,this.getContent(u,s)])}return[]}has(t,n){if(n){const s=this.getRelatedKeys(t);return(s==null?void 0:s.has(n))??!1}return this.relations.has(t)}}class Vt{constructor(){w(this,"Subscriber");w(this,"subscribers",new Map)}subscribe(t,n){return this.subscribers.set(t,n),()=>{this.unsubscribe(t)}}unsubscribe(t){this.subscribers.delete(t)}next(t){const n=this.subscribers.values();for(const s of n)s(t)}}class wC extends Vt{constructor(n){super();w(this,"state");this.state=n}next(n){this.state=n,super.next(n)}}function li(e){return"epoch"in e.transactionMeta}function Pt(e){return"phase"in e.transactionMeta}const AC=e=>{const t=ge(e);if(!Pt(t)){e.logger.warn("๐Ÿž","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}e.logger.info("๐Ÿช‚","transaction",t.transactionMeta.update.key,"Aborting transaction"),t.parent.child=null};function TC(e){return e[0].toUpperCase()+e.slice(1)}function EC(e){return e.type.split("_").map(TC).join(" ")}class pm extends Error{constructor(t,n){super(`${EC(t)} ${Nn(t.key)} not found in store "${n.config.name}".`)}}function mm(e,t,n){return(...s)=>{const a=wt(e,t);if(a)return a.run(s,n);throw new pm(t,e)}}const ym=e=>t=>e instanceof Function?e(t):e,Nc=(e,t)=>{if(e.valueMap.has(t.key))return e.logger.info("๐Ÿ“–",t.type,t.key,"reading cached value"),n_(t,e);switch(t.type){case"readonly_held_selector":case"readonly_pure_selector":case"writable_held_selector":case"writable_pure_selector":return e.logger.info("๐Ÿงฎ",t.type,t.key,"computing value"),t.get();case"atom":case"mutable_atom":{const n=t.default;let s;return n instanceof Function?s=n():s=n,e.logger.info("๐Ÿ’","atom",t.key,"could not find cached value; using default",s),s}}},RC=(e,t)=>{if(e.operation.open){const n=performance.now();return e.logger.info("โ—",t.type,t.key,`deferring setState at T-${n} until setState for "${e.operation.token.key}" is done`),n}e.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:t},e.logger.info("โญ•",t.type,t.key,`operation start in store "${e.config.name}"${Pt(e)?` ${e.transactionMeta.phase} "${e.transactionMeta.update.key}"`:""}`)},OC=e=>{e.operation.open&&e.logger.info("๐Ÿ”ด",e.operation.token.type,e.operation.token.key,`operation done in store "${e.config.name}"`),e.operation={open:!1},e.on.operationClose.next(e.operation)},MC=(e,t)=>e.operation.open?e.operation.done.has(t):(e.logger.error("๐Ÿž","unknown",t,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),$c=(e,t)=>{if(!e.operation.open){e.logger.error("๐Ÿž","unknown",t,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}e.operation.done.add(t)},CC=(e,t,n)=>{switch(t.type){case"mutable_atom":e.logger.info("๐Ÿ“ข",t.type,t.key,"is now (",n.newValue,") subscribers:",t.subject.subscribers);break;case"atom":case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":e.logger.info("๐Ÿ“ข",t.type,t.key,"went (",n.oldValue,"->",n.newValue,") subscribers:",t.subject.subscribers)}t.subject.next(n)},O0=(e,t)=>{const n=ge(e),s=n.selectorAtoms.getRelatedKeys(t.key);if(n.logger.info("๐Ÿงน",t.type,t.key,s?`evicting ${s.size} states downstream:`:"no downstream states",s??"to evict"),s){n.operation.open&&n.logger.info("๐Ÿงน",t.type,t.key,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const a of s)MC(n,a)||(i_(a,n),$c(n,a))}},_C=(e,t,n)=>{const s=Nc(e,t);let a=s;if(t.type==="mutable_atom"&&Pt(e)){const{parent:c}=e;a=cp(e,t,c)}a=ym(n)(a),e.logger.info("๐Ÿ“","atom",t.key,"set to",a),a=ai(e,t.key,a,t.subject),s_(e,t.key)&&r_(e,t.key),$c(e,t.key),O0(e,t);const u={oldValue:s,newValue:a};if(!Pt(e)){CC(e,t,u);return}if(e.on.transactionApplying.state===null){const{key:c}=t;if(t_(u.newValue))return;const d={type:"atom_update",key:c,...u};t.family&&(d.family=t.family),e.transactionMeta.update.updates.push(d),e.logger.info("๐Ÿ“","atom",c,"stowed (",u.oldValue,"->",u.newValue,")")}else if(t.key.startsWith("*")){const c=t.key.slice(1),d=e.atoms.get(c);let h=e.valueMap.get(c);if(d.type==="mutable_atom"&&Pt(e)){const{parent:y}=e;h=cp(e,d,y)}h.do(u.newValue)===null&&O0(e,d)}},Fx=(e,t,n)=>{switch(t.type){case"atom":case"mutable_atom":_C(e,t,n);break;case"writable_pure_selector":case"writable_held_selector":t.set(n);break}},gm=(e,t)=>ge(e).atoms.has(t),kC=(e,t)=>ge(e).writableSelectors.has(t),DC=(e,t)=>ge(e).readonlySelectors.has(t),NC=(e,t)=>gm(e,t)||kC(e,t)||DC(e,t),up=(e,t)=>ge(e).selectorGraph.getRelationEntries({downstreamSelectorKey:t}).filter(([s,{source:a}])=>a!==t).map(([s,{source:a}])=>a).filter(s=>NC(e,s)),Yx=(e,t,n)=>{const s=[],a=up(e,t);for(;a.length>0;){const u=a.shift();n.has(u)||(n.add(u),gm(e,u)?s.includes(u)||s.push(u):a.push(...up(e,u)))}return s},$C=(e,t)=>{const n=e.key,s=up(t,n),a=new Set;return s.flatMap(u=>gm(t,u)?u:Yx(t,u,a))},BC=(e,t,n,s,a)=>{const u=ge(e),{type:c,key:d}=s;if(c==="atom"||c==="mutable_atom")u.selectorAtoms.set({selectorKey:n,atomKey:d}),e.logger.info("๐Ÿ”",t,n,`discovers root atom "${d}"`);else{const h=Yx(e,d,a);e.logger.info("๐Ÿ”",t,n,`discovers root atoms: [ ${h.map(p=>`"${p}"`).join(", ")} ]`);for(const p of h)u.selectorAtoms=u.selectorAtoms.set({selectorKey:n,atomKey:p})}a.add(d)},Bc=(e,t,n,s)=>({get:(...a)=>{const u=ge(e);let c;if(a.length===2){const[y,g]=a;c=gn(e,y,g)}else[c]=a;const d=wt(e,c),h=Nc(e,d),p=c.key;return e.logger.info("๐Ÿ”Œ",t,n,`registers dependency ( "${p}" =`,h,")"),u.selectorGraph.set({upstreamSelectorKey:p,downstreamSelectorKey:n},{source:c.key}),BC(e,t,n,c,s),h},set:(...a)=>{let u,c;if(a.length===2)u=a[0],c=a[1];else{const p=a[0],y=a[1];c=a[2],u=gn(e,p,y)}const d=ge(e),h=wt(d,u);Fx(d,h,c)},find:(...a)=>gn(e,...a),json:a=>Vc(e,a)}),Xx=(e,t,n)=>{const s=ge(e),a=new Vt,u=new Set,{key:c,const:d}=t,h="readonly_held_selector",{get:p,find:y,json:g}=Bc(s,h,c,u),S={...t,type:h,subject:a,install:E=>Xx(E,t,n),get:()=>(t.get({get:p,find:y,json:g},d),ai(ge(e),c,d,a),u.clear(),d),...n};return s.readonlySelectors.set(c,S),e.logger.info("โœจ",h,c,"=",d),{key:c,type:h}},Zx=(e,t,n)=>{const s=ge(e),a=new Vt,u=new Set,c=t.key,d="readonly_pure_selector",{get:h,find:p,json:y}=Bc(s,d,c,u),g=()=>{const E=t.get({get:h,find:p,json:y});return ai(ge(e),c,E,a),u.clear(),E},v={...t,type:d,subject:a,install:E=>Zx(E,t,n),get:g,...n};s.readonlySelectors.set(c,v);const S=g();return e.logger.info("โœจ",d,c,"=",S),{key:c,type:d}},Jx=(e,t,n)=>{const s=ge(e),a=new Vt,u=new Set,{key:c,const:d}=t,h="writable_held_selector",p=Bc(s,h,c,u),{find:y,get:g,json:v}=p,S={find:y,get:g,json:v},A=(C=t.get,G=ge(e))=>(C(S,d),ai(G,c,d,a),u.clear(),d),M={...t,type:h,subject:a,install:C=>Jx(C,t,n),get:A,set:C=>{const G=ge(e),z=A(t.get,G),te=ym(C)(z);e.logger.info("๐Ÿ“",h,c,"set (",z,"->",te,")"),ai(G,c,te,a),$c(G,c),li(G)&&a.next({newValue:te,oldValue:z}),t.set(p,te)},...n};s.writableSelectors.set(c,M);const k=A();return e.logger.info("โœจ",h,c,"=",k),{key:c,type:h}},Qx=(e,t,n)=>{const s=ge(e),a=new Vt,u=new Set,c=t.key,d="writable_pure_selector",h=Bc(s,d,c,u),{find:p,get:y,json:g}=h,v={find:p,get:y,json:g},S=($=t.get,C=ge(e))=>{const G=$(v);return ai(C,c,G,a),u.clear(),G},E={...t,type:d,subject:a,install:$=>Qx($,t,n),get:S,set:$=>{const C=ge(e),G=S(t.get,C),z=ym($)(G);e.logger.info("๐Ÿ“",d,c,"set (",G,"->",z,")"),ai(C,t.key,z,a),$c(C,t.key),li(C)&&a.next({newValue:z,oldValue:G}),t.set(h,z)},...n};s.writableSelectors.set(c,E);const M=S();return e.logger.info("โœจ",E.type,E.key,"=",M),{key:c,type:d}};function Wx(e,t){const n="set"in t,s="const"in t;if(s&&n){const u=Jx(e,t,void 0);return e.on.selectorCreation.next(u),u}if(s){const u=Xx(e,t,void 0);return e.on.selectorCreation.next(u),u}if(n){const u=Qx(e,t,void 0);return e.on.selectorCreation.next(u),u}const a=Zx(e,t,void 0);return e.on.selectorCreation.next(a),a}function LC(e,t){const n=ge(e),{key:s,type:a}=t,u=wt(n,t);if(!u.family)e.logger.error("โŒ",a,s,"Standalone selectors cannot be disposed.");else{n.molecules.get(u.family.subKey)&&n.moleculeData.delete(u.family.subKey,u.family.key);let d;switch(t.type){case"writable_held_selector":n.writableSelectors.delete(s),d={key:u.family.key,type:"writable_held_selector_family"},wt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"writable_pure_selector":n.writableSelectors.delete(s),d={key:u.family.key,type:"writable_pure_selector_family"},wt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"readonly_held_selector":n.readonlySelectors.delete(s),d={key:u.family.key,type:"readonly_held_selector_family"},wt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"readonly_pure_selector":n.readonlySelectors.delete(s),d={key:u.family.key,type:"readonly_pure_selector_family"},wt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break}n.valueMap.delete(s),n.selectorAtoms.delete(s),n.selectorGraph.delete(s),e.logger.info("๐Ÿ”ฅ",t.type,s,"deleted"),Pt(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:t}):e.on.selectorDisposal.next(t)}}function VC(e,t,n){const s=e.families.get(t.key);if(s===void 0)throw new pm(t,e);const a=s(n),u=ge(e);if(a.family)if(li(u))switch(a.type){case"atom":case"mutable_atom":e.on.atomCreation.next(a);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":e.on.selectorCreation.next(a);break}else Pt(u)&&u.on.transactionApplying.state===null&&u.transactionMeta.update.updates.push({type:"state_creation",token:a});return a}function jC(e,t,n){const s=Nn(n),a=`${t.key}(${s})`,u=ge(e);let c;switch(t.type){case"atom_family":case"mutable_atom_family":c=u.atoms.get(a);break;case"writable_held_selector_family":case"writable_pure_selector_family":c=u.writableSelectors.get(a);break;case"readonly_held_selector_family":case"readonly_pure_selector_family":c=u.readonlySelectors.get(a);break}return c&&ha(c)}function gn(e,t,n){let s=jC(e,t,n);if(s)return s;const a=Nn(n),u=e.molecules.get(a);if(!u&&e.config.lifespan==="immortal"){const c=yC(t,n);return e.logger.error("โŒ",c.type,c.key,`was not found in store "${e.config.name}"; returned a counterfeit token.`),c}return s=VC(e,t,n),u&&ge(e).moleculeData.set(a,t.key),s}function Lc(e,...t){let n;if(t.length===1)n=t[0];else{const s=t[0],a=t[1];n=gn(e,s,a)}try{wt(e,n)}catch{e.logger.error("โŒ",n.type,n.key,`could not be disposed because it was not found in the store "${e.config.name}".`);return}switch(n.type){case"atom":case"mutable_atom":xm(e,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":LC(e,n);break}}function zC(e,t){if(t.family){const n=e.families.get(t.family.key);if(n)return n}}function Tt(e,...t){let n,s,a,u;if(t.length===2?(n=t[0],u=t[1],s=zC(e,n)??null,s&&(a=n.family?Ta(n.family.subKey):null,n=gn(e,s,a))):(s=t[0],a=t[1],u=t[2],n=gn(e,s,a)),"counterfeit"in n&&"family"in n){const h=n.family.subKey,p=e.disposalTraces.buffer.find(y=>(y==null?void 0:y.key)===h);e.logger.error("โŒ",n.type,n.key,`could not be set because it was not found in the store "${e.config.name}".`,p?`This state was previously disposed:
18
- ${p.trace}`:"No previous disposal trace was found.");return}const c=RC(e,n);if(c){const h=e.on.operationClose.subscribe(`waiting to set "${n.key}" at T-${c}`,()=>{h(),e.logger.info("๐ŸŸข",n.type,n.key,`resuming deferred setState from T-${c}`),Tt(e,n,u)});return}const d=wt(e,n);Fx(e,d,u),OC(e)}function UC(e,t,n){const{key:s,newValue:a,oldValue:u}=t,c=e==="newValue"?a:u,d={key:s,type:"atom"};t.family&&Object.assign(d,{family:t.family}),Tt(n,d,c)}function qC(e){var n,s;const{stack:t}=e;return t?`
19
- `+((s=(n=t.split(`
20
- `))==null?void 0:n.slice(1))==null?void 0:s.join(`
21
- `)):""}function ew(e,t,n,s="any"){const a=t,u=Nn(n),c=[],d=ge(e);if(Array.isArray(a))for(const y of a){const g=Nn(y);d.molecules.get(g)?e.moleculeGraph.set(g,u,{source:g}):c.push(g)}else{const y=Nn(a);d.molecules.get(y)?e.moleculeGraph.set(y,u,{source:y}):c.push(y)}c.length===0&&d.molecules.set(u,{key:n,stringKey:u,dependsOn:s});const h={type:"molecule_creation",key:n,provenance:a};Pt(d)&&d.transactionMeta.phase==="building"?d.transactionMeta.update.updates.push(h):d.on.moleculeCreation.next(h);for(const y of c){const g=e.disposalTraces.buffer.find(v=>(v==null?void 0:v.key)===y);e.logger.error("โŒ","molecule",n,"allocation failed:",`Could not allocate to ${y} in store "${e.config.name}".`,g?`
22
- ${y} was most recently disposed
23
- ${g.trace}`:`No previous disposal trace for ${y} was found.`)}return n}function bm(e,t){const n=Nn(t),s=e.molecules.get(n);if(!s){const S=e.disposalTraces.buffer.find(A=>(A==null?void 0:A.key)===n);e.logger.error("โŒ","molecule",t,"deallocation failed:",`Could not find allocation for ${n} in store "${e.config.name}".`,S?`
24
- This state was most recently deallocated
25
- ${S.trace}`:`No previous disposal trace for ${n} was found.`);return}const a=e.moleculeJoins.getRelatedKeys(s.key);if(a)for(const S of a){const A=e.joins.get(S);A&&(A.relations.delete(s.key),A.molecules.delete(s.stringKey))}e.moleculeJoins.delete(s.stringKey);const u=[],c=[],d={type:"molecule_disposal",key:s.key,values:c,provenance:u},h=ge(e);h.molecules.delete(n);const p=Pt(h)&&h.transactionMeta.phase==="building";p&&h.transactionMeta.update.updates.push(d);const y=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:s.stringKey});if(y)for(const[S,{source:A}]of y)if(A===s.stringKey){const E=Ta(S);bm(e,E)}else u.push(A);const g=h.moleculeData.getRelatedKeys(s.stringKey);if(g)for(const S of g){const A=h.families.get(S),E=gn(e,A,s.key);c.push([A.key,E]),Lc(e,E)}h.moleculeGraph.delete(s.stringKey),h.moleculeJoins.delete(s.stringKey),h.moleculeData.delete(s.stringKey),p||h.on.moleculeDisposal.next(d),h.molecules.delete(s.stringKey);const v=qC(new Error);e.disposalTraces.add({key:n,trace:v})}function M0(e,t,n,s){const a=Nn(n),u=ge(e),c=u.molecules.get(a);if(!c){const v=e.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===a);return e.logger.error("โŒ","molecule",n,"claim failed:",`Could not allocate to ${a} in store "${e.config.name}".`,v?`
26
- ${a} was most recently disposed
27
- ${v.trace}`:`No previous disposal trace for ${a} was found.`),n}const d=Nn(t),h=u.molecules.get(d);if(!h){const v=e.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===d);return e.logger.error("โŒ","molecule",n,"claim failed:",`Could not allocate to ${d} in store "${e.config.name}".`,v?`
28
- ${d} was most recently disposed
29
- ${v.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:v}])=>v!==a).map(([v])=>Ta(v));u.moleculeGraph.delete(a),u.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,from:p,to:[h.key]};return Pt(u)&&u.transactionMeta.phase==="building"&&u.transactionMeta.update.updates.push(y),n}function KC(e,t,n){switch(t){case"newValue":{tw(e,n);break}case"oldValue":{Lc(n,e.token);break}}}function PC(e,t,n){switch(t){case"newValue":{Lc(n,e.token);break}case"oldValue":{tw(e,n),e.subType==="atom"&&n.valueMap.set(e.token.key,e.value);break}}}function tw(e,t){const{family:n}=e.token;if(n){const s=t.families.get(n.key);s&&gn(t,s,Ta(n.subKey))}}function IC(e,t,n){switch(t){case"newValue":ew(n,e.provenance,e.key);break;case"oldValue":bm(n,e.key);break}}function HC(e,t,n){switch(t){case"newValue":bm(n,e.key);break;case"oldValue":{const s=e.provenance.map(Ta);ew(n,s,e.key);for(const[a,u]of e.values){const c=n.families.get(a);if(c){gn(n,c,e.key);const d=`${a}(${Nn(e.key)})`;n.valueMap.set(d,u)}}}break}}function GC(e,t,n){switch(t){case"newValue":{const s=e.to.length===1?e.to[0]:e.to;M0(n,s,e.key)}break;case"oldValue":{const s=e.from.length===1?e.from[0]:e.from;M0(n,s,e.key)}break}}function ta(e,t,n){const s=e==="newValue"?t.updates:[...t.updates].reverse();for(const a of s)switch(a.type){case"atom_update":case"selector_update":UC(e,a,n);break;case"state_creation":KC(a,e,n);break;case"state_disposal":PC(a,e,n);break;case"molecule_creation":IC(a,e,n);break;case"molecule_disposal":HC(a,e,n);break;case"molecule_transfer":GC(a,e,n);break;case"transaction_update":ta(e,a,n);break}}function nw(e,t){return e.transactionMeta.actionContinuities.getRelatedKey(t)}function iw(e,t){return e.transactionMeta.epoch.get(t)}function FC(e,t){if(!li(e))return;const s=nw(e,t);if(s!==void 0)return iw(e,s)}function vm(e,t,n){li(e)&&t&&e.transactionMeta.epoch.set(t,n)}function YC(e,t,n){if(!li(e))return;const a=nw(e,t);a!==void 0&&e.transactionMeta.epoch.set(a,n)}const XC=(e,t)=>{var u;const n=ge(t),{parent:s}=n;if(s===null||!Pt(n)||((u=n.transactionMeta)==null?void 0:u.phase)!=="building"){t.logger.warn("๐Ÿž","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,s.child=null,s.on.transactionApplying.next(n.transactionMeta);const{updates:a}=n.transactionMeta.update;if(t.logger.info("๐Ÿ›„","transaction",n.transactionMeta.update.key,`Applying transaction with ${a.length} updates:`,a),ta("newValue",n.transactionMeta.update,s),li(s)){YC(s,n.transactionMeta.update.key,n.transactionMeta.update.epoch);const c=wt(t,{key:n.transactionMeta.update.key,type:"transaction"});c==null||c.subject.next(n.transactionMeta.update),t.logger.info("๐Ÿ›ฌ","transaction",n.transactionMeta.update.key,"Finished applying transaction.")}else Pt(s)&&s.transactionMeta.update.updates.push(n.transactionMeta.update);s.on.transactionApplying.next(null)};function sw(e,t,n){if(!li(e))return;const{epoch:a,actionContinuities:u}=e.transactionMeta;u.set(t,n),a.has(t)||a.set(t,-1)}function ZC(e){return{store:e}}function Di(e,...t){let n,s,a;if(t.length===1?n=t[0]:(s=t[0],a=t[1],n=gn(e,s,a)),"counterfeit"in n&&"family"in n){s=e.families.get(n.family.key);const u=n.family.subKey,c=e.disposalTraces.buffer.find(d=>(d==null?void 0:d.key)===u);switch(e.logger.error("โŒ",n.type,n.key,`could not be retrieved because it was not found in the store "${e.config.name}".`,c?`This state was previously disposed:
30
- ${c.trace}`:"No previous disposal trace was found."),s.type){case"atom_family":case"mutable_atom_family":return e.defaults.get(s.key);case"readonly_pure_selector_family":case"writable_pure_selector_family":case"readonly_held_selector_family":case"writable_held_selector_family":{if(e.defaults.has(s.key))return e.defaults.get(n.family.key);const d=wt(e,s).default(u);return e.defaults.set(s.key,d),d}}}return Nc(e,wt(e,n))}class Qn extends Map{constructor(n){super();w(this,"deleted",new Set);w(this,"source");this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n)}set(n,s){return this.deleted.delete(n),super.set(n,s)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}const JC=(e,t,n,s)=>{const a=ge(e),u={parent:a,child:null,on:a.on,loggers:a.loggers,logger:a.logger,config:a.config,atoms:new Qn(a.atoms),atomsThatAreDefault:new Set(a.atomsThatAreDefault),families:new Qn(a.families),joins:new Qn(a.joins),operation:{open:!1},readonlySelectors:new Qn(a.readonlySelectors),timelines:new Qn(a.timelines),timelineTopics:new nn(a.timelineTopics.toJSON()),trackers:new Map,transactions:new Qn(a.transactions),selectorAtoms:new nn(a.selectorAtoms.toJSON()),selectorGraph:new nn(a.selectorGraph.toJSON(),{makeContentKey:(...p)=>p.sort().join(":")}),writableSelectors:new Qn(a.writableSelectors),valueMap:new Qn(a.valueMap),defaults:a.defaults,disposalTraces:e.disposalTraces.copy(),molecules:new Qn(a.molecules),moleculeGraph:new nn(a.moleculeGraph.toJSON(),{makeContentKey:a.moleculeGraph.makeContentKey}),moleculeData:new nn(a.moleculeData.toJSON(),{makeContentKey:a.moleculeData.makeContentKey}),moleculeJoins:new nn(a.moleculeJoins.toJSON(),{makeContentKey:a.moleculeJoins.makeContentKey}),miscResources:new Qn(a.miscResources)},c=FC(e,t),d={phase:"building",update:{type:"transaction_update",key:t,id:s,epoch:c===void 0?Number.NaN:c+1,updates:[],params:n,output:void 0},toolkit:{get:(...p)=>Di(h,...p),set:(...p)=>{Tt(h,...p)},run:(p,y=Dc())=>mm(h,p,y),find:(...p)=>gn(e,...p),json:p=>Vc(h,p),dispose:(...p)=>{Lc(h,...p)},env:()=>ZC(h)}},h=Object.assign(u,{transactionMeta:d});return a.child=h,e.logger.info("๐Ÿ›ซ","transaction",t,"Building transaction with params:",n),h};function rw(e,t){const n={key:t.key,type:"transaction",run:(u,c)=>{const d=JC(e,t.key,u,c);try{const h=ge(e),{toolkit:p}=d.transactionMeta,y=t.do(p,...u);return XC(y,h),y}catch(h){throw AC(s),e.logger.warn("๐Ÿ’ฅ","transaction",t.key,"caught:",h),h}},install:u=>rw(u,t),subject:new Vt},s=ge(e);s.transactions.set(n.key,n);const a=ha(n);return e.on.transactionCreation.next(a),a}class QC{constructor(t,n=null){w(this,"parent",null);w(this,"child",null);w(this,"valueMap",new Map);w(this,"defaults",new Map);w(this,"atoms",new Map);w(this,"writableSelectors",new Map);w(this,"readonlySelectors",new Map);w(this,"atomsThatAreDefault",new Set);w(this,"selectorAtoms",new nn({between:["selectorKey","atomKey"],cardinality:"n:n"}));w(this,"selectorGraph",new nn({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));w(this,"trackers",new Map);w(this,"families",new Map);w(this,"joins",new Map);w(this,"transactions",new Map);w(this,"transactionMeta",{epoch:new Map,actionContinuities:new nn({between:["continuity","action"],cardinality:"1:n"})});w(this,"timelines",new Map);w(this,"timelineTopics",new nn({between:["timelineKey","topicKey"],cardinality:"1:n"}));w(this,"disposalTraces",new hm(100));w(this,"molecules",new Map);w(this,"moleculeJoins",new nn({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));w(this,"moleculeGraph",new nn({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));w(this,"moleculeData",new nn({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));w(this,"miscResources",new Map);w(this,"on",{atomCreation:new Vt,atomDisposal:new Vt,selectorCreation:new Vt,selectorDisposal:new Vt,timelineCreation:new Vt,transactionCreation:new Vt,transactionApplying:new wC(null),operationClose:new Vt,moleculeCreation:new Vt,moleculeDisposal:new Vt});w(this,"operation",{open:!1});w(this,"config",{name:"IMPLICIT_STORE",lifespan:"ephemeral"});w(this,"loggers",[new bC("warn",(t,n,s)=>!o_(s))]);w(this,"logger",{error:(...t)=>{for(const n of this.loggers)n.error(...t)},info:(...t)=>{for(const n of this.loggers)n.info(...t)},warn:(...t)=>{for(const n of this.loggers)n.warn(...t)}});var s,a;if(this.config={...n==null?void 0:n.config,...t},n!==null){this.valueMap=new Map(n==null?void 0:n.valueMap),this.operation={...n==null?void 0:n.operation},li(n)&&(this.transactionMeta={epoch:new Map(n==null?void 0:n.transactionMeta.epoch),actionContinuities:new nn(n==null?void 0:n.transactionMeta.actionContinuities.toJSON())});for(const[,c]of n.families)(s=c.internalRoles)!=null&&s.includes("mutable")||(a=c.internalRoles)!=null&&a.includes("join")||c.install(this);const u=new Set;for(const[,c]of n.atoms)if(!u.has(c.key)&&(c.install(this),c.type==="mutable_atom")){const d=Vc(n,c),h=cw(c);u.add(d.key),u.add(h.key)}for(const[,c]of n.readonlySelectors)c.install(this);for(const[,c]of n.writableSelectors)u.has(c.key)||c.install(this);for(const[,c]of n.transactions)c.install(this);for(const[,c]of n.timelines)c.install(this)}}}const vn={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??(globalThis.ATOM_IO_IMPLICIT_STORE=new QC({name:"IMPLICIT_STORE",lifespan:"ephemeral"})),globalThis.ATOM_IO_IMPLICIT_STORE}};function wt(e,t){let n,s=e;for(;s!==null;){switch(t.type){case"atom":case"mutable_atom":n=s.atoms.get(t.key);break;case"writable_pure_selector":case"writable_held_selector":n=s.writableSelectors.get(t.key);break;case"readonly_pure_selector":case"readonly_held_selector":n=s.readonlySelectors.get(t.key);break;case"atom_family":case"mutable_atom_family":case"writable_pure_selector_family":case"readonly_pure_selector_family":case"writable_held_selector_family":case"readonly_held_selector_family":n=s.families.get(t.key);break;case"timeline":n=s.timelines.get(t.key);break;case"transaction":n=s.transactions.get(t.key);break}if(n)return n;s=s.child}throw new pm(t,e)}const WC=(e,t)=>{const n=ge(e);return n.operation.open?n.operation.prev.get(t.key):n.valueMap.get(t.key)};function e_(e,t,n,s=Dc()){switch(t.type){case"atom":case"mutable_atom":case"readonly_pure_selector":case"readonly_held_selector":case"writable_pure_selector":case"writable_held_selector":return pa(e,t,s,n);case"transaction":return ow(e,t,s,n);case"timeline":return aw(e,t,s,n)}}const C0=(e,t)=>{const n=ge(e);return $C(t,e).map(a=>{const u=n.atoms.get(a);if(u===void 0)throw new Error(`Atom "${a}", a dependency of selector "${t.key}", not found in store "${e.config.name}".`);return u.subject.subscribe(`${t.type}:${t.key}`,c=>{e.logger.info("๐Ÿ“ข",t.type,t.key,"root",a,"went",c.oldValue,"->",c.newValue);const d=WC(n,t),h=Nc(n,t);e.logger.info("โœจ",t.type,t.key,"went",d,"->",h),t.subject.next({newValue:h,oldValue:d})})})};function pa(e,t,n,s){function a(g){if(e.operation.open){const v=e.on.operationClose.subscribe(`state subscription ${n}`,()=>{v(),s(g)})}else s(g)}const u=wt(e,t);e.logger.info("๐Ÿ‘€",u.type,u.key,`Adding subscription "${n}"`);const c=u.type==="writable_pure_selector"||u.type==="readonly_pure_selector";let d=null,h=a;c&&(d=C0(e,u),h=g=>{d&&(d.length=0,d.push(...C0(e,u))),a(g)});const p=u.subject.subscribe(n,h);return()=>{if(e.logger.info("๐Ÿ™ˆ",u.type,u.key,`Removing subscription "${n}"`),p(),d)for(const g of d)g()}}const aw=(e,t,n,s)=>{const a=wt(e,t);e.logger.info("๐Ÿ‘€","timeline",t.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,s);return()=>{e.logger.info("๐Ÿ™ˆ","timeline",t.key,`Removing subscription "${n}" from timeline`),u()}},ow=(e,t,n,s)=>{const a=wt(e,t);e.logger.info("๐Ÿ‘€","transaction",t.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,s);return()=>{e.logger.info("๐Ÿ™ˆ","transaction",t.key,`Removing subscription "${n}"`),u()}};var Ex;Ex=Symbol.dispose;class lw{constructor(t,n){w(this,"unsubscribeFromInnerValue");w(this,"unsubscribeFromState");w(this,"mutableState");w(this,"latestUpdateState");w(this,Ex);this.mutableState=t;const s=ge(n);this.latestUpdateState=this.initializeState(t,s),this.observeCore(t,this.latestUpdateState,s),this.updateCore(t,this.latestUpdateState,s),s.trackers.set(t.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),s.trackers.delete(t.key)}}initializeState(t,n){var c;const s=`*${t.key}`;n.atoms.delete(s),n.valueMap.delete(s);const a=t.family?{key:`*${t.family.key}`,subKey:t.family.subKey}:void 0,u=Sm(n,{key:s,default:null},a);if((c=n.parent)!=null&&c.valueMap.has(s)){const d=n.parent.valueMap.get(s);n.valueMap.set(s,d)}return u}observeCore(t,n,s){const a=`tracker:${s.config.name}:${Pt(s)?s.transactionMeta.update.key:"main"}:${t.key}`,u=Di(s,t);this.unsubscribeFromInnerValue=u.subscribe(a,c=>{Tt(s,n,c)}),this.unsubscribeFromState=pa(s,t,a,c=>{c.newValue!==c.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=c.newValue.subscribe(a,d=>{Tt(s,n,d)}))})}updateCore(t,n,s){const a=`tracker:${s.config.name}:${Pt(s)?s.transactionMeta.update.key:"main"}:${t.key}`;pa(s,n,a,({newValue:u,oldValue:c})=>{const d=s.timelineTopics.getRelatedKey(n.key);if(d){const p=s.timelines.get(d);if(p!=null&&p.timeTraveling){const y=aw(s,{key:d,type:"timeline"},a,g=>{y(),Tt(s,t,v=>(g==="redo"&&u?v.do(u):g==="undo"&&c&&v.undo(c),v))});return}}const h=s.on.operationClose.subscribe(a,()=>{h();const p=Di(s,t),y=u===null?-1:p.getUpdateNumber(u),g=y-p.cacheUpdateNumber;u&&g===1?Tt(s,t,v=>(v.do(u),v)):s.logger.info("โŒ","mutable_atom",t.key,`could not be updated. Expected update number ${p.cacheUpdateNumber+1}, but got ${y}`)})})}}function uw(e,t,n){e.logger.info("๐Ÿ”จ","atom",t.key,`creating in store "${e.config.name}"`);const s=ge(e),{key:a,default:u}=t,c=s.atoms.get(a),d="mutable_atom";if(c&&c.type===d)return e.logger.error("โŒ",d,a,"Tried to create atom, but it already exists in the store."),ha(c);const h=new Vt,p={...t,type:d,install:v=>(v.logger.info("๐Ÿ› ๏ธ","atom",a,`installing in store "${v.config.name}"`),uw(v,t)),subject:h},y=u();s.atoms.set(p.key,p),fw(e,a),ai(s,a,y,h);const g=ha(p);if(t.effects){let v=0;const S=[];for(const A of t.effects){const E=A({setSelf:M=>{Tt(e,g,M)},onSet:M=>pa(e,g,`effect[${v}]`,M)});E&&S.push(E),++v}p.cleanup=()=>{for(const A of S)A()}}return new lw(g,e),pC(g,t,e),g}const Vc=(e,t)=>{if(t.family){const s=ge(e),u={key:`${t.family.key}:JSON`,type:"writable_pure_selector_family"},c=wt(s,u),d=JSON.parse(t.family.subKey);return gn(e,c,d)}return{type:"writable_pure_selector",key:`${t.key}:JSON`}},cw=e=>{const n={type:"atom",key:`*${e.key}`};return e.family&&(n.family={key:`*${e.family.key}`,subKey:e.family.subKey}),n};function t_(e){return typeof e=="object"&&e!==null&&"do"in e&&"undo"in e&&"subscribe"in e}function cp(e,t,n){const s=n.valueMap.get(t.key),a=e.valueMap.get(t.key);if(s!==a)return a;if(s===void 0)return t.default();n.logger.info("๐Ÿ“ƒ","atom",t.key,"copying");const u=t.toJson(s),c=t.fromJson(u);return e.valueMap.set(t.key,c),new lw(t,n),c}function ai(e,t,n,s){const a=e.valueMap.get(t);if(a instanceof lp&&a.use(n),n instanceof Promise){const u=new lp(n);return e.valueMap.set(t,u),u.then(c=>{ai(e,t,c,s),s.next({newValue:c,oldValue:u})}).catch(c=>{e.logger.error("๐Ÿ’ฅ","state",t,"rejected:",c)}),u}return e.valueMap.set(t,n),n}const n_=(e,t)=>{let n=t.valueMap.get(e.key);if(e.type==="mutable_atom"&&Pt(t)){const{parent:s}=t;n=cp(t,e,s)}return n},i_=(e,t)=>{const n=t.valueMap.get(e);if(n instanceof lp){const s=n,a=t.writableSelectors.get(e)??t.readonlySelectors.get(e);a&&s.use(a.get());return}t.operation.open&&t.operation.prev.set(e,n),t.valueMap.delete(e),t.logger.info("๐Ÿ—‘","state",e,"evicted")},s_=(e,t)=>ge(e).atomsThatAreDefault.has(t),fw=(e,t)=>{const n=ge(e);n.atomsThatAreDefault=new Set(n.atomsThatAreDefault).add(t)},r_=(e,t)=>{const n=ge(e);n.atomsThatAreDefault=new Set(ge(e).atomsThatAreDefault),n.atomsThatAreDefault.delete(t)};function Sm(e,t,n){const s="atom",{key:a,default:u}=t;e.logger.info("๐Ÿ”จ","atom",a,`creating in store "${e.config.name}"`);const c=ge(e),d=c.atoms.get(a);if(d&&d.type===s)return e.logger.error("โŒ","atom",a,"Tried to create atom, but it already exists in the store."),ha(d);const h=new Vt,p={...t,type:s,install:v=>(v.logger.info("๐Ÿ› ๏ธ",s,a,`installing in store "${v.config.name}"`),Sm(v,t,n)),subject:h};n&&(p.family=n);let y=u;u instanceof Function&&(y=u()),c.atoms.set(a,p),fw(e,a),ai(c,a,y,h);const g=ha(p);if(t.effects){let v=0;const S=[];for(const A of t.effects){const E=A({setSelf:M=>{Tt(e,g,M)},onSet:M=>pa(e,g,`effect[${v}]`,M)});E&&S.push(E),++v}p.cleanup=()=>{for(const A of S)A()}}return g}function a_(e,t){if("mutable"in t){const a=uw(e,t);return e.on.atomCreation.next(a),a}const s=Sm(e,t,void 0);return e.on.atomCreation.next(s),s}function xm(e,t){var c;const n=ge(e),{key:s,family:a}=t,u=wt(n,t);if(!a)e.logger.error("โŒ","atom",s,"Standalone atoms cannot be disposed.");else{(c=u.cleanup)==null||c.call(u);const d=e.valueMap.get(u.key),h=wt(e,{key:a.key,type:"atom_family"}),p={type:"state_disposal",subType:"atom",token:t,value:d};h.subject.next(p);const y=Pt(n);if(n.atoms.delete(s),n.valueMap.delete(s),n.selectorAtoms.delete(s),n.atomsThatAreDefault.delete(s),e.timelineTopics.delete(s),t.type==="mutable_atom"){const g=cw(t);xm(e,g),e.trackers.delete(s)}if(e.logger.info("๐Ÿ”ฅ","atom",s,"deleted"),y&&n.transactionMeta.phase==="building"){const g=n.transactionMeta.update.updates.at(-1);(g==null?void 0:g.type)==="molecule_disposal"&&g.values.some(([A])=>{var E;return A===((E=u.family)==null?void 0:E.key)})||n.transactionMeta.update.updates.push(p)}else e.on.atomDisposal.next(t)}}function o_(e){return e.startsWith("๐Ÿ” ")}const wm=j.createContext(vn.STORE);function dw(e,...t){let n;if(t.length===2){const s=t[0],a=t[1];n=gn(e,s,a)}else n=t[0];return n}function Ci(...e){const t=j.useContext(wm),n=dw(t,...e),s=j.useRef(null);return s.current??(s.current=a=>{Tt(t,n,a)}),s.current}function yt(...e){const t=j.useContext(wm),n=dw(t,...e),s=j.useId();return j.useSyncExternalStore(a=>pa(t,n,`use-o:${s}`,a),()=>Di(t,n),()=>Di(t,n))}const l_=(e,t,n,s,a)=>u=>{function c(h,p){if(e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"reconciling updates"),Tt(e,Fu,g=>(g.shift(),g)),h.id===p.id){const g=JSON.stringify(h.updates),v=JSON.stringify(p.updates);if(g===v){e.logger.info("โœ…","continuity",t,`results for ${h.id} match between client and server`),n.emit(`ack:${t}`,p.epoch);return}}else e.logger.info("โŒ","continuity",t,`thought update #${p.epoch} was ${h.key}:${h.id}, but it was actually ${p.key}:${p.id}`);e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"updates do not match",h,p);const y=s.toReversed();for(const g of y)ta("oldValue",g,e);e.logger.info("โช","continuity",t,"undid optimistic updates:",y),ta("oldValue",h,e),e.logger.info("โช","continuity",t,"undid zeroth optimistic update",h),ta("newValue",p,e),e.logger.info("โฉ","continuity",t,"applied confirmed update",p),n.emit(`ack:${t}`,p.epoch);for(const g of s){const v={type:"transaction",key:g.key},{id:S,params:A}=g;mm(e,v,S)(...A)}e.logger.info("โฉ","continuity",t,"reapplied subsequent optimistic updates:",s)}e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:a,optimisticUpdates:s});const d=s[0];if(d)if(e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"has optimistic updates to reconcile"),u.epoch===d.epoch){e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,`epoch of confirmed update #${u.epoch} matches zeroth optimistic update`),c(d,u);for(const h of a){const p=s[0];if(h.epoch===(p==null?void 0:p.epoch))c(p,h);else break}}else e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${d.epoch}`),a.some(p=>p.epoch===u.epoch)||(e.logger.info("๐Ÿ‘ˆ","continuity",t,"pushing confirmed update to queue",u),Tt(e,fp,p=>(p.push(u),p.sort((y,g)=>y.epoch-g.epoch),p)));else{e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"has no optimistic updates to deal with");const h=li(e);let p;h&&(p=iw(e,t)),p===u.epoch-1?(e.logger.info("โœ…","continuity",t,`integrating update #${u.epoch} (${u.key} ${u.id})`),ta("newValue",u,e),n.emit(`ack:${t}`,u.epoch),vm(e,t,u.epoch)):h&&p!==void 0&&(e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,`received update #${u.epoch} but still waiting for update #${p+1}`,{clientEpoch:p,serverEpoch:u.epoch}),a.some(g=>g.epoch===u.epoch)?e.logger.info("๐Ÿ‘","continuity",t,`confirmed update #${u.epoch} is already enqueued`):(e.logger.info("๐Ÿ‘ˆ","continuity",t,`pushing confirmed update #${u.epoch} to queue`),Tt(e,fp,g=>(g.push(u),g.sort((v,S)=>v.epoch-S.epoch),g))))}};function u_(e){return t=>{for(const n of t)xm(e,n)}}function c_(e){return t=>{let n=0,s,a;for(const u of t)n%2===0?s=u:(a=u,Tt(e,s,a)),n++}}const hw=(e,{stringify:t,parse:n},s)=>({setSelf:a,onSet:u})=>{const c=e.getItem(s);c!=null&&a(n(c)),u(({newValue:d})=>{if(d==null){e.removeItem(s);return}e.setItem(s,t(d))})},pw=Ht({key:"mySocketId__INTERNAL",default:void 0});Ui({key:"mySocketId",get:({get:e})=>e(pw)});Ht({key:"myName",default:null,effects:typeof window>"u"?[]:[hw(window.localStorage,JSON,"myUsername")]});const Fu=Ht({key:"updateQueue",default:[]}),fp=Ht({key:"serverConfirmedUpdateQueue",default:[]});function f_(e,t,n){const s=n.key,a=Di(e,Fu),u=Di(e,fp),c=(g,v)=>{t.off(`continuity-init:${s}`,c);let S=0,A,E;for(const M of v)S%2===0?A=M:(E=M,"type"in A&&A.type==="mutable_atom"&&(A=Vc(e,A)),Tt(e,A,E)),S++;vm(e,s,g)};t.off(`continuity-init:${s}`),t.on(`continuity-init:${s}`,c);const d=l_(e,s,t,a,u);t.off(`tx-new:${s}`),t.on(`tx-new:${s}`,d);const h=n.actions.map(g=>(sw(e,s,g.key),ow(e,g,`tx-run:${s}`,S=>{e.logger.info("๐Ÿคž","continuity",s,"enqueuing optimistic update");const A=a.findIndex(E=>E.id===S.id);A===-1?(e.logger.info("๐Ÿคž","continuity",s,"enqueuing new optimistic update"),Tt(e,Fu,E=>(E.push(S),E.sort((M,k)=>M.epoch-k.epoch),E))):(e.logger.info("๐Ÿคž","continuity",s,`replacing existing optimistic update at index ${A}`),Tt(e,Fu,E=>(E[A]=S,E))),t.emit(`tx-run:${s}`,{id:S.id,key:g.key,params:S.params})}))),p=c_(e),y=u_(e);return t.on(`reveal:${s}`,p),t.on(`conceal:${s}`,y),t.emit(`get:${s}`),()=>{t.off(`continuity-init:${s}`),t.off(`tx-new:${s}`);for(const g of h)g()}}const mw=j.createContext({socket:null,services:null}),d_=({children:e,socket:t})=>{const n=j.useRef(new Map).current,s=Ci(pw);return j.useEffect(()=>{s(t==null?void 0:t.id),t==null||t.on("connect",()=>{s(t.id)}),t==null||t.on("disconnect",()=>{s(void 0)})},[t,s]),U.jsx(mw.Provider,{value:{socket:t,services:n},children:e})};function h_(e,t){const{socket:n,services:s}=j.useContext(mw);ac(()=>{let a=s==null?void 0:s.get(e);return a?a[0]++:(a=[1,n?t(n):void 0],s==null||s.set(e,a)),()=>{var u;a&&(a[0]--,a[0]===0&&((u=a[1])==null||u.call(a),s==null||s.delete(e)))}})}function p_(e){const t=j.useContext(wm);h_(`tx-sync:${e.key}`,n=>f_(t,n,e))}var xh={exports:{}},ko={},wh={exports:{}},Ah={};/**
31
- * @license React
32
- * scheduler.production.js
33
- *
34
- * Copyright (c) Meta Platforms, Inc. and affiliates.
35
- *
36
- * This source code is licensed under the MIT license found in the
37
- * LICENSE file in the root directory of this source tree.
38
- */var _0;function m_(){return _0||(_0=1,function(e){function t(L,I){var F=L.length;L.push(I);e:for(;0<F;){var J=F-1>>>1,T=L[J];if(0<a(T,I))L[J]=I,L[F]=T,F=J;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var I=L[0],F=L.pop();if(F!==I){L[0]=F;e:for(var J=0,T=L.length,q=T>>>1;J<q;){var Y=2*(J+1)-1,Q=L[Y],ae=Y+1,xe=L[ae];if(0>a(Q,F))ae<T&&0>a(xe,Q)?(L[J]=xe,L[ae]=F,J=ae):(L[J]=Q,L[Y]=F,J=Y);else if(ae<T&&0>a(xe,F))L[J]=xe,L[ae]=F,J=ae;else break e}}return I}function a(L,I){var F=L.sortIndex-I.sortIndex;return F!==0?F:L.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],p=[],y=1,g=null,v=3,S=!1,A=!1,E=!1,M=!1,k=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function G(L){for(var I=n(p);I!==null;){if(I.callback===null)s(p);else if(I.startTime<=L)s(p),I.sortIndex=I.expirationTime,t(h,I);else break;I=n(p)}}function z(L){if(E=!1,G(L),!A)if(n(h)!==null)A=!0,te||(te=!0,ke());else{var I=n(p);I!==null&&X(z,I.startTime-L)}}var te=!1,ie=-1,ne=5,ee=-1;function me(){return M?!0:!(e.unstable_now()-ee<ne)}function ve(){if(M=!1,te){var L=e.unstable_now();ee=L;var I=!0;try{e:{A=!1,E&&(E=!1,$(ie),ie=-1),S=!0;var F=v;try{t:{for(G(L),g=n(h);g!==null&&!(g.expirationTime>L&&me());){var J=g.callback;if(typeof J=="function"){g.callback=null,v=g.priorityLevel;var T=J(g.expirationTime<=L);if(L=e.unstable_now(),typeof T=="function"){g.callback=T,G(L),I=!0;break t}g===n(h)&&s(h),G(L)}else s(h);g=n(h)}if(g!==null)I=!0;else{var q=n(p);q!==null&&X(z,q.startTime-L),I=!1}}break e}finally{g=null,v=F,S=!1}I=void 0}}finally{I?ke():te=!1}}}var ke;if(typeof C=="function")ke=function(){C(ve)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,_e=Ge.port2;Ge.port1.onmessage=ve,ke=function(){_e.postMessage(null)}}else ke=function(){k(ve,0)};function X(L,I){ie=k(function(){L(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(L){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var F=v;v=I;try{return L()}finally{v=F}},e.unstable_requestPaint=function(){M=!0},e.unstable_runWithPriority=function(L,I){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var F=v;v=L;try{return I()}finally{v=F}},e.unstable_scheduleCallback=function(L,I,F){var J=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?J+F:J):F=J,L){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=F+T,L={id:y++,callback:I,priorityLevel:L,startTime:F,expirationTime:T,sortIndex:-1},F>J?(L.sortIndex=F,t(p,L),n(h)===null&&L===n(p)&&(E?($(ie),ie=-1):E=!0,X(z,F-J))):(L.sortIndex=T,t(h,L),A||S||(A=!0,te||(te=!0,ke()))),L},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(L){var I=v;return function(){var F=v;v=I;try{return L.apply(this,arguments)}finally{v=F}}}}(Ah)),Ah}var k0;function y_(){return k0||(k0=1,wh.exports=m_()),wh.exports}var Th={exports:{}},Ut={};/**
39
- * @license React
40
- * react-dom.production.js
41
- *
42
- * Copyright (c) Meta Platforms, Inc. and affiliates.
43
- *
44
- * This source code is licensed under the MIT license found in the
45
- * LICENSE file in the root directory of this source tree.
46
- */var D0;function g_(){if(D0)return Ut;D0=1;var e=dm();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function u(h,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:h,containerInfo:p,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Ut.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Ut.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return u(h,p,null,y)},Ut.flushSync=function(h){var p=c.T,y=s.p;try{if(c.T=null,s.p=2,h)return h()}finally{c.T=p,s.p=y,s.d.f()}},Ut.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(h,p))},Ut.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},Ut.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?s.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:S}):y==="script"&&s.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Ut.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=d(p.as,p.crossOrigin);s.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(h)},Ut.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin);s.d.L(h,y,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Ut.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=d(p.as,p.crossOrigin);s.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(h)},Ut.requestFormReset=function(h){s.d.r(h)},Ut.unstable_batchedUpdates=function(h,p){return h(p)},Ut.useFormState=function(h,p,y){return c.H.useFormState(h,p,y)},Ut.useFormStatus=function(){return c.H.useHostTransitionStatus()},Ut.version="19.1.0",Ut}var N0;function yw(){if(N0)return Th.exports;N0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Th.exports=g_(),Th.exports}/**
47
- * @license React
48
- * react-dom-client.production.js
49
- *
50
- * Copyright (c) Meta Platforms, Inc. and affiliates.
51
- *
52
- * This source code is licensed under the MIT license found in the
53
- * LICENSE file in the root directory of this source tree.
54
- */var $0;function b_(){if($0)return ko;$0=1;var e=y_(),t=dm(),n=yw();function s(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)r+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function u(i){var r=i,o=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(o=r.return),i=r.return;while(i)}return r.tag===3?o:null}function c(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function d(i){if(u(i)!==i)throw Error(s(188))}function h(i){var r=i.alternate;if(!r){if(r=u(i),r===null)throw Error(s(188));return r!==i?null:i}for(var o=i,l=r;;){var f=o.return;if(f===null)break;var m=f.alternate;if(m===null){if(l=f.return,l!==null){o=l;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===o)return d(f),i;if(m===l)return d(f),r;m=m.sibling}throw Error(s(188))}if(o.return!==l.return)o=f,l=m;else{for(var b=!1,x=f.child;x;){if(x===o){b=!0,o=f,l=m;break}if(x===l){b=!0,l=f,o=m;break}x=x.sibling}if(!b){for(x=m.child;x;){if(x===o){b=!0,o=m,l=f;break}if(x===l){b=!0,l=m,o=f;break}x=x.sibling}if(!b)throw Error(s(189))}}if(o.alternate!==l)throw Error(s(190))}if(o.tag!==3)throw Error(s(188));return o.stateNode.current===o?i:r}function p(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=p(i),r!==null)return r;i=i.sibling}return null}var y=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),k=Symbol.for("react.provider"),$=Symbol.for("react.consumer"),C=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),ve=Symbol.iterator;function ke(i){return i===null||typeof i!="object"?null:(i=ve&&i[ve]||i["@@iterator"],typeof i=="function"?i:null)}var Ge=Symbol.for("react.client.reference");function _e(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Ge?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case A:return"Fragment";case M:return"Profiler";case E:return"StrictMode";case z:return"Suspense";case te:return"SuspenseList";case ee:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case C:return(i.displayName||"Context")+".Provider";case $:return(i._context.displayName||"Context")+".Consumer";case G:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ie:return r=i.displayName||null,r!==null?r:_e(i.type)||"Memo";case ne:r=i._payload,i=i._init;try{return _e(i(r))}catch{}}return null}var X=Array.isArray,L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},J=[],T=-1;function q(i){return{current:i}}function Y(i){0>T||(i.current=J[T],J[T]=null,T--)}function Q(i,r){T++,J[T]=i.current,i.current=r}var ae=q(null),xe=q(null),re=q(null),Xe=q(null);function De(i,r){switch(Q(re,r),Q(xe,i),Q(ae,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?Jv(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=Jv(r),i=Qv(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Y(ae),Q(ae,i)}function rn(){Y(ae),Y(xe),Y(re)}function Ki(i){i.memoizedState!==null&&Q(Xe,i);var r=ae.current,o=Qv(r,i.type);r!==o&&(Q(xe,i),Q(ae,o))}function be(i){xe.current===i&&(Y(ae),Y(xe)),Xe.current===i&&(Y(Xe),Eo._currentValue=F)}var Te=Object.prototype.hasOwnProperty,we=e.unstable_scheduleCallback,Me=e.unstable_cancelCallback,Qe=e.unstable_shouldYield,Gn=e.unstable_requestPaint,Ke=e.unstable_now,Dt=e.unstable_getCurrentPriorityLevel,We=e.unstable_ImmediatePriority,Ze=e.unstable_UserBlockingPriority,an=e.unstable_NormalPriority,jR=e.unstable_LowPriority,Ny=e.unstable_IdlePriority,zR=e.log,UR=e.unstable_setDisableYieldValue,Da=null,on=null;function Pi(i){if(typeof zR=="function"&&UR(i),on&&typeof on.setStrictMode=="function")try{on.setStrictMode(Da,i)}catch{}}var ln=Math.clz32?Math.clz32:PR,qR=Math.log,KR=Math.LN2;function PR(i){return i>>>=0,i===0?32:31-(qR(i)/KR|0)|0}var Sl=256,xl=4194304;function Rs(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function wl(i,r,o){var l=i.pendingLanes;if(l===0)return 0;var f=0,m=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var x=l&134217727;return x!==0?(l=x&~m,l!==0?f=Rs(l):(b&=x,b!==0?f=Rs(b):o||(o=x&~i,o!==0&&(f=Rs(o))))):(x=l&~m,x!==0?f=Rs(x):b!==0?f=Rs(b):o||(o=l&~i,o!==0&&(f=Rs(o)))),f===0?0:r!==0&&r!==f&&(r&m)===0&&(m=f&-f,o=r&-r,m>=o||m===32&&(o&4194048)!==0)?r:f}function Na(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function IR(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function $y(){var i=Sl;return Sl<<=1,(Sl&4194048)===0&&(Sl=256),i}function By(){var i=xl;return xl<<=1,(xl&62914560)===0&&(xl=4194304),i}function of(i){for(var r=[],o=0;31>o;o++)r.push(i);return r}function $a(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function HR(i,r,o,l,f,m){var b=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var x=i.entanglements,R=i.expirationTimes,N=i.hiddenUpdates;for(o=b&~o;0<o;){var K=31-ln(o),H=1<<K;x[K]=0,R[K]=-1;var B=N[K];if(B!==null)for(N[K]=null,K=0;K<B.length;K++){var V=B[K];V!==null&&(V.lane&=-536870913)}o&=~H}l!==0&&Ly(i,l,0),m!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=m&~(b&~r))}function Ly(i,r,o){i.pendingLanes|=r,i.suspendedLanes&=~r;var l=31-ln(r);i.entangledLanes|=r,i.entanglements[l]=i.entanglements[l]|1073741824|o&4194090}function Vy(i,r){var o=i.entangledLanes|=r;for(i=i.entanglements;o;){var l=31-ln(o),f=1<<l;f&r|i[l]&r&&(i[l]|=r),o&=~f}}function lf(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function uf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function jy(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:g0(i.type))}function GR(i,r){var o=I.p;try{return I.p=i,r()}finally{I.p=o}}var Ii=Math.random().toString(36).slice(2),jt="__reactFiber$"+Ii,Zt="__reactProps$"+Ii,fr="__reactContainer$"+Ii,cf="__reactEvents$"+Ii,FR="__reactListeners$"+Ii,YR="__reactHandles$"+Ii,zy="__reactResources$"+Ii,Ba="__reactMarker$"+Ii;function ff(i){delete i[jt],delete i[Zt],delete i[cf],delete i[FR],delete i[YR]}function dr(i){var r=i[jt];if(r)return r;for(var o=i.parentNode;o;){if(r=o[fr]||o[jt]){if(o=r.alternate,r.child!==null||o!==null&&o.child!==null)for(i=n0(i);i!==null;){if(o=i[jt])return o;i=n0(i)}return r}i=o,o=i.parentNode}return null}function hr(i){if(i=i[jt]||i[fr]){var r=i.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return i}return null}function La(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(s(33))}function pr(i){var r=i[zy];return r||(r=i[zy]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Rt(i){i[Ba]=!0}var Uy=new Set,qy={};function Os(i,r){mr(i,r),mr(i+"Capture",r)}function mr(i,r){for(qy[i]=r,i=0;i<r.length;i++)Uy.add(r[i])}var XR=RegExp("^[: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]*$"),Ky={},Py={};function ZR(i){return Te.call(Py,i)?!0:Te.call(Ky,i)?!1:XR.test(i)?Py[i]=!0:(Ky[i]=!0,!1)}function Al(i,r,o){if(ZR(r))if(o===null)i.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+o)}}function Tl(i,r,o){if(o===null)i.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+o)}}function di(i,r,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(r,o,""+l)}}var df,Iy;function yr(i){if(df===void 0)try{throw Error()}catch(o){var r=o.stack.trim().match(/\n( *(at )?)/);df=r&&r[1]||"",Iy=-1<o.stack.indexOf(`
55
- at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
56
- `+df+i+Iy}var hf=!1;function pf(i,r){if(!i||hf)return"";hf=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var H=function(){throw Error()};if(Object.defineProperty(H.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(H,[])}catch(V){var B=V}Reflect.construct(i,[],H)}else{try{H.call()}catch(V){B=V}i.call(H.prototype)}}else{try{throw Error()}catch(V){B=V}(H=i())&&typeof H.catch=="function"&&H.catch(function(){})}}catch(V){if(V&&B&&typeof V.stack=="string")return[V.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),b=m[0],x=m[1];if(b&&x){var R=b.split(`
57
- `),N=x.split(`
58
- `);for(f=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;f<N.length&&!N[f].includes("DetermineComponentFrameRoot");)f++;if(l===R.length||f===N.length)for(l=R.length-1,f=N.length-1;1<=l&&0<=f&&R[l]!==N[f];)f--;for(;1<=l&&0<=f;l--,f--)if(R[l]!==N[f]){if(l!==1||f!==1)do if(l--,f--,0>f||R[l]!==N[f]){var K=`
59
- `+R[l].replace(" at new "," at ");return i.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",i.displayName)),K}while(1<=l&&0<=f);break}}}finally{hf=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?yr(o):""}function JR(i){switch(i.tag){case 26:case 27:case 5:return yr(i.type);case 16:return yr("Lazy");case 13:return yr("Suspense");case 19:return yr("SuspenseList");case 0:case 15:return pf(i.type,!1);case 11:return pf(i.type.render,!1);case 1:return pf(i.type,!0);case 31:return yr("Activity");default:return""}}function Hy(i){try{var r="";do r+=JR(i),i=i.return;while(i);return r}catch(o){return`
60
- Error generating stack: `+o.message+`
61
- `+o.stack}}function Sn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Gy(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function QR(i){var r=Gy(i)?"checked":"value",o=Object.getOwnPropertyDescriptor(i.constructor.prototype,r),l=""+i[r];if(!i.hasOwnProperty(r)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,m=o.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(i,r,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function El(i){i._valueTracker||(i._valueTracker=QR(i))}function Fy(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var o=r.getValue(),l="";return i&&(l=Gy(i)?i.checked?"true":"false":i.value),i=l,i!==o?(r.setValue(i),!0):!1}function Rl(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var WR=/[\n"\\]/g;function xn(i){return i.replace(WR,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function mf(i,r,o,l,f,m,b,x){i.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?i.type=b:i.removeAttribute("type"),r!=null?b==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+Sn(r)):i.value!==""+Sn(r)&&(i.value=""+Sn(r)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),r!=null?yf(i,b,Sn(r)):o!=null?yf(i,b,Sn(o)):l!=null&&i.removeAttribute("value"),f==null&&m!=null&&(i.defaultChecked=!!m),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?i.name=""+Sn(x):i.removeAttribute("name")}function Yy(i,r,o,l,f,m,b,x){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(i.type=m),r!=null||o!=null){if(!(m!=="submit"&&m!=="reset"||r!=null))return;o=o!=null?""+Sn(o):"",r=r!=null?""+Sn(r):o,x||r===i.value||(i.value=r),i.defaultValue=r}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=x?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b)}function yf(i,r,o){r==="number"&&Rl(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function gr(i,r,o,l){if(i=i.options,r){r={};for(var f=0;f<o.length;f++)r["$"+o[f]]=!0;for(o=0;o<i.length;o++)f=r.hasOwnProperty("$"+i[o].value),i[o].selected!==f&&(i[o].selected=f),f&&l&&(i[o].defaultSelected=!0)}else{for(o=""+Sn(o),r=null,f=0;f<i.length;f++){if(i[f].value===o){i[f].selected=!0,l&&(i[f].defaultSelected=!0);return}r!==null||i[f].disabled||(r=i[f])}r!==null&&(r.selected=!0)}}function Xy(i,r,o){if(r!=null&&(r=""+Sn(r),r!==i.value&&(i.value=r),o==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=o!=null?""+Sn(o):""}function Zy(i,r,o,l){if(r==null){if(l!=null){if(o!=null)throw Error(s(92));if(X(l)){if(1<l.length)throw Error(s(93));l=l[0]}o=l}o==null&&(o=""),r=o}o=Sn(r),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l)}function br(i,r){if(r){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=r;return}}i.textContent=r}var eO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Jy(i,r,o){var l=r.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":l?i.setProperty(r,o):typeof o!="number"||o===0||eO.has(r)?r==="float"?i.cssFloat=o:i[r]=(""+o).trim():i[r]=o+"px"}function Qy(i,r,o){if(r!=null&&typeof r!="object")throw Error(s(62));if(i=i.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var f in r)l=r[f],r.hasOwnProperty(f)&&o[f]!==l&&Jy(i,f,l)}else for(var m in r)r.hasOwnProperty(m)&&Jy(i,m,r[m])}function gf(i){if(i.indexOf("-")===-1)return!1;switch(i){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 tO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),nO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ol(i){return nO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var bf=null;function vf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var vr=null,Sr=null;function Wy(i){var r=hr(i);if(r&&(i=r.stateNode)){var o=i[Zt]||null;e:switch(i=r.stateNode,r.type){case"input":if(mf(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),r=o.name,o.type==="radio"&&r!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+xn(""+r)+'"][type="radio"]'),r=0;r<o.length;r++){var l=o[r];if(l!==i&&l.form===i.form){var f=l[Zt]||null;if(!f)throw Error(s(90));mf(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<o.length;r++)l=o[r],l.form===i.form&&Fy(l)}break e;case"textarea":Xy(i,o.value,o.defaultValue);break e;case"select":r=o.value,r!=null&&gr(i,!!o.multiple,r,!1)}}}var Sf=!1;function eg(i,r,o){if(Sf)return i(r,o);Sf=!0;try{var l=i(r);return l}finally{if(Sf=!1,(vr!==null||Sr!==null)&&(du(),vr&&(r=vr,i=Sr,Sr=vr=null,Wy(r),i)))for(r=0;r<i.length;r++)Wy(i[r])}}function Va(i,r){var o=i.stateNode;if(o===null)return null;var l=o[Zt]||null;if(l===null)return null;o=l[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(s(231,r,typeof o));return o}var hi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xf=!1;if(hi)try{var ja={};Object.defineProperty(ja,"passive",{get:function(){xf=!0}}),window.addEventListener("test",ja,ja),window.removeEventListener("test",ja,ja)}catch{xf=!1}var Hi=null,wf=null,Ml=null;function tg(){if(Ml)return Ml;var i,r=wf,o=r.length,l,f="value"in Hi?Hi.value:Hi.textContent,m=f.length;for(i=0;i<o&&r[i]===f[i];i++);var b=o-i;for(l=1;l<=b&&r[o-l]===f[m-l];l++);return Ml=f.slice(i,1<l?1-l:void 0)}function Cl(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function _l(){return!0}function ng(){return!1}function Jt(i){function r(o,l,f,m,b){this._reactName=o,this._targetInst=f,this.type=l,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var x in i)i.hasOwnProperty(x)&&(o=i[x],this[x]=o?o(m):m[x]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?_l:ng,this.isPropagationStopped=ng,this}return y(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=_l)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=_l)},persist:function(){},isPersistent:_l}),r}var Ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kl=Jt(Ms),za=y({},Ms,{view:0,detail:0}),iO=Jt(za),Af,Tf,Ua,Dl=y({},za,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rf,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Ua&&(Ua&&i.type==="mousemove"?(Af=i.screenX-Ua.screenX,Tf=i.screenY-Ua.screenY):Tf=Af=0,Ua=i),Af)},movementY:function(i){return"movementY"in i?i.movementY:Tf}}),ig=Jt(Dl),sO=y({},Dl,{dataTransfer:0}),rO=Jt(sO),aO=y({},za,{relatedTarget:0}),Ef=Jt(aO),oO=y({},Ms,{animationName:0,elapsedTime:0,pseudoElement:0}),lO=Jt(oO),uO=y({},Ms,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),cO=Jt(uO),fO=y({},Ms,{data:0}),sg=Jt(fO),dO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},pO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mO(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=pO[i])?!!r[i]:!1}function Rf(){return mO}var yO=y({},za,{key:function(i){if(i.key){var r=dO[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Cl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?hO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rf,charCode:function(i){return i.type==="keypress"?Cl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Cl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),gO=Jt(yO),bO=y({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rg=Jt(bO),vO=y({},za,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rf}),SO=Jt(vO),xO=y({},Ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),wO=Jt(xO),AO=y({},Dl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),TO=Jt(AO),EO=y({},Ms,{newState:0,oldState:0}),RO=Jt(EO),OO=[9,13,27,32],Of=hi&&"CompositionEvent"in window,qa=null;hi&&"documentMode"in document&&(qa=document.documentMode);var MO=hi&&"TextEvent"in window&&!qa,ag=hi&&(!Of||qa&&8<qa&&11>=qa),og=" ",lg=!1;function ug(i,r){switch(i){case"keyup":return OO.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var xr=!1;function CO(i,r){switch(i){case"compositionend":return cg(r);case"keypress":return r.which!==32?null:(lg=!0,og);case"textInput":return i=r.data,i===og&&lg?null:i;default:return null}}function _O(i,r){if(xr)return i==="compositionend"||!Of&&ug(i,r)?(i=tg(),Ml=wf=Hi=null,xr=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return ag&&r.locale!=="ko"?null:r.data;default:return null}}var kO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function fg(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!kO[i.type]:r==="textarea"}function dg(i,r,o,l){vr?Sr?Sr.push(l):Sr=[l]:vr=l,r=bu(r,"onChange"),0<r.length&&(o=new kl("onChange","change",null,o,l),i.push({event:o,listeners:r}))}var Ka=null,Pa=null;function DO(i){Gv(i,0)}function Nl(i){var r=La(i);if(Fy(r))return i}function hg(i,r){if(i==="change")return r}var pg=!1;if(hi){var Mf;if(hi){var Cf="oninput"in document;if(!Cf){var mg=document.createElement("div");mg.setAttribute("oninput","return;"),Cf=typeof mg.oninput=="function"}Mf=Cf}else Mf=!1;pg=Mf&&(!document.documentMode||9<document.documentMode)}function yg(){Ka&&(Ka.detachEvent("onpropertychange",gg),Pa=Ka=null)}function gg(i){if(i.propertyName==="value"&&Nl(Pa)){var r=[];dg(r,Pa,i,vf(i)),eg(DO,r)}}function NO(i,r,o){i==="focusin"?(yg(),Ka=r,Pa=o,Ka.attachEvent("onpropertychange",gg)):i==="focusout"&&yg()}function $O(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Nl(Pa)}function BO(i,r){if(i==="click")return Nl(r)}function LO(i,r){if(i==="input"||i==="change")return Nl(r)}function VO(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var un=typeof Object.is=="function"?Object.is:VO;function Ia(i,r){if(un(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var o=Object.keys(i),l=Object.keys(r);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var f=o[l];if(!Te.call(r,f)||!un(i[f],r[f]))return!1}return!0}function bg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function vg(i,r){var o=bg(i);i=0;for(var l;o;){if(o.nodeType===3){if(l=i+o.textContent.length,i<=r&&l>=r)return{node:o,offset:r-i};i=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=bg(o)}}function Sg(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?Sg(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function xg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Rl(i.document);r instanceof i.HTMLIFrameElement;){try{var o=typeof r.contentWindow.location.href=="string"}catch{o=!1}if(o)i=r.contentWindow;else break;r=Rl(i.document)}return r}function _f(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var jO=hi&&"documentMode"in document&&11>=document.documentMode,wr=null,kf=null,Ha=null,Df=!1;function wg(i,r,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Df||wr==null||wr!==Rl(l)||(l=wr,"selectionStart"in l&&_f(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ha&&Ia(Ha,l)||(Ha=l,l=bu(kf,"onSelect"),0<l.length&&(r=new kl("onSelect","select",null,r,o),i.push({event:r,listeners:l}),r.target=wr)))}function Cs(i,r){var o={};return o[i.toLowerCase()]=r.toLowerCase(),o["Webkit"+i]="webkit"+r,o["Moz"+i]="moz"+r,o}var Ar={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},Nf={},Ag={};hi&&(Ag=document.createElement("div").style,"AnimationEvent"in window||(delete Ar.animationend.animation,delete Ar.animationiteration.animation,delete Ar.animationstart.animation),"TransitionEvent"in window||delete Ar.transitionend.transition);function _s(i){if(Nf[i])return Nf[i];if(!Ar[i])return i;var r=Ar[i],o;for(o in r)if(r.hasOwnProperty(o)&&o in Ag)return Nf[i]=r[o];return i}var Tg=_s("animationend"),Eg=_s("animationiteration"),Rg=_s("animationstart"),zO=_s("transitionrun"),UO=_s("transitionstart"),qO=_s("transitioncancel"),Og=_s("transitionend"),Mg=new Map,$f="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");$f.push("scrollEnd");function Ln(i,r){Mg.set(i,r),Os(r,[i])}var Cg=new WeakMap;function wn(i,r){if(typeof i=="object"&&i!==null){var o=Cg.get(i);return o!==void 0?o:(r={value:i,source:r,stack:Hy(r)},Cg.set(i,r),r)}return{value:i,source:r,stack:Hy(r)}}var An=[],Tr=0,Bf=0;function $l(){for(var i=Tr,r=Bf=Tr=0;r<i;){var o=An[r];An[r++]=null;var l=An[r];An[r++]=null;var f=An[r];An[r++]=null;var m=An[r];if(An[r++]=null,l!==null&&f!==null){var b=l.pending;b===null?f.next=f:(f.next=b.next,b.next=f),l.pending=f}m!==0&&_g(o,f,m)}}function Bl(i,r,o,l){An[Tr++]=i,An[Tr++]=r,An[Tr++]=o,An[Tr++]=l,Bf|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function Lf(i,r,o,l){return Bl(i,r,o,l),Ll(i)}function Er(i,r){return Bl(i,null,null,r),Ll(i)}function _g(i,r,o){i.lanes|=o;var l=i.alternate;l!==null&&(l.lanes|=o);for(var f=!1,m=i.return;m!==null;)m.childLanes|=o,l=m.alternate,l!==null&&(l.childLanes|=o),m.tag===22&&(i=m.stateNode,i===null||i._visibility&1||(f=!0)),i=m,m=m.return;return i.tag===3?(m=i.stateNode,f&&r!==null&&(f=31-ln(o),i=m.hiddenUpdates,l=i[f],l===null?i[f]=[r]:l.push(r),r.lane=o|536870912),m):null}function Ll(i){if(50<go)throw go=0,Kd=null,Error(s(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Rr={};function KO(i,r,o,l){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(i,r,o,l){return new KO(i,r,o,l)}function Vf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function pi(i,r){var o=i.alternate;return o===null?(o=cn(i.tag,r,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=r,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,r=i.dependencies,o.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function kg(i,r){i.flags&=65011714;var o=i.alternate;return o===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,r=o.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function Vl(i,r,o,l,f,m){var b=0;if(l=i,typeof i=="function")Vf(i)&&(b=1);else if(typeof i=="string")b=IM(i,o,ae.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case ee:return i=cn(31,o,r,f),i.elementType=ee,i.lanes=m,i;case A:return ks(o.children,f,m,r);case E:b=8,f|=24;break;case M:return i=cn(12,o,r,f|2),i.elementType=M,i.lanes=m,i;case z:return i=cn(13,o,r,f),i.elementType=z,i.lanes=m,i;case te:return i=cn(19,o,r,f),i.elementType=te,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:case C:b=10;break e;case $:b=9;break e;case G:b=11;break e;case ie:b=14;break e;case ne:b=16,l=null;break e}b=29,o=Error(s(130,i===null?"null":typeof i,"")),l=null}return r=cn(b,o,r,f),r.elementType=i,r.type=l,r.lanes=m,r}function ks(i,r,o,l){return i=cn(7,i,l,r),i.lanes=o,i}function jf(i,r,o){return i=cn(6,i,null,r),i.lanes=o,i}function zf(i,r,o){return r=cn(4,i.children!==null?i.children:[],i.key,r),r.lanes=o,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var Or=[],Mr=0,jl=null,zl=0,Tn=[],En=0,Ds=null,mi=1,yi="";function Ns(i,r){Or[Mr++]=zl,Or[Mr++]=jl,jl=i,zl=r}function Dg(i,r,o){Tn[En++]=mi,Tn[En++]=yi,Tn[En++]=Ds,Ds=i;var l=mi;i=yi;var f=32-ln(l)-1;l&=~(1<<f),o+=1;var m=32-ln(r)+f;if(30<m){var b=f-f%5;m=(l&(1<<b)-1).toString(32),l>>=b,f-=b,mi=1<<32-ln(r)+f|o<<f|l,yi=m+i}else mi=1<<m|o<<f|l,yi=i}function Uf(i){i.return!==null&&(Ns(i,1),Dg(i,1,0))}function qf(i){for(;i===jl;)jl=Or[--Mr],Or[Mr]=null,zl=Or[--Mr],Or[Mr]=null;for(;i===Ds;)Ds=Tn[--En],Tn[En]=null,yi=Tn[--En],Tn[En]=null,mi=Tn[--En],Tn[En]=null}var Gt=null,st=null,$e=!1,$s=null,Fn=!1,Kf=Error(s(519));function Bs(i){var r=Error(s(418,""));throw Ya(wn(r,i)),Kf}function Ng(i){var r=i.stateNode,o=i.type,l=i.memoizedProps;switch(r[jt]=i,r[Zt]=l,o){case"dialog":Re("cancel",r),Re("close",r);break;case"iframe":case"object":case"embed":Re("load",r);break;case"video":case"audio":for(o=0;o<vo.length;o++)Re(vo[o],r);break;case"source":Re("error",r);break;case"img":case"image":case"link":Re("error",r),Re("load",r);break;case"details":Re("toggle",r);break;case"input":Re("invalid",r),Yy(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),El(r);break;case"select":Re("invalid",r);break;case"textarea":Re("invalid",r),Zy(r,l.value,l.defaultValue,l.children),El(r)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||r.textContent===""+o||l.suppressHydrationWarning===!0||Zv(r.textContent,o)?(l.popover!=null&&(Re("beforetoggle",r),Re("toggle",r)),l.onScroll!=null&&Re("scroll",r),l.onScrollEnd!=null&&Re("scrollend",r),l.onClick!=null&&(r.onclick=vu),r=!0):r=!1,r||Bs(i)}function $g(i){for(Gt=i.return;Gt;)switch(Gt.tag){case 5:case 13:Fn=!1;return;case 27:case 3:Fn=!0;return;default:Gt=Gt.return}}function Ga(i){if(i!==Gt)return!1;if(!$e)return $g(i),$e=!0,!1;var r=i.tag,o;if((o=r!==3&&r!==27)&&((o=r===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||sh(i.type,i.memoizedProps)),o=!o),o&&st&&Bs(i),$g(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));e:{for(i=i.nextSibling,r=0;i;){if(i.nodeType===8)if(o=i.data,o==="/$"){if(r===0){st=jn(i.nextSibling);break e}r--}else o!=="$"&&o!=="$!"&&o!=="$?"||r++;i=i.nextSibling}st=null}}else r===27?(r=st,os(i.type)?(i=lh,lh=null,st=i):st=r):st=Gt?jn(i.stateNode.nextSibling):null;return!0}function Fa(){st=Gt=null,$e=!1}function Bg(){var i=$s;return i!==null&&(en===null?en=i:en.push.apply(en,i),$s=null),i}function Ya(i){$s===null?$s=[i]:$s.push(i)}var Pf=q(null),Ls=null,gi=null;function Gi(i,r,o){Q(Pf,r._currentValue),r._currentValue=o}function bi(i){i._currentValue=Pf.current,Y(Pf)}function If(i,r,o){for(;i!==null;){var l=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),i===o)break;i=i.return}}function Hf(i,r,o,l){var f=i.child;for(f!==null&&(f.return=i);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var x=m;m=f;for(var R=0;R<r.length;R++)if(x.context===r[R]){m.lanes|=o,x=m.alternate,x!==null&&(x.lanes|=o),If(m.return,o,i),l||(b=null);break e}m=x.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(s(341));b.lanes|=o,m=b.alternate,m!==null&&(m.lanes|=o),If(b,o,i),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===i){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Xa(i,r,o,l){i=null;for(var f=r,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(s(387));if(b=b.memoizedProps,b!==null){var x=f.type;un(f.pendingProps.value,b.value)||(i!==null?i.push(x):i=[x])}}else if(f===Xe.current){if(b=f.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(Eo):i=[Eo])}f=f.return}i!==null&&Hf(r,i,o,l),r.flags|=262144}function Ul(i){for(i=i.firstContext;i!==null;){if(!un(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Vs(i){Ls=i,gi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function zt(i){return Lg(Ls,i)}function ql(i,r){return Ls===null&&Vs(i),Lg(i,r)}function Lg(i,r){var o=r._currentValue;if(r={context:r,memoizedValue:o,next:null},gi===null){if(i===null)throw Error(s(308));gi=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else gi=gi.next=r;return o}var PO=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(o,l){i.push(l)}};this.abort=function(){r.aborted=!0,i.forEach(function(o){return o()})}},IO=e.unstable_scheduleCallback,HO=e.unstable_NormalPriority,vt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gf(){return{controller:new PO,data:new Map,refCount:0}}function Za(i){i.refCount--,i.refCount===0&&IO(HO,function(){i.controller.abort()})}var Ja=null,Ff=0,Cr=0,_r=null;function GO(i,r){if(Ja===null){var o=Ja=[];Ff=0,Cr=Xd(),_r={status:"pending",value:void 0,then:function(l){o.push(l)}}}return Ff++,r.then(Vg,Vg),r}function Vg(){if(--Ff===0&&Ja!==null){_r!==null&&(_r.status="fulfilled");var i=Ja;Ja=null,Cr=0,_r=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function FO(i,r){var o=[],l={status:"pending",value:null,reason:null,then:function(f){o.push(f)}};return i.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<o.length;f++)(0,o[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<o.length;f++)(0,o[f])(void 0)}),l}var jg=L.S;L.S=function(i,r){typeof r=="object"&&r!==null&&typeof r.then=="function"&&GO(i,r),jg!==null&&jg(i,r)};var js=q(null);function Yf(){var i=js.current;return i!==null?i:Fe.pooledCache}function Kl(i,r){r===null?Q(js,js.current):Q(js,r.pool)}function zg(){var i=Yf();return i===null?null:{parent:vt._currentValue,pool:i}}var Qa=Error(s(460)),Ug=Error(s(474)),Pl=Error(s(542)),Xf={then:function(){}};function qg(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Il(){}function Kg(i,r,o){switch(o=i[o],o===void 0?i.push(r):o!==r&&(r.then(Il,Il),r=o),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Ig(i),i;default:if(typeof r.status=="string")r.then(Il,Il);else{if(i=Fe,i!==null&&100<i.shellSuspendCounter)throw Error(s(482));i=r,i.status="pending",i.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Ig(i),i}throw Wa=r,Qa}}var Wa=null;function Pg(){if(Wa===null)throw Error(s(459));var i=Wa;return Wa=null,i}function Ig(i){if(i===Qa||i===Pl)throw Error(s(483))}var Fi=!1;function Zf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jf(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Yi(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Xi(i,r,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(Le&2)!==0){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=Ll(i),_g(i,null,o),r}return Bl(i,l,r,o),Ll(i)}function eo(i,r,o){if(r=r.updateQueue,r!==null&&(r=r.shared,(o&4194048)!==0)){var l=r.lanes;l&=i.pendingLanes,o|=l,r.lanes=o,Vy(i,o)}}function Qf(i,r){var o=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var f=null,m=null;if(o=o.firstBaseUpdate,o!==null){do{var b={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,o=o.next}while(o!==null);m===null?f=m=r:m=m.next=r}else f=m=r;o={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=r:i.next=r,o.lastBaseUpdate=r}var Wf=!1;function to(){if(Wf){var i=_r;if(i!==null)throw i}}function no(i,r,o,l){Wf=!1;var f=i.updateQueue;Fi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,x=f.shared.pending;if(x!==null){f.shared.pending=null;var R=x,N=R.next;R.next=null,b===null?m=N:b.next=N,b=R;var K=i.alternate;K!==null&&(K=K.updateQueue,x=K.lastBaseUpdate,x!==b&&(x===null?K.firstBaseUpdate=N:x.next=N,K.lastBaseUpdate=R))}if(m!==null){var H=f.baseState;b=0,K=N=R=null,x=m;do{var B=x.lane&-536870913,V=B!==x.lane;if(V?(Ce&B)===B:(l&B)===B){B!==0&&B===Cr&&(Wf=!0),K!==null&&(K=K.next={lane:0,tag:x.tag,payload:x.payload,callback:null,next:null});e:{var de=i,ue=x;B=r;var Ue=o;switch(ue.tag){case 1:if(de=ue.payload,typeof de=="function"){H=de.call(Ue,H,B);break e}H=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ue.payload,B=typeof de=="function"?de.call(Ue,H,B):de,B==null)break e;H=y({},H,B);break e;case 2:Fi=!0}}B=x.callback,B!==null&&(i.flags|=64,V&&(i.flags|=8192),V=f.callbacks,V===null?f.callbacks=[B]:V.push(B))}else V={lane:B,tag:x.tag,payload:x.payload,callback:x.callback,next:null},K===null?(N=K=V,R=H):K=K.next=V,b|=B;if(x=x.next,x===null){if(x=f.shared.pending,x===null)break;V=x,x=V.next,V.next=null,f.lastBaseUpdate=V,f.shared.pending=null}}while(!0);K===null&&(R=H),f.baseState=R,f.firstBaseUpdate=N,f.lastBaseUpdate=K,m===null&&(f.shared.lanes=0),is|=b,i.lanes=b,i.memoizedState=H}}function Hg(i,r){if(typeof i!="function")throw Error(s(191,i));i.call(r)}function Gg(i,r){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Hg(o[i],r)}var kr=q(null),Hl=q(0);function Fg(i,r){i=Ei,Q(Hl,i),Q(kr,r),Ei=i|r.baseLanes}function ed(){Q(Hl,Ei),Q(kr,kr.current)}function td(){Ei=Hl.current,Y(kr),Y(Hl)}var Zi=0,Se=null,je=null,ht=null,Gl=!1,Dr=!1,zs=!1,Fl=0,io=0,Nr=null,YO=0;function ut(){throw Error(s(321))}function nd(i,r){if(r===null)return!1;for(var o=0;o<r.length&&o<i.length;o++)if(!un(i[o],r[o]))return!1;return!0}function id(i,r,o,l,f,m){return Zi=m,Se=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,L.H=i===null||i.memoizedState===null?_b:kb,zs=!1,m=o(l,f),zs=!1,Dr&&(m=Xg(r,o,l,f)),Yg(i),m}function Yg(i){L.H=Wl;var r=je!==null&&je.next!==null;if(Zi=0,ht=je=Se=null,Gl=!1,io=0,Nr=null,r)throw Error(s(300));i===null||Ot||(i=i.dependencies,i!==null&&Ul(i)&&(Ot=!0))}function Xg(i,r,o,l){Se=i;var f=0;do{if(Dr&&(Nr=null),io=0,Dr=!1,25<=f)throw Error(s(301));if(f+=1,ht=je=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}L.H=tM,m=r(o,l)}while(Dr);return m}function XO(){var i=L.H,r=i.useState()[0];return r=typeof r.then=="function"?so(r):r,i=i.useState()[0],(je!==null?je.memoizedState:null)!==i&&(Se.flags|=1024),r}function sd(){var i=Fl!==0;return Fl=0,i}function rd(i,r,o){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~o}function ad(i){if(Gl){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Gl=!1}Zi=0,ht=je=Se=null,Dr=!1,io=Fl=0,Nr=null}function Qt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ht===null?Se.memoizedState=ht=i:ht=ht.next=i,ht}function pt(){if(je===null){var i=Se.alternate;i=i!==null?i.memoizedState:null}else i=je.next;var r=ht===null?Se.memoizedState:ht.next;if(r!==null)ht=r,je=i;else{if(i===null)throw Se.alternate===null?Error(s(467)):Error(s(310));je=i,i={memoizedState:je.memoizedState,baseState:je.baseState,baseQueue:je.baseQueue,queue:je.queue,next:null},ht===null?Se.memoizedState=ht=i:ht=ht.next=i}return ht}function od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(i){var r=io;return io+=1,Nr===null&&(Nr=[]),i=Kg(Nr,i,r),r=Se,(ht===null?r.memoizedState:ht.next)===null&&(r=r.alternate,L.H=r===null||r.memoizedState===null?_b:kb),i}function Yl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return so(i);if(i.$$typeof===C)return zt(i)}throw Error(s(438,String(i)))}function ld(i){var r=null,o=Se.updateQueue;if(o!==null&&(r=o.memoCache),r==null){var l=Se.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),o===null&&(o=od(),Se.updateQueue=o),o.memoCache=r,o=r.data[r.index],o===void 0)for(o=r.data[r.index]=Array(i),l=0;l<i;l++)o[l]=me;return r.index++,o}function vi(i,r){return typeof r=="function"?r(i):r}function Xl(i){var r=pt();return ud(r,je,i)}function ud(i,r,o){var l=i.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=o;var f=i.baseQueue,m=l.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}r.baseQueue=f=m,l.pending=null}if(m=i.baseState,f===null)i.memoizedState=m;else{r=f.next;var x=b=null,R=null,N=r,K=!1;do{var H=N.lane&-536870913;if(H!==N.lane?(Ce&H)===H:(Zi&H)===H){var B=N.revertLane;if(B===0)R!==null&&(R=R.next={lane:0,revertLane:0,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),H===Cr&&(K=!0);else if((Zi&B)===B){N=N.next,B===Cr&&(K=!0);continue}else H={lane:0,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},R===null?(x=R=H,b=m):R=R.next=H,Se.lanes|=B,is|=B;H=N.action,zs&&o(m,H),m=N.hasEagerState?N.eagerState:o(m,H)}else B={lane:H,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},R===null?(x=R=B,b=m):R=R.next=B,Se.lanes|=H,is|=H;N=N.next}while(N!==null&&N!==r);if(R===null?b=m:R.next=x,!un(m,i.memoizedState)&&(Ot=!0,K&&(o=_r,o!==null)))throw o;i.memoizedState=m,i.baseState=b,i.baseQueue=R,l.lastRenderedState=m}return f===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function cd(i){var r=pt(),o=r.queue;if(o===null)throw Error(s(311));o.lastRenderedReducer=i;var l=o.dispatch,f=o.pending,m=r.memoizedState;if(f!==null){o.pending=null;var b=f=f.next;do m=i(m,b.action),b=b.next;while(b!==f);un(m,r.memoizedState)||(Ot=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),o.lastRenderedState=m}return[m,l]}function Zg(i,r,o){var l=Se,f=pt(),m=$e;if(m){if(o===void 0)throw Error(s(407));o=o()}else o=r();var b=!un((je||f).memoizedState,o);b&&(f.memoizedState=o,Ot=!0),f=f.queue;var x=Wg.bind(null,l,f,i);if(ro(2048,8,x,[i]),f.getSnapshot!==r||b||ht!==null&&ht.memoizedState.tag&1){if(l.flags|=2048,$r(9,Zl(),Qg.bind(null,l,f,o,r),null),Fe===null)throw Error(s(349));m||(Zi&124)!==0||Jg(l,r,o)}return o}function Jg(i,r,o){i.flags|=16384,i={getSnapshot:r,value:o},r=Se.updateQueue,r===null?(r=od(),Se.updateQueue=r,r.stores=[i]):(o=r.stores,o===null?r.stores=[i]:o.push(i))}function Qg(i,r,o,l){r.value=o,r.getSnapshot=l,eb(r)&&tb(i)}function Wg(i,r,o){return o(function(){eb(r)&&tb(i)})}function eb(i){var r=i.getSnapshot;i=i.value;try{var o=r();return!un(i,o)}catch{return!0}}function tb(i){var r=Er(i,2);r!==null&&mn(r,i,2)}function fd(i){var r=Qt();if(typeof i=="function"){var o=i;if(i=o(),zs){Pi(!0);try{o()}finally{Pi(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:i},r}function nb(i,r,o,l){return i.baseState=o,ud(i,je,typeof l=="function"?l:vi)}function ZO(i,r,o,l,f){if(Ql(i))throw Error(s(485));if(i=r.action,i!==null){var m={payload:f,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};L.T!==null?o(!0):m.isTransition=!1,l(m),o=r.pending,o===null?(m.next=r.pending=m,ib(r,m)):(m.next=o.next,r.pending=o.next=m)}}function ib(i,r){var o=r.action,l=r.payload,f=i.state;if(r.isTransition){var m=L.T,b={};L.T=b;try{var x=o(f,l),R=L.S;R!==null&&R(b,x),sb(i,r,x)}catch(N){dd(i,r,N)}finally{L.T=m}}else try{m=o(f,l),sb(i,r,m)}catch(N){dd(i,r,N)}}function sb(i,r,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){rb(i,r,l)},function(l){return dd(i,r,l)}):rb(i,r,o)}function rb(i,r,o){r.status="fulfilled",r.value=o,ab(r),i.state=o,r=i.pending,r!==null&&(o=r.next,o===r?i.pending=null:(o=o.next,r.next=o,ib(i,o)))}function dd(i,r,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=o,ab(r),r=r.next;while(r!==l)}i.action=null}function ab(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function ob(i,r){return r}function lb(i,r){if($e){var o=Fe.formState;if(o!==null){e:{var l=Se;if($e){if(st){t:{for(var f=st,m=Fn;f.nodeType!==8;){if(!m){f=null;break t}if(f=jn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){st=jn(f.nextSibling),l=f.data==="F!";break e}}Bs(l)}l=!1}l&&(r=o[0])}}return o=Qt(),o.memoizedState=o.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ob,lastRenderedState:r},o.queue=l,o=Ob.bind(null,Se,l),l.dispatch=o,l=fd(!1),m=gd.bind(null,Se,!1,l.queue),l=Qt(),f={state:r,dispatch:null,action:i,pending:null},l.queue=f,o=ZO.bind(null,Se,f,m,o),f.dispatch=o,l.memoizedState=i,[r,o,!1]}function ub(i){var r=pt();return cb(r,je,i)}function cb(i,r,o){if(r=ud(i,r,ob)[0],i=Xl(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=so(r)}catch(b){throw b===Qa?Pl:b}else l=r;r=pt();var f=r.queue,m=f.dispatch;return o!==r.memoizedState&&(Se.flags|=2048,$r(9,Zl(),JO.bind(null,f,o),null)),[l,m,i]}function JO(i,r){i.action=r}function fb(i){var r=pt(),o=je;if(o!==null)return cb(r,o,i);pt(),r=r.memoizedState,o=pt();var l=o.queue.dispatch;return o.memoizedState=i,[r,l,!1]}function $r(i,r,o,l){return i={tag:i,create:o,deps:l,inst:r,next:null},r=Se.updateQueue,r===null&&(r=od(),Se.updateQueue=r),o=r.lastEffect,o===null?r.lastEffect=i.next=i:(l=o.next,o.next=i,i.next=l,r.lastEffect=i),i}function Zl(){return{destroy:void 0,resource:void 0}}function db(){return pt().memoizedState}function Jl(i,r,o,l){var f=Qt();l=l===void 0?null:l,Se.flags|=i,f.memoizedState=$r(1|r,Zl(),o,l)}function ro(i,r,o,l){var f=pt();l=l===void 0?null:l;var m=f.memoizedState.inst;je!==null&&l!==null&&nd(l,je.memoizedState.deps)?f.memoizedState=$r(r,m,o,l):(Se.flags|=i,f.memoizedState=$r(1|r,m,o,l))}function hb(i,r){Jl(8390656,8,i,r)}function pb(i,r){ro(2048,8,i,r)}function mb(i,r){return ro(4,2,i,r)}function yb(i,r){return ro(4,4,i,r)}function gb(i,r){if(typeof r=="function"){i=i();var o=r(i);return function(){typeof o=="function"?o():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function bb(i,r,o){o=o!=null?o.concat([i]):null,ro(4,4,gb.bind(null,r,i),o)}function hd(){}function vb(i,r){var o=pt();r=r===void 0?null:r;var l=o.memoizedState;return r!==null&&nd(r,l[1])?l[0]:(o.memoizedState=[i,r],i)}function Sb(i,r){var o=pt();r=r===void 0?null:r;var l=o.memoizedState;if(r!==null&&nd(r,l[1]))return l[0];if(l=i(),zs){Pi(!0);try{i()}finally{Pi(!1)}}return o.memoizedState=[l,r],l}function pd(i,r,o){return o===void 0||(Zi&1073741824)!==0?i.memoizedState=r:(i.memoizedState=o,i=Av(),Se.lanes|=i,is|=i,o)}function xb(i,r,o,l){return un(o,r)?o:kr.current!==null?(i=pd(i,o,l),un(i,r)||(Ot=!0),i):(Zi&42)===0?(Ot=!0,i.memoizedState=o):(i=Av(),Se.lanes|=i,is|=i,r)}function wb(i,r,o,l,f){var m=I.p;I.p=m!==0&&8>m?m:8;var b=L.T,x={};L.T=x,gd(i,!1,r,o);try{var R=f(),N=L.S;if(N!==null&&N(x,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var K=FO(R,l);ao(i,r,K,pn(i))}else ao(i,r,l,pn(i))}catch(H){ao(i,r,{then:function(){},status:"rejected",reason:H},pn())}finally{I.p=m,L.T=b}}function QO(){}function md(i,r,o,l){if(i.tag!==5)throw Error(s(476));var f=Ab(i).queue;wb(i,f,r,F,o===null?QO:function(){return Tb(i),o(l)})}function Ab(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:F},next:null};var o={};return r.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:o},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function Tb(i){var r=Ab(i).next.queue;ao(i,r,{},pn())}function yd(){return zt(Eo)}function Eb(){return pt().memoizedState}function Rb(){return pt().memoizedState}function WO(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var o=pn();i=Yi(o);var l=Xi(r,i,o);l!==null&&(mn(l,r,o),eo(l,r,o)),r={cache:Gf()},i.payload=r;return}r=r.return}}function eM(i,r,o){var l=pn();o={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null},Ql(i)?Mb(r,o):(o=Lf(i,r,o,l),o!==null&&(mn(o,i,l),Cb(o,r,l)))}function Ob(i,r,o){var l=pn();ao(i,r,o,l)}function ao(i,r,o,l){var f={lane:l,revertLane:0,action:o,hasEagerState:!1,eagerState:null,next:null};if(Ql(i))Mb(r,f);else{var m=i.alternate;if(i.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var b=r.lastRenderedState,x=m(b,o);if(f.hasEagerState=!0,f.eagerState=x,un(x,b))return Bl(i,r,f,0),Fe===null&&$l(),!1}catch{}finally{}if(o=Lf(i,r,f,l),o!==null)return mn(o,i,l),Cb(o,r,l),!0}return!1}function gd(i,r,o,l){if(l={lane:2,revertLane:Xd(),action:l,hasEagerState:!1,eagerState:null,next:null},Ql(i)){if(r)throw Error(s(479))}else r=Lf(i,o,l,2),r!==null&&mn(r,i,2)}function Ql(i){var r=i.alternate;return i===Se||r!==null&&r===Se}function Mb(i,r){Dr=Gl=!0;var o=i.pending;o===null?r.next=r:(r.next=o.next,o.next=r),i.pending=r}function Cb(i,r,o){if((o&4194048)!==0){var l=r.lanes;l&=i.pendingLanes,o|=l,r.lanes=o,Vy(i,o)}}var Wl={readContext:zt,use:Yl,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut},_b={readContext:zt,use:Yl,useCallback:function(i,r){return Qt().memoizedState=[i,r===void 0?null:r],i},useContext:zt,useEffect:hb,useImperativeHandle:function(i,r,o){o=o!=null?o.concat([i]):null,Jl(4194308,4,gb.bind(null,r,i),o)},useLayoutEffect:function(i,r){return Jl(4194308,4,i,r)},useInsertionEffect:function(i,r){Jl(4,2,i,r)},useMemo:function(i,r){var o=Qt();r=r===void 0?null:r;var l=i();if(zs){Pi(!0);try{i()}finally{Pi(!1)}}return o.memoizedState=[l,r],l},useReducer:function(i,r,o){var l=Qt();if(o!==void 0){var f=o(r);if(zs){Pi(!0);try{o(r)}finally{Pi(!1)}}}else f=r;return l.memoizedState=l.baseState=f,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:f},l.queue=i,i=i.dispatch=eM.bind(null,Se,i),[l.memoizedState,i]},useRef:function(i){var r=Qt();return i={current:i},r.memoizedState=i},useState:function(i){i=fd(i);var r=i.queue,o=Ob.bind(null,Se,r);return r.dispatch=o,[i.memoizedState,o]},useDebugValue:hd,useDeferredValue:function(i,r){var o=Qt();return pd(o,i,r)},useTransition:function(){var i=fd(!1);return i=wb.bind(null,Se,i.queue,!0,!1),Qt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,o){var l=Se,f=Qt();if($e){if(o===void 0)throw Error(s(407));o=o()}else{if(o=r(),Fe===null)throw Error(s(349));(Ce&124)!==0||Jg(l,r,o)}f.memoizedState=o;var m={value:o,getSnapshot:r};return f.queue=m,hb(Wg.bind(null,l,m,i),[i]),l.flags|=2048,$r(9,Zl(),Qg.bind(null,l,m,o,r),null),o},useId:function(){var i=Qt(),r=Fe.identifierPrefix;if($e){var o=yi,l=mi;o=(l&~(1<<32-ln(l)-1)).toString(32)+o,r="ยซ"+r+"R"+o,o=Fl++,0<o&&(r+="H"+o.toString(32)),r+="ยป"}else o=YO++,r="ยซ"+r+"r"+o.toString(32)+"ยป";return i.memoizedState=r},useHostTransitionStatus:yd,useFormState:lb,useActionState:lb,useOptimistic:function(i){var r=Qt();r.memoizedState=r.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=o,r=gd.bind(null,Se,!0,o),o.dispatch=r,[i,r]},useMemoCache:ld,useCacheRefresh:function(){return Qt().memoizedState=WO.bind(null,Se)}},kb={readContext:zt,use:Yl,useCallback:vb,useContext:zt,useEffect:pb,useImperativeHandle:bb,useInsertionEffect:mb,useLayoutEffect:yb,useMemo:Sb,useReducer:Xl,useRef:db,useState:function(){return Xl(vi)},useDebugValue:hd,useDeferredValue:function(i,r){var o=pt();return xb(o,je.memoizedState,i,r)},useTransition:function(){var i=Xl(vi)[0],r=pt().memoizedState;return[typeof i=="boolean"?i:so(i),r]},useSyncExternalStore:Zg,useId:Eb,useHostTransitionStatus:yd,useFormState:ub,useActionState:ub,useOptimistic:function(i,r){var o=pt();return nb(o,je,i,r)},useMemoCache:ld,useCacheRefresh:Rb},tM={readContext:zt,use:Yl,useCallback:vb,useContext:zt,useEffect:pb,useImperativeHandle:bb,useInsertionEffect:mb,useLayoutEffect:yb,useMemo:Sb,useReducer:cd,useRef:db,useState:function(){return cd(vi)},useDebugValue:hd,useDeferredValue:function(i,r){var o=pt();return je===null?pd(o,i,r):xb(o,je.memoizedState,i,r)},useTransition:function(){var i=cd(vi)[0],r=pt().memoizedState;return[typeof i=="boolean"?i:so(i),r]},useSyncExternalStore:Zg,useId:Eb,useHostTransitionStatus:yd,useFormState:fb,useActionState:fb,useOptimistic:function(i,r){var o=pt();return je!==null?nb(o,je,i,r):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:ld,useCacheRefresh:Rb},Br=null,oo=0;function eu(i){var r=oo;return oo+=1,Br===null&&(Br=[]),Kg(Br,i,r)}function lo(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function tu(i,r){throw r.$$typeof===g?Error(s(525)):(i=Object.prototype.toString.call(r),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function Db(i){var r=i._init;return r(i._payload)}function Nb(i){function r(_,O){if(i){var D=_.deletions;D===null?(_.deletions=[O],_.flags|=16):D.push(O)}}function o(_,O){if(!i)return null;for(;O!==null;)r(_,O),O=O.sibling;return null}function l(_){for(var O=new Map;_!==null;)_.key!==null?O.set(_.key,_):O.set(_.index,_),_=_.sibling;return O}function f(_,O){return _=pi(_,O),_.index=0,_.sibling=null,_}function m(_,O,D){return _.index=D,i?(D=_.alternate,D!==null?(D=D.index,D<O?(_.flags|=67108866,O):D):(_.flags|=67108866,O)):(_.flags|=1048576,O)}function b(_){return i&&_.alternate===null&&(_.flags|=67108866),_}function x(_,O,D,P){return O===null||O.tag!==6?(O=jf(D,_.mode,P),O.return=_,O):(O=f(O,D),O.return=_,O)}function R(_,O,D,P){var se=D.type;return se===A?K(_,O,D.props.children,P,D.key):O!==null&&(O.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===ne&&Db(se)===O.type)?(O=f(O,D.props),lo(O,D),O.return=_,O):(O=Vl(D.type,D.key,D.props,null,_.mode,P),lo(O,D),O.return=_,O)}function N(_,O,D,P){return O===null||O.tag!==4||O.stateNode.containerInfo!==D.containerInfo||O.stateNode.implementation!==D.implementation?(O=zf(D,_.mode,P),O.return=_,O):(O=f(O,D.children||[]),O.return=_,O)}function K(_,O,D,P,se){return O===null||O.tag!==7?(O=ks(D,_.mode,P,se),O.return=_,O):(O=f(O,D),O.return=_,O)}function H(_,O,D){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=jf(""+O,_.mode,D),O.return=_,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case v:return D=Vl(O.type,O.key,O.props,null,_.mode,D),lo(D,O),D.return=_,D;case S:return O=zf(O,_.mode,D),O.return=_,O;case ne:var P=O._init;return O=P(O._payload),H(_,O,D)}if(X(O)||ke(O))return O=ks(O,_.mode,D,null),O.return=_,O;if(typeof O.then=="function")return H(_,eu(O),D);if(O.$$typeof===C)return H(_,ql(_,O),D);tu(_,O)}return null}function B(_,O,D,P){var se=O!==null?O.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return se!==null?null:x(_,O,""+D,P);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case v:return D.key===se?R(_,O,D,P):null;case S:return D.key===se?N(_,O,D,P):null;case ne:return se=D._init,D=se(D._payload),B(_,O,D,P)}if(X(D)||ke(D))return se!==null?null:K(_,O,D,P,null);if(typeof D.then=="function")return B(_,O,eu(D),P);if(D.$$typeof===C)return B(_,O,ql(_,D),P);tu(_,D)}return null}function V(_,O,D,P,se){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return _=_.get(D)||null,x(O,_,""+P,se);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case v:return _=_.get(P.key===null?D:P.key)||null,R(O,_,P,se);case S:return _=_.get(P.key===null?D:P.key)||null,N(O,_,P,se);case ne:var Ae=P._init;return P=Ae(P._payload),V(_,O,D,P,se)}if(X(P)||ke(P))return _=_.get(D)||null,K(O,_,P,se,null);if(typeof P.then=="function")return V(_,O,D,eu(P),se);if(P.$$typeof===C)return V(_,O,D,ql(O,P),se);tu(O,P)}return null}function de(_,O,D,P){for(var se=null,Ae=null,le=O,ce=O=0,Ct=null;le!==null&&ce<D.length;ce++){le.index>ce?(Ct=le,le=null):Ct=le.sibling;var Ne=B(_,le,D[ce],P);if(Ne===null){le===null&&(le=Ct);break}i&&le&&Ne.alternate===null&&r(_,le),O=m(Ne,O,ce),Ae===null?se=Ne:Ae.sibling=Ne,Ae=Ne,le=Ct}if(ce===D.length)return o(_,le),$e&&Ns(_,ce),se;if(le===null){for(;ce<D.length;ce++)le=H(_,D[ce],P),le!==null&&(O=m(le,O,ce),Ae===null?se=le:Ae.sibling=le,Ae=le);return $e&&Ns(_,ce),se}for(le=l(le);ce<D.length;ce++)Ct=V(le,_,ce,D[ce],P),Ct!==null&&(i&&Ct.alternate!==null&&le.delete(Ct.key===null?ce:Ct.key),O=m(Ct,O,ce),Ae===null?se=Ct:Ae.sibling=Ct,Ae=Ct);return i&&le.forEach(function(ds){return r(_,ds)}),$e&&Ns(_,ce),se}function ue(_,O,D,P){if(D==null)throw Error(s(151));for(var se=null,Ae=null,le=O,ce=O=0,Ct=null,Ne=D.next();le!==null&&!Ne.done;ce++,Ne=D.next()){le.index>ce?(Ct=le,le=null):Ct=le.sibling;var ds=B(_,le,Ne.value,P);if(ds===null){le===null&&(le=Ct);break}i&&le&&ds.alternate===null&&r(_,le),O=m(ds,O,ce),Ae===null?se=ds:Ae.sibling=ds,Ae=ds,le=Ct}if(Ne.done)return o(_,le),$e&&Ns(_,ce),se;if(le===null){for(;!Ne.done;ce++,Ne=D.next())Ne=H(_,Ne.value,P),Ne!==null&&(O=m(Ne,O,ce),Ae===null?se=Ne:Ae.sibling=Ne,Ae=Ne);return $e&&Ns(_,ce),se}for(le=l(le);!Ne.done;ce++,Ne=D.next())Ne=V(le,_,ce,Ne.value,P),Ne!==null&&(i&&Ne.alternate!==null&&le.delete(Ne.key===null?ce:Ne.key),O=m(Ne,O,ce),Ae===null?se=Ne:Ae.sibling=Ne,Ae=Ne);return i&&le.forEach(function(nC){return r(_,nC)}),$e&&Ns(_,ce),se}function Ue(_,O,D,P){if(typeof D=="object"&&D!==null&&D.type===A&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case v:e:{for(var se=D.key;O!==null;){if(O.key===se){if(se=D.type,se===A){if(O.tag===7){o(_,O.sibling),P=f(O,D.props.children),P.return=_,_=P;break e}}else if(O.elementType===se||typeof se=="object"&&se!==null&&se.$$typeof===ne&&Db(se)===O.type){o(_,O.sibling),P=f(O,D.props),lo(P,D),P.return=_,_=P;break e}o(_,O);break}else r(_,O);O=O.sibling}D.type===A?(P=ks(D.props.children,_.mode,P,D.key),P.return=_,_=P):(P=Vl(D.type,D.key,D.props,null,_.mode,P),lo(P,D),P.return=_,_=P)}return b(_);case S:e:{for(se=D.key;O!==null;){if(O.key===se)if(O.tag===4&&O.stateNode.containerInfo===D.containerInfo&&O.stateNode.implementation===D.implementation){o(_,O.sibling),P=f(O,D.children||[]),P.return=_,_=P;break e}else{o(_,O);break}else r(_,O);O=O.sibling}P=zf(D,_.mode,P),P.return=_,_=P}return b(_);case ne:return se=D._init,D=se(D._payload),Ue(_,O,D,P)}if(X(D))return de(_,O,D,P);if(ke(D)){if(se=ke(D),typeof se!="function")throw Error(s(150));return D=se.call(D),ue(_,O,D,P)}if(typeof D.then=="function")return Ue(_,O,eu(D),P);if(D.$$typeof===C)return Ue(_,O,ql(_,D),P);tu(_,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,O!==null&&O.tag===6?(o(_,O.sibling),P=f(O,D),P.return=_,_=P):(o(_,O),P=jf(D,_.mode,P),P.return=_,_=P),b(_)):o(_,O)}return function(_,O,D,P){try{oo=0;var se=Ue(_,O,D,P);return Br=null,se}catch(le){if(le===Qa||le===Pl)throw le;var Ae=cn(29,le,null,_.mode);return Ae.lanes=P,Ae.return=_,Ae}finally{}}}var Lr=Nb(!0),$b=Nb(!1),Rn=q(null),Yn=null;function Ji(i){var r=i.alternate;Q(St,St.current&1),Q(Rn,i),Yn===null&&(r===null||kr.current!==null||r.memoizedState!==null)&&(Yn=i)}function Bb(i){if(i.tag===22){if(Q(St,St.current),Q(Rn,i),Yn===null){var r=i.alternate;r!==null&&r.memoizedState!==null&&(Yn=i)}}else Qi()}function Qi(){Q(St,St.current),Q(Rn,Rn.current)}function Si(i){Y(Rn),Yn===i&&(Yn=null),Y(St)}var St=q(0);function nu(i){for(var r=i;r!==null;){if(r.tag===13){var o=r.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||oh(o)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function bd(i,r,o,l){r=i.memoizedState,o=o(l,r),o=o==null?r:y({},r,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var vd={enqueueSetState:function(i,r,o){i=i._reactInternals;var l=pn(),f=Yi(l);f.payload=r,o!=null&&(f.callback=o),r=Xi(i,f,l),r!==null&&(mn(r,i,l),eo(r,i,l))},enqueueReplaceState:function(i,r,o){i=i._reactInternals;var l=pn(),f=Yi(l);f.tag=1,f.payload=r,o!=null&&(f.callback=o),r=Xi(i,f,l),r!==null&&(mn(r,i,l),eo(r,i,l))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var o=pn(),l=Yi(o);l.tag=2,r!=null&&(l.callback=r),r=Xi(i,l,o),r!==null&&(mn(r,i,o),eo(r,i,o))}};function Lb(i,r,o,l,f,m,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,m,b):r.prototype&&r.prototype.isPureReactComponent?!Ia(o,l)||!Ia(f,m):!0}function Vb(i,r,o,l){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(o,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(o,l),r.state!==i&&vd.enqueueReplaceState(r,r.state,null)}function Us(i,r){var o=r;if("ref"in r){o={};for(var l in r)l!=="ref"&&(o[l]=r[l])}if(i=i.defaultProps){o===r&&(o=y({},o));for(var f in i)o[f]===void 0&&(o[f]=i[f])}return o}var iu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function jb(i){iu(i)}function zb(i){console.error(i)}function Ub(i){iu(i)}function su(i,r){try{var o=i.onUncaughtError;o(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function qb(i,r,o){try{var l=i.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Sd(i,r,o){return o=Yi(o),o.tag=3,o.payload={element:null},o.callback=function(){su(i,r)},o}function Kb(i){return i=Yi(i),i.tag=3,i}function Pb(i,r,o,l){var f=o.type.getDerivedStateFromError;if(typeof f=="function"){var m=l.value;i.payload=function(){return f(m)},i.callback=function(){qb(r,o,l)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){qb(r,o,l),typeof f!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var x=l.stack;this.componentDidCatch(l.value,{componentStack:x!==null?x:""})})}function nM(i,r,o,l,f){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=o.alternate,r!==null&&Xa(r,o,f,!0),o=Rn.current,o!==null){switch(o.tag){case 13:return Yn===null?Id():o.alternate===null&&rt===0&&(rt=3),o.flags&=-257,o.flags|=65536,o.lanes=f,l===Xf?o.flags|=16384:(r=o.updateQueue,r===null?o.updateQueue=new Set([l]):r.add(l),Gd(i,l,f)),!1;case 22:return o.flags|=65536,l===Xf?o.flags|=16384:(r=o.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=r):(o=r.retryQueue,o===null?r.retryQueue=new Set([l]):o.add(l)),Gd(i,l,f)),!1}throw Error(s(435,o.tag))}return Gd(i,l,f),Id(),!1}if($e)return r=Rn.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==Kf&&(i=Error(s(422),{cause:l}),Ya(wn(i,o)))):(l!==Kf&&(r=Error(s(423),{cause:l}),Ya(wn(r,o))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,l=wn(l,o),f=Sd(i.stateNode,l,f),Qf(i,f),rt!==4&&(rt=2)),!1;var m=Error(s(520),{cause:l});if(m=wn(m,o),yo===null?yo=[m]:yo.push(m),rt!==4&&(rt=2),r===null)return!0;l=wn(l,o),o=r;do{switch(o.tag){case 3:return o.flags|=65536,i=f&-f,o.lanes|=i,i=Sd(o.stateNode,l,i),Qf(o,i),!1;case 1:if(r=o.type,m=o.stateNode,(o.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(ss===null||!ss.has(m))))return o.flags|=65536,f&=-f,o.lanes|=f,f=Kb(f),Pb(f,i,o,l),Qf(o,f),!1}o=o.return}while(o!==null);return!1}var Ib=Error(s(461)),Ot=!1;function Nt(i,r,o,l){r.child=i===null?$b(r,null,o,l):Lr(r,i.child,o,l)}function Hb(i,r,o,l,f){o=o.render;var m=r.ref;if("ref"in l){var b={};for(var x in l)x!=="ref"&&(b[x]=l[x])}else b=l;return Vs(r),l=id(i,r,o,b,m,f),x=sd(),i!==null&&!Ot?(rd(i,r,f),xi(i,r,f)):($e&&x&&Uf(r),r.flags|=1,Nt(i,r,l,f),r.child)}function Gb(i,r,o,l,f){if(i===null){var m=o.type;return typeof m=="function"&&!Vf(m)&&m.defaultProps===void 0&&o.compare===null?(r.tag=15,r.type=m,Fb(i,r,m,l,f)):(i=Vl(o.type,null,l,r,r.mode,f),i.ref=r.ref,i.return=r,r.child=i)}if(m=i.child,!Md(i,f)){var b=m.memoizedProps;if(o=o.compare,o=o!==null?o:Ia,o(b,l)&&i.ref===r.ref)return xi(i,r,f)}return r.flags|=1,i=pi(m,l),i.ref=r.ref,i.return=r,r.child=i}function Fb(i,r,o,l,f){if(i!==null){var m=i.memoizedProps;if(Ia(m,l)&&i.ref===r.ref)if(Ot=!1,r.pendingProps=l=m,Md(i,f))(i.flags&131072)!==0&&(Ot=!0);else return r.lanes=i.lanes,xi(i,r,f)}return xd(i,r,o,l,f)}function Yb(i,r,o){var l=r.pendingProps,f=l.children,m=i!==null?i.memoizedState:null;if(l.mode==="hidden"){if((r.flags&128)!==0){if(l=m!==null?m.baseLanes|o:o,i!==null){for(f=r.child=i.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;r.childLanes=m&~l}else r.childLanes=0,r.child=null;return Xb(i,r,l,o)}if((o&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Kl(r,m!==null?m.cachePool:null),m!==null?Fg(r,m):ed(),Bb(r);else return r.lanes=r.childLanes=536870912,Xb(i,r,m!==null?m.baseLanes|o:o,o)}else m!==null?(Kl(r,m.cachePool),Fg(r,m),Qi(),r.memoizedState=null):(i!==null&&Kl(r,null),ed(),Qi());return Nt(i,r,f,o),r.child}function Xb(i,r,o,l){var f=Yf();return f=f===null?null:{parent:vt._currentValue,pool:f},r.memoizedState={baseLanes:o,cachePool:f},i!==null&&Kl(r,null),ed(),Bb(r),i!==null&&Xa(i,r,l,!0),null}function ru(i,r){var o=r.ref;if(o===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(s(284));(i===null||i.ref!==o)&&(r.flags|=4194816)}}function xd(i,r,o,l,f){return Vs(r),o=id(i,r,o,l,void 0,f),l=sd(),i!==null&&!Ot?(rd(i,r,f),xi(i,r,f)):($e&&l&&Uf(r),r.flags|=1,Nt(i,r,o,f),r.child)}function Zb(i,r,o,l,f,m){return Vs(r),r.updateQueue=null,o=Xg(r,l,o,f),Yg(i),l=sd(),i!==null&&!Ot?(rd(i,r,m),xi(i,r,m)):($e&&l&&Uf(r),r.flags|=1,Nt(i,r,o,m),r.child)}function Jb(i,r,o,l,f){if(Vs(r),r.stateNode===null){var m=Rr,b=o.contextType;typeof b=="object"&&b!==null&&(m=zt(b)),m=new o(l,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=vd,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=l,m.state=r.memoizedState,m.refs={},Zf(r),b=o.contextType,m.context=typeof b=="object"&&b!==null?zt(b):Rr,m.state=r.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(bd(r,o,b,l),m.state=r.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&vd.enqueueReplaceState(m,m.state,null),no(r,l,m,f),to(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(i===null){m=r.stateNode;var x=r.memoizedProps,R=Us(o,x);m.props=R;var N=m.context,K=o.contextType;b=Rr,typeof K=="object"&&K!==null&&(b=zt(K));var H=o.getDerivedStateFromProps;K=typeof H=="function"||typeof m.getSnapshotBeforeUpdate=="function",x=r.pendingProps!==x,K||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(x||N!==b)&&Vb(r,m,l,b),Fi=!1;var B=r.memoizedState;m.state=B,no(r,l,m,f),to(),N=r.memoizedState,x||B!==N||Fi?(typeof H=="function"&&(bd(r,o,H,l),N=r.memoizedState),(R=Fi||Lb(r,o,R,l,B,N,b))?(K||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=N),m.props=l,m.state=N,m.context=b,l=R):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{m=r.stateNode,Jf(i,r),b=r.memoizedProps,K=Us(o,b),m.props=K,H=r.pendingProps,B=m.context,N=o.contextType,R=Rr,typeof N=="object"&&N!==null&&(R=zt(N)),x=o.getDerivedStateFromProps,(N=typeof x=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==H||B!==R)&&Vb(r,m,l,R),Fi=!1,B=r.memoizedState,m.state=B,no(r,l,m,f),to();var V=r.memoizedState;b!==H||B!==V||Fi||i!==null&&i.dependencies!==null&&Ul(i.dependencies)?(typeof x=="function"&&(bd(r,o,x,l),V=r.memoizedState),(K=Fi||Lb(r,o,K,l,B,V,R)||i!==null&&i.dependencies!==null&&Ul(i.dependencies))?(N||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,V,R),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,V,R)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=V),m.props=l,m.state=V,m.context=R,l=K):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=1024),l=!1)}return m=l,ru(i,r),l=(r.flags&128)!==0,m||l?(m=r.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,i!==null&&l?(r.child=Lr(r,i.child,null,f),r.child=Lr(r,null,o,f)):Nt(i,r,o,f),r.memoizedState=m.state,i=r.child):i=xi(i,r,f),i}function Qb(i,r,o,l){return Fa(),r.flags|=256,Nt(i,r,o,l),r.child}var wd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ad(i){return{baseLanes:i,cachePool:zg()}}function Td(i,r,o){return i=i!==null?i.childLanes&~o:0,r&&(i|=On),i}function Wb(i,r,o){var l=r.pendingProps,f=!1,m=(r.flags&128)!==0,b;if((b=m)||(b=i!==null&&i.memoizedState===null?!1:(St.current&2)!==0),b&&(f=!0,r.flags&=-129),b=(r.flags&32)!==0,r.flags&=-33,i===null){if($e){if(f?Ji(r):Qi(),$e){var x=st,R;if(R=x){e:{for(R=x,x=Fn;R.nodeType!==8;){if(!x){x=null;break e}if(R=jn(R.nextSibling),R===null){x=null;break e}}x=R}x!==null?(r.memoizedState={dehydrated:x,treeContext:Ds!==null?{id:mi,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},R=cn(18,null,null,0),R.stateNode=x,R.return=r,r.child=R,Gt=r,st=null,R=!0):R=!1}R||Bs(r)}if(x=r.memoizedState,x!==null&&(x=x.dehydrated,x!==null))return oh(x)?r.lanes=32:r.lanes=536870912,null;Si(r)}return x=l.children,l=l.fallback,f?(Qi(),f=r.mode,x=au({mode:"hidden",children:x},f),l=ks(l,f,o,null),x.return=r,l.return=r,x.sibling=l,r.child=x,f=r.child,f.memoizedState=Ad(o),f.childLanes=Td(i,b,o),r.memoizedState=wd,l):(Ji(r),Ed(r,x))}if(R=i.memoizedState,R!==null&&(x=R.dehydrated,x!==null)){if(m)r.flags&256?(Ji(r),r.flags&=-257,r=Rd(i,r,o)):r.memoizedState!==null?(Qi(),r.child=i.child,r.flags|=128,r=null):(Qi(),f=l.fallback,x=r.mode,l=au({mode:"visible",children:l.children},x),f=ks(f,x,o,null),f.flags|=2,l.return=r,f.return=r,l.sibling=f,r.child=l,Lr(r,i.child,null,o),l=r.child,l.memoizedState=Ad(o),l.childLanes=Td(i,b,o),r.memoizedState=wd,r=f);else if(Ji(r),oh(x)){if(b=x.nextSibling&&x.nextSibling.dataset,b)var N=b.dgst;b=N,l=Error(s(419)),l.stack="",l.digest=b,Ya({value:l,source:null,stack:null}),r=Rd(i,r,o)}else if(Ot||Xa(i,r,o,!1),b=(o&i.childLanes)!==0,Ot||b){if(b=Fe,b!==null&&(l=o&-o,l=(l&42)!==0?1:lf(l),l=(l&(b.suspendedLanes|o))!==0?0:l,l!==0&&l!==R.retryLane))throw R.retryLane=l,Er(i,l),mn(b,i,l),Ib;x.data==="$?"||Id(),r=Rd(i,r,o)}else x.data==="$?"?(r.flags|=192,r.child=i.child,r=null):(i=R.treeContext,st=jn(x.nextSibling),Gt=r,$e=!0,$s=null,Fn=!1,i!==null&&(Tn[En++]=mi,Tn[En++]=yi,Tn[En++]=Ds,mi=i.id,yi=i.overflow,Ds=r),r=Ed(r,l.children),r.flags|=4096);return r}return f?(Qi(),f=l.fallback,x=r.mode,R=i.child,N=R.sibling,l=pi(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,N!==null?f=pi(N,f):(f=ks(f,x,o,null),f.flags|=2),f.return=r,l.return=r,l.sibling=f,r.child=l,l=f,f=r.child,x=i.child.memoizedState,x===null?x=Ad(o):(R=x.cachePool,R!==null?(N=vt._currentValue,R=R.parent!==N?{parent:N,pool:N}:R):R=zg(),x={baseLanes:x.baseLanes|o,cachePool:R}),f.memoizedState=x,f.childLanes=Td(i,b,o),r.memoizedState=wd,l):(Ji(r),o=i.child,i=o.sibling,o=pi(o,{mode:"visible",children:l.children}),o.return=r,o.sibling=null,i!==null&&(b=r.deletions,b===null?(r.deletions=[i],r.flags|=16):b.push(i)),r.child=o,r.memoizedState=null,o)}function Ed(i,r){return r=au({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function au(i,r){return i=cn(22,i,null,r),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Rd(i,r,o){return Lr(r,i.child,null,o),i=Ed(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function ev(i,r,o){i.lanes|=r;var l=i.alternate;l!==null&&(l.lanes|=r),If(i.return,r,o)}function Od(i,r,o,l,f){var m=i.memoizedState;m===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:f}:(m.isBackwards=r,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=o,m.tailMode=f)}function tv(i,r,o){var l=r.pendingProps,f=l.revealOrder,m=l.tail;if(Nt(i,r,l.children,o),l=St.current,(l&2)!==0)l=l&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&ev(i,o,r);else if(i.tag===19)ev(i,o,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}l&=1}switch(Q(St,l),f){case"forwards":for(o=r.child,f=null;o!==null;)i=o.alternate,i!==null&&nu(i)===null&&(f=o),o=o.sibling;o=f,o===null?(f=r.child,r.child=null):(f=o.sibling,o.sibling=null),Od(r,!1,f,o,m);break;case"backwards":for(o=null,f=r.child,r.child=null;f!==null;){if(i=f.alternate,i!==null&&nu(i)===null){r.child=f;break}i=f.sibling,f.sibling=o,o=f,f=i}Od(r,!0,o,null,m);break;case"together":Od(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function xi(i,r,o){if(i!==null&&(r.dependencies=i.dependencies),is|=r.lanes,(o&r.childLanes)===0)if(i!==null){if(Xa(i,r,o,!1),(o&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(s(153));if(r.child!==null){for(i=r.child,o=pi(i,i.pendingProps),r.child=o,o.return=r;i.sibling!==null;)i=i.sibling,o=o.sibling=pi(i,i.pendingProps),o.return=r;o.sibling=null}return r.child}function Md(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&Ul(i)))}function iM(i,r,o){switch(r.tag){case 3:De(r,r.stateNode.containerInfo),Gi(r,vt,i.memoizedState.cache),Fa();break;case 27:case 5:Ki(r);break;case 4:De(r,r.stateNode.containerInfo);break;case 10:Gi(r,r.type,r.memoizedProps.value);break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(Ji(r),r.flags|=128,null):(o&r.child.childLanes)!==0?Wb(i,r,o):(Ji(r),i=xi(i,r,o),i!==null?i.sibling:null);Ji(r);break;case 19:var f=(i.flags&128)!==0;if(l=(o&r.childLanes)!==0,l||(Xa(i,r,o,!1),l=(o&r.childLanes)!==0),f){if(l)return tv(i,r,o);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Q(St,St.current),l)break;return null;case 22:case 23:return r.lanes=0,Yb(i,r,o);case 24:Gi(r,vt,i.memoizedState.cache)}return xi(i,r,o)}function nv(i,r,o){if(i!==null)if(i.memoizedProps!==r.pendingProps)Ot=!0;else{if(!Md(i,o)&&(r.flags&128)===0)return Ot=!1,iM(i,r,o);Ot=(i.flags&131072)!==0}else Ot=!1,$e&&(r.flags&1048576)!==0&&Dg(r,zl,r.index);switch(r.lanes=0,r.tag){case 16:e:{i=r.pendingProps;var l=r.elementType,f=l._init;if(l=f(l._payload),r.type=l,typeof l=="function")Vf(l)?(i=Us(l,i),r.tag=1,r=Jb(null,r,l,i,o)):(r.tag=0,r=xd(null,r,l,i,o));else{if(l!=null){if(f=l.$$typeof,f===G){r.tag=11,r=Hb(null,r,l,i,o);break e}else if(f===ie){r.tag=14,r=Gb(null,r,l,i,o);break e}}throw r=_e(l)||l,Error(s(306,r,""))}}return r;case 0:return xd(i,r,r.type,r.pendingProps,o);case 1:return l=r.type,f=Us(l,r.pendingProps),Jb(i,r,l,f,o);case 3:e:{if(De(r,r.stateNode.containerInfo),i===null)throw Error(s(387));l=r.pendingProps;var m=r.memoizedState;f=m.element,Jf(i,r),no(r,l,null,o);var b=r.memoizedState;if(l=b.cache,Gi(r,vt,l),l!==m.cache&&Hf(r,[vt],o,!0),to(),l=b.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:b.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=Qb(i,r,l,o);break e}else if(l!==f){f=wn(Error(s(424)),r),Ya(f),r=Qb(i,r,l,o);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(st=jn(i.firstChild),Gt=r,$e=!0,$s=null,Fn=!0,o=$b(r,null,l,o),r.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Fa(),l===f){r=xi(i,r,o);break e}Nt(i,r,l,o)}r=r.child}return r;case 26:return ru(i,r),i===null?(o=a0(r.type,null,r.pendingProps,null))?r.memoizedState=o:$e||(o=r.type,i=r.pendingProps,l=Su(re.current).createElement(o),l[jt]=r,l[Zt]=i,Bt(l,o,i),Rt(l),r.stateNode=l):r.memoizedState=a0(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Ki(r),i===null&&$e&&(l=r.stateNode=i0(r.type,r.pendingProps,re.current),Gt=r,Fn=!0,f=st,os(r.type)?(lh=f,st=jn(l.firstChild)):st=f),Nt(i,r,r.pendingProps.children,o),ru(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&$e&&((f=l=st)&&(l=kM(l,r.type,r.pendingProps,Fn),l!==null?(r.stateNode=l,Gt=r,st=jn(l.firstChild),Fn=!1,f=!0):f=!1),f||Bs(r)),Ki(r),f=r.type,m=r.pendingProps,b=i!==null?i.memoizedProps:null,l=m.children,sh(f,m)?l=null:b!==null&&sh(f,b)&&(r.flags|=32),r.memoizedState!==null&&(f=id(i,r,XO,null,null,o),Eo._currentValue=f),ru(i,r),Nt(i,r,l,o),r.child;case 6:return i===null&&$e&&((i=o=st)&&(o=DM(o,r.pendingProps,Fn),o!==null?(r.stateNode=o,Gt=r,st=null,i=!0):i=!1),i||Bs(r)),null;case 13:return Wb(i,r,o);case 4:return De(r,r.stateNode.containerInfo),l=r.pendingProps,i===null?r.child=Lr(r,null,l,o):Nt(i,r,l,o),r.child;case 11:return Hb(i,r,r.type,r.pendingProps,o);case 7:return Nt(i,r,r.pendingProps,o),r.child;case 8:return Nt(i,r,r.pendingProps.children,o),r.child;case 12:return Nt(i,r,r.pendingProps.children,o),r.child;case 10:return l=r.pendingProps,Gi(r,r.type,l.value),Nt(i,r,l.children,o),r.child;case 9:return f=r.type._context,l=r.pendingProps.children,Vs(r),f=zt(f),l=l(f),r.flags|=1,Nt(i,r,l,o),r.child;case 14:return Gb(i,r,r.type,r.pendingProps,o);case 15:return Fb(i,r,r.type,r.pendingProps,o);case 19:return tv(i,r,o);case 31:return l=r.pendingProps,o=r.mode,l={mode:l.mode,children:l.children},i===null?(o=au(l,o),o.ref=r.ref,r.child=o,o.return=r,r=o):(o=pi(i.child,l),o.ref=r.ref,r.child=o,o.return=r,r=o),r;case 22:return Yb(i,r,o);case 24:return Vs(r),l=zt(vt),i===null?(f=Yf(),f===null&&(f=Fe,m=Gf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=o),f=m),r.memoizedState={parent:l,cache:f},Zf(r),Gi(r,vt,f)):((i.lanes&o)!==0&&(Jf(i,r),no(r,null,null,o),to()),f=i.memoizedState,m=r.memoizedState,f.parent!==l?(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Gi(r,vt,l)):(l=m.cache,Gi(r,vt,l),l!==f.cache&&Hf(r,[vt],o,!0))),Nt(i,r,r.pendingProps.children,o),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function wi(i){i.flags|=4}function iv(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!f0(r)){if(r=Rn.current,r!==null&&((Ce&4194048)===Ce?Yn!==null:(Ce&62914560)!==Ce&&(Ce&536870912)===0||r!==Yn))throw Wa=Xf,Ug;i.flags|=8192}}function ou(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?By():536870912,i.lanes|=r,Ur|=r)}function uo(i,r){if(!$e)switch(i.tailMode){case"hidden":r=i.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function tt(i){var r=i.alternate!==null&&i.alternate.child===i.child,o=0,l=0;if(r)for(var f=i.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=i,f=f.sibling;else for(f=i.child;f!==null;)o|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=i,f=f.sibling;return i.subtreeFlags|=l,i.childLanes=o,r}function sM(i,r,o){var l=r.pendingProps;switch(qf(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(r),null;case 1:return tt(r),null;case 3:return o=r.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),bi(vt),rn(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Ga(r)?wi(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,Bg())),tt(r),null;case 26:return o=r.memoizedState,i===null?(wi(r),o!==null?(tt(r),iv(r,o)):(tt(r),r.flags&=-16777217)):o?o!==i.memoizedState?(wi(r),tt(r),iv(r,o)):(tt(r),r.flags&=-16777217):(i.memoizedProps!==l&&wi(r),tt(r),r.flags&=-16777217),null;case 27:be(r),o=re.current;var f=r.type;if(i!==null&&r.stateNode!=null)i.memoizedProps!==l&&wi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return tt(r),null}i=ae.current,Ga(r)?Ng(r):(i=i0(f,l,o),r.stateNode=i,wi(r))}return tt(r),null;case 5:if(be(r),o=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==l&&wi(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return tt(r),null}if(i=ae.current,Ga(r))Ng(r);else{switch(f=Su(re.current),i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?f.createElement(o,{is:l.is}):f.createElement(o)}}i[jt]=r,i[Zt]=l;e:for(f=r.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===r)break e;for(;f.sibling===null;){if(f.return===null||f.return===r)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}r.stateNode=i;e:switch(Bt(i,o,l),o){case"button":case"input":case"select":case"textarea":i=!!l.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&wi(r)}}return tt(r),r.flags&=-16777217,null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==l&&wi(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(i=re.current,Ga(r)){if(i=r.stateNode,o=r.memoizedProps,l=null,f=Gt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}i[jt]=r,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||Zv(i.nodeValue,o)),i||Bs(r)}else i=Su(i).createTextNode(l),i[jt]=r,r.stateNode=i}return tt(r),null;case 13:if(l=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=Ga(r),l!==null&&l.dehydrated!==null){if(i===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[jt]=r}else Fa(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),f=!1}else f=Bg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(Si(r),r):(Si(r),null)}if(Si(r),(r.flags&128)!==0)return r.lanes=o,r;if(o=l!==null,i=i!==null&&i.memoizedState!==null,o){l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var m=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048)}return o!==i&&o&&(r.child.flags|=8192),ou(r,r.updateQueue),tt(r),null;case 4:return rn(),i===null&&Wd(r.stateNode.containerInfo),tt(r),null;case 10:return bi(r.type),tt(r),null;case 19:if(Y(St),f=r.memoizedState,f===null)return tt(r),null;if(l=(r.flags&128)!==0,m=f.rendering,m===null)if(l)uo(f,!1);else{if(rt!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(m=nu(i),m!==null){for(r.flags|=128,uo(f,!1),i=m.updateQueue,r.updateQueue=i,ou(r,i),r.subtreeFlags=0,i=o,o=r.child;o!==null;)kg(o,i),o=o.sibling;return Q(St,St.current&1|2),r.child}i=i.sibling}f.tail!==null&&Ke()>cu&&(r.flags|=128,l=!0,uo(f,!1),r.lanes=4194304)}else{if(!l)if(i=nu(m),i!==null){if(r.flags|=128,l=!0,i=i.updateQueue,r.updateQueue=i,ou(r,i),uo(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!$e)return tt(r),null}else 2*Ke()-f.renderingStartTime>cu&&o!==536870912&&(r.flags|=128,l=!0,uo(f,!1),r.lanes=4194304);f.isBackwards?(m.sibling=r.child,r.child=m):(i=f.last,i!==null?i.sibling=m:r.child=m,f.last=m)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=Ke(),r.sibling=null,i=St.current,Q(St,l?i&1|2:i&1),r):(tt(r),null);case 22:case 23:return Si(r),td(),l=r.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(o&536870912)!==0&&(r.flags&128)===0&&(tt(r),r.subtreeFlags&6&&(r.flags|=8192)):tt(r),o=r.updateQueue,o!==null&&ou(r,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==o&&(r.flags|=2048),i!==null&&Y(js),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),r.memoizedState.cache!==o&&(r.flags|=2048),bi(vt),tt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function rM(i,r){switch(qf(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return bi(vt),rn(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return be(r),null;case 13:if(Si(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Fa()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return Y(St),null;case 4:return rn(),null;case 10:return bi(r.type),null;case 22:case 23:return Si(r),td(),i!==null&&Y(js),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return bi(vt),null;case 25:return null;default:return null}}function sv(i,r){switch(qf(r),r.tag){case 3:bi(vt),rn();break;case 26:case 27:case 5:be(r);break;case 4:rn();break;case 13:Si(r);break;case 19:Y(St);break;case 10:bi(r.type);break;case 22:case 23:Si(r),td(),i!==null&&Y(js);break;case 24:bi(vt)}}function co(i,r){try{var o=r.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var f=l.next;o=f;do{if((o.tag&i)===i){l=void 0;var m=o.create,b=o.inst;l=m(),b.destroy=l}o=o.next}while(o!==f)}}catch(x){Pe(r,r.return,x)}}function Wi(i,r,o){try{var l=r.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var m=f.next;l=m;do{if((l.tag&i)===i){var b=l.inst,x=b.destroy;if(x!==void 0){b.destroy=void 0,f=r;var R=o,N=x;try{N()}catch(K){Pe(f,R,K)}}}l=l.next}while(l!==m)}}catch(K){Pe(r,r.return,K)}}function rv(i){var r=i.updateQueue;if(r!==null){var o=i.stateNode;try{Gg(r,o)}catch(l){Pe(i,i.return,l)}}}function av(i,r,o){o.props=Us(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Pe(i,r,l)}}function fo(i,r){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof o=="function"?i.refCleanup=o(l):o.current=l}}catch(f){Pe(i,r,f)}}function Xn(i,r){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(f){Pe(i,r,f)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(f){Pe(i,r,f)}else o.current=null}function ov(i){var r=i.type,o=i.memoizedProps,l=i.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(f){Pe(i,i.return,f)}}function Cd(i,r,o){try{var l=i.stateNode;RM(l,i.type,o,r),l[Zt]=r}catch(f){Pe(i,i.return,f)}}function lv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&os(i.type)||i.tag===4}function _d(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||lv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&os(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function kd(i,r,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,r?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,r):(r=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,r.appendChild(i),o=o._reactRootContainer,o!=null||r.onclick!==null||(r.onclick=vu));else if(l!==4&&(l===27&&os(i.type)&&(o=i.stateNode,r=null),i=i.child,i!==null))for(kd(i,r,o),i=i.sibling;i!==null;)kd(i,r,o),i=i.sibling}function lu(i,r,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,r?o.insertBefore(i,r):o.appendChild(i);else if(l!==4&&(l===27&&os(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(lu(i,r,o),i=i.sibling;i!==null;)lu(i,r,o),i=i.sibling}function uv(i){var r=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);Bt(r,l,o),r[jt]=i,r[Zt]=o}catch(m){Pe(i,i.return,m)}}var Ai=!1,ct=!1,Dd=!1,cv=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function aM(i,r){if(i=i.containerInfo,nh=Ru,i=xg(i),_f(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var f=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{o.nodeType,m.nodeType}catch{o=null;break e}var b=0,x=-1,R=-1,N=0,K=0,H=i,B=null;t:for(;;){for(var V;H!==o||f!==0&&H.nodeType!==3||(x=b+f),H!==m||l!==0&&H.nodeType!==3||(R=b+l),H.nodeType===3&&(b+=H.nodeValue.length),(V=H.firstChild)!==null;)B=H,H=V;for(;;){if(H===i)break t;if(B===o&&++N===f&&(x=b),B===m&&++K===l&&(R=b),(V=H.nextSibling)!==null)break;H=B,B=H.parentNode}H=V}o=x===-1||R===-1?null:{start:x,end:R}}else o=null}o=o||{start:0,end:0}}else o=null;for(ih={focusedElem:i,selectionRange:o},Ru=!1,Mt=r;Mt!==null;)if(r=Mt,i=r.child,(r.subtreeFlags&1024)!==0&&i!==null)i.return=r,Mt=i;else for(;Mt!==null;){switch(r=Mt,m=r.alternate,i=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&m!==null){i=void 0,o=r,f=m.memoizedProps,m=m.memoizedState,l=o.stateNode;try{var de=Us(o.type,f,o.elementType===o.type);i=l.getSnapshotBeforeUpdate(de,m),l.__reactInternalSnapshotBeforeUpdate=i}catch(ue){Pe(o,o.return,ue)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,o=i.nodeType,o===9)ah(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":ah(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(s(163))}if(i=r.sibling,i!==null){i.return=r.return,Mt=i;break}Mt=r.return}}function fv(i,r,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:es(i,o),l&4&&co(5,o);break;case 1:if(es(i,o),l&4)if(i=o.stateNode,r===null)try{i.componentDidMount()}catch(b){Pe(o,o.return,b)}else{var f=Us(o.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(f,r,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Pe(o,o.return,b)}}l&64&&rv(o),l&512&&fo(o,o.return);break;case 3:if(es(i,o),l&64&&(i=o.updateQueue,i!==null)){if(r=null,o.child!==null)switch(o.child.tag){case 27:case 5:r=o.child.stateNode;break;case 1:r=o.child.stateNode}try{Gg(i,r)}catch(b){Pe(o,o.return,b)}}break;case 27:r===null&&l&4&&uv(o);case 26:case 5:es(i,o),r===null&&l&4&&ov(o),l&512&&fo(o,o.return);break;case 12:es(i,o);break;case 13:es(i,o),l&4&&pv(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=mM.bind(null,o),NM(i,o))));break;case 22:if(l=o.memoizedState!==null||Ai,!l){r=r!==null&&r.memoizedState!==null||ct,f=Ai;var m=ct;Ai=l,(ct=r)&&!m?ts(i,o,(o.subtreeFlags&8772)!==0):es(i,o),Ai=f,ct=m}break;case 30:break;default:es(i,o)}}function dv(i){var r=i.alternate;r!==null&&(i.alternate=null,dv(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&ff(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var et=null,Wt=!1;function Ti(i,r,o){for(o=o.child;o!==null;)hv(i,r,o),o=o.sibling}function hv(i,r,o){if(on&&typeof on.onCommitFiberUnmount=="function")try{on.onCommitFiberUnmount(Da,o)}catch{}switch(o.tag){case 26:ct||Xn(o,r),Ti(i,r,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:ct||Xn(o,r);var l=et,f=Wt;os(o.type)&&(et=o.stateNode,Wt=!1),Ti(i,r,o),xo(o.stateNode),et=l,Wt=f;break;case 5:ct||Xn(o,r);case 6:if(l=et,f=Wt,et=null,Ti(i,r,o),et=l,Wt=f,et!==null)if(Wt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(o.stateNode)}catch(m){Pe(o,r,m)}else try{et.removeChild(o.stateNode)}catch(m){Pe(o,r,m)}break;case 18:et!==null&&(Wt?(i=et,t0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),Co(i)):t0(et,o.stateNode));break;case 4:l=et,f=Wt,et=o.stateNode.containerInfo,Wt=!0,Ti(i,r,o),et=l,Wt=f;break;case 0:case 11:case 14:case 15:ct||Wi(2,o,r),ct||Wi(4,o,r),Ti(i,r,o);break;case 1:ct||(Xn(o,r),l=o.stateNode,typeof l.componentWillUnmount=="function"&&av(o,r,l)),Ti(i,r,o);break;case 21:Ti(i,r,o);break;case 22:ct=(l=ct)||o.memoizedState!==null,Ti(i,r,o),ct=l;break;default:Ti(i,r,o)}}function pv(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Co(i)}catch(o){Pe(r,r.return,o)}}function oM(i){switch(i.tag){case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new cv),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new cv),r;default:throw Error(s(435,i.tag))}}function Nd(i,r){var o=oM(i);r.forEach(function(l){var f=yM.bind(null,i,l);o.has(l)||(o.add(l),l.then(f,f))})}function fn(i,r){var o=r.deletions;if(o!==null)for(var l=0;l<o.length;l++){var f=o[l],m=i,b=r,x=b;e:for(;x!==null;){switch(x.tag){case 27:if(os(x.type)){et=x.stateNode,Wt=!1;break e}break;case 5:et=x.stateNode,Wt=!1;break e;case 3:case 4:et=x.stateNode.containerInfo,Wt=!0;break e}x=x.return}if(et===null)throw Error(s(160));hv(m,b,f),et=null,Wt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)mv(r,i),r=r.sibling}var Vn=null;function mv(i,r){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:fn(r,i),dn(i),l&4&&(Wi(3,i,i.return),co(3,i),Wi(5,i,i.return));break;case 1:fn(r,i),dn(i),l&512&&(ct||o===null||Xn(o,o.return)),l&64&&Ai&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var f=Vn;if(fn(r,i),dn(i),l&512&&(ct||o===null||Xn(o,o.return)),l&4){var m=o!==null?o.memoizedState:null;if(l=i.memoizedState,o===null)if(l===null)if(i.stateNode===null){e:{l=i.type,o=i.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Ba]||m[jt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(l),f.head.insertBefore(m,f.querySelector("head > title"))),Bt(m,l,o),m[jt]=i,Rt(m),l=m;break e;case"link":var b=u0("link","href",f).get(l+(o.href||""));if(b){for(var x=0;x<b.length;x++)if(m=b[x],m.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&m.getAttribute("rel")===(o.rel==null?null:o.rel)&&m.getAttribute("title")===(o.title==null?null:o.title)&&m.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){b.splice(x,1);break t}}m=f.createElement(l),Bt(m,l,o),f.head.appendChild(m);break;case"meta":if(b=u0("meta","content",f).get(l+(o.content||""))){for(x=0;x<b.length;x++)if(m=b[x],m.getAttribute("content")===(o.content==null?null:""+o.content)&&m.getAttribute("name")===(o.name==null?null:o.name)&&m.getAttribute("property")===(o.property==null?null:o.property)&&m.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&m.getAttribute("charset")===(o.charSet==null?null:o.charSet)){b.splice(x,1);break t}}m=f.createElement(l),Bt(m,l,o),f.head.appendChild(m);break;default:throw Error(s(468,l))}m[jt]=i,Rt(m),l=m}i.stateNode=l}else c0(f,i.type,i.stateNode);else i.stateNode=l0(f,l,i.memoizedProps);else m!==l?(m===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):m.count--,l===null?c0(f,i.type,i.stateNode):l0(f,l,i.memoizedProps)):l===null&&i.stateNode!==null&&Cd(i,i.memoizedProps,o.memoizedProps)}break;case 27:fn(r,i),dn(i),l&512&&(ct||o===null||Xn(o,o.return)),o!==null&&l&4&&Cd(i,i.memoizedProps,o.memoizedProps);break;case 5:if(fn(r,i),dn(i),l&512&&(ct||o===null||Xn(o,o.return)),i.flags&32){f=i.stateNode;try{br(f,"")}catch(V){Pe(i,i.return,V)}}l&4&&i.stateNode!=null&&(f=i.memoizedProps,Cd(i,f,o!==null?o.memoizedProps:f)),l&1024&&(Dd=!0);break;case 6:if(fn(r,i),dn(i),l&4){if(i.stateNode===null)throw Error(s(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(V){Pe(i,i.return,V)}}break;case 3:if(Au=null,f=Vn,Vn=xu(r.containerInfo),fn(r,i),Vn=f,dn(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{Co(r.containerInfo)}catch(V){Pe(i,i.return,V)}Dd&&(Dd=!1,yv(i));break;case 4:l=Vn,Vn=xu(i.stateNode.containerInfo),fn(r,i),dn(i),Vn=l;break;case 12:fn(r,i),dn(i);break;case 13:fn(r,i),dn(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(zd=Ke()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Nd(i,l)));break;case 22:f=i.memoizedState!==null;var R=o!==null&&o.memoizedState!==null,N=Ai,K=ct;if(Ai=N||f,ct=K||R,fn(r,i),ct=K,Ai=N,dn(i),l&8192)e:for(r=i.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(o===null||R||Ai||ct||qs(i)),o=null,r=i;;){if(r.tag===5||r.tag===26){if(o===null){R=o=r;try{if(m=R.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{x=R.stateNode;var H=R.memoizedProps.style,B=H!=null&&H.hasOwnProperty("display")?H.display:null;x.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(V){Pe(R,R.return,V)}}}else if(r.tag===6){if(o===null){R=r;try{R.stateNode.nodeValue=f?"":R.memoizedProps}catch(V){Pe(R,R.return,V)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;o===r&&(o=null),r=r.return}o===r&&(o=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=i.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,Nd(i,o))));break;case 19:fn(r,i),dn(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Nd(i,l)));break;case 30:break;case 21:break;default:fn(r,i),dn(i)}}function dn(i){var r=i.flags;if(r&2){try{for(var o,l=i.return;l!==null;){if(lv(l)){o=l;break}l=l.return}if(o==null)throw Error(s(160));switch(o.tag){case 27:var f=o.stateNode,m=_d(i);lu(i,m,f);break;case 5:var b=o.stateNode;o.flags&32&&(br(b,""),o.flags&=-33);var x=_d(i);lu(i,x,b);break;case 3:case 4:var R=o.stateNode.containerInfo,N=_d(i);kd(i,N,R);break;default:throw Error(s(161))}}catch(K){Pe(i,i.return,K)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function yv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;yv(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function es(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)fv(i,r.alternate,r),r=r.sibling}function qs(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:Wi(4,r,r.return),qs(r);break;case 1:Xn(r,r.return);var o=r.stateNode;typeof o.componentWillUnmount=="function"&&av(r,r.return,o),qs(r);break;case 27:xo(r.stateNode);case 26:case 5:Xn(r,r.return),qs(r);break;case 22:r.memoizedState===null&&qs(r);break;case 30:qs(r);break;default:qs(r)}i=i.sibling}}function ts(i,r,o){for(o=o&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,f=i,m=r,b=m.flags;switch(m.tag){case 0:case 11:case 15:ts(f,m,o),co(4,m);break;case 1:if(ts(f,m,o),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(N){Pe(l,l.return,N)}if(l=m,f=l.updateQueue,f!==null){var x=l.stateNode;try{var R=f.shared.hiddenCallbacks;if(R!==null)for(f.shared.hiddenCallbacks=null,f=0;f<R.length;f++)Hg(R[f],x)}catch(N){Pe(l,l.return,N)}}o&&b&64&&rv(m),fo(m,m.return);break;case 27:uv(m);case 26:case 5:ts(f,m,o),o&&l===null&&b&4&&ov(m),fo(m,m.return);break;case 12:ts(f,m,o);break;case 13:ts(f,m,o),o&&b&4&&pv(f,m);break;case 22:m.memoizedState===null&&ts(f,m,o),fo(m,m.return);break;case 30:break;default:ts(f,m,o)}r=r.sibling}}function $d(i,r){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&Za(o))}function Bd(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Za(i))}function Zn(i,r,o,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)gv(i,r,o,l),r=r.sibling}function gv(i,r,o,l){var f=r.flags;switch(r.tag){case 0:case 11:case 15:Zn(i,r,o,l),f&2048&&co(9,r);break;case 1:Zn(i,r,o,l);break;case 3:Zn(i,r,o,l),f&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&Za(i)));break;case 12:if(f&2048){Zn(i,r,o,l),i=r.stateNode;try{var m=r.memoizedProps,b=m.id,x=m.onPostCommit;typeof x=="function"&&x(b,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(R){Pe(r,r.return,R)}}else Zn(i,r,o,l);break;case 13:Zn(i,r,o,l);break;case 23:break;case 22:m=r.stateNode,b=r.alternate,r.memoizedState!==null?m._visibility&2?Zn(i,r,o,l):ho(i,r):m._visibility&2?Zn(i,r,o,l):(m._visibility|=2,Vr(i,r,o,l,(r.subtreeFlags&10256)!==0)),f&2048&&$d(b,r);break;case 24:Zn(i,r,o,l),f&2048&&Bd(r.alternate,r);break;default:Zn(i,r,o,l)}}function Vr(i,r,o,l,f){for(f=f&&(r.subtreeFlags&10256)!==0,r=r.child;r!==null;){var m=i,b=r,x=o,R=l,N=b.flags;switch(b.tag){case 0:case 11:case 15:Vr(m,b,x,R,f),co(8,b);break;case 23:break;case 22:var K=b.stateNode;b.memoizedState!==null?K._visibility&2?Vr(m,b,x,R,f):ho(m,b):(K._visibility|=2,Vr(m,b,x,R,f)),f&&N&2048&&$d(b.alternate,b);break;case 24:Vr(m,b,x,R,f),f&&N&2048&&Bd(b.alternate,b);break;default:Vr(m,b,x,R,f)}r=r.sibling}}function ho(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var o=i,l=r,f=l.flags;switch(l.tag){case 22:ho(o,l),f&2048&&$d(l.alternate,l);break;case 24:ho(o,l),f&2048&&Bd(l.alternate,l);break;default:ho(o,l)}r=r.sibling}}var po=8192;function jr(i){if(i.subtreeFlags&po)for(i=i.child;i!==null;)bv(i),i=i.sibling}function bv(i){switch(i.tag){case 26:jr(i),i.flags&po&&i.memoizedState!==null&&GM(Vn,i.memoizedState,i.memoizedProps);break;case 5:jr(i);break;case 3:case 4:var r=Vn;Vn=xu(i.stateNode.containerInfo),jr(i),Vn=r;break;case 22:i.memoizedState===null&&(r=i.alternate,r!==null&&r.memoizedState!==null?(r=po,po=16777216,jr(i),po=r):jr(i));break;default:jr(i)}}function vv(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function mo(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];Mt=l,xv(l,i)}vv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Sv(i),i=i.sibling}function Sv(i){switch(i.tag){case 0:case 11:case 15:mo(i),i.flags&2048&&Wi(9,i,i.return);break;case 3:mo(i);break;case 12:mo(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,uu(i)):mo(i);break;default:mo(i)}}function uu(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var o=0;o<r.length;o++){var l=r[o];Mt=l,xv(l,i)}vv(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:Wi(8,r,r.return),uu(r);break;case 22:o=r.stateNode,o._visibility&2&&(o._visibility&=-3,uu(r));break;default:uu(r)}i=i.sibling}}function xv(i,r){for(;Mt!==null;){var o=Mt;switch(o.tag){case 0:case 11:case 15:Wi(8,o,r);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Za(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,Mt=l;else e:for(o=i;Mt!==null;){l=Mt;var f=l.sibling,m=l.return;if(dv(l),l===o){Mt=null;break e}if(f!==null){f.return=m,Mt=f;break e}Mt=m}}}var lM={getCacheForType:function(i){var r=zt(vt),o=r.data.get(i);return o===void 0&&(o=i(),r.data.set(i,o)),o}},uM=typeof WeakMap=="function"?WeakMap:Map,Le=0,Fe=null,Ee=null,Ce=0,Ve=0,hn=null,ns=!1,zr=!1,Ld=!1,Ei=0,rt=0,is=0,Ks=0,Vd=0,On=0,Ur=0,yo=null,en=null,jd=!1,zd=0,cu=1/0,fu=null,ss=null,$t=0,rs=null,qr=null,Kr=0,Ud=0,qd=null,wv=null,go=0,Kd=null;function pn(){if((Le&2)!==0&&Ce!==0)return Ce&-Ce;if(L.T!==null){var i=Cr;return i!==0?i:Xd()}return jy()}function Av(){On===0&&(On=(Ce&536870912)===0||$e?$y():536870912);var i=Rn.current;return i!==null&&(i.flags|=32),On}function mn(i,r,o){(i===Fe&&(Ve===2||Ve===9)||i.cancelPendingCommit!==null)&&(Pr(i,0),as(i,Ce,On,!1)),$a(i,o),((Le&2)===0||i!==Fe)&&(i===Fe&&((Le&2)===0&&(Ks|=o),rt===4&&as(i,Ce,On,!1)),Jn(i))}function Tv(i,r,o){if((Le&6)!==0)throw Error(s(327));var l=!o&&(r&124)===0&&(r&i.expiredLanes)===0||Na(i,r),f=l?dM(i,r):Hd(i,r,!0),m=l;do{if(f===0){zr&&!l&&as(i,r,0,!1);break}else{if(o=i.current.alternate,m&&!cM(o)){f=Hd(i,r,!1),m=!1;continue}if(f===2){if(m=r,i.errorRecoveryDisabledLanes&m)var b=0;else b=i.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){r=b;e:{var x=i;f=yo;var R=x.current.memoizedState.isDehydrated;if(R&&(Pr(x,b).flags|=256),b=Hd(x,b,!1),b!==2){if(Ld&&!R){x.errorRecoveryDisabledLanes|=m,Ks|=m,f=4;break e}m=en,en=f,m!==null&&(en===null?en=m:en.push.apply(en,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Pr(i,0),as(i,r,0,!0);break}e:{switch(l=i,m=f,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:as(l,r,On,!ns);break e;case 2:en=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=zd+300-Ke(),10<f)){if(as(l,r,On,!ns),wl(l,0,!0)!==0)break e;l.timeoutHandle=Wv(Ev.bind(null,l,o,en,fu,jd,r,On,Ks,Ur,ns,m,2,-0,0),f);break e}Ev(l,o,en,fu,jd,r,On,Ks,Ur,ns,m,0,-0,0)}}break}while(!0);Jn(i)}function Ev(i,r,o,l,f,m,b,x,R,N,K,H,B,V){if(i.timeoutHandle=-1,H=r.subtreeFlags,(H&8192||(H&16785408)===16785408)&&(To={stylesheets:null,count:0,unsuspend:HM},bv(r),H=FM(),H!==null)){i.cancelPendingCommit=H(Dv.bind(null,i,r,m,o,l,f,b,x,R,K,1,B,V)),as(i,m,b,!N);return}Dv(i,r,m,o,l,f,b,x,R)}function cM(i){for(var r=i;;){var o=r.tag;if((o===0||o===11||o===15)&&r.flags&16384&&(o=r.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var f=o[l],m=f.getSnapshot;f=f.value;try{if(!un(m(),f))return!1}catch{return!1}}if(o=r.child,r.subtreeFlags&16384&&o!==null)o.return=r,r=o;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function as(i,r,o,l){r&=~Vd,r&=~Ks,i.suspendedLanes|=r,i.pingedLanes&=~r,l&&(i.warmLanes|=r),l=i.expirationTimes;for(var f=r;0<f;){var m=31-ln(f),b=1<<m;l[m]=-1,f&=~b}o!==0&&Ly(i,o,r)}function du(){return(Le&6)===0?(bo(0),!1):!0}function Pd(){if(Ee!==null){if(Ve===0)var i=Ee.return;else i=Ee,gi=Ls=null,ad(i),Br=null,oo=0,i=Ee;for(;i!==null;)sv(i.alternate,i),i=i.return;Ee=null}}function Pr(i,r){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,MM(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Pd(),Fe=i,Ee=o=pi(i.current,null),Ce=r,Ve=0,hn=null,ns=!1,zr=Na(i,r),Ld=!1,Ur=On=Vd=Ks=is=rt=0,en=yo=null,jd=!1,(r&8)!==0&&(r|=r&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=r;0<l;){var f=31-ln(l),m=1<<f;r|=i[f],l&=~m}return Ei=r,$l(),o}function Rv(i,r){Se=null,L.H=Wl,r===Qa||r===Pl?(r=Pg(),Ve=3):r===Ug?(r=Pg(),Ve=4):Ve=r===Ib?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,hn=r,Ee===null&&(rt=1,su(i,wn(r,i.current)))}function Ov(){var i=L.H;return L.H=Wl,i===null?Wl:i}function Mv(){var i=L.A;return L.A=lM,i}function Id(){rt=4,ns||(Ce&4194048)!==Ce&&Rn.current!==null||(zr=!0),(is&134217727)===0&&(Ks&134217727)===0||Fe===null||as(Fe,Ce,On,!1)}function Hd(i,r,o){var l=Le;Le|=2;var f=Ov(),m=Mv();(Fe!==i||Ce!==r)&&(fu=null,Pr(i,r)),r=!1;var b=rt;e:do try{if(Ve!==0&&Ee!==null){var x=Ee,R=hn;switch(Ve){case 8:Pd(),b=6;break e;case 3:case 2:case 9:case 6:Rn.current===null&&(r=!0);var N=Ve;if(Ve=0,hn=null,Ir(i,x,R,N),o&&zr){b=0;break e}break;default:N=Ve,Ve=0,hn=null,Ir(i,x,R,N)}}fM(),b=rt;break}catch(K){Rv(i,K)}while(!0);return r&&i.shellSuspendCounter++,gi=Ls=null,Le=l,L.H=f,L.A=m,Ee===null&&(Fe=null,Ce=0,$l()),b}function fM(){for(;Ee!==null;)Cv(Ee)}function dM(i,r){var o=Le;Le|=2;var l=Ov(),f=Mv();Fe!==i||Ce!==r?(fu=null,cu=Ke()+500,Pr(i,r)):zr=Na(i,r);e:do try{if(Ve!==0&&Ee!==null){r=Ee;var m=hn;t:switch(Ve){case 1:Ve=0,hn=null,Ir(i,r,m,1);break;case 2:case 9:if(qg(m)){Ve=0,hn=null,_v(r);break}r=function(){Ve!==2&&Ve!==9||Fe!==i||(Ve=7),Jn(i)},m.then(r,r);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:qg(m)?(Ve=0,hn=null,_v(r)):(Ve=0,hn=null,Ir(i,r,m,7));break;case 5:var b=null;switch(Ee.tag){case 26:b=Ee.memoizedState;case 5:case 27:var x=Ee;if(!b||f0(b)){Ve=0,hn=null;var R=x.sibling;if(R!==null)Ee=R;else{var N=x.return;N!==null?(Ee=N,hu(N)):Ee=null}break t}}Ve=0,hn=null,Ir(i,r,m,5);break;case 6:Ve=0,hn=null,Ir(i,r,m,6);break;case 8:Pd(),rt=6;break e;default:throw Error(s(462))}}hM();break}catch(K){Rv(i,K)}while(!0);return gi=Ls=null,L.H=l,L.A=f,Le=o,Ee!==null?0:(Fe=null,Ce=0,$l(),rt)}function hM(){for(;Ee!==null&&!Qe();)Cv(Ee)}function Cv(i){var r=nv(i.alternate,i,Ei);i.memoizedProps=i.pendingProps,r===null?hu(i):Ee=r}function _v(i){var r=i,o=r.alternate;switch(r.tag){case 15:case 0:r=Zb(o,r,r.pendingProps,r.type,void 0,Ce);break;case 11:r=Zb(o,r,r.pendingProps,r.type.render,r.ref,Ce);break;case 5:ad(r);default:sv(o,r),r=Ee=kg(r,Ei),r=nv(o,r,Ei)}i.memoizedProps=i.pendingProps,r===null?hu(i):Ee=r}function Ir(i,r,o,l){gi=Ls=null,ad(r),Br=null,oo=0;var f=r.return;try{if(nM(i,f,r,o,Ce)){rt=1,su(i,wn(o,i.current)),Ee=null;return}}catch(m){if(f!==null)throw Ee=f,m;rt=1,su(i,wn(o,i.current)),Ee=null;return}r.flags&32768?($e||l===1?i=!0:zr||(Ce&536870912)!==0?i=!1:(ns=i=!0,(l===2||l===9||l===3||l===6)&&(l=Rn.current,l!==null&&l.tag===13&&(l.flags|=16384))),kv(r,i)):hu(r)}function hu(i){var r=i;do{if((r.flags&32768)!==0){kv(r,ns);return}i=r.return;var o=sM(r.alternate,r,Ei);if(o!==null){Ee=o;return}if(r=r.sibling,r!==null){Ee=r;return}Ee=r=i}while(r!==null);rt===0&&(rt=5)}function kv(i,r){do{var o=rM(i.alternate,i);if(o!==null){o.flags&=32767,Ee=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!r&&(i=i.sibling,i!==null)){Ee=i;return}Ee=i=o}while(i!==null);rt=6,Ee=null}function Dv(i,r,o,l,f,m,b,x,R){i.cancelPendingCommit=null;do pu();while($t!==0);if((Le&6)!==0)throw Error(s(327));if(r!==null){if(r===i.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=Bf,HR(i,o,m,b,x,R),i===Fe&&(Ee=Fe=null,Ce=0),qr=r,rs=i,Kr=o,Ud=m,qd=f,wv=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,gM(an,function(){return Vv(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=L.T,L.T=null,f=I.p,I.p=2,b=Le,Le|=4;try{aM(i,r,o)}finally{Le=b,I.p=f,L.T=l}}$t=1,Nv(),$v(),Bv()}}function Nv(){if($t===1){$t=0;var i=rs,r=qr,o=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||o){o=L.T,L.T=null;var l=I.p;I.p=2;var f=Le;Le|=4;try{mv(r,i);var m=ih,b=xg(i.containerInfo),x=m.focusedElem,R=m.selectionRange;if(b!==x&&x&&x.ownerDocument&&Sg(x.ownerDocument.documentElement,x)){if(R!==null&&_f(x)){var N=R.start,K=R.end;if(K===void 0&&(K=N),"selectionStart"in x)x.selectionStart=N,x.selectionEnd=Math.min(K,x.value.length);else{var H=x.ownerDocument||document,B=H&&H.defaultView||window;if(B.getSelection){var V=B.getSelection(),de=x.textContent.length,ue=Math.min(R.start,de),Ue=R.end===void 0?ue:Math.min(R.end,de);!V.extend&&ue>Ue&&(b=Ue,Ue=ue,ue=b);var _=vg(x,ue),O=vg(x,Ue);if(_&&O&&(V.rangeCount!==1||V.anchorNode!==_.node||V.anchorOffset!==_.offset||V.focusNode!==O.node||V.focusOffset!==O.offset)){var D=H.createRange();D.setStart(_.node,_.offset),V.removeAllRanges(),ue>Ue?(V.addRange(D),V.extend(O.node,O.offset)):(D.setEnd(O.node,O.offset),V.addRange(D))}}}}for(H=[],V=x;V=V.parentNode;)V.nodeType===1&&H.push({element:V,left:V.scrollLeft,top:V.scrollTop});for(typeof x.focus=="function"&&x.focus(),x=0;x<H.length;x++){var P=H[x];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}Ru=!!nh,ih=nh=null}finally{Le=f,I.p=l,L.T=o}}i.current=r,$t=2}}function $v(){if($t===2){$t=0;var i=rs,r=qr,o=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||o){o=L.T,L.T=null;var l=I.p;I.p=2;var f=Le;Le|=4;try{fv(i,r.alternate,r)}finally{Le=f,I.p=l,L.T=o}}$t=3}}function Bv(){if($t===4||$t===3){$t=0,Gn();var i=rs,r=qr,o=Kr,l=wv;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?$t=5:($t=0,qr=rs=null,Lv(i,i.pendingLanes));var f=i.pendingLanes;if(f===0&&(ss=null),uf(o),r=r.stateNode,on&&typeof on.onCommitFiberRoot=="function")try{on.onCommitFiberRoot(Da,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=L.T,f=I.p,I.p=2,L.T=null;try{for(var m=i.onRecoverableError,b=0;b<l.length;b++){var x=l[b];m(x.value,{componentStack:x.stack})}}finally{L.T=r,I.p=f}}(Kr&3)!==0&&pu(),Jn(i),f=i.pendingLanes,(o&4194090)!==0&&(f&42)!==0?i===Kd?go++:(go=0,Kd=i):go=0,bo(0)}}function Lv(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,Za(r)))}function pu(i){return Nv(),$v(),Bv(),Vv()}function Vv(){if($t!==5)return!1;var i=rs,r=Ud;Ud=0;var o=uf(Kr),l=L.T,f=I.p;try{I.p=32>o?32:o,L.T=null,o=qd,qd=null;var m=rs,b=Kr;if($t=0,qr=rs=null,Kr=0,(Le&6)!==0)throw Error(s(331));var x=Le;if(Le|=4,Sv(m.current),gv(m,m.current,b,o),Le=x,bo(0,!1),on&&typeof on.onPostCommitFiberRoot=="function")try{on.onPostCommitFiberRoot(Da,m)}catch{}return!0}finally{I.p=f,L.T=l,Lv(i,r)}}function jv(i,r,o){r=wn(o,r),r=Sd(i.stateNode,r,2),i=Xi(i,r,2),i!==null&&($a(i,2),Jn(i))}function Pe(i,r,o){if(i.tag===3)jv(i,i,o);else for(;r!==null;){if(r.tag===3){jv(r,i,o);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ss===null||!ss.has(l))){i=wn(o,i),o=Kb(2),l=Xi(r,o,2),l!==null&&(Pb(o,l,r,i),$a(l,2),Jn(l));break}}r=r.return}}function Gd(i,r,o){var l=i.pingCache;if(l===null){l=i.pingCache=new uM;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(o)||(Ld=!0,f.add(o),i=pM.bind(null,i,r,o),r.then(i,i))}function pM(i,r,o){var l=i.pingCache;l!==null&&l.delete(r),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,Fe===i&&(Ce&o)===o&&(rt===4||rt===3&&(Ce&62914560)===Ce&&300>Ke()-zd?(Le&2)===0&&Pr(i,0):Vd|=o,Ur===Ce&&(Ur=0)),Jn(i)}function zv(i,r){r===0&&(r=By()),i=Er(i,r),i!==null&&($a(i,r),Jn(i))}function mM(i){var r=i.memoizedState,o=0;r!==null&&(o=r.retryLane),zv(i,o)}function yM(i,r){var o=0;switch(i.tag){case 13:var l=i.stateNode,f=i.memoizedState;f!==null&&(o=f.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),zv(i,o)}function gM(i,r){return we(i,r)}var mu=null,Hr=null,Fd=!1,yu=!1,Yd=!1,Ps=0;function Jn(i){i!==Hr&&i.next===null&&(Hr===null?mu=Hr=i:Hr=Hr.next=i),yu=!0,Fd||(Fd=!0,vM())}function bo(i,r){if(!Yd&&yu){Yd=!0;do for(var o=!1,l=mu;l!==null;){if(i!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var b=l.suspendedLanes,x=l.pingedLanes;m=(1<<31-ln(42|i)+1)-1,m&=f&~(b&~x),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(o=!0,Pv(l,m))}else m=Ce,m=wl(l,l===Fe?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Na(l,m)||(o=!0,Pv(l,m));l=l.next}while(o);Yd=!1}}function bM(){Uv()}function Uv(){yu=Fd=!1;var i=0;Ps!==0&&(OM()&&(i=Ps),Ps=0);for(var r=Ke(),o=null,l=mu;l!==null;){var f=l.next,m=qv(l,r);m===0?(l.next=null,o===null?mu=f:o.next=f,f===null&&(Hr=o)):(o=l,(i!==0||(m&3)!==0)&&(yu=!0)),l=f}bo(i)}function qv(i,r){for(var o=i.suspendedLanes,l=i.pingedLanes,f=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var b=31-ln(m),x=1<<b,R=f[b];R===-1?((x&o)===0||(x&l)!==0)&&(f[b]=IR(x,r)):R<=r&&(i.expiredLanes|=x),m&=~x}if(r=Fe,o=Ce,o=wl(i,i===r?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===r&&(Ve===2||Ve===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&Me(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||Na(i,o)){if(r=o&-o,r===i.callbackPriority)return r;switch(l!==null&&Me(l),uf(o)){case 2:case 8:o=Ze;break;case 32:o=an;break;case 268435456:o=Ny;break;default:o=an}return l=Kv.bind(null,i),o=we(o,l),i.callbackPriority=r,i.callbackNode=o,r}return l!==null&&l!==null&&Me(l),i.callbackPriority=2,i.callbackNode=null,2}function Kv(i,r){if($t!==0&&$t!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(pu()&&i.callbackNode!==o)return null;var l=Ce;return l=wl(i,i===Fe?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(Tv(i,l,r),qv(i,Ke()),i.callbackNode!=null&&i.callbackNode===o?Kv.bind(null,i):null)}function Pv(i,r){if(pu())return null;Tv(i,r,!0)}function vM(){CM(function(){(Le&6)!==0?we(We,bM):Uv()})}function Xd(){return Ps===0&&(Ps=$y()),Ps}function Iv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ol(""+i)}function Hv(i,r){var o=r.ownerDocument.createElement("input");return o.name=r.name,o.value=r.value,i.id&&o.setAttribute("form",i.id),r.parentNode.insertBefore(o,r),i=new FormData(i),o.parentNode.removeChild(o),i}function SM(i,r,o,l,f){if(r==="submit"&&o&&o.stateNode===f){var m=Iv((f[Zt]||null).action),b=l.submitter;b&&(r=(r=b[Zt]||null)?Iv(r.formAction):b.getAttribute("formAction"),r!==null&&(m=r,b=null));var x=new kl("action","action",null,l,f);i.push({event:x,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Ps!==0){var R=b?Hv(f,b):new FormData(f);md(o,{pending:!0,data:R,method:f.method,action:m},null,R)}}else typeof m=="function"&&(x.preventDefault(),R=b?Hv(f,b):new FormData(f),md(o,{pending:!0,data:R,method:f.method,action:m},m,R))},currentTarget:f}]})}}for(var Zd=0;Zd<$f.length;Zd++){var Jd=$f[Zd],xM=Jd.toLowerCase(),wM=Jd[0].toUpperCase()+Jd.slice(1);Ln(xM,"on"+wM)}Ln(Tg,"onAnimationEnd"),Ln(Eg,"onAnimationIteration"),Ln(Rg,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(zO,"onTransitionRun"),Ln(UO,"onTransitionStart"),Ln(qO,"onTransitionCancel"),Ln(Og,"onTransitionEnd"),mr("onMouseEnter",["mouseout","mouseover"]),mr("onMouseLeave",["mouseout","mouseover"]),mr("onPointerEnter",["pointerout","pointerover"]),mr("onPointerLeave",["pointerout","pointerover"]),Os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Os("onBeforeInput",["compositionend","keypress","textInput","paste"]),Os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),AM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function Gv(i,r){r=(r&4)!==0;for(var o=0;o<i.length;o++){var l=i[o],f=l.event;l=l.listeners;e:{var m=void 0;if(r)for(var b=l.length-1;0<=b;b--){var x=l[b],R=x.instance,N=x.currentTarget;if(x=x.listener,R!==m&&f.isPropagationStopped())break e;m=x,f.currentTarget=N;try{m(f)}catch(K){iu(K)}f.currentTarget=null,m=R}else for(b=0;b<l.length;b++){if(x=l[b],R=x.instance,N=x.currentTarget,x=x.listener,R!==m&&f.isPropagationStopped())break e;m=x,f.currentTarget=N;try{m(f)}catch(K){iu(K)}f.currentTarget=null,m=R}}}}function Re(i,r){var o=r[cf];o===void 0&&(o=r[cf]=new Set);var l=i+"__bubble";o.has(l)||(Fv(r,i,2,!1),o.add(l))}function Qd(i,r,o){var l=0;r&&(l|=4),Fv(o,i,l,r)}var gu="_reactListening"+Math.random().toString(36).slice(2);function Wd(i){if(!i[gu]){i[gu]=!0,Uy.forEach(function(o){o!=="selectionchange"&&(AM.has(o)||Qd(o,!1,i),Qd(o,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[gu]||(r[gu]=!0,Qd("selectionchange",!1,r))}}function Fv(i,r,o,l){switch(g0(r)){case 2:var f=ZM;break;case 8:f=JM;break;default:f=hh}o=f.bind(null,r,o,i),f=void 0,!xf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f!==void 0?i.addEventListener(r,o,{capture:!0,passive:f}):i.addEventListener(r,o,!0):f!==void 0?i.addEventListener(r,o,{passive:f}):i.addEventListener(r,o,!1)}function eh(i,r,o,l,f){var m=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var x=l.stateNode.containerInfo;if(x===f)break;if(b===4)for(b=l.return;b!==null;){var R=b.tag;if((R===3||R===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;x!==null;){if(b=dr(x),b===null)return;if(R=b.tag,R===5||R===6||R===26||R===27){l=m=b;continue e}x=x.parentNode}}l=l.return}eg(function(){var N=m,K=vf(o),H=[];e:{var B=Mg.get(i);if(B!==void 0){var V=kl,de=i;switch(i){case"keypress":if(Cl(o)===0)break e;case"keydown":case"keyup":V=gO;break;case"focusin":de="focus",V=Ef;break;case"focusout":de="blur",V=Ef;break;case"beforeblur":case"afterblur":V=Ef;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":V=ig;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":V=rO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":V=SO;break;case Tg:case Eg:case Rg:V=lO;break;case Og:V=wO;break;case"scroll":case"scrollend":V=iO;break;case"wheel":V=TO;break;case"copy":case"cut":case"paste":V=cO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":V=rg;break;case"toggle":case"beforetoggle":V=RO}var ue=(r&4)!==0,Ue=!ue&&(i==="scroll"||i==="scrollend"),_=ue?B!==null?B+"Capture":null:B;ue=[];for(var O=N,D;O!==null;){var P=O;if(D=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||D===null||_===null||(P=Va(O,_),P!=null&&ue.push(So(O,P,D))),Ue)break;O=O.return}0<ue.length&&(B=new V(B,de,null,o,K),H.push({event:B,listeners:ue}))}}if((r&7)===0){e:{if(B=i==="mouseover"||i==="pointerover",V=i==="mouseout"||i==="pointerout",B&&o!==bf&&(de=o.relatedTarget||o.fromElement)&&(dr(de)||de[fr]))break e;if((V||B)&&(B=K.window===K?K:(B=K.ownerDocument)?B.defaultView||B.parentWindow:window,V?(de=o.relatedTarget||o.toElement,V=N,de=de?dr(de):null,de!==null&&(Ue=u(de),ue=de.tag,de!==Ue||ue!==5&&ue!==27&&ue!==6)&&(de=null)):(V=null,de=N),V!==de)){if(ue=ig,P="onMouseLeave",_="onMouseEnter",O="mouse",(i==="pointerout"||i==="pointerover")&&(ue=rg,P="onPointerLeave",_="onPointerEnter",O="pointer"),Ue=V==null?B:La(V),D=de==null?B:La(de),B=new ue(P,O+"leave",V,o,K),B.target=Ue,B.relatedTarget=D,P=null,dr(K)===N&&(ue=new ue(_,O+"enter",de,o,K),ue.target=D,ue.relatedTarget=Ue,P=ue),Ue=P,V&&de)t:{for(ue=V,_=de,O=0,D=ue;D;D=Gr(D))O++;for(D=0,P=_;P;P=Gr(P))D++;for(;0<O-D;)ue=Gr(ue),O--;for(;0<D-O;)_=Gr(_),D--;for(;O--;){if(ue===_||_!==null&&ue===_.alternate)break t;ue=Gr(ue),_=Gr(_)}ue=null}else ue=null;V!==null&&Yv(H,B,V,ue,!1),de!==null&&Ue!==null&&Yv(H,Ue,de,ue,!0)}}e:{if(B=N?La(N):window,V=B.nodeName&&B.nodeName.toLowerCase(),V==="select"||V==="input"&&B.type==="file")var se=hg;else if(fg(B))if(pg)se=LO;else{se=$O;var Ae=NO}else V=B.nodeName,!V||V.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?N&&gf(N.elementType)&&(se=hg):se=BO;if(se&&(se=se(i,N))){dg(H,se,o,K);break e}Ae&&Ae(i,B,N),i==="focusout"&&N&&B.type==="number"&&N.memoizedProps.value!=null&&yf(B,"number",B.value)}switch(Ae=N?La(N):window,i){case"focusin":(fg(Ae)||Ae.contentEditable==="true")&&(wr=Ae,kf=N,Ha=null);break;case"focusout":Ha=kf=wr=null;break;case"mousedown":Df=!0;break;case"contextmenu":case"mouseup":case"dragend":Df=!1,wg(H,o,K);break;case"selectionchange":if(jO)break;case"keydown":case"keyup":wg(H,o,K)}var le;if(Of)e:{switch(i){case"compositionstart":var ce="onCompositionStart";break e;case"compositionend":ce="onCompositionEnd";break e;case"compositionupdate":ce="onCompositionUpdate";break e}ce=void 0}else xr?ug(i,o)&&(ce="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(ce="onCompositionStart");ce&&(ag&&o.locale!=="ko"&&(xr||ce!=="onCompositionStart"?ce==="onCompositionEnd"&&xr&&(le=tg()):(Hi=K,wf="value"in Hi?Hi.value:Hi.textContent,xr=!0)),Ae=bu(N,ce),0<Ae.length&&(ce=new sg(ce,i,null,o,K),H.push({event:ce,listeners:Ae}),le?ce.data=le:(le=cg(o),le!==null&&(ce.data=le)))),(le=MO?CO(i,o):_O(i,o))&&(ce=bu(N,"onBeforeInput"),0<ce.length&&(Ae=new sg("onBeforeInput","beforeinput",null,o,K),H.push({event:Ae,listeners:ce}),Ae.data=le)),SM(H,i,N,o,K)}Gv(H,r)})}function So(i,r,o){return{instance:i,listener:r,currentTarget:o}}function bu(i,r){for(var o=r+"Capture",l=[];i!==null;){var f=i,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Va(i,o),f!=null&&l.unshift(So(i,f,m)),f=Va(i,r),f!=null&&l.push(So(i,f,m))),i.tag===3)return l;i=i.return}return[]}function Gr(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Yv(i,r,o,l,f){for(var m=r._reactName,b=[];o!==null&&o!==l;){var x=o,R=x.alternate,N=x.stateNode;if(x=x.tag,R!==null&&R===l)break;x!==5&&x!==26&&x!==27||N===null||(R=N,f?(N=Va(o,m),N!=null&&b.unshift(So(o,N,R))):f||(N=Va(o,m),N!=null&&b.push(So(o,N,R)))),o=o.return}b.length!==0&&i.push({event:r,listeners:b})}var TM=/\r\n?/g,EM=/\u0000|\uFFFD/g;function Xv(i){return(typeof i=="string"?i:""+i).replace(TM,`
62
- `).replace(EM,"")}function Zv(i,r){return r=Xv(r),Xv(i)===r}function vu(){}function ze(i,r,o,l,f,m){switch(o){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||br(i,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&br(i,""+l);break;case"className":Tl(i,"class",l);break;case"tabIndex":Tl(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Tl(i,o,l);break;case"style":Qy(i,l,m);break;case"data":if(r!=="object"){Tl(i,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||o!=="href")){i.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Ol(""+l),i.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){i.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(o==="formAction"?(r!=="input"&&ze(i,r,"name",f.name,f,null),ze(i,r,"formEncType",f.formEncType,f,null),ze(i,r,"formMethod",f.formMethod,f,null),ze(i,r,"formTarget",f.formTarget,f,null)):(ze(i,r,"encType",f.encType,f,null),ze(i,r,"method",f.method,f,null),ze(i,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Ol(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=vu);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(s(60));i.innerHTML=o}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){i.removeAttribute("xlink:href");break}o=Ol(""+l),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""+l):i.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":l===!0?i.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,l):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(o,l):i.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(o):i.setAttribute(o,l);break;case"popover":Re("beforetoggle",i),Re("toggle",i),Al(i,"popover",l);break;case"xlinkActuate":di(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":di(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":di(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":di(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":di(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":di(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":di(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":di(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":di(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Al(i,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=tO.get(o)||o,Al(i,o,l))}}function th(i,r,o,l,f,m){switch(o){case"style":Qy(i,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(o=l.__html,o!=null){if(f.children!=null)throw Error(s(60));i.innerHTML=o}}break;case"children":typeof l=="string"?br(i,l):(typeof l=="number"||typeof l=="bigint")&&br(i,""+l);break;case"onScroll":l!=null&&Re("scroll",i);break;case"onScrollEnd":l!=null&&Re("scrollend",i);break;case"onClick":l!=null&&(i.onclick=vu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qy.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(f=o.endsWith("Capture"),r=o.slice(2,f?o.length-7:void 0),m=i[Zt]||null,m=m!=null?m[o]:null,typeof m=="function"&&i.removeEventListener(r,m,f),typeof l=="function")){typeof m!="function"&&m!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(r,l,f);break e}o in i?i[o]=l:l===!0?i.setAttribute(o,""):Al(i,o,l)}}}function Bt(i,r,o){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Re("error",i),Re("load",i);var l=!1,f=!1,m;for(m in o)if(o.hasOwnProperty(m)){var b=o[m];if(b!=null)switch(m){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ze(i,r,m,b,o,null)}}f&&ze(i,r,"srcSet",o.srcSet,o,null),l&&ze(i,r,"src",o.src,o,null);return;case"input":Re("invalid",i);var x=m=b=f=null,R=null,N=null;for(l in o)if(o.hasOwnProperty(l)){var K=o[l];if(K!=null)switch(l){case"name":f=K;break;case"type":b=K;break;case"checked":R=K;break;case"defaultChecked":N=K;break;case"value":m=K;break;case"defaultValue":x=K;break;case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(137,r));break;default:ze(i,r,l,K,o,null)}}Yy(i,m,x,R,N,b,f,!1),El(i);return;case"select":Re("invalid",i),l=b=m=null;for(f in o)if(o.hasOwnProperty(f)&&(x=o[f],x!=null))switch(f){case"value":m=x;break;case"defaultValue":b=x;break;case"multiple":l=x;default:ze(i,r,f,x,o,null)}r=m,o=b,i.multiple=!!l,r!=null?gr(i,!!l,r,!1):o!=null&&gr(i,!!l,o,!0);return;case"textarea":Re("invalid",i),m=f=l=null;for(b in o)if(o.hasOwnProperty(b)&&(x=o[b],x!=null))switch(b){case"value":l=x;break;case"defaultValue":f=x;break;case"children":m=x;break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(s(91));break;default:ze(i,r,b,x,o,null)}Zy(i,l,f,m),El(i);return;case"option":for(R in o)if(o.hasOwnProperty(R)&&(l=o[R],l!=null))switch(R){case"selected":i.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:ze(i,r,R,l,o,null)}return;case"dialog":Re("beforetoggle",i),Re("toggle",i),Re("cancel",i),Re("close",i);break;case"iframe":case"object":Re("load",i);break;case"video":case"audio":for(l=0;l<vo.length;l++)Re(vo[l],i);break;case"image":Re("error",i),Re("load",i);break;case"details":Re("toggle",i);break;case"embed":case"source":case"link":Re("error",i),Re("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(N in o)if(o.hasOwnProperty(N)&&(l=o[N],l!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:ze(i,r,N,l,o,null)}return;default:if(gf(r)){for(K in o)o.hasOwnProperty(K)&&(l=o[K],l!==void 0&&th(i,r,K,l,o,void 0));return}}for(x in o)o.hasOwnProperty(x)&&(l=o[x],l!=null&&ze(i,r,x,l,o,null))}function RM(i,r,o,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,x=null,R=null,N=null,K=null;for(V in o){var H=o[V];if(o.hasOwnProperty(V)&&H!=null)switch(V){case"checked":break;case"value":break;case"defaultValue":R=H;default:l.hasOwnProperty(V)||ze(i,r,V,null,l,H)}}for(var B in l){var V=l[B];if(H=o[B],l.hasOwnProperty(B)&&(V!=null||H!=null))switch(B){case"type":m=V;break;case"name":f=V;break;case"checked":N=V;break;case"defaultChecked":K=V;break;case"value":b=V;break;case"defaultValue":x=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(s(137,r));break;default:V!==H&&ze(i,r,B,V,l,H)}}mf(i,b,x,R,N,K,m,f);return;case"select":V=b=x=B=null;for(m in o)if(R=o[m],o.hasOwnProperty(m)&&R!=null)switch(m){case"value":break;case"multiple":V=R;default:l.hasOwnProperty(m)||ze(i,r,m,null,l,R)}for(f in l)if(m=l[f],R=o[f],l.hasOwnProperty(f)&&(m!=null||R!=null))switch(f){case"value":B=m;break;case"defaultValue":x=m;break;case"multiple":b=m;default:m!==R&&ze(i,r,f,m,l,R)}r=x,o=b,l=V,B!=null?gr(i,!!o,B,!1):!!l!=!!o&&(r!=null?gr(i,!!o,r,!0):gr(i,!!o,o?[]:"",!1));return;case"textarea":V=B=null;for(x in o)if(f=o[x],o.hasOwnProperty(x)&&f!=null&&!l.hasOwnProperty(x))switch(x){case"value":break;case"children":break;default:ze(i,r,x,null,l,f)}for(b in l)if(f=l[b],m=o[b],l.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":B=f;break;case"defaultValue":V=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==m&&ze(i,r,b,f,l,m)}Xy(i,B,V);return;case"option":for(var de in o)if(B=o[de],o.hasOwnProperty(de)&&B!=null&&!l.hasOwnProperty(de))switch(de){case"selected":i.selected=!1;break;default:ze(i,r,de,null,l,B)}for(R in l)if(B=l[R],V=o[R],l.hasOwnProperty(R)&&B!==V&&(B!=null||V!=null))switch(R){case"selected":i.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:ze(i,r,R,B,l,V)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in o)B=o[ue],o.hasOwnProperty(ue)&&B!=null&&!l.hasOwnProperty(ue)&&ze(i,r,ue,null,l,B);for(N in l)if(B=l[N],V=o[N],l.hasOwnProperty(N)&&B!==V&&(B!=null||V!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(137,r));break;default:ze(i,r,N,B,l,V)}return;default:if(gf(r)){for(var Ue in o)B=o[Ue],o.hasOwnProperty(Ue)&&B!==void 0&&!l.hasOwnProperty(Ue)&&th(i,r,Ue,void 0,l,B);for(K in l)B=l[K],V=o[K],!l.hasOwnProperty(K)||B===V||B===void 0&&V===void 0||th(i,r,K,B,l,V);return}}for(var _ in o)B=o[_],o.hasOwnProperty(_)&&B!=null&&!l.hasOwnProperty(_)&&ze(i,r,_,null,l,B);for(H in l)B=l[H],V=o[H],!l.hasOwnProperty(H)||B===V||B==null&&V==null||ze(i,r,H,B,l,V)}var nh=null,ih=null;function Su(i){return i.nodeType===9?i:i.ownerDocument}function Jv(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Qv(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function sh(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var rh=null;function OM(){var i=window.event;return i&&i.type==="popstate"?i===rh?!1:(rh=i,!0):(rh=null,!1)}var Wv=typeof setTimeout=="function"?setTimeout:void 0,MM=typeof clearTimeout=="function"?clearTimeout:void 0,e0=typeof Promise=="function"?Promise:void 0,CM=typeof queueMicrotask=="function"?queueMicrotask:typeof e0<"u"?function(i){return e0.resolve(null).then(i).catch(_M)}:Wv;function _M(i){setTimeout(function(){throw i})}function os(i){return i==="head"}function t0(i,r){var o=r,l=0,f=0;do{var m=o.nextSibling;if(i.removeChild(o),m&&m.nodeType===8)if(o=m.data,o==="/$"){if(0<l&&8>l){o=l;var b=i.ownerDocument;if(o&1&&xo(b.documentElement),o&2&&xo(b.body),o&4)for(o=b.head,xo(o),b=o.firstChild;b;){var x=b.nextSibling,R=b.nodeName;b[Ba]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&b.rel.toLowerCase()==="stylesheet"||o.removeChild(b),b=x}}if(f===0){i.removeChild(m),Co(r);return}f--}else o==="$"||o==="$?"||o==="$!"?f++:l=o.charCodeAt(0)-48;else l=0;o=m}while(o);Co(r)}function ah(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var o=r;switch(r=r.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":ah(o),ff(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function kM(i,r,o,l){for(;i.nodeType===1;){var f=o;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[Ba])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(m=i.getAttribute("rel"),m==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(m!==f.rel||i.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||i.getAttribute("title")!==(f.title==null?null:f.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(m=i.getAttribute("src"),(m!==(f.src==null?null:f.src)||i.getAttribute("type")!==(f.type==null?null:f.type)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&i.getAttribute("name")===m)return i}else return i;if(i=jn(i.nextSibling),i===null)break}return null}function DM(i,r,o){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=jn(i.nextSibling),i===null))return null;return i}function oh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function NM(i,r){var o=i.ownerDocument;if(i.data!=="$?"||o.readyState==="complete")r();else{var l=function(){r(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function jn(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return i}var lh=null;function n0(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"){if(r===0)return i;r--}else o==="/$"&&r++}i=i.previousSibling}return null}function i0(i,r,o){switch(r=Su(o),i){case"html":if(i=r.documentElement,!i)throw Error(s(452));return i;case"head":if(i=r.head,!i)throw Error(s(453));return i;case"body":if(i=r.body,!i)throw Error(s(454));return i;default:throw Error(s(451))}}function xo(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);ff(i)}var Mn=new Map,s0=new Set;function xu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ri=I.d;I.d={f:$M,r:BM,D:LM,C:VM,L:jM,m:zM,X:qM,S:UM,M:KM};function $M(){var i=Ri.f(),r=du();return i||r}function BM(i){var r=hr(i);r!==null&&r.tag===5&&r.type==="form"?Tb(r):Ri.r(i)}var Fr=typeof document>"u"?null:document;function r0(i,r,o){var l=Fr;if(l&&typeof r=="string"&&r){var f=xn(r);f='link[rel="'+i+'"][href="'+f+'"]',typeof o=="string"&&(f+='[crossorigin="'+o+'"]'),s0.has(f)||(s0.add(f),i={rel:i,crossOrigin:o,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),Bt(r,"link",i),Rt(r),l.head.appendChild(r)))}}function LM(i){Ri.D(i),r0("dns-prefetch",i,null)}function VM(i,r){Ri.C(i,r),r0("preconnect",i,r)}function jM(i,r,o){Ri.L(i,r,o);var l=Fr;if(l&&i&&r){var f='link[rel="preload"][as="'+xn(r)+'"]';r==="image"&&o&&o.imageSrcSet?(f+='[imagesrcset="'+xn(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(f+='[imagesizes="'+xn(o.imageSizes)+'"]')):f+='[href="'+xn(i)+'"]';var m=f;switch(r){case"style":m=Yr(i);break;case"script":m=Xr(i)}Mn.has(m)||(i=y({rel:"preload",href:r==="image"&&o&&o.imageSrcSet?void 0:i,as:r},o),Mn.set(m,i),l.querySelector(f)!==null||r==="style"&&l.querySelector(wo(m))||r==="script"&&l.querySelector(Ao(m))||(r=l.createElement("link"),Bt(r,"link",i),Rt(r),l.head.appendChild(r)))}}function zM(i,r){Ri.m(i,r);var o=Fr;if(o&&i){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+xn(l)+'"][href="'+xn(i)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Xr(i)}if(!Mn.has(m)&&(i=y({rel:"modulepreload",href:i},r),Mn.set(m,i),o.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ao(m)))return}l=o.createElement("link"),Bt(l,"link",i),Rt(l),o.head.appendChild(l)}}}function UM(i,r,o){Ri.S(i,r,o);var l=Fr;if(l&&i){var f=pr(l).hoistableStyles,m=Yr(i);r=r||"default";var b=f.get(m);if(!b){var x={loading:0,preload:null};if(b=l.querySelector(wo(m)))x.loading=5;else{i=y({rel:"stylesheet",href:i,"data-precedence":r},o),(o=Mn.get(m))&&uh(i,o);var R=b=l.createElement("link");Rt(R),Bt(R,"link",i),R._p=new Promise(function(N,K){R.onload=N,R.onerror=K}),R.addEventListener("load",function(){x.loading|=1}),R.addEventListener("error",function(){x.loading|=2}),x.loading|=4,wu(b,r,l)}b={type:"stylesheet",instance:b,count:1,state:x},f.set(m,b)}}}function qM(i,r){Ri.X(i,r);var o=Fr;if(o&&i){var l=pr(o).hoistableScripts,f=Xr(i),m=l.get(f);m||(m=o.querySelector(Ao(f)),m||(i=y({src:i,async:!0},r),(r=Mn.get(f))&&ch(i,r),m=o.createElement("script"),Rt(m),Bt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function KM(i,r){Ri.M(i,r);var o=Fr;if(o&&i){var l=pr(o).hoistableScripts,f=Xr(i),m=l.get(f);m||(m=o.querySelector(Ao(f)),m||(i=y({src:i,async:!0,type:"module"},r),(r=Mn.get(f))&&ch(i,r),m=o.createElement("script"),Rt(m),Bt(m,"link",i),o.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function a0(i,r,o,l){var f=(f=re.current)?xu(f):null;if(!f)throw Error(s(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(r=Yr(o.href),o=pr(f).hoistableStyles,l=o.get(r),l||(l={type:"style",instance:null,count:0,state:null},o.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=Yr(o.href);var m=pr(f).hoistableStyles,b=m.get(i);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(i,b),(m=f.querySelector(wo(i)))&&!m._p&&(b.instance=m,b.state.loading=5),Mn.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},Mn.set(i,o),m||PM(f,i,o,b.state))),r&&l===null)throw Error(s(528,""));return b}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=o.async,o=o.src,typeof o=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Xr(o),o=pr(f).hoistableScripts,l=o.get(r),l||(l={type:"script",instance:null,count:0,state:null},o.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,i))}}function Yr(i){return'href="'+xn(i)+'"'}function wo(i){return'link[rel="stylesheet"]['+i+"]"}function o0(i){return y({},i,{"data-precedence":i.precedence,precedence:null})}function PM(i,r,o,l){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=i.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),Bt(r,"link",o),Rt(r),i.head.appendChild(r))}function Xr(i){return'[src="'+xn(i)+'"]'}function Ao(i){return"script[async]"+i}function l0(i,r,o){if(r.count++,r.instance===null)switch(r.type){case"style":var l=i.querySelector('style[data-href~="'+xn(o.href)+'"]');if(l)return r.instance=l,Rt(l),l;var f=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),Rt(l),Bt(l,"style",f),wu(l,o.precedence,i),r.instance=l;case"stylesheet":f=Yr(o.href);var m=i.querySelector(wo(f));if(m)return r.state.loading|=4,r.instance=m,Rt(m),m;l=o0(o),(f=Mn.get(f))&&uh(l,f),m=(i.ownerDocument||i).createElement("link"),Rt(m);var b=m;return b._p=new Promise(function(x,R){b.onload=x,b.onerror=R}),Bt(m,"link",l),r.state.loading|=4,wu(m,o.precedence,i),r.instance=m;case"script":return m=Xr(o.src),(f=i.querySelector(Ao(m)))?(r.instance=f,Rt(f),f):(l=o,(f=Mn.get(m))&&(l=y({},o),ch(l,f)),i=i.ownerDocument||i,f=i.createElement("script"),Rt(f),Bt(f,"link",l),i.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,wu(l,o.precedence,i));return r.instance}function wu(i,r,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,m=f,b=0;b<l.length;b++){var x=l[b];if(x.dataset.precedence===r)m=x;else if(m!==f)break}m?m.parentNode.insertBefore(i,m.nextSibling):(r=o.nodeType===9?o.head:o,r.insertBefore(i,r.firstChild))}function uh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function ch(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Au=null;function u0(i,r,o){if(Au===null){var l=new Map,f=Au=new Map;f.set(o,l)}else f=Au,l=f.get(o),l||(l=new Map,f.set(o,l));if(l.has(i))return l;for(l.set(i,null),o=o.getElementsByTagName(i),f=0;f<o.length;f++){var m=o[f];if(!(m[Ba]||m[jt]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(r)||"";b=i+b;var x=l.get(b);x?x.push(m):l.set(b,[m])}}return l}function c0(i,r,o){i=i.ownerDocument||i,i.head.insertBefore(o,r==="title"?i.querySelector("head > title"):null)}function IM(i,r,o){if(o===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function f0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var To=null;function HM(){}function GM(i,r,o){if(To===null)throw Error(s(475));var l=To;if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Yr(o.href),m=i.querySelector(wo(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(l.count++,l=Tu.bind(l),i.then(l,l)),r.state.loading|=4,r.instance=m,Rt(m);return}m=i.ownerDocument||i,o=o0(o),(f=Mn.get(f))&&uh(o,f),m=m.createElement("link"),Rt(m);var b=m;b._p=new Promise(function(x,R){b.onload=x,b.onerror=R}),Bt(m,"link",o),r.instance=m}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(l.count++,r=Tu.bind(l),i.addEventListener("load",r),i.addEventListener("error",r))}}function FM(){if(To===null)throw Error(s(475));var i=To;return i.stylesheets&&i.count===0&&fh(i,i.stylesheets),0<i.count?function(r){var o=setTimeout(function(){if(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend){var l=i.unsuspend;i.unsuspend=null,l()}},6e4);return i.unsuspend=r,function(){i.unsuspend=null,clearTimeout(o)}}:null}function Tu(){if(this.count--,this.count===0){if(this.stylesheets)fh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Eu=null;function fh(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Eu=new Map,r.forEach(YM,i),Eu=null,Tu.call(i))}function YM(i,r){if(!(r.state.loading&4)){var o=Eu.get(i);if(o)var l=o.get(null);else{o=new Map,Eu.set(i,o);for(var f=i.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(o.set(b.dataset.precedence,b),l=b)}l&&o.set(null,l)}f=r.instance,b=f.getAttribute("data-precedence"),m=o.get(b)||l,m===l&&o.set(null,f),o.set(b,f),this.count++,l=Tu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),m?m.parentNode.insertBefore(f,m.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(f,i.firstChild)),r.state.loading|=4}}var Eo={$$typeof:C,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function XM(i,r,o,l,f,m,b,x){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=of(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=of(0),this.hiddenUpdates=of(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=x,this.incompleteTransitions=new Map}function d0(i,r,o,l,f,m,b,x,R,N,K,H){return i=new XM(i,r,o,b,x,R,N,H),r=1,m===!0&&(r|=24),m=cn(3,null,null,r),i.current=m,m.stateNode=i,r=Gf(),r.refCount++,i.pooledCache=r,r.refCount++,m.memoizedState={element:l,isDehydrated:o,cache:r},Zf(m),i}function h0(i){return i?(i=Rr,i):Rr}function p0(i,r,o,l,f,m){f=h0(f),l.context===null?l.context=f:l.pendingContext=f,l=Yi(r),l.payload={element:o},m=m===void 0?null:m,m!==null&&(l.callback=m),o=Xi(i,l,r),o!==null&&(mn(o,i,r),eo(o,i,r))}function m0(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<r?o:r}}function dh(i,r){m0(i,r),(i=i.alternate)&&m0(i,r)}function y0(i){if(i.tag===13){var r=Er(i,67108864);r!==null&&mn(r,i,67108864),dh(i,67108864)}}var Ru=!0;function ZM(i,r,o,l){var f=L.T;L.T=null;var m=I.p;try{I.p=2,hh(i,r,o,l)}finally{I.p=m,L.T=f}}function JM(i,r,o,l){var f=L.T;L.T=null;var m=I.p;try{I.p=8,hh(i,r,o,l)}finally{I.p=m,L.T=f}}function hh(i,r,o,l){if(Ru){var f=ph(l);if(f===null)eh(i,r,l,Ou,o),b0(i,l);else if(WM(f,i,r,o,l))l.stopPropagation();else if(b0(i,l),r&4&&-1<QM.indexOf(i)){for(;f!==null;){var m=hr(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Rs(m.pendingLanes);if(b!==0){var x=m;for(x.pendingLanes|=2,x.entangledLanes|=2;b;){var R=1<<31-ln(b);x.entanglements[1]|=R,b&=~R}Jn(m),(Le&6)===0&&(cu=Ke()+500,bo(0))}}break;case 13:x=Er(m,2),x!==null&&mn(x,m,2),du(),dh(m,2)}if(m=ph(l),m===null&&eh(i,r,l,Ou,o),m===f)break;f=m}f!==null&&l.stopPropagation()}else eh(i,r,l,null,o)}}function ph(i){return i=vf(i),mh(i)}var Ou=null;function mh(i){if(Ou=null,i=dr(i),i!==null){var r=u(i);if(r===null)i=null;else{var o=r.tag;if(o===13){if(i=c(r),i!==null)return i;i=null}else if(o===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Ou=i,null}function g0(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Dt()){case We:return 2;case Ze:return 8;case an:case jR:return 32;case Ny:return 268435456;default:return 32}default:return 32}}var yh=!1,ls=null,us=null,cs=null,Ro=new Map,Oo=new Map,fs=[],QM="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function b0(i,r){switch(i){case"focusin":case"focusout":ls=null;break;case"dragenter":case"dragleave":us=null;break;case"mouseover":case"mouseout":cs=null;break;case"pointerover":case"pointerout":Ro.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oo.delete(r.pointerId)}}function Mo(i,r,o,l,f,m){return i===null||i.nativeEvent!==m?(i={blockedOn:r,domEventName:o,eventSystemFlags:l,nativeEvent:m,targetContainers:[f]},r!==null&&(r=hr(r),r!==null&&y0(r)),i):(i.eventSystemFlags|=l,r=i.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),i)}function WM(i,r,o,l,f){switch(r){case"focusin":return ls=Mo(ls,i,r,o,l,f),!0;case"dragenter":return us=Mo(us,i,r,o,l,f),!0;case"mouseover":return cs=Mo(cs,i,r,o,l,f),!0;case"pointerover":var m=f.pointerId;return Ro.set(m,Mo(Ro.get(m)||null,i,r,o,l,f)),!0;case"gotpointercapture":return m=f.pointerId,Oo.set(m,Mo(Oo.get(m)||null,i,r,o,l,f)),!0}return!1}function v0(i){var r=dr(i.target);if(r!==null){var o=u(r);if(o!==null){if(r=o.tag,r===13){if(r=c(o),r!==null){i.blockedOn=r,GR(i.priority,function(){if(o.tag===13){var l=pn();l=lf(l);var f=Er(o,l);f!==null&&mn(f,o,l),dh(o,l)}});return}}else if(r===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Mu(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var o=ph(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);bf=l,o.target.dispatchEvent(l),bf=null}else return r=hr(o),r!==null&&y0(r),i.blockedOn=o,!1;r.shift()}return!0}function S0(i,r,o){Mu(i)&&o.delete(r)}function eC(){yh=!1,ls!==null&&Mu(ls)&&(ls=null),us!==null&&Mu(us)&&(us=null),cs!==null&&Mu(cs)&&(cs=null),Ro.forEach(S0),Oo.forEach(S0)}function Cu(i,r){i.blockedOn===r&&(i.blockedOn=null,yh||(yh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,eC)))}var _u=null;function x0(i){_u!==i&&(_u=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){_u===i&&(_u=null);for(var r=0;r<i.length;r+=3){var o=i[r],l=i[r+1],f=i[r+2];if(typeof l!="function"){if(mh(l||o)===null)continue;break}var m=hr(o);m!==null&&(i.splice(r,3),r-=3,md(m,{pending:!0,data:f,method:o.method,action:l},l,f))}}))}function Co(i){function r(R){return Cu(R,i)}ls!==null&&Cu(ls,i),us!==null&&Cu(us,i),cs!==null&&Cu(cs,i),Ro.forEach(r),Oo.forEach(r);for(var o=0;o<fs.length;o++){var l=fs[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<fs.length&&(o=fs[0],o.blockedOn===null);)v0(o),o.blockedOn===null&&fs.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var f=o[l],m=o[l+1],b=f[Zt]||null;if(typeof m=="function")b||x0(o);else if(b){var x=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Zt]||null)x=b.formAction;else if(mh(f)!==null)continue}else x=b.action;typeof x=="function"?o[l+1]=x:(o.splice(l,3),l-=3),x0(o)}}}function gh(i){this._internalRoot=i}ku.prototype.render=gh.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(s(409));var o=r.current,l=pn();p0(o,l,i,r,null,null)},ku.prototype.unmount=gh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;p0(i.current,2,null,i,null,null),du(),r[fr]=null}};function ku(i){this._internalRoot=i}ku.prototype.unstable_scheduleHydration=function(i){if(i){var r=jy();i={blockedOn:null,target:i,priority:r};for(var o=0;o<fs.length&&r!==0&&r<fs[o].priority;o++);fs.splice(o,0,i),o===0&&v0(i)}};var w0=t.version;if(w0!=="19.1.0")throw Error(s(527,w0,"19.1.0"));I.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=h(r),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var tC={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Du.isDisabled&&Du.supportsFiber)try{Da=Du.inject(tC),on=Du}catch{}}return ko.createRoot=function(i,r){if(!a(i))throw Error(s(299));var o=!1,l="",f=jb,m=zb,b=Ub,x=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(b=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(x=r.unstable_transitionCallbacks)),r=d0(i,1,!1,null,null,o,l,f,m,b,x,null),i[fr]=r.current,Wd(i),new gh(r)},ko.hydrateRoot=function(i,r,o){if(!a(i))throw Error(s(299));var l=!1,f="",m=jb,b=zb,x=Ub,R=null,N=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(f=o.identifierPrefix),o.onUncaughtError!==void 0&&(m=o.onUncaughtError),o.onCaughtError!==void 0&&(b=o.onCaughtError),o.onRecoverableError!==void 0&&(x=o.onRecoverableError),o.unstable_transitionCallbacks!==void 0&&(R=o.unstable_transitionCallbacks),o.formState!==void 0&&(N=o.formState)),r=d0(i,1,!0,r,o??null,l,f,m,b,x,R,N),r.context=h0(null),o=r.current,l=pn(),l=lf(l),f=Yi(l),f.callback=null,Xi(o,f,l),o=l,r.current.lanes=o,$a(r,o),Jn(r),i[fr]=r.current,Wd(i),new ku(r)},ko.version="19.1.0",ko}var B0;function v_(){if(B0)return xh.exports;B0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xh.exports=b_(),xh.exports}var S_=v_();function jc(){return typeof window<"u"}function Ts(e){return gw(e)?(e.nodeName||"").toLowerCase():"#document"}function bn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ui(e){var t;return(t=(gw(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function gw(e){return jc()?e instanceof Node||e instanceof bn(e).Node:!1}function dt(e){return jc()?e instanceof Element||e instanceof bn(e).Element:!1}function At(e){return jc()?e instanceof HTMLElement||e instanceof bn(e).HTMLElement:!1}function dp(e){return!jc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof bn(e).ShadowRoot}function rl(e){const{overflow:t,overflowX:n,overflowY:s,display:a}=Bn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!["inline","contents"].includes(a)}function x_(e){return["table","td","th"].includes(Ts(e))}function zc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Am(e){const t=Uc(),n=dt(e)?Bn(e):e;return["transform","translate","scale","rotate","perspective"].some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(n.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(n.contain||"").includes(s))}function w_(e){let t=Ni(e);for(;At(t)&&!ki(t);){if(Am(t))return t;if(zc(t))return null;t=Ni(t)}return null}function Uc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ki(e){return["html","body","#document"].includes(Ts(e))}function Bn(e){return bn(e).getComputedStyle(e)}function qc(e){return dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ni(e){if(Ts(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dp(e)&&e.host||ui(e);return dp(t)?t.host:t}function bw(e){const t=Ni(e);return ki(t)?e.ownerDocument?e.ownerDocument.body:e.body:At(t)&&rl(t)?t:bw(t)}function bs(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=bw(e),u=a===((s=e.ownerDocument)==null?void 0:s.body),c=bn(a);if(u){const d=hp(c);return t.concat(c,c.visualViewport||[],rl(a)?a:[],d&&n?bs(d):[])}return t.concat(a,bs(a,[],n))}function hp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const oc=Math.min,er=Math.max,lc=Math.round,$u=Math.floor,ei=e=>({x:e,y:e}),A_={left:"right",right:"left",bottom:"top",top:"bottom"},T_={start:"end",end:"start"};function L0(e,t,n){return er(e,oc(t,n))}function Kc(e,t){return typeof e=="function"?e(t):e}function ar(e){return e.split("-")[0]}function Pc(e){return e.split("-")[1]}function vw(e){return e==="x"?"y":"x"}function Sw(e){return e==="y"?"height":"width"}function tr(e){return["top","bottom"].includes(ar(e))?"y":"x"}function xw(e){return vw(tr(e))}function E_(e,t,n){n===void 0&&(n=!1);const s=Pc(e),a=xw(e),u=Sw(a);let c=a==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(c=uc(c)),[c,uc(c)]}function R_(e){const t=uc(e);return[pp(e),t,pp(t)]}function pp(e){return e.replace(/start|end/g,t=>T_[t])}function O_(e,t,n){const s=["left","right"],a=["right","left"],u=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:s:t?s:a;case"left":case"right":return t?u:c;default:return[]}}function M_(e,t,n,s){const a=Pc(e);let u=O_(ar(e),n==="start",s);return a&&(u=u.map(c=>c+"-"+a),t&&(u=u.concat(u.map(pp)))),u}function uc(e){return e.replace(/left|right|bottom|top/g,t=>A_[t])}function C_(e){return{top:0,right:0,bottom:0,left:0,...e}}function __(e){return typeof e!="number"?C_(e):{top:e,right:e,bottom:e,left:e}}function cc(e){const{x:t,y:n,width:s,height:a}=e;return{width:s,height:a,top:n,left:t,right:t+s,bottom:n+a,x:t,y:n}}/*!
63
- * tabbable 6.2.0
64
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
65
- */var k_=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],fc=k_.join(","),ww=typeof Element>"u",ma=ww?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,dc=!ww&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},hc=function e(t,n){var s;n===void 0&&(n=!0);var a=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),u=a===""||a==="true",c=u||n&&t&&e(t.parentNode);return c},D_=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},Aw=function(t,n,s){if(hc(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(fc));return n&&ma.call(t,fc)&&a.unshift(t),a=a.filter(s),a},Tw=function e(t,n,s){for(var a=[],u=Array.from(t);u.length;){var c=u.shift();if(!hc(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,p=e(h,!0,s);s.flatten?a.push.apply(a,p):a.push({scopeParent:c,candidates:p})}else{var y=ma.call(c,fc);y&&s.filter(c)&&(n||!t.includes(c))&&a.push(c);var g=c.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(c),v=!hc(g,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(c));if(g&&v){var S=e(g===!0?c.children:g.children,!0,s);s.flatten?a.push.apply(a,S):a.push({scopeParent:c,candidates:S})}else u.unshift.apply(u,c.children)}}return a},Ew=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},Rw=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||D_(t))&&!Ew(t)?0:t.tabIndex},N_=function(t,n){var s=Rw(t);return s<0&&n&&!Ew(t)?0:s},$_=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Ow=function(t){return t.tagName==="INPUT"},B_=function(t){return Ow(t)&&t.type==="hidden"},L_=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},V_=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},j_=function(t){if(!t.name)return!0;var n=t.form||dc(t),s=function(d){return n.querySelectorAll('input[type="radio"][name="'+d+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=s(window.CSS.escape(t.name));else try{a=s(t.name)}catch(c){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",c.message),!1}var u=V_(a,t.form);return!u||u===t},z_=function(t){return Ow(t)&&t.type==="radio"},U_=function(t){return z_(t)&&!j_(t)},q_=function(t){var n,s=t&&dc(t),a=(n=s)===null||n===void 0?void 0:n.host,u=!1;if(s&&s!==t){var c,d,h;for(u=!!((c=a)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(a)||t!=null&&(h=t.ownerDocument)!==null&&h!==void 0&&h.contains(t));!u&&a;){var p,y,g;s=dc(a),a=(p=s)===null||p===void 0?void 0:p.host,u=!!((y=a)!==null&&y!==void 0&&(g=y.ownerDocument)!==null&&g!==void 0&&g.contains(a))}}return u},V0=function(t){var n=t.getBoundingClientRect(),s=n.width,a=n.height;return s===0&&a===0},K_=function(t,n){var s=n.displayCheck,a=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var u=ma.call(t,"details>summary:first-of-type"),c=u?t.parentElement:t;if(ma.call(c,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof a=="function"){for(var d=t;t;){var h=t.parentElement,p=dc(t);if(h&&!h.shadowRoot&&a(h)===!0)return V0(t);t.assignedSlot?t=t.assignedSlot:!h&&p!==t.ownerDocument?t=p.host:t=h}t=d}if(q_(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return V0(t);return!1},P_=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var a=n.children.item(s);if(a.tagName==="LEGEND")return ma.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},mp=function(t,n){return!(n.disabled||hc(n)||B_(n)||K_(n,t)||L_(n)||P_(n))},yp=function(t,n){return!(U_(n)||Rw(n)<0||!mp(t,n))},I_=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},H_=function e(t){var n=[],s=[];return t.forEach(function(a,u){var c=!!a.scopeParent,d=c?a.scopeParent:a,h=N_(d,c),p=c?e(a.candidates):d;h===0?c?n.push.apply(n,p):n.push(d):s.push({documentOrder:u,tabIndex:h,item:a,isScope:c,content:p})}),s.sort($_).reduce(function(a,u){return u.isScope?a.push.apply(a,u.content):a.push(u.content),a},[]).concat(n)},Tm=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Tw([t],n.includeContainer,{filter:yp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:I_}):s=Aw(t,n.includeContainer,yp.bind(null,n)),H_(s)},G_=function(t,n){n=n||{};var s;return n.getShadowRoot?s=Tw([t],n.includeContainer,{filter:mp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=Aw(t,n.includeContainer,mp.bind(null,n)),s},Mw=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return ma.call(t,fc)===!1?!1:yp(n,t)};function F_(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Cw(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:s}=t;return n+"/"+s}).join(" "):navigator.userAgent}function Y_(){return/apple/i.test(navigator.vendor)}function gp(){const e=/android/i;return e.test(F_())||e.test(Cw())}function X_(){return Cw().includes("jsdom/")}const j0="data-floating-ui-focusable",Z_="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ea(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function yn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&dp(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Xs(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Eh(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function J_(e){return e.matches("html,body")}function Kn(e){return(e==null?void 0:e.ownerDocument)||document}function _w(e){return At(e)&&e.matches(Z_)}function z0(e){return e?e.getAttribute("role")==="combobox"&&_w(e):!1}function bp(e){return e?e.hasAttribute(j0)?e:e.querySelector("["+j0+"]")||e:null}function jo(e,t,n){n===void 0&&(n=!0);let s=e.filter(u=>{var c;return u.parentId===t&&((c=u.context)==null?void 0:c.open)}),a=s;for(;a.length;)a=n?e.filter(u=>{var c;return(c=a)==null?void 0:c.some(d=>{var h;return u.parentId===d.id&&((h=u.context)==null?void 0:h.open)})}):e,s=s.concat(a);return s}function U0(e,t){var n;let s=[],a=(n=e.find(u=>u.id===t))==null?void 0:n.parentId;for(;a;){const u=e.find(c=>c.id===a);a=u==null?void 0:u.parentId,u&&(s=s.concat(u))}return s}function Rh(e){e.preventDefault(),e.stopPropagation()}function Q_(e){return"nativeEvent"in e}function W_(e){return e.mozInputSource===0&&e.isTrusted?!0:gp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ek(e){return X_()?!1:!gp()&&e.width===0&&e.height===0||gp()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function q0(e,t){return["mouse","pen"].includes(e)}var _i=typeof document<"u"?j.useLayoutEffect:j.useEffect;const tk={...Gx};function Oh(e){const t=j.useRef(e);return _i(()=>{t.current=e}),t}const nk=tk.useInsertionEffect,ik=nk||(e=>e());function Wn(e){const t=j.useRef(()=>{});return ik(()=>{t.current=e}),j.useCallback(function(){for(var n=arguments.length,s=new Array(n),a=0;a<n;a++)s[a]=arguments[a];return t.current==null?void 0:t.current(...s)},[])}const Ic=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function kw(e,t){const n=Tm(e,Ic()),s=n.length;if(s===0)return;const a=ea(Kn(e)),u=n.indexOf(a),c=u===-1?t===1?0:s-1:u+t;return n[c]}function sk(e){return kw(Kn(e).body,1)||e}function rk(e){return kw(Kn(e).body,-1)||e}function K0(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!yn(n,s)}var ak=yw();function P0(e,t,n){let{reference:s,floating:a}=e;const u=tr(t),c=xw(t),d=Sw(c),h=ar(t),p=u==="y",y=s.x+s.width/2-a.width/2,g=s.y+s.height/2-a.height/2,v=s[d]/2-a[d]/2;let S;switch(h){case"top":S={x:y,y:s.y-a.height};break;case"bottom":S={x:y,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:g};break;case"left":S={x:s.x-a.width,y:g};break;default:S={x:s.x,y:s.y}}switch(Pc(t)){case"start":S[c]-=v*(n&&p?-1:1);break;case"end":S[c]+=v*(n&&p?-1:1);break}return S}const ok=async(e,t,n)=>{const{placement:s="bottom",strategy:a="absolute",middleware:u=[],platform:c}=n,d=u.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:y,y:g}=P0(p,s,h),v=s,S={},A=0;for(let E=0;E<d.length;E++){const{name:M,fn:k}=d[E],{x:$,y:C,data:G,reset:z}=await k({x:y,y:g,initialPlacement:s,placement:v,strategy:a,middlewareData:S,rects:p,platform:c,elements:{reference:e,floating:t}});y=$??y,g=C??g,S={...S,[M]:{...S[M],...G}},z&&A<=50&&(A++,typeof z=="object"&&(z.placement&&(v=z.placement),z.rects&&(p=z.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):z.rects),{x:y,y:g}=P0(p,v,h)),E=-1)}return{x:y,y:g,placement:v,strategy:a,middlewareData:S}};async function Dw(e,t){var n;t===void 0&&(t={});const{x:s,y:a,platform:u,rects:c,elements:d,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=Kc(t,e),A=__(S),M=d[v?g==="floating"?"reference":"floating":g],k=cc(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(M)))==null||n?M:M.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(d.floating)),boundary:p,rootBoundary:y,strategy:h})),$=g==="floating"?{x:s,y:a,width:c.floating.width,height:c.floating.height}:c.reference,C=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d.floating)),G=await(u.isElement==null?void 0:u.isElement(C))?await(u.getScale==null?void 0:u.getScale(C))||{x:1,y:1}:{x:1,y:1},z=cc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:$,offsetParent:C,strategy:h}):$);return{top:(k.top-z.top+A.top)/G.y,bottom:(z.bottom-k.bottom+A.bottom)/G.y,left:(k.left-z.left+A.left)/G.x,right:(z.right-k.right+A.right)/G.x}}const lk=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:a,middlewareData:u,rects:c,initialPlacement:d,platform:h,elements:p}=t,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:E=!0,...M}=Kc(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const k=ar(a),$=tr(d),C=ar(d)===d,G=await(h.isRTL==null?void 0:h.isRTL(p.floating)),z=v||(C||!E?[uc(d)]:R_(d)),te=A!=="none";!v&&te&&z.push(...M_(d,E,A,G));const ie=[d,...z],ne=await Dw(t,M),ee=[];let me=((s=u.flip)==null?void 0:s.overflows)||[];if(y&&ee.push(ne[k]),g){const X=E_(a,c,G);ee.push(ne[X[0]],ne[X[1]])}if(me=[...me,{placement:a,overflows:ee}],!ee.every(X=>X<=0)){var ve,ke;const X=(((ve=u.flip)==null?void 0:ve.index)||0)+1,L=ie[X];if(L){var Ge;const F=g==="alignment"?$!==tr(L):!1,J=((Ge=me[0])==null?void 0:Ge.overflows[0])>0;if(!F||J)return{data:{index:X,overflows:me},reset:{placement:L}}}let I=(ke=me.filter(F=>F.overflows[0]<=0).sort((F,J)=>F.overflows[1]-J.overflows[1])[0])==null?void 0:ke.placement;if(!I)switch(S){case"bestFit":{var _e;const F=(_e=me.filter(J=>{if(te){const T=tr(J.placement);return T===$||T==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(T=>T>0).reduce((T,q)=>T+q,0)]).sort((J,T)=>J[1]-T[1])[0])==null?void 0:_e[0];F&&(I=F);break}case"initialPlacement":I=d;break}if(a!==I)return{reset:{placement:I}}}return{}}}};async function uk(e,t){const{placement:n,platform:s,elements:a}=e,u=await(s.isRTL==null?void 0:s.isRTL(a.floating)),c=ar(n),d=Pc(n),h=tr(n)==="y",p=["left","top"].includes(c)?-1:1,y=u&&h?-1:1,g=Kc(t,e);let{mainAxis:v,crossAxis:S,alignmentAxis:A}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof A=="number"&&(S=d==="end"?A*-1:A),h?{x:S*y,y:v*p}:{x:v*p,y:S*y}}const ck=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:a,y:u,placement:c,middlewareData:d}=t,h=await uk(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:a+h.x,y:u+h.y,data:{...h,placement:c}}}}},fk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:a}=t,{mainAxis:u=!0,crossAxis:c=!1,limiter:d={fn:M=>{let{x:k,y:$}=M;return{x:k,y:$}}},...h}=Kc(e,t),p={x:n,y:s},y=await Dw(t,h),g=tr(ar(a)),v=vw(g);let S=p[v],A=p[g];if(u){const M=v==="y"?"top":"left",k=v==="y"?"bottom":"right",$=S+y[M],C=S-y[k];S=L0($,S,C)}if(c){const M=g==="y"?"top":"left",k=g==="y"?"bottom":"right",$=A+y[M],C=A-y[k];A=L0($,A,C)}const E=d.fn({...t,[v]:S,[g]:A});return{...E,data:{x:E.x-n,y:E.y-s,enabled:{[v]:u,[g]:c}}}}}};function Nw(e){const t=Bn(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const a=At(e),u=a?e.offsetWidth:n,c=a?e.offsetHeight:s,d=lc(n)!==u||lc(s)!==c;return d&&(n=u,s=c),{width:n,height:s,$:d}}function Em(e){return dt(e)?e:e.contextElement}function ua(e){const t=Em(e);if(!At(t))return ei(1);const n=t.getBoundingClientRect(),{width:s,height:a,$:u}=Nw(t);let c=(u?lc(n.width):n.width)/s,d=(u?lc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const dk=ei(0);function $w(e){const t=bn(e);return!Uc()||!t.visualViewport?dk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function hk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==bn(e)?!1:t}function or(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),u=Em(e);let c=ei(1);t&&(s?dt(s)&&(c=ua(s)):c=ua(e));const d=hk(u,n,s)?$w(u):ei(0);let h=(a.left+d.x)/c.x,p=(a.top+d.y)/c.y,y=a.width/c.x,g=a.height/c.y;if(u){const v=bn(u),S=s&&dt(s)?bn(s):s;let A=v,E=hp(A);for(;E&&s&&S!==A;){const M=ua(E),k=E.getBoundingClientRect(),$=Bn(E),C=k.left+(E.clientLeft+parseFloat($.paddingLeft))*M.x,G=k.top+(E.clientTop+parseFloat($.paddingTop))*M.y;h*=M.x,p*=M.y,y*=M.x,g*=M.y,h+=C,p+=G,A=bn(E),E=hp(A)}}return cc({width:y,height:g,x:h,y:p})}function Rm(e,t){const n=qc(e).scrollLeft;return t?t.left+n:or(ui(e)).left+n}function Bw(e,t,n){n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=s.left+t.scrollLeft-(n?0:Rm(e,s)),u=s.top+t.scrollTop;return{x:a,y:u}}function pk(e){let{elements:t,rect:n,offsetParent:s,strategy:a}=e;const u=a==="fixed",c=ui(s),d=t?zc(t.floating):!1;if(s===c||d&&u)return n;let h={scrollLeft:0,scrollTop:0},p=ei(1);const y=ei(0),g=At(s);if((g||!g&&!u)&&((Ts(s)!=="body"||rl(c))&&(h=qc(s)),At(s))){const S=or(s);p=ua(s),y.x=S.x+s.clientLeft,y.y=S.y+s.clientTop}const v=c&&!g&&!u?Bw(c,h,!0):ei(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-h.scrollLeft*p.x+y.x+v.x,y:n.y*p.y-h.scrollTop*p.y+y.y+v.y}}function mk(e){return Array.from(e.getClientRects())}function yk(e){const t=ui(e),n=qc(e),s=e.ownerDocument.body,a=er(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=er(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+Rm(e);const d=-n.scrollTop;return Bn(s).direction==="rtl"&&(c+=er(t.clientWidth,s.clientWidth)-a),{width:a,height:u,x:c,y:d}}function gk(e,t){const n=bn(e),s=ui(e),a=n.visualViewport;let u=s.clientWidth,c=s.clientHeight,d=0,h=0;if(a){u=a.width,c=a.height;const p=Uc();(!p||p&&t==="fixed")&&(d=a.offsetLeft,h=a.offsetTop)}return{width:u,height:c,x:d,y:h}}function bk(e,t){const n=or(e,!0,t==="fixed"),s=n.top+e.clientTop,a=n.left+e.clientLeft,u=At(e)?ua(e):ei(1),c=e.clientWidth*u.x,d=e.clientHeight*u.y,h=a*u.x,p=s*u.y;return{width:c,height:d,x:h,y:p}}function I0(e,t,n){let s;if(t==="viewport")s=gk(e,n);else if(t==="document")s=yk(ui(e));else if(dt(t))s=bk(t,n);else{const a=$w(e);s={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return cc(s)}function Lw(e,t){const n=Ni(e);return n===t||!dt(n)||ki(n)?!1:Bn(n).position==="fixed"||Lw(n,t)}function vk(e,t){const n=t.get(e);if(n)return n;let s=bs(e,[],!1).filter(d=>dt(d)&&Ts(d)!=="body"),a=null;const u=Bn(e).position==="fixed";let c=u?Ni(e):e;for(;dt(c)&&!ki(c);){const d=Bn(c),h=Am(c);!h&&d.position==="fixed"&&(a=null),(u?!h&&!a:!h&&d.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||rl(c)&&!h&&Lw(e,c))?s=s.filter(y=>y!==c):a=d,c=Ni(c)}return t.set(e,s),s}function Sk(e){let{element:t,boundary:n,rootBoundary:s,strategy:a}=e;const c=[...n==="clippingAncestors"?zc(t)?[]:vk(t,this._c):[].concat(n),s],d=c[0],h=c.reduce((p,y)=>{const g=I0(t,y,a);return p.top=er(g.top,p.top),p.right=oc(g.right,p.right),p.bottom=oc(g.bottom,p.bottom),p.left=er(g.left,p.left),p},I0(t,d,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function xk(e){const{width:t,height:n}=Nw(e);return{width:t,height:n}}function wk(e,t,n){const s=At(t),a=ui(t),u=n==="fixed",c=or(e,!0,u,t);let d={scrollLeft:0,scrollTop:0};const h=ei(0);function p(){h.x=Rm(a)}if(s||!s&&!u)if((Ts(t)!=="body"||rl(a))&&(d=qc(t)),s){const S=or(t,!0,u,t);h.x=S.x+t.clientLeft,h.y=S.y+t.clientTop}else a&&p();u&&!s&&a&&p();const y=a&&!s&&!u?Bw(a,d):ei(0),g=c.left+d.scrollLeft-h.x-y.x,v=c.top+d.scrollTop-h.y-y.y;return{x:g,y:v,width:c.width,height:c.height}}function Mh(e){return Bn(e).position==="static"}function H0(e,t){if(!At(e)||Bn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ui(e)===n&&(n=n.ownerDocument.body),n}function Vw(e,t){const n=bn(e);if(zc(e))return n;if(!At(e)){let a=Ni(e);for(;a&&!ki(a);){if(dt(a)&&!Mh(a))return a;a=Ni(a)}return n}let s=H0(e,t);for(;s&&x_(s)&&Mh(s);)s=H0(s,t);return s&&ki(s)&&Mh(s)&&!Am(s)?n:s||w_(e)||n}const Ak=async function(e){const t=this.getOffsetParent||Vw,n=this.getDimensions,s=await n(e.floating);return{reference:wk(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Tk(e){return Bn(e).direction==="rtl"}const Ek={convertOffsetParentRelativeRectToViewportRelativeRect:pk,getDocumentElement:ui,getClippingRect:Sk,getOffsetParent:Vw,getElementRects:Ak,getClientRects:mk,getDimensions:xk,getScale:ua,isElement:dt,isRTL:Tk};function jw(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Rk(e,t){let n=null,s;const a=ui(e);function u(){var d;clearTimeout(s),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),u();const p=e.getBoundingClientRect(),{left:y,top:g,width:v,height:S}=p;if(d||t(),!v||!S)return;const A=$u(g),E=$u(a.clientWidth-(y+v)),M=$u(a.clientHeight-(g+S)),k=$u(y),C={rootMargin:-A+"px "+-E+"px "+-M+"px "+-k+"px",threshold:er(0,oc(1,h))||1};let G=!0;function z(te){const ie=te[0].intersectionRatio;if(ie!==h){if(!G)return c();ie?c(!1,ie):s=setTimeout(()=>{c(!1,1e-7)},1e3)}ie===1&&!jw(p,e.getBoundingClientRect())&&c(),G=!1}try{n=new IntersectionObserver(z,{...C,root:a.ownerDocument})}catch{n=new IntersectionObserver(z,C)}n.observe(e)}return c(!0),u}function Ok(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:a=!0,ancestorResize:u=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,p=Em(e),y=a||u?[...p?bs(p):[],...bs(t)]:[];y.forEach(k=>{a&&k.addEventListener("scroll",n,{passive:!0}),u&&k.addEventListener("resize",n)});const g=p&&d?Rk(p,n):null;let v=-1,S=null;c&&(S=new ResizeObserver(k=>{let[$]=k;$&&$.target===p&&S&&(S.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var C;(C=S)==null||C.observe(t)})),n()}),p&&!h&&S.observe(p),S.observe(t));let A,E=h?or(e):null;h&&M();function M(){const k=or(e);E&&!jw(E,k)&&n(),E=k,A=requestAnimationFrame(M)}return n(),()=>{var k;y.forEach($=>{a&&$.removeEventListener("scroll",n),u&&$.removeEventListener("resize",n)}),g==null||g(),(k=S)==null||k.disconnect(),S=null,h&&cancelAnimationFrame(A)}}const Mk=ck,Ck=fk,_k=lk,kk=(e,t,n)=>{const s=new Map,a={platform:Ek,...n},u={...a.platform,_c:s};return ok(e,t,{...a,platform:u})};var Yu=typeof document<"u"?j.useLayoutEffect:j.useEffect;function pc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!pc(e[s],t[s]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,a[s]))return!1;for(s=n;s--!==0;){const u=a[s];if(!(u==="_owner"&&e.$$typeof)&&!pc(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function zw(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function G0(e,t){const n=zw(e);return Math.round(t*n)/n}function Ch(e){const t=j.useRef(e);return Yu(()=>{t.current=e}),t}function Dk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:a,elements:{reference:u,floating:c}={},transform:d=!0,whileElementsMounted:h,open:p}=e,[y,g]=j.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,S]=j.useState(s);pc(v,s)||S(s);const[A,E]=j.useState(null),[M,k]=j.useState(null),$=j.useCallback(F=>{F!==te.current&&(te.current=F,E(F))},[]),C=j.useCallback(F=>{F!==ie.current&&(ie.current=F,k(F))},[]),G=u||A,z=c||M,te=j.useRef(null),ie=j.useRef(null),ne=j.useRef(y),ee=h!=null,me=Ch(h),ve=Ch(a),ke=Ch(p),Ge=j.useCallback(()=>{if(!te.current||!ie.current)return;const F={placement:t,strategy:n,middleware:v};ve.current&&(F.platform=ve.current),kk(te.current,ie.current,F).then(J=>{const T={...J,isPositioned:ke.current!==!1};_e.current&&!pc(ne.current,T)&&(ne.current=T,ak.flushSync(()=>{g(T)}))})},[v,t,n,ve,ke]);Yu(()=>{p===!1&&ne.current.isPositioned&&(ne.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[p]);const _e=j.useRef(!1);Yu(()=>(_e.current=!0,()=>{_e.current=!1}),[]),Yu(()=>{if(G&&(te.current=G),z&&(ie.current=z),G&&z){if(me.current)return me.current(G,z,Ge);Ge()}},[G,z,Ge,me,ee]);const X=j.useMemo(()=>({reference:te,floating:ie,setReference:$,setFloating:C}),[$,C]),L=j.useMemo(()=>({reference:G,floating:z}),[G,z]),I=j.useMemo(()=>{const F={position:n,left:0,top:0};if(!L.floating)return F;const J=G0(L.floating,y.x),T=G0(L.floating,y.y);return d?{...F,transform:"translate("+J+"px, "+T+"px)",...zw(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:T}},[n,d,L.floating,y.x,y.y]);return j.useMemo(()=>({...y,update:Ge,refs:X,elements:L,floatingStyles:I}),[y,Ge,X,L,I])}const Nk=(e,t)=>({...Mk(e),options:[e,t]}),$k=(e,t)=>({...Ck(e),options:[e,t]}),Bk=(e,t)=>({..._k(e),options:[e,t]}),Lk="data-floating-ui-focusable",F0="active",Y0="selected",Vk={...Gx};let X0=!1,jk=0;const Z0=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+jk++;function zk(){const[e,t]=j.useState(()=>X0?Z0():void 0);return _i(()=>{e==null&&t(Z0())},[]),j.useEffect(()=>{X0=!0},[]),e}const Uk=Vk.useId,Uw=Uk||zk;function qk(){const e=new Map;return{emit(t,n){var s;(s=e.get(t))==null||s.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var s;(s=e.get(t))==null||s.delete(n)}}}const Kk=j.createContext(null),Pk=j.createContext(null),qw=()=>{var e;return((e=j.useContext(Kk))==null?void 0:e.id)||null},Om=()=>j.useContext(Pk);function mc(e){return"data-floating-ui-"+e}let J0=0;function Zr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:s=!0,sync:a=!1}=t;s&&cancelAnimationFrame(J0);const u=()=>e==null?void 0:e.focus({preventScroll:n});a?u():J0=requestAnimationFrame(u)}function Ik(e){return(e==null?void 0:e.ownerDocument)||document}let Jr=new WeakMap,Bu=new WeakSet,Lu={},_h=0;const Hk=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Kw=e=>e&&(e.host||Kw(e.parentNode)),Gk=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=Kw(n);return e.contains(s)?s:null}).filter(n=>n!=null);function Fk(e,t,n,s){const a="data-floating-ui-inert",u=s?"inert":n?"aria-hidden":null,c=Gk(t,e),d=new Set,h=new Set(c),p=[];Lu[a]||(Lu[a]=new WeakMap);const y=Lu[a];c.forEach(g),v(t),d.clear();function g(S){!S||d.has(S)||(d.add(S),S.parentNode&&g(S.parentNode))}function v(S){!S||h.has(S)||[].forEach.call(S.children,A=>{if(Ts(A)!=="script")if(d.has(A))v(A);else{const E=u?A.getAttribute(u):null,M=E!==null&&E!=="false",k=Jr.get(A)||0,$=u?k+1:k,C=(y.get(A)||0)+1;Jr.set(A,$),y.set(A,C),p.push(A),$===1&&M&&Bu.add(A),C===1&&A.setAttribute(a,""),!M&&u&&A.setAttribute(u,u==="inert"?"":"true")}})}return _h++,()=>{p.forEach(S=>{const A=Jr.get(S)||0,E=u?A-1:A,M=(y.get(S)||0)-1;Jr.set(S,E),y.set(S,M),E||(!Bu.has(S)&&u&&S.removeAttribute(u),Bu.delete(S)),M||S.removeAttribute(a)}),_h--,_h||(Jr=new WeakMap,Jr=new WeakMap,Bu=new WeakSet,Lu={})}}function Q0(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=Ik(e[0]).body;return Fk(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const Mm={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},W0=j.forwardRef(function(t,n){const[s,a]=j.useState();_i(()=>{Y_()&&a("button")},[]);const u={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[mc("focus-guard")]:"",style:Mm};return U.jsx("span",{...t,...u})}),Yk=j.createContext(null),Xk=()=>j.useContext(Yk);function eS(e){return j.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const Zk=20;let Hs=[];function Jk(e){Hs=Hs.filter(t=>t.isConnected),e&&Ts(e)!=="body"&&(Hs.push(e),Hs.length>Zk&&(Hs=Hs.slice(-20)))}function tS(){return Hs.slice().reverse().find(e=>e.isConnected)}function Qk(e){const t=Ic();return Mw(e,t)?e:Tm(e,t)[0]||e}function nS(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const s=Ic(),u=G_(e,s).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return Mw(d,s)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=e.getAttribute("tabindex");t.current.includes("floating")||u.length===0?c!=="0"&&e.setAttribute("tabindex","0"):(c!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const Wk=j.forwardRef(function(t,n){return U.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:Mm})});function eD(e){const{context:t,children:n,disabled:s=!1,order:a=["content"],guards:u=!0,initialFocus:c=0,returnFocus:d=!0,restoreFocus:h=!1,modal:p=!0,visuallyHiddenDismiss:y=!1,closeOnFocusOut:g=!0,outsideElementsInert:v=!1,getInsideElements:S=()=>[]}=e,{open:A,onOpenChange:E,events:M,dataRef:k,elements:{domReference:$,floating:C}}=t,G=Wn(()=>{var be;return(be=k.current.floatingContext)==null?void 0:be.nodeId}),z=Wn(S),te=typeof c=="number"&&c<0,ie=z0($)&&te,ne=Hk(),ee=ne?u:!0,me=!ee||ne&&v,ve=Oh(a),ke=Oh(c),Ge=Oh(d),_e=Om(),X=Xk(),L=j.useRef(null),I=j.useRef(null),F=j.useRef(!1),J=j.useRef(!1),T=j.useRef(-1),q=X!=null,Y=bp(C),Q=Wn(function(be){return be===void 0&&(be=Y),be?Tm(be,Ic()):[]}),ae=Wn(be=>{const Te=Q(be);return ve.current.map(we=>$&&we==="reference"?$:Y&&we==="floating"?Y:Te).filter(Boolean).flat()});j.useEffect(()=>{if(s||!p)return;function be(we){if(we.key==="Tab"){yn(Y,ea(Kn(Y)))&&Q().length===0&&!ie&&Rh(we);const Me=ae(),Qe=Xs(we);ve.current[0]==="reference"&&Qe===$&&(Rh(we),we.shiftKey?Zr(Me[Me.length-1]):Zr(Me[1])),ve.current[1]==="floating"&&Qe===Y&&we.shiftKey&&(Rh(we),Zr(Me[0]))}}const Te=Kn(Y);return Te.addEventListener("keydown",be),()=>{Te.removeEventListener("keydown",be)}},[s,$,Y,p,ve,ie,Q,ae]),j.useEffect(()=>{if(s||!C)return;function be(Te){const we=Xs(Te),Qe=Q().indexOf(we);Qe!==-1&&(T.current=Qe)}return C.addEventListener("focusin",be),()=>{C.removeEventListener("focusin",be)}},[s,C,Q]),j.useEffect(()=>{if(s||!g)return;function be(){J.current=!0,setTimeout(()=>{J.current=!1})}function Te(we){const Me=we.relatedTarget,Qe=we.currentTarget;queueMicrotask(()=>{const Gn=G(),Ke=!(yn($,Me)||yn(C,Me)||yn(Me,C)||yn(X==null?void 0:X.portalNode,Me)||Me!=null&&Me.hasAttribute(mc("focus-guard"))||_e&&(jo(_e.nodesRef.current,Gn).find(Dt=>{var We,Ze;return yn((We=Dt.context)==null?void 0:We.elements.floating,Me)||yn((Ze=Dt.context)==null?void 0:Ze.elements.domReference,Me)})||U0(_e.nodesRef.current,Gn).find(Dt=>{var We,Ze,an;return[(We=Dt.context)==null?void 0:We.elements.floating,bp((Ze=Dt.context)==null?void 0:Ze.elements.floating)].includes(Me)||((an=Dt.context)==null?void 0:an.elements.domReference)===Me})));if(Qe===$&&Y&&nS(Y,ve),h&&Ke&&ea(Kn(Y))===Kn(Y).body){At(Y)&&Y.focus();const Dt=T.current,We=Q(),Ze=We[Dt]||We[We.length-1]||Y;At(Ze)&&Ze.focus()}(ie||!p)&&Me&&Ke&&!J.current&&Me!==tS()&&(F.current=!0,E(!1,we,"focus-out"))})}if(C&&At($))return $.addEventListener("focusout",Te),$.addEventListener("pointerdown",be),C.addEventListener("focusout",Te),()=>{$.removeEventListener("focusout",Te),$.removeEventListener("pointerdown",be),C.removeEventListener("focusout",Te)}},[s,$,C,Y,p,_e,X,E,g,h,Q,ie,G,ve]);const xe=j.useRef(null),re=j.useRef(null),Xe=eS([xe,X==null?void 0:X.beforeInsideRef]),De=eS([re,X==null?void 0:X.afterInsideRef]);j.useEffect(()=>{var be,Te;if(s||!C)return;const we=Array.from((X==null||(be=X.portalNode)==null?void 0:be.querySelectorAll("["+mc("portal")+"]"))||[]),Me=_e?U0(_e.nodesRef.current,G()):[],Qe=_e&&!p?Me.map(We=>{var Ze;return(Ze=We.context)==null?void 0:Ze.elements.floating}):[],Gn=(Te=Me.find(We=>{var Ze;return z0(((Ze=We.context)==null?void 0:Ze.elements.domReference)||null)}))==null||(Te=Te.context)==null?void 0:Te.elements.domReference,Ke=[C,Gn,...we,...Qe,...z(),L.current,I.current,xe.current,re.current,X==null?void 0:X.beforeOutsideRef.current,X==null?void 0:X.afterOutsideRef.current,ve.current.includes("reference")||ie?$:null].filter(We=>We!=null),Dt=p||ie?Q0(Ke,!me,me):Q0(Ke);return()=>{Dt()}},[s,$,C,p,ve,X,ie,ee,me,_e,G,z]),_i(()=>{if(s||!At(Y))return;const be=Kn(Y),Te=ea(be);queueMicrotask(()=>{const we=ae(Y),Me=ke.current,Qe=(typeof Me=="number"?we[Me]:Me.current)||Y,Gn=yn(Y,Te);!te&&!Gn&&A&&Zr(Qe,{preventScroll:Qe===Y})})},[s,A,Y,te,ae,ke]),_i(()=>{if(s||!Y)return;let be=!1;const Te=Kn(Y),we=ea(Te);Jk(we);function Me(Ke){let{reason:Dt,event:We,nested:Ze}=Ke;if(["hover","safe-polygon"].includes(Dt)&&We.type==="mouseleave"&&(F.current=!0),Dt==="outside-press")if(Ze)F.current=!1,be=!0;else if(W_(We)||ek(We))F.current=!1;else{let an=!1;document.createElement("div").focus({get preventScroll(){return an=!0,!1}}),an?(F.current=!1,be=!0):F.current=!0}}M.on("openchange",Me);const Qe=Te.createElement("span");Qe.setAttribute("tabindex","-1"),Qe.setAttribute("aria-hidden","true"),Object.assign(Qe.style,Mm),q&&$&&$.insertAdjacentElement("afterend",Qe);function Gn(){if(typeof Ge.current=="boolean"){const Ke=$||tS();return Ke&&Ke.isConnected?Ke:Qe}return Ge.current.current||Qe}return()=>{M.off("openchange",Me);const Ke=ea(Te),Dt=yn(C,Ke)||_e&&jo(_e.nodesRef.current,G()).some(Ze=>{var an;return yn((an=Ze.context)==null?void 0:an.elements.floating,Ke)}),We=Gn();queueMicrotask(()=>{const Ze=Qk(We);Ge.current&&!F.current&&At(Ze)&&(!(Ze!==Ke&&Ke!==Te.body)||Dt)&&Ze.focus({preventScroll:be}),Qe.remove()})}},[s,C,Y,Ge,k,M,_e,q,$,G]),j.useEffect(()=>{queueMicrotask(()=>{F.current=!1})},[s]),_i(()=>{if(!s&&X)return X.setFocusManagerState({modal:p,closeOnFocusOut:g,open:A,onOpenChange:E,domReference:$}),()=>{X.setFocusManagerState(null)}},[s,X,p,A,E,g,$]),_i(()=>{s||Y&&nS(Y,ve)},[s,Y,ve]);function rn(be){return s||!y||!p?null:U.jsx(Wk,{ref:be==="start"?L:I,onClick:Te=>E(!1,Te.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const Ki=!s&&ee&&(p?!ie:!0)&&(q||p);return U.jsxs(U.Fragment,{children:[Ki&&U.jsx(W0,{"data-type":"inside",ref:Xe,onFocus:be=>{if(p){const we=ae();Zr(a[0]==="reference"?we[0]:we[we.length-1])}else if(X!=null&&X.preserveTabOrder&&X.portalNode)if(F.current=!1,K0(be,X.portalNode)){const we=sk($);we==null||we.focus()}else{var Te;(Te=X.beforeOutsideRef.current)==null||Te.focus()}}}),!ie&&rn("start"),n,rn("end"),Ki&&U.jsx(W0,{"data-type":"inside",ref:De,onFocus:be=>{if(p)Zr(ae()[0]);else if(X!=null&&X.preserveTabOrder&&X.portalNode)if(g&&(F.current=!0),K0(be,X.portalNode)){const we=rk($);we==null||we.focus()}else{var Te;(Te=X.afterOutsideRef.current)==null||Te.focus()}}})]})}function iS(e){return At(e.target)&&e.target.tagName==="BUTTON"}function tD(e){return At(e.target)&&e.target.tagName==="A"}function sS(e){return _w(e)}function nD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:s,dataRef:a,elements:{domReference:u}}=e,{enabled:c=!0,event:d="click",toggle:h=!0,ignoreMouse:p=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=t,v=j.useRef(),S=j.useRef(!1),A=j.useMemo(()=>({onPointerDown(E){v.current=E.pointerType},onMouseDown(E){const M=v.current;E.button===0&&d!=="click"&&(q0(M)&&p||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="mousedown")?s(!1,E.nativeEvent,"click"):(E.preventDefault(),s(!0,E.nativeEvent,"click"))))},onClick(E){const M=v.current;if(d==="mousedown"&&v.current){v.current=void 0;return}q0(M)&&p||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="click")?s(!1,E.nativeEvent,"click"):s(!0,E.nativeEvent,"click"))},onKeyDown(E){v.current=void 0,!(E.defaultPrevented||!y||iS(E))&&(E.key===" "&&!sS(u)&&(E.preventDefault(),S.current=!0),!tD(E)&&E.key==="Enter"&&s(!(n&&h),E.nativeEvent,"click"))},onKeyUp(E){E.defaultPrevented||!y||iS(E)||sS(u)||E.key===" "&&S.current&&(S.current=!1,s(!(n&&h),E.nativeEvent,"click"))}}),[a,u,d,p,y,s,n,g,h]);return j.useMemo(()=>c?{reference:A}:{},[c,A])}const iD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},sD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},rS=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function rD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:s,elements:a,dataRef:u}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:A}=t,E=Om(),M=Wn(typeof h=="function"?h:()=>!1),k=typeof h=="function"?M:h,$=j.useRef(!1),C=j.useRef(!1),{escapeKey:G,outsidePress:z}=rS(S),{escapeKey:te,outsidePress:ie}=rS(A),ne=j.useRef(!1),ee=Wn(X=>{var L;if(!n||!c||!d||X.key!=="Escape"||ne.current)return;const I=(L=u.current.floatingContext)==null?void 0:L.nodeId,F=E?jo(E.nodesRef.current,I):[];if(!G&&(X.stopPropagation(),F.length>0)){let J=!0;if(F.forEach(T=>{var q;if((q=T.context)!=null&&q.open&&!T.context.dataRef.current.__escapeKeyBubbles){J=!1;return}}),!J)return}s(!1,Q_(X)?X.nativeEvent:X,"escape-key")}),me=Wn(X=>{var L;const I=()=>{var F;ee(X),(F=Xs(X))==null||F.removeEventListener("keydown",I)};(L=Xs(X))==null||L.addEventListener("keydown",I)}),ve=Wn(X=>{var L;const I=$.current;$.current=!1;const F=C.current;if(C.current=!1,p==="click"&&F||I||typeof k=="function"&&!k(X))return;const J=Xs(X),T="["+mc("inert")+"]",q=Kn(a.floating).querySelectorAll(T);let Y=dt(J)?J:null;for(;Y&&!ki(Y);){const re=Ni(Y);if(ki(re)||!dt(re))break;Y=re}if(q.length&&dt(J)&&!J_(J)&&!yn(J,a.floating)&&Array.from(q).every(re=>!yn(Y,re)))return;if(At(J)&&_e){const re=ki(J),Xe=Bn(J),De=/auto|scroll/,rn=re||De.test(Xe.overflowX),Ki=re||De.test(Xe.overflowY),be=rn&&J.clientWidth>0&&J.scrollWidth>J.clientWidth,Te=Ki&&J.clientHeight>0&&J.scrollHeight>J.clientHeight,we=Xe.direction==="rtl",Me=Te&&(we?X.offsetX<=J.offsetWidth-J.clientWidth:X.offsetX>J.clientWidth),Qe=be&&X.offsetY>J.clientHeight;if(Me||Qe)return}const Q=(L=u.current.floatingContext)==null?void 0:L.nodeId,ae=E&&jo(E.nodesRef.current,Q).some(re=>{var Xe;return Eh(X,(Xe=re.context)==null?void 0:Xe.elements.floating)});if(Eh(X,a.floating)||Eh(X,a.domReference)||ae)return;const xe=E?jo(E.nodesRef.current,Q):[];if(xe.length>0){let re=!0;if(xe.forEach(Xe=>{var De;if((De=Xe.context)!=null&&De.open&&!Xe.context.dataRef.current.__outsidePressBubbles){re=!1;return}}),!re)return}s(!1,X,"outside-press")}),ke=Wn(X=>{var L;const I=()=>{var F;ve(X),(F=Xs(X))==null||F.removeEventListener(p,I)};(L=Xs(X))==null||L.addEventListener(p,I)});j.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=G,u.current.__outsidePressBubbles=z;let X=-1;function L(q){s(!1,q,"ancestor-scroll")}function I(){window.clearTimeout(X),ne.current=!0}function F(){X=window.setTimeout(()=>{ne.current=!1},Uc()?5:0)}const J=Kn(a.floating);d&&(J.addEventListener("keydown",te?me:ee,te),J.addEventListener("compositionstart",I),J.addEventListener("compositionend",F)),k&&J.addEventListener(p,ie?ke:ve,ie);let T=[];return v&&(dt(a.domReference)&&(T=bs(a.domReference)),dt(a.floating)&&(T=T.concat(bs(a.floating))),!dt(a.reference)&&a.reference&&a.reference.contextElement&&(T=T.concat(bs(a.reference.contextElement)))),T=T.filter(q=>{var Y;return q!==((Y=J.defaultView)==null?void 0:Y.visualViewport)}),T.forEach(q=>{q.addEventListener("scroll",L,{passive:!0})}),()=>{d&&(J.removeEventListener("keydown",te?me:ee,te),J.removeEventListener("compositionstart",I),J.removeEventListener("compositionend",F)),k&&J.removeEventListener(p,ie?ke:ve,ie),T.forEach(q=>{q.removeEventListener("scroll",L)}),window.clearTimeout(X)}},[u,a,d,k,p,n,s,v,c,G,z,ee,te,me,ve,ie,ke]),j.useEffect(()=>{$.current=!1},[k,p]);const Ge=j.useMemo(()=>({onKeyDown:ee,...y&&{[iD[g]]:X=>{s(!1,X.nativeEvent,"reference-press")},...g!=="click"&&{onClick(X){s(!1,X.nativeEvent,"reference-press")}}}}),[ee,s,y,g]),_e=j.useMemo(()=>({onKeyDown:ee,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[sD[p]]:()=>{$.current=!0}}),[ee,p]);return j.useMemo(()=>c?{reference:Ge,floating:_e}:{},[c,Ge,_e])}function aD(e){const{open:t=!1,onOpenChange:n,elements:s}=e,a=Uw(),u=j.useRef({}),[c]=j.useState(()=>qk()),d=qw()!=null,[h,p]=j.useState(s.reference),y=Wn((S,A,E)=>{u.current.openEvent=S?A:void 0,c.emit("openchange",{open:S,event:A,reason:E,nested:d}),n==null||n(S,A,E)}),g=j.useMemo(()=>({setPositionReference:p}),[]),v=j.useMemo(()=>({reference:h||s.reference||null,floating:s.floating||null,domReference:s.reference}),[h,s.reference,s.floating]);return j.useMemo(()=>({dataRef:u,open:t,onOpenChange:y,elements:v,events:c,floatingId:a,refs:g}),[t,y,v,c,a,g])}function oD(e){e===void 0&&(e={});const{nodeId:t}=e,n=aD({...e,elements:{reference:null,floating:null,...e.elements}}),s=e.rootContext||n,a=s.elements,[u,c]=j.useState(null),[d,h]=j.useState(null),y=(a==null?void 0:a.domReference)||u,g=j.useRef(null),v=Om();_i(()=>{y&&(g.current=y)},[y]);const S=Dk({...e,elements:{...a,...d&&{reference:d}}}),A=j.useCallback(C=>{const G=dt(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;h(G),S.refs.setReference(G)},[S.refs]),E=j.useCallback(C=>{(dt(C)||C===null)&&(g.current=C,c(C)),(dt(S.refs.reference.current)||S.refs.reference.current===null||C!==null&&!dt(C))&&S.refs.setReference(C)},[S.refs]),M=j.useMemo(()=>({...S.refs,setReference:E,setPositionReference:A,domReference:g}),[S.refs,E,A]),k=j.useMemo(()=>({...S.elements,domReference:y}),[S.elements,y]),$=j.useMemo(()=>({...S,...s,refs:M,elements:k,nodeId:t}),[S,M,k,t,s]);return _i(()=>{s.dataRef.current.floatingContext=$;const C=v==null?void 0:v.nodesRef.current.find(G=>G.id===t);C&&(C.context=$)}),j.useMemo(()=>({...S,context:$,refs:M,elements:k}),[S,M,k,$])}function kh(e,t,n){const s=new Map,a=n==="item";let u=e;if(a&&e){const{[F0]:c,[Y0]:d,...h}=e;u=h}return{...n==="floating"&&{tabIndex:-1,[Lk]:""},...u,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(h=>{let[p,y]=h;if(!(a&&[F0,Y0].includes(p)))if(p.indexOf("on")===0){if(s.has(p)||s.set(p,[]),typeof y=="function"){var g;(g=s.get(p))==null||g.push(y),c[p]=function(){for(var v,S=arguments.length,A=new Array(S),E=0;E<S;E++)A[E]=arguments[E];return(v=s.get(p))==null?void 0:v.map(M=>M(...A)).find(M=>M!==void 0)}}}else c[p]=y}),c),{})}}function lD(e){e===void 0&&(e=[]);const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),s=e.map(d=>d==null?void 0:d.item),a=j.useCallback(d=>kh(d,e,"reference"),t),u=j.useCallback(d=>kh(d,e,"floating"),n),c=j.useCallback(d=>kh(d,e,"item"),s);return j.useMemo(()=>({getReferenceProps:a,getFloatingProps:u,getItemProps:c}),[a,u,c])}const uD=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function cD(e,t){var n,s;t===void 0&&(t={});const{open:a,elements:u,floatingId:c}=e,{enabled:d=!0,role:h="dialog"}=t,p=Uw(),y=((n=u.domReference)==null?void 0:n.id)||p,g=j.useMemo(()=>{var $;return(($=bp(u.floating))==null?void 0:$.id)||c},[u.floating,c]),v=(s=uD.get(h))!=null?s:h,A=qw()!=null,E=j.useMemo(()=>v==="tooltip"||h==="label"?{["aria-"+(h==="label"?"labelledby":"describedby")]:a?g:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":v==="alertdialog"?"dialog":v,"aria-controls":a?g:void 0,...v==="listbox"&&{role:"combobox"},...v==="menu"&&{id:y},...v==="menu"&&A&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,A,a,y,h]),M=j.useMemo(()=>{const $={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?$:{...$,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),k=j.useCallback($=>{let{active:C,selected:G}=$;const z={role:"option",...C&&{id:g+"-fui-option"}};switch(h){case"select":return{...z,"aria-selected":C&&G};case"combobox":return{...z,"aria-selected":G}}return{}},[g,h]);return j.useMemo(()=>d?{reference:E,floating:M,item:k}:{},[d,E,M,k])}const al=e=>Array.isArray(e)?e:[e],fD=(e,t)=>{const n=[[],[]];for(const s of e)t(s)?n[0].push(s):n[1].push(s);return n},Pw=Array,Gs=(e,t)=>e.includes(t),dD=(e,t=0)=>[...new Array(e)].map((n,s)=>s+t),Ie=(e,t,n)=>e===void 0?t===void 0?[]:Array.isArray(t)?t:[t]:(Array.isArray(t)?e.push(...t):e.push(t),e),Js=(e,t)=>t==null?e??[]:e==null?al(t):e.concat(t),hD=(...e)=>e.reduce(Js,[]),nr=(e,t,n)=>{if(e===void 0)return Array.isArray(t)?t:[t];const s=(n==null?void 0:n.isEqual)??((a,u)=>a===u);for(const a of al(t))e.some(u=>s(u,a))||e.push(a);return e},pD=(e,t)=>e.reduce((n,s)=>{const a=s[t];return n[a]=Ie(n[a],s),n},{}),ya=(e,t,n)=>e.length===t.length&&e.every(n!=null&&n.isEqual?(s,a)=>n.isEqual(s,t[a]):(s,a)=>s===t[a]),ur=(e,t)=>Hn(e)===t,Hn=e=>{const t=typeof e;return t==="object"?e===null?"null":"object":t==="function"?"object":t},$i={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},mD={...$i,function:"a function"};class yD extends Error{}const bt=e=>ga(e,yD),ga=(e,t=Error)=>{throw new t(e)};class gD extends Error{constructor(){super(...arguments);w(this,"name","ParseError")}}const Z=e=>ga(e,gD),Iw=e=>` ${e}`,He=(e,t)=>{const n={},s=Array.isArray(e);let a=!1;for(const[u,c]of Object.entries(e).entries()){const d=s?t(u,c[1]):t(...c,u);a||(a=typeof d[0]=="number");const h=Array.isArray(d[0])||d.length===0?d:[d];for(const[p,y]of h)typeof p=="object"?n[p.group]=Ie(n[p.group],y):n[p]=y}return a?Object.values(n):n},Hw=Object.entries,ci=(e,t)=>e in t,Cm=(e,t)=>t in e;class bD{constructor(t){Object.assign(this,t)}}const vD=class{};class Gw extends vD{}const SD=(e,t)=>{const n={},s={};let a;for(a in e)a in t?n[a]=e[a]:s[a]=e[a];return[n,s]},xD=(e,t)=>SD(e,t)[1],ol=e=>Object.keys(e).length===0,yc=e=>[...Object.entries(e),...Object.getOwnPropertySymbols(e).map(t=>[t,e[t]])],wD=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),AD=e=>{const t=Object.keys(e).sort(),n={};for(let s=0;s<t.length;s++)n[t[s]]=e[t[s]];return n},Mi=Iw("represents an uninitialized value"),TD=e=>Object.values(e).filter(t=>typeof t=="number"?!0:typeof e[t]!="number"),Fw={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},Yw=globalThis.File??Blob,Xw={ArrayBuffer,Blob,File:Yw,FormData,Headers,Request,Response,URL},ED={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},ba={...Fw,...Xw,...ED,String,Number,Boolean},_m=e=>{var s;let t=Object.getPrototypeOf(e);for(;t!=null&&t.constructor&&(!ci(t.constructor.name,ba)||!(e instanceof ba[t.constructor.name]));)t=Object.getPrototypeOf(t);const n=(s=t==null?void 0:t.constructor)==null?void 0:s.name;if(!(n===void 0||n==="Object"))return n},vp=e=>typeof e=="object"&&e!==null?_m(e)??"object":Hn(e),It=Array.isArray,RD={Array:"an array",Function:"a function",Date:"a Date",RegExp:"a RegExp",Error:"an Error",Map:"a Map",Set:"a Set",String:"a String object",Number:"a Number object",Boolean:"a Boolean object",Promise:"a Promise",WeakMap:"a WeakMap",WeakSet:"a WeakSet"},OD={ArrayBuffer:"an ArrayBuffer instance",Blob:"a Blob instance",File:"a File instance",FormData:"a FormData instance",Headers:"a Headers instance",Request:"a Request instance",Response:"a Response instance",URL:"a URL instance"},MD={Int8Array:"an Int8Array",Uint8Array:"a Uint8Array",Uint8ClampedArray:"a Uint8ClampedArray",Int16Array:"an Int16Array",Uint16Array:"a Uint16Array",Int32Array:"an Int32Array",Uint32Array:"a Uint32Array",Float32Array:"a Float32Array",Float64Array:"a Float64Array",BigInt64Array:"a BigInt64Array",BigUint64Array:"a BigUint64Array"},CD={...RD,...OD,...MD},km=e=>{const t=Object(e).name??null;return t&&ci(t,ba)&&ba[t]===e?t:null},aS=(e,t)=>{let n=e.prototype;for(;n!==null;){if(n===t.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},_D=e=>Zw(e,new Map),Zw=(e,t)=>{if(typeof e!="object"||e===null)return e;if(t!=null&&t.has(e))return t.get(e);const n=km(e.constructor);if(n==="Date")return new Date(e.getTime());if(n&&n!=="Array")return e;const s=Array.isArray(e)?e.slice():Object.create(Object.getPrototypeOf(e)),a=Object.getOwnPropertyDescriptors(e);if(t){t.set(e,s);for(const u in a){const c=a[u];"get"in c||"set"in c||(c.value=Zw(c.value,t))}}return Object.defineProperties(s,a),s},kD=e=>{let t=Mi;return()=>t===Mi?t=e():t},Hc=e=>typeof e=="function"&&e.length===0,DD=class extends Function{constructor(...e){const t=e.slice(0,-1),n=e.at(-1);try{super(...t,n)}catch(s){return bt(`Encountered an unexpected error while compiling your definition:
66
- Message: ${s}
67
- Source: (${e.slice(0,-1)}) => {
68
- ${e.at(-1)}
69
- }`)}}};class Ea{constructor(t,...[n]){return Object.assign(Object.setPrototypeOf(t.bind((n==null?void 0:n.bind)??this),this.constructor.prototype),n==null?void 0:n.attach)}}const ND=kD(()=>{try{return new Function("return false")()}catch{return!0}});class fi{constructor(){}}const $D=()=>{var e,t,n;try{return(((n=(((t=(e=new Error().stack)==null?void 0:e.split(`
70
- `)[2])==null?void 0:t.trim())||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/))==null?void 0:n[1])||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}};var Rx;const BD=((Rx=globalThis.process)==null?void 0:Rx.env)??{},LD={fileName:$D,env:BD},VD=e=>e[0].toUpperCase()+e.slice(1),Jw=e=>new RegExp(jD(e),typeof e=="string"?"":e.flags),jD=e=>`^(?:${typeof e=="string"?e:e.source})$`,ms={negativeLookahead:e=>`(?!${e})`,nonCapturingGroup:e=>`(?:${e})`},Sp="\\",Gc={" ":1,"\n":1," ":1},zD=/^-0\.?0*$/.source,Qw=/[1-9]\d*/.source,UD=/\.\d+/.source,qD=/\.\d*[1-9]/.source,Ww=e=>Jw(ms.negativeLookahead(zD)+ms.nonCapturingGroup("-?"+ms.nonCapturingGroup(ms.nonCapturingGroup("0|"+Qw)+ms.nonCapturingGroup(e.decimalPattern)+"?")+(e.allowDecimalOnly?"|"+e.decimalPattern:"")+"?")),oS=Ww({decimalPattern:qD,allowDecimalOnly:!1}),KD=oS.test.bind(oS),xp=Ww({decimalPattern:UD,allowDecimalOnly:!0});xp.test.bind(xp);const PD=/^-?\d*\.?\d*$/,ID=e=>e.length!==0&&PD.test(e),gc=Jw(ms.negativeLookahead("^-0$")+"-?"+ms.nonCapturingGroup(ms.nonCapturingGroup("0|"+Qw))),HD=gc.test.bind(gc),wp=/^-?\d+$/,GD=wp.test.bind(wp),eA={number:"a number",bigint:"a bigint",integer:"an integer"},tA=(e,t)=>`'${e}' was parsed as ${eA[t]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,FD=(e,t)=>t==="number"?KD(e):HD(e),YD=(e,t)=>t==="number"?Number(e):Number.parseInt(e),XD=(e,t)=>t==="number"?ID(e):GD(e),ZD=(e,t)=>Dm(e,"number",t),JD=(e,t)=>Dm(e,"number",{...t,strict:!0}),QD=(e,t)=>Dm(e,"integer",t),Dm=(e,t,n)=>{const s=YD(e,t);return!Number.isNaN(s)&&XD(e,t)?n!=null&&n.strict?FD(e,t)?s:Z(tA(e,t)):s:n!=null&&n.errorOnFail?Z((n==null?void 0:n.errorOnFail)===!0?`Failed to parse ${eA[t]} from '${e}'`:n==null?void 0:n.errorOnFail):void 0},WD=e=>{if(e[e.length-1]!=="n")return;const t=e.slice(0,-1);let n;try{n=BigInt(t)}catch{return}if(gc.test(t))return n;if(wp.test(t))return Z(tA(e,"bigint"))},eN="0.46.0",tN={version:eN,filename:LD.fileName(),FileConstructor:Yw},ll=tN,lS=new Map,Dh=Object.create(null),Ap=e=>{const t=lS.get(e);if(t)return t;let n=nN(e);return Dh[n]?n=`${n}${Dh[n]++}`:Dh[n]=1,ll[n]=e,lS.set(e,n),n},Go=e=>/^[$A-Z_a-z][\w$]*$/.test(e),nN=e=>{switch(typeof e){case"object":{if(e===null)break;const t=_m(e)??"object";return t[0].toLowerCase()+t.slice(1)}case"function":return Go(e.name)?e.name:"fn";case"symbol":return e.description&&Go(e.description)?e.description:"symbol"}return bt(`Unexpected attempt to register serializable value of type ${Hn(e)}`)},Nm=e=>typeof e=="string"?JSON.stringify(e):typeof e=="bigint"?`${e}n`:`${e}`,iN=(e,t={})=>zo(e,{onUndefined:"$ark.undefined",onBigInt:n=>`$ark.bigint-${n}`,...t},[]),qe=(e,t)=>{switch(Hn(e)){case"object":const n=e,s=n.constructor.name;return s==="Object"||s==="Array"?(t==null?void 0:t.quoteKeys)===!1?bc(n,(t==null?void 0:t.indent)??0,""):JSON.stringify(zo(n,va,[]),null,t==null?void 0:t.indent):bc(n,(t==null?void 0:t.indent)??0,"");case"symbol":return va.onSymbol(e);default:return Nm(e)}},bc=(e,t,n)=>{if(typeof e=="function")return va.onFunction(e);if(typeof e!="object"||e===null)return Nm(e);const s=n+" ".repeat(t);if(Array.isArray(e)){if(e.length===0)return"[]";const u=e.map(c=>bc(c,t,s)).join(`,
71
- `+s);return t?`[
72
- ${s}${u}
73
- ${n}]`:`[${u}]`}const a=e.constructor.name;if(a==="Object"){const u=yc(e).map(([c,d])=>{const h=typeof c=="symbol"?va.onSymbol(c):Go(c)?c:JSON.stringify(c),p=bc(d,t,s);return`${s}${h}: ${p}`});return u.length===0?"{}":t?`{
74
- ${u.join(`,
75
- `)}
76
- ${n}}`:`{${u.join(", ")}}`}return e instanceof Date?ul(e):"expression"in e&&typeof e.expression=="string"?e.expression:a},va={onCycle:()=>"(cycle)",onSymbol:e=>`Symbol(${Ap(e)})`,onFunction:e=>`Function(${Ap(e)})`},zo=(e,t,n)=>{var s,a;switch(Hn(e)){case"object":{const u=e;if("toJSON"in u&&typeof u.toJSON=="function")return u.toJSON();if(typeof u=="function")return va.onFunction(u);if(n.includes(u))return"(cycle)";const c=[...n,u];if(Array.isArray(u))return u.map(h=>zo(h,t,c));if(u instanceof Date)return u.toDateString();const d={};for(const h in u)d[h]=zo(u[h],t,c);for(const h of Object.getOwnPropertySymbols(u))d[((s=t.onSymbol)==null?void 0:s.call(t,h))??h.toString()]=zo(u[h],t,c);return d}case"symbol":return va.onSymbol(e);case"bigint":return((a=t.onBigInt)==null?void 0:a.call(t,e))??`${e}n`;case"undefined":return t.onUndefined??"undefined";case"string":return e.replaceAll("\\","\\\\");default:return e}},ul=e=>{const t=e.getFullYear(),n=e.getMonth(),s=e.getDate(),a=e.getHours(),u=e.getMinutes(),c=e.getSeconds(),d=e.getMilliseconds();if(n===0&&s===1&&a===0&&u===0&&c===0&&d===0)return`${t}`;const h=`${sN[n]} ${s}, ${t}`;if(a===0&&u===0&&c===0&&d===0)return h;let p=e.toLocaleTimeString();const y=p.endsWith(" AM")||p.endsWith(" PM")?p.slice(-3):"";return y&&(p=p.slice(0,-y.length)),d?p+=`.${aN(d,3)}`:rN.test(p)&&(p=p.slice(0,-3)),`${p+y}, ${h}`},sN=["January","February","March","April","May","June","July","August","September","October","November","December"],rN=/:\d\d:00$/,aN=(e,t)=>String(e).padStart(t,"0"),nA=(e,t,...[n])=>{const s=(n==null?void 0:n.stringifySymbol)??qe;let a=e;switch(typeof t){case"string":a=Go(t)?e===""?t:`${e}.${t}`:`${e}[${JSON.stringify(t)}]`;break;case"number":a=`${e}[${t}]`;break;case"symbol":a=`${e}[${s(t)}]`;break;default:n!=null&&n.stringifyNonKey?a=`${e}[${n.stringifyNonKey(t)}]`:Z(`${qe(t)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return a},cl=(e,...t)=>e.reduce((n,s)=>nA(n,s,...t),"");class iA extends Pw{constructor(...n){super();w(this,"cache",{});this.push(...n)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let n=0;n<this.length;n++)this.cache.json.push(typeof this[n]=="symbol"?qe(this[n]):this[n]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=cl(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let n="";const s=[n];for(const a of this)n=nA(n,a),s.push(n);return this.cache.stringifyAncestors=s}}class oN{constructor(t){w(this,"chars");w(this,"i");w(this,"def");this.def=t,this.chars=[...t],this.i=0}shift(){return this.chars[this.i++]??""}get lookahead(){return this.chars[this.i]??""}get nextLookahead(){return this.chars[this.i+1]??""}get length(){return this.chars.length}shiftUntil(t){let n="";for(;this.lookahead;){if(t(this,n))if(n[n.length-1]===Sp)n=n.slice(0,-1);else break;n+=this.shift()}return n}shiftUntilLookahead(t){return typeof t=="string"?this.shiftUntil(n=>n.lookahead===t):this.shiftUntil(n=>n.lookahead in t)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in Gc))}jumpToIndex(t){this.i=t<0?this.length+t:t}jumpForward(t){this.i+=t}get location(){return this.i}get unscanned(){return this.chars.slice(this.i,this.length).join("")}get scanned(){return this.chars.slice(0,this.i).join("")}sliceChars(t,n){return this.chars.slice(t,n).join("")}lookaheadIs(t){return this.lookahead===t}lookaheadIsIn(t){return this.lookahead in t}}let Tp="$ark",lN=2;for(;Tp in globalThis;)Tp=`$ark${lN++}`;const sA=Tp;globalThis[sA]=ll;const W=ll,uN=e=>`${sA}.${e}`,Xt=e=>uN(Ap(e));class rA extends Gw{constructor(...n){super();w(this,"argNames");w(this,"body","");w(this,"indentation",0);this.argNames=n;for(const s of n){if(s in this)throw new Error(`Arg name '${s}' would overwrite an existing property on FunctionBody`);this[s]=s}}indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(n,s=!1){return aA(n,s)}index(n,s=!1){return oA(`${n}`,s)}line(n){return this.body+=`${" ".repeat(this.indentation)}${n}
77
- `,this}const(n,s){return this.line(`const ${n} = ${s}`),this}let(n,s){return this.line(`let ${n} = ${s}`)}set(n,s){return this.line(`${n} = ${s}`)}if(n,s){return this.block(`if (${n})`,s)}elseIf(n,s){return this.block(`else if (${n})`,s)}else(n){return this.block("else",n)}for(n,s,a=0){return this.block(`for (let i = ${a}; ${n}; i++)`,s)}forIn(n,s){return this.block(`for (const k in ${n})`,s)}block(n,s,a=""){return this.line(`${n} {`),this.indent(),s(this),this.dedent(),this.line(`}${a}`)}return(n=""){return this.line(`return ${n}`)}write(n="anonymous",s=0){return`${n}(${this.argNames.join(", ")}) { ${s?this.body.split(`
78
- `).map(a=>" ".repeat(s)+`${a}`).join(`
79
- `):this.body} }`}compile(){return new DD(...this.argNames,this.body)}}const fl=e=>ur(e,"object")||typeof e=="symbol"?Xt(e):Nm(e),aA=(e,t=!1)=>typeof e=="string"&&Go(e)?`${t?"?":""}.${e}`:oA(cN(e),t),cN=e=>typeof e=="symbol"?Xt(e):JSON.stringify(e),oA=(e,t=!1)=>`${t?"?.":""}[${e}]`;class Nh extends rA{constructor(n){super("data","ctx");w(this,"traversalKind");w(this,"optimistic");this.traversalKind=n.kind,this.optimistic=n.optimistic===!0}invoke(n,s){const a=(s==null?void 0:s.arg)??this.data,u=typeof n=="string"?!0:this.requiresContextFor(n),c=typeof n=="string"?n:n.id;return u?`${this.referenceToId(c,s)}(${a}, ${this.ctx})`:`${this.referenceToId(c,s)}(${a})`}referenceToId(n,s){const a=(s==null?void 0:s.kind)??this.traversalKind,u=`this.${n}${a}`;return s!=null&&s.bind?`${u}.bind(${s==null?void 0:s.bind})`:u}requiresContextFor(n){return this.traversalKind==="Apply"||n.allowsRequiresContext}initializeErrorCount(){return this.const("errorCount","ctx.currentErrorCount")}returnIfFail(){return this.if("ctx.currentErrorCount > errorCount",()=>this.return())}returnIfFailFast(){return this.if("ctx.failFast && ctx.currentErrorCount > errorCount",()=>this.return())}traverseKey(n,s,a){const u=this.requiresContextFor(a);return u&&this.line(`${this.ctx}.path.push(${n})`),this.check(a,{arg:s}),u&&this.line(`${this.ctx}.path.pop()`),this}check(n,s){return this.traversalKind==="Allows"?this.if(`!${this.invoke(n,s)}`,()=>this.return(!1)):this.line(this.invoke(n,s))}}const lA=e=>He(e,(t,n)=>[t,It(n)?[...n]:n]),Bi=Iw("arkKind"),fe=(e,t)=>(e==null?void 0:e[Bi])===t,Ft=e=>fe(e,"root")||fe(e,"constraint"),fN=["unit","proto","domain"],Fc=["required","optional","index","sequence"],uA=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],$m=[...uA,...Fc,"structure","predicate"],Yc=["alias","union","morph","unit","intersection","proto","domain"],dN=[...Yc,...$m],cA=He($m,(e,t)=>[t,1]),hN=He([...Fc,"undeclared"],(e,t)=>[t,1]),fA=He(dN,(e,t)=>[t,e]),Xu=e=>typeof e=="string"&&e in fA,vc=e=>fA[e],Bm=e=>Yc.slice(vc(e)+1);[...Bm("union")];[...Bm("morph")];const lr=e=>typeof e=="string"||typeof e=="boolean"||e===null?e:typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e:fl(e),Xc=e=>{let t="{ ";for(const[n,s]of Object.entries(e))t+=`${n}: ${fl(s)}, `;return t+" }"},lt=e=>{var n,s,a,u;const t=e;return t.hasAssociatedError&&((n=t.defaults).expected??(n.expected=c=>"description"in c?c.description:t.defaults.description(c)),(s=t.defaults).actual??(s.actual=c=>qe(c)),(a=t.defaults).problem??(a.problem=c=>`must be ${c.expected}${c.actual?` (was ${c.actual})`:""}`),(u=t.defaults).message??(u.message=c=>{if(c.path.length===0)return c.problem;const d=`${c.propString} ${c.problem}`;return d[0]==="["?`value at ${d}`:d})),t};class pN extends Error{constructor(n,s){super(qe(s,{quoteKeys:!1,indent:4}));w(this,"name","ToJsonSchemaError");w(this,"code");w(this,"context");this.code=n,this.context=s}hasCode(n){return this.code===n}}const mN={dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:e=>xt.throw("arrayObject",e),arrayPostfix:e=>xt.throw("arrayPostfix",e),defaultValue:e=>xt.throw("defaultValue",e),domain:e=>xt.throw("domain",e),morph:e=>xt.throw("morph",e),patternIntersection:e=>xt.throw("patternIntersection",e),predicate:e=>xt.throw("predicate",e),proto:e=>xt.throw("proto",e),symbolKey:e=>xt.throw("symbolKey",e),unit:e=>xt.throw("unit",e),date:e=>xt.throw("date",e)}},xt={Error:pN,throw:(...e)=>{throw new xt.Error(...e)},throwInternalOperandError:(e,t)=>bt(`Unexpected JSON Schema input for ${e}: ${qe(t)}`),defaultConfig:mN};W.config??(W.config={});const Ep=(e,t)=>{if(!t)return e;const n={...e};let s;for(s in t){const a={...e.keywords};if(s==="keywords"){for(const u in t[s]){const c=t.keywords[u];c!==void 0&&(a[u]=typeof c=="string"?{description:c}:c)}n.keywords=a}else s==="toJsonSchema"?n[s]=dA(e.toJsonSchema,t.toJsonSchema):Xu(s)?n[s]={...e[s],...t[s]}:n[s]=t[s]}return n},dA=(e,t)=>{if(!e)return t??{};if(!t)return e;const n={...e};let s;for(s in t)s==="fallback"?n.fallback=yN(e.fallback,t.fallback):n[s]=t[s];return n},yN=(e,t)=>{e=uS(e),t=uS(t);const n={};let s;for(s in xt.defaultConfig.fallback)n[s]=t[s]??t.default??e[s]??e.default??xt.defaultConfig.fallback[s];return n},uS=e=>typeof e=="function"?{default:e}:e??{};var Ox,Mx;class Sa extends(Mx=Gw,Ox=Bi,Mx){constructor({prefixPath:n,relativePath:s,...a},u){super();w(this,Ox,"error");w(this,"path");w(this,"data");w(this,"nodeConfig");w(this,"input");w(this,"ctx");this.input=a,this.ctx=u,wD(this,a);const c=u.data;a.code==="union"&&(a.errors=a.errors.flatMap(h=>{const p=h.hasCode("union")?h.errors:[h];return!n&&!s?p:p.map(y=>y.transform(g=>({...g,path:hD(n,g.path,s)})))})),this.nodeConfig=u.config[this.code];const d=[...a.path??u.path];s&&d.push(...s),n&&d.unshift(...n),this.path=new iA(...d),this.data="data"in a?a.data:c}transform(n){return new Sa(n({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(n){return this.code===n}get propString(){return cl(this.path)}get expected(){var s;if(this.input.expected)return this.input.expected;const n=((s=this.meta)==null?void 0:s.expected)??this.nodeConfig.expected;return typeof n=="function"?n(this.input):n}get actual(){var s;if(this.input.actual)return this.input.actual;const n=((s=this.meta)==null?void 0:s.actual)??this.nodeConfig.actual;return typeof n=="function"?n(this.data):n}get problem(){var s;if(this.input.problem)return this.input.problem;const n=((s=this.meta)==null?void 0:s.problem)??this.nodeConfig.problem;return typeof n=="function"?n(this):n}get message(){var s;if(this.input.message)return this.input.message;const n=((s=this.meta)==null?void 0:s.message)??this.nodeConfig.message;return typeof n=="function"?n(this):n}get flat(){return this.hasCode("intersection")?[...this.errors]:[this]}toJSON(){return{data:this.data,path:this.path,...this.input,expected:this.expected,actual:this.actual,problem:this.problem,message:this.message}}toString(){return this.message}throw(){throw this}}var Cx,_x;class xs extends(_x=Pw,Cx=Bi,_x){constructor(n){super();w(this,Cx,"errors");w(this,"ctx");w(this,"byPath",Object.create(null));w(this,"byAncestorPath",Object.create(null));w(this,"count",0);w(this,"mutable",this);this.ctx=n}get flatByPath(){return He(this.byPath,(n,s)=>[n,s.flat])}get flatProblemsByPath(){return He(this.byPath,(n,s)=>[n,s.flat.map(a=>a.problem)])}throw(){throw this.toTraversalError()}toTraversalError(){return new gN(this)}add(n){this.includes(n)||this._add(n)}transform(n){const s=new xs(this.ctx);for(const a of this)s.add(n(a));return s}merge(n){for(const s of n)this.includes(s)||this._add(new Sa({...s,path:[...this.ctx.path,...s.path]},this.ctx))}affectsPath(n){return this.length===0?!1:n.stringifyAncestors().some(s=>s in this.byPath)||n.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(n=>n.toJSON())]}toString(){return this.join(`
80
- `)}_add(n){const s=this.byPath[n.propString];if(s){if(s.hasCode("union")&&s.errors.length===0)return;const a=n.hasCode("union")&&n.errors.length===0?n:new Sa({code:"intersection",errors:s.hasCode("intersection")?[...s.errors,n]:[s,n]},this.ctx),u=this.indexOf(s);this.mutable[u===-1?this.length:u]=a,this.byPath[n.propString]=a,this.addAncestorPaths(n)}else this.byPath[n.propString]=n,this.addAncestorPaths(n),this.mutable.push(n);this.count++}addAncestorPaths(n){for(const s of n.path.stringifyAncestors())this.byAncestorPath[s]=Ie(this.byAncestorPath[s],n)}}class gN extends Error{constructor(n){var t=(...Qq)=>(super(...Qq),w(this,"name","TraversalError"),this);n.length===1?t(n.summary):t(`
81
- `+n.map(s=>` โ€ข ${bN(s)}`).join(`
82
- `)),Object.defineProperty(this,"arkErrors",{value:n,enumerable:!1})}}const bN=e=>e.toString().split(`
83
- `).join(`
84
- `);class na{constructor(t,n){w(this,"path",[]);w(this,"errors",new xs(this));w(this,"root");w(this,"config");w(this,"queuedMorphs",[]);w(this,"branches",[]);w(this,"seen",{});this.root=t,this.config=n}get data(){let t=this.root;for(const n of this.path)t=t==null?void 0:t[n];return t}get propString(){return cl(this.path)}reject(t){return this.error(t),!1}mustBe(t){return this.error(t),!1}error(t){const n=typeof t=="object"?t.code?t:{...t,code:"predicate"}:{code:"predicate",expected:t};return this.errorFromContext(n)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches.at(-1)}queueMorphs(t){const n={path:new iA(...this.path),morphs:t};this.currentBranch?this.currentBranch.queuedMorphs.push(n):this.queuedMorphs.push(n)}finalize(t){return this.queuedMorphs.length&&(typeof this.root=="object"&&this.root!==null&&this.config.clone&&(this.root=this.config.clone(this.root)),this.applyQueuedMorphs()),this.hasError()?t?t(this.errors):this.errors:this.root}get currentErrorCount(){return this.currentBranch?this.currentBranch.error?1:0:this.errors.count}get failFast(){return this.branches.length!==0}pushBranch(){this.branches.push({error:void 0,queuedMorphs:[]})}popBranch(){return this.branches.pop()}get external(){return this}errorFromNodeContext(t){return this.errorFromContext(t)}errorFromContext(t){const n=new Sa(t,this);return this.currentBranch?this.currentBranch.error=n:this.errors.add(n),n}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const t=this.queuedMorphs;this.queuedMorphs=[];for(const{path:n,morphs:s}of t)this.errors.affectsPath(n)||this.applyMorphsAtPath(n,s)}}applyMorphsAtPath(t,n){const s=t.at(-1);let a;if(s!==void 0){a=this.root;for(let u=0;u<t.length-1;u++)a=a[t[u]]}this.path=[...t];for(const u of n){const c=Ft(u),d=u(a===void 0?this.root:a[s],this);if(d instanceof Sa){this.errors.add(d);break}if(d instanceof xs){c||this.errors.merge(d);break}a===void 0?this.root=d:a[s]=d,this.applyQueuedMorphs()}}}const Li=(e,t,n)=>{if(!n)return t();n.path.push(e);const s=t();return n.path.pop(),s};class hA extends Ea{constructor(n,s){var u;super((c,d,h=this.onFail)=>d?(this.traverseApply(c,d),d.hasError()?d.errors:d.data):this.rootApply(c,h),{attach:n});w(this,"attachments");w(this,"$");w(this,"onFail");w(this,"includesTransform");w(this,"includesContextualPredicate");w(this,"isCyclic");w(this,"allowsRequiresContext");w(this,"rootApplyStrategy");w(this,"contextFreeMorph");w(this,"rootApply");w(this,"referencesById");w(this,"shallowReferences");w(this,"flatRefs");w(this,"flatMorphs");w(this,"allows");w(this,"compiledMeta",xN(this.metaJson));w(this,"precedence",vc(this.kind));w(this,"precompilation");w(this,"assert",(n,s)=>this(n,s,a=>a.throw()));this.attachments=n,this.$=s,this.onFail=this.meta.onFail??this.$.resolvedConfig.onFail,this.includesTransform=this.hasKind("morph")||this.hasKind("structure")&&this.structuralMorph!==void 0,this.includesContextualPredicate=this.hasKind("predicate")&&this.inner.predicate.length!==1,this.isCyclic=this.kind==="alias",this.referencesById={[this.id]:this},this.shallowReferences=this.hasKind("structure")?[this,...this.children]:this.children.reduce((c,d)=>wN(c,d.shallowReferences),[this]);const a=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let c=0;c<this.children.length;c++){if(this.includesTransform||(this.includesTransform=this.children[c].includesTransform),this.includesContextualPredicate||(this.includesContextualPredicate=this.children[c].includesContextualPredicate),this.isCyclic||(this.isCyclic=this.children[c].isCyclic),!a){const d=this.children[c].flatRefs;for(let h=0;h<d.length;h++){const p=d[h];if(!this.flatRefs.some(y=>pA(y,p))){this.flatRefs.push(p);for(const y of p.node.branches)(y.hasKind("morph")||y.hasKind("intersection")&&((u=y.structure)==null?void 0:u.structuralMorph)!==void 0)&&this.flatMorphs.push({path:p.path,propString:p.propString,node:y})}}}Object.assign(this.referencesById,this.children[c].referencesById)}this.flatRefs.sort((c,d)=>c.path.length>d.path.length?1:c.path.length<d.path.length?-1:c.propString>d.propString?1:c.propString<d.propString||c.node.expression<d.node.expression?-1:1),this.allowsRequiresContext=this.includesContextualPredicate||this.isCyclic,this.rootApplyStrategy=!this.allowsRequiresContext&&this.flatMorphs.length===0?this.shallowMorphs.length===0?"allows":this.shallowMorphs.every(c=>c.length===1||c.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(c=>c.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?c=>this.traverseAllows(c,new na(c,this.$.resolvedConfig)):c=>this.traverseAllows(c)}get shallowMorphs(){return[]}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(s,a)=>{if(this.allows(s))return s;const u=new na(s,this.$.resolvedConfig);return this.traverseApply(s,u),u.finalize(a)};case"contextual":return(s,a)=>{const u=new na(s,this.$.resolvedConfig);return this.traverseApply(s,u),u.finalize(a)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const n=this.$.resolvedConfig.clone;return(s,a)=>{if(this.allows(s))return this.contextFreeMorph(n&&(typeof s=="object"&&s!==null||typeof s=="function")?n(s):s);const u=new na(s,this.$.resolvedConfig);return this.traverseApply(s,u),u.finalize(a)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,bt(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}cacheGetter(n,s){return Object.defineProperty(this,n,{value:s}),s}get description(){var n;return this.cacheGetter("description",((n=this.meta)==null?void 0:n.description)??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}traverse(n,s){return this(n,s,null)}get in(){return this.cacheGetter("in",this.getIo("in"))}get out(){return this.cacheGetter("out",this.getIo("out"))}getIo(n){if(!this.includesTransform)return this;const s={};for(const[a,u]of this.innerEntries){const c=this.impl.keys[a];if(c.reduceIo)c.reduceIo(n,s,u);else if(c.child){const d=u;s[a]=It(d)?d.map(h=>h[n]):d[n]}else s[a]=u}return this.$.node(this.kind,s)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(n){const s=Ft(n)?n:this.$.parseDefinition(n);return this.innerHash===s.innerHash}ifEquals(n){return this.equals(n)?this:void 0}hasKind(n){return this.kind===n}assertHasKind(n){return this.kind!==n&&ga(`${this.kind} node was not of asserted kind ${n}`),this}hasKindIn(...n){return n.includes(this.kind)}assertHasKindIn(...n){return Gs(n,this.kind)||ga(`${this.kind} node was not one of asserted kinds ${n}`),this}isBasis(){return Gs(fN,this.kind)}isConstraint(){return Gs($m,this.kind)}isStructural(){return Gs(Fc,this.kind)}isRefinement(){return Gs(uA,this.kind)}isRoot(){return Gs(Yc,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(n){return this.hasKind("unit")&&this.allows(n)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(n){const s=$o.normalize(n);return this._select(s)}_select(n){let s=$o.applyBoundary[n.boundary??"references"](this);return n.kind&&(s=s.filter(a=>a.kind===n.kind)),n.where&&(s=s.filter(n.where)),$o.applyMethod[n.method??"filter"](s,this,n)}transform(n,s){return this._transform(n,this._createTransformContext(s))}_createTransformContext(n){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:(n==null?void 0:n.prereduced)??!1},undeclaredKeyHandling:void 0,...n}}_transform(n,s){var g;const a=s.bindScope??this.$;if(s.seen[this.id])return this.$.lazilyResolve(s.seen[this.id]);if(((g=s.shouldTransform)==null?void 0:g.call(s,this,s))===!1)return this;let u;s.seen[this.id]=()=>u,this.hasKind("structure")&&this.undeclared!==s.undeclaredKeyHandling&&(s={...s,undeclaredKeyHandling:this.undeclared});const c=He(this.inner,(v,S)=>{if(!this.impl.keys[v].child)return[v,S];const A=S;if(!It(A)){const M=A._transform(n,s);return M?[v,M]:[]}if(A.length===0)return[v,S];const E=A.flatMap(M=>M._transform(n,s)??[]);return E.length?[v,E]:[]});delete s.seen[this.id];const d=Object.assign(c,{meta:this.meta}),h=s.selected&&!s.selected.includes(this)?d:n(this.kind,d,s);if(h===null)return null;if(Ft(h))return u=h;const p=Object.keys(h);return(p.length===0||p.length===1&&p[0]==="meta")&&!ol(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in h)?s.undeclaredKeyHandling?{...h,value:W.intrinsic.unknown}:null:(this.kind==="morph"&&(h.in??(h.in=W.intrinsic.unknown)),u=a.node(this.kind,h,s.parseOptions))}configureReferences(n,s="references"){const a=$o.normalize(s),u=typeof n=="string"?(p,y)=>({...y,meta:{...y.meta,description:n}}):typeof n=="function"?(p,y)=>({...y,meta:n(y.meta)}):(p,y)=>({...y,meta:{...y.meta,...n}});if(a.boundary==="self")return this.$.node(this.kind,u(this.kind,{...this.inner,meta:this.meta}));const c=this._select(a),d=c&&al(c),h=a.boundary==="child"?(p,y)=>y.root.children.includes(p):a.boundary==="shallow"?p=>p.kind!=="structure":()=>!0;return this.$.finalize(this.transform(u,{shouldTransform:h,selected:d}))}}const $o={applyBoundary:{self:e=>[e],child:e=>[...e.children],shallow:e=>[...e.shallowReferences],references:e=>[...e.references]},applyMethod:{filter:e=>e,assertFilter:(e,t,n)=>(e.length===0&&ga(cS(t,n)),e),find:e=>e[0],assertFind:(e,t,n)=>(e.length===0&&ga(cS(t,n)),e[0])},normalize:e=>typeof e=="function"?{boundary:"references",method:"filter",where:e}:typeof e=="string"?ci(e,$o.applyBoundary)?{method:"filter",boundary:e}:{boundary:"references",method:"filter",kind:e}:{boundary:"references",method:"filter",...e}},cS=(e,t)=>`${e} had no references matching ${qe(t)}.`,vN=e=>cl(e,{stringifyNonKey:t=>t.expression}),SN=/"(\$ark\.[^"]+)"/g,xN=e=>JSON.stringify(e).replaceAll(SN,"$1"),ys=(e,t)=>({path:e,node:t,propString:vN(e)}),pA=(e,t)=>e.propString===t.propString&&e.node.equals(t.node),fS=(e,t)=>nr(e,t,{isEqual:pA}),wN=(e,t)=>nr(e,t,{isEqual:(n,s)=>n.equals(s)});class oe extends Array{static init(t,n,s,a){return new oe({kind:t,l:n,r:s,path:(a==null?void 0:a.path)??[],optional:(a==null?void 0:a.optional)??!1})}add(t,n,s,a){return this.push({kind:t,l:n,r:s,path:(a==null?void 0:a.path)??[],optional:(a==null?void 0:a.optional)??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:t,l:n,r:s}=this[0],a=cl(t);return mA(`Intersection${a&&` at ${a}`} of ${dS(n,s)}`)}return`The following intersections result in unsatisfiable types:
85
- โ€ข ${this.map(({path:t,l:n,r:s})=>`${t}: ${dS(n,s)}`).join(`
86
- โ€ข `)}`}throw(){return Z(this.describeReasons())}invert(){const t=this.map(n=>({...n,l:n.r,r:n.l}));return t instanceof oe?t:new oe(...t)}withPrefixKey(t,n){return this.map(s=>({...s,path:[t,...s.path],optional:s.optional||n==="optional"}))}toNeverIfDisjoint(){return W.intrinsic.never}}const dS=(e,t)=>`${Rp(e)} and ${Rp(t)}`,Rp=e=>Ft(e)?e.expression:It(e)?e.map(Rp).join(" | ")||"never":String(e),mA=e=>`${e} results in an unsatisfiable type`,Qr={},Vi=(e,t,n)=>kt(e,t,{$:n,invert:!1,pipe:!1}),Op=(e,t,n)=>kt(e,t,{$:n,invert:!1,pipe:!0}),kt=(e,t,n)=>{const s=n.pipe?"|>":"&",a=`${e.hash}${s}${t.hash}`;if(Qr[a]!==void 0)return Qr[a];if(!n.pipe){const d=`${t.hash}${s}${e.hash}`;if(Qr[d]!==void 0){const h=Qr[d],p=h instanceof oe?h.invert():h;return Qr[a]=p,p}}const u=!n.pipe||!e.includesTransform&&!t.includesTransform;if(u&&e.equals(t))return e;let c=u?Mp(e,t,n):e.hasKindIn(...Yc)?AN(e,t,n):Mp(e,t,n);return Ft(c)&&(e.equals(c)?c=e:t.equals(c)&&(c=t)),Qr[a]=c,c},Mp=(e,t,n)=>{const s=e.precedence<t.precedence?e.kind:t.kind,a=e.impl.intersections[t.kind]??t.impl.intersections[e.kind];if(a===void 0)return null;if(s===e.kind)return a(e,t,n);{let u=a(t,e,{...n,invert:!n.invert});return u instanceof oe&&(u=u.invert()),u}},AN=(e,t,n)=>e.includesTransform||t.includesTransform?n.invert?hS(t,e,n):hS(e,t,n):Mp(e,t,n),hS=(e,t,n)=>e.distribute(s=>TN(s,t,n),s=>{const a=s.filter(Ft);if(a.length===0)return oe.init("union",e.branches,t.branches);if(a.length<e.branches.length||!e.branches.every((c,d)=>c.in.equals(a[d].in)))return n.$.parseSchema(a);if(a.length===1)return a[0];const u={branches:a};return n.$.parseSchema(u)}),TN=(e,t,n)=>{if(e.hasKind("morph")){const a=[...e.morphs];if(e.lastMorphIfNode){const u=kt(e.lastMorphIfNode,t,n);if(u instanceof oe)return u;a[a.length-1]=u}else a.push(t);return n.$.node("morph",{morphs:a,in:e.inner.in})}if(t.hasKind("morph")){const a=kt(e,t.in,n);return a instanceof oe?a:n.$.node("morph",{morphs:[t],in:a})}return n.$.node("morph",{morphs:[t],in:e})};class Ra extends hA{constructor(n,s){super(n,s);w(this,"impliedSiblings");Object.defineProperty(this,Bi,{value:"constraint",enumerable:!1})}intersect(n){return Vi(this,n,this.$)}}class Zc extends Ra{constructor(){super(...arguments);w(this,"traverseApply",(n,s)=>{this.traverseAllows(n,s)||s.errorFromNodeContext(this.errorContext)})}compile(n){n.traversalKind==="Allows"?n.return(this.compiledCondition):n.if(this.compiledNegation,()=>n.line(`${n.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Xc(this.errorContext)}}const tn=e=>(t,n)=>{if(It(t)){if(t.length===0)return;const a=t.map(u=>n.$.node(e,u));return e==="predicate"?a:a.sort((u,c)=>u.hash<c.hash?-1:1)}const s=n.$.node(e,t);return s.hasOpenIntersection()?[s]:s},Sc=e=>{const t=e.r.shift();if(!t){let s=e.l.length===0&&e.kind==="structure"?W.intrinsic.unknown.internal:e.ctx.$.node(e.kind,Object.assign(e.baseInner,EN(e.l)),{prereduced:!0});for(const a of e.roots){if(s instanceof oe)return s;s=kt(a,s,e.ctx)}return s}let n=!1;for(let s=0;s<e.l.length;s++){const a=kt(e.l[s],t,e.ctx);if(a!==null){if(a instanceof oe)return a;if(n){if(!e.l.includes(a))return bt(`Unexpectedly encountered multiple distinct intersection results for refinement ${a}`)}else{if(a.isRoot())return e.roots.push(a),e.l.splice(s),Sc(e);e.l[s]=a,n=!0}}}if(n||e.l.push(t),e.kind==="intersection"&&t.impliedSiblings)for(const s of t.impliedSiblings)nr(e.r,s);return Sc(e)},xc=e=>Object.entries(e).flatMap(([n,s])=>n in cA?s:[]).sort((n,s)=>n.precedence<s.precedence?-1:n.precedence>s.precedence?1:n.kind==="predicate"&&s.kind==="predicate"?0:n.hash<s.hash?-1:1),EN=e=>{const t={};for(const n of e)if(n.hasOpenIntersection())t[n.kind]=Ie(t[n.kind],n);else{if(t[n.kind])return bt(`Unexpected intersection of closed refinements of kind ${n.kind}`);t[n.kind]=n}return t},RN=(...e)=>Z(ON(...e)),ON=(e,t,n)=>{const s=n.hasKind("morph")?"a morph":n.isUnknown()?"unknown":n.exclude(t).defaultShortDescription;return`${VD(e)} operand must be ${t.description} (was ${s})`},MN=(e,t,n)=>new wc(e,t,n,n,null);class yA extends Ea{}var kx,Dx;class wc extends(Dx=Ea,kx=Bi,Dx){constructor(n,s,a,u,c){super((...d)=>{const h=He(this.names,(p,y)=>{const g=this.arg$.parse(d[p]);return g.extends(this.constraints[p])||Z(CN(y,this.constraints[p].expression,g.expression)),[y,g]});if(this.defIsLazy()){const p=this.bodyDef(h);return this.$.parse(p)}return this.$.parse(s,{args:h})});w(this,kx,"generic");w(this,"paramDefs");w(this,"bodyDef");w(this,"$");w(this,"arg$");w(this,"baseInstantiation");w(this,"hkt");w(this,"description");this.paramDefs=n,this.bodyDef=s,this.$=a,this.arg$=u,this.hkt=c,this.description=c?new c().description??`a generic type for ${c.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof yA}cacheGetter(n,s){return Object.defineProperty(this,n,{value:s}),s}get json(){return this.cacheGetter("json",{params:this.params.map(n=>n[1].isUnknown()?n[0]:[n[0],n[1].json]),body:iN(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(n=>typeof n=="string"?[n,W.intrinsic.unknown]:[n[0],this.$.parse(n[1])]))}get names(){return this.cacheGetter("names",this.params.map(n=>n[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(n=>n[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const CN=(e,t,n)=>`${e} must be assignable to ${t} (was ${n})`,_N=lt({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:e=>typeof e=="function"?{predicate:e}:e,defaults:{description:e=>`valid according to ${e.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class kN extends Ra{constructor(){super(...arguments);w(this,"serializedPredicate",Xt(this.predicate));w(this,"compiledCondition",`${this.serializedPredicate}(data, ctx)`);w(this,"compiledNegation",`!${this.compiledCondition}`);w(this,"impliedBasis",null);w(this,"expression",this.serializedPredicate);w(this,"traverseAllows",this.predicate);w(this,"errorContext",{code:"predicate",description:this.description,meta:this.meta});w(this,"compiledErrorContext",Xc(this.errorContext));w(this,"traverseApply",(n,s)=>{!this.predicate(n,s.external)&&!s.hasError()&&s.errorFromNodeContext(this.errorContext)})}compile(n){if(n.traversalKind==="Allows"){n.return(this.compiledCondition);return}n.if(`${this.compiledNegation} && !ctx.hasError()`,()=>n.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(n,s){return s.fallback.predicate({code:"predicate",base:n,predicate:this.predicate})}}const gA={implementation:_N,Node:kN},DN=lt({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:e=>Number.isInteger(e)?e:Z($N(e))}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>e.rule===1?"an integer":e.rule===2?"even":`a multiple of ${e.rule}`},intersections:{divisor:(e,t,n)=>n.$.node("divisor",{rule:Math.abs(e.rule*t.rule/BN(e.rule,t.rule))})},obviatesBasisDescription:!0});class NN extends Zc{constructor(){super(...arguments);w(this,"traverseAllows",n=>n%this.rule===0);w(this,"compiledCondition",`data % ${this.rule} === 0`);w(this,"compiledNegation",`data % ${this.rule} !== 0`);w(this,"impliedBasis",W.intrinsic.number.internal);w(this,"expression",`% ${this.rule}`)}reduceJsonSchema(n){return n.type="integer",this.rule===1||(n.multipleOf=this.rule),n}}const bA={implementation:DN,Node:NN},$N=e=>`divisor must be an integer (was ${e})`,BN=(e,t)=>{let n,s=e,a=t;for(;a!==0;)n=a,a=s%a,s=n;return s};class Oa extends Zc{constructor(){super(...arguments);w(this,"boundOperandKind",zN[this.kind]);w(this,"compiledActual",this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()");w(this,"comparator",UN(this.kind,this.exclusive));w(this,"numericLimit",this.rule.valueOf());w(this,"expression",`${this.comparator} ${this.rule}`);w(this,"compiledCondition",`${this.compiledActual} ${this.comparator} ${this.numericLimit}`);w(this,"compiledNegation",`${this.compiledActual} ${LN[this.comparator]} ${this.numericLimit}`);w(this,"stringLimit",this.boundOperandKind==="date"?qN(this.numericLimit):`${this.numericLimit}`);w(this,"limitKind",this.comparator[0]==="<"?"upper":"lower")}isStricterThan(n){return(this.limitKind==="upper"?this.numericLimit<n.numericLimit:this.numericLimit>n.numericLimit)||this.numericLimit===n.numericLimit&&this.exclusive===!0&&!n.exclusive}overlapsRange(n){return!(this.isStricterThan(n)||this.numericLimit===n.numericLimit&&(this.exclusive||n.exclusive))}overlapIsUnit(n){return this.numericLimit===n.numericLimit&&!this.exclusive&&!n.exclusive}}const LN={"<":">=","<=":">",">":"<=",">=":"<"},VN={min:"max",minLength:"maxLength",after:"before"},vA={parse:e=>e||void 0},SA=e=>t=>{if(typeof t=="number")return{rule:t};const{exclusive:n,...s}=t;return n?{...s,rule:e==="minLength"?s.rule+1:s.rule-1}:s},xA=e=>t=>{if(typeof t=="number"||typeof t=="string"||t instanceof Date)return{rule:t};const{exclusive:n,...s}=t;if(!n)return s;const a=typeof s.rule=="number"?s.rule:typeof s.rule=="string"?new Date(s.rule).valueOf():s.rule.valueOf();return n?{...s,rule:e==="after"?a+1:a-1}:s},wA=e=>typeof e=="string"||typeof e=="number"?new Date(e):e,jN=(e,t)=>`${e} bound must be a positive integer (was ${t})`,Lm=e=>t=>((!Number.isInteger(t)||t<0)&&Z(jN(e,t)),t),zN={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},UN=(e,t)=>`${ci(e,VN)?">":"<"}${t?"":"="}`,qN=e=>typeof e=="string"?e:new Date(e).toLocaleString(),KN=e=>`Bounded expression ${e} must be exactly one of number, string, Array, or Date`,PN=lt({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:wA,serialize:e=>e.toISOString()}},normalize:xA("after"),defaults:{description:e=>`${e.collapsibleLimitString} or later`,actual:ul},intersections:{after:(e,t)=>e.isStricterThan(t)?e:t}});class IN extends Oa{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.Date.internal);w(this,"collapsibleLimitString",ul(this.rule));w(this,"traverseAllows",n=>n>=this.rule)}reduceJsonSchema(n,s){return s.fallback.date({code:"date",base:n,after:this.rule})}}const AA={implementation:PN,Node:IN},HN=lt({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:wA,serialize:e=>e.toISOString()}},normalize:xA("before"),defaults:{description:e=>`${e.collapsibleLimitString} or earlier`,actual:ul},intersections:{before:(e,t)=>e.isStricterThan(t)?e:t,after:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:oe.init("range",e,t)}});class GN extends Oa{constructor(){super(...arguments);w(this,"collapsibleLimitString",ul(this.rule));w(this,"traverseAllows",n=>n<=this.rule);w(this,"impliedBasis",W.intrinsic.Date.internal)}reduceJsonSchema(n,s){return s.fallback.date({code:"date",base:n,before:this.rule})}}const TA={implementation:HN,Node:GN},FN=lt({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:Lm("exactLength")}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>`exactly length ${e.rule}`,actual:e=>`${e.length}`},intersections:{exactLength:(e,t,n)=>oe.init("unit",n.$.node("unit",{unit:e.rule}),n.$.node("unit",{unit:t.rule}),{path:["length"]}),minLength:(e,t)=>e.rule>=t.rule?e:oe.init("range",e,t),maxLength:(e,t)=>e.rule<=t.rule?e:oe.init("range",e,t)}});class YN extends Zc{constructor(){super(...arguments);w(this,"traverseAllows",n=>n.length===this.rule);w(this,"compiledCondition",`data.length === ${this.rule}`);w(this,"compiledNegation",`data.length !== ${this.rule}`);w(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);w(this,"expression",`== ${this.rule}`)}reduceJsonSchema(n){switch(n.type){case"string":return n.minLength=this.rule,n.maxLength=this.rule,n;case"array":return n.minItems=this.rule,n.maxItems=this.rule,n;default:return xt.throwInternalOperandError("exactLength",n)}}}const EA={implementation:FN,Node:YN},XN=lt({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:vA},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"negative":"non-positive":`${e.exclusive?"less than":"at most"} ${e.rule}`},intersections:{max:(e,t)=>e.isStricterThan(t)?e:t,min:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:oe.init("range",e,t)},obviatesBasisDescription:!0});class ZN extends Oa{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.number.internal);w(this,"traverseAllows",this.exclusive?n=>n<this.rule:n=>n<=this.rule)}reduceJsonSchema(n){return this.exclusive?n.exclusiveMaximum=this.rule:n.maximum=this.rule,n}}const RA={implementation:XN,Node:ZN},JN=lt({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Lm("maxLength")}},reduce:(e,t)=>e.rule===0?t.node("exactLength",e):void 0,normalize:SA("maxLength"),defaults:{description:e=>`at most length ${e.rule}`,actual:e=>`${e.length}`},intersections:{maxLength:(e,t)=>e.isStricterThan(t)?e:t,minLength:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("exactLength",{rule:e.rule}):null:oe.init("range",e,t)}});class QN extends Oa{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);w(this,"traverseAllows",n=>n.length<=this.rule)}reduceJsonSchema(n){switch(n.type){case"string":return n.maxLength=this.rule,n;case"array":return n.maxItems=this.rule,n;default:return xt.throwInternalOperandError("maxLength",n)}}}const OA={implementation:JN,Node:QN},WN=lt({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:vA},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"positive":"non-negative":`${e.exclusive?"more than":"at least"} ${e.rule}`},intersections:{min:(e,t)=>e.isStricterThan(t)?e:t},obviatesBasisDescription:!0});class e2 extends Oa{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.number.internal);w(this,"traverseAllows",this.exclusive?n=>n>this.rule:n=>n>=this.rule)}reduceJsonSchema(n){return this.exclusive?n.exclusiveMinimum=this.rule:n.minimum=this.rule,n}}const MA={implementation:WN,Node:e2},t2=lt({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Lm("minLength")}},reduce:e=>e.rule===0?W.intrinsic.unknown:void 0,normalize:SA("minLength"),defaults:{description:e=>e.rule===1?"non-empty":`at least length ${e.rule}`,actual:e=>e.length===0?"":`${e.length}`},intersections:{minLength:(e,t)=>e.isStricterThan(t)?e:t}});class n2 extends Oa{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);w(this,"traverseAllows",n=>n.length>=this.rule)}reduceJsonSchema(n){switch(n.type){case"string":return n.minLength=this.rule,n;case"array":return n.minItems=this.rule,n;default:return xt.throwInternalOperandError("minLength",n)}}}const CA={implementation:t2,Node:n2},i2={min:MA.implementation,max:RA.implementation,minLength:CA.implementation,maxLength:OA.implementation,exactLength:EA.implementation,after:AA.implementation,before:TA.implementation},s2={min:MA.Node,max:RA.Node,minLength:CA.Node,maxLength:OA.Node,exactLength:EA.Node,after:AA.Node,before:TA.Node},r2=lt({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:e=>typeof e=="string"?{rule:e}:e instanceof RegExp?e.flags?{rule:e.source,flags:e.flags}:{rule:e.source}:e,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:e=>`matched by ${e.rule}`},intersections:{pattern:()=>null}});class a2 extends Zc{constructor(){super(...arguments);w(this,"instance",new RegExp(this.rule,this.flags));w(this,"expression",`${this.instance}`);w(this,"traverseAllows",this.instance.test.bind(this.instance));w(this,"compiledCondition",`${this.expression}.test(data)`);w(this,"compiledNegation",`!${this.compiledCondition}`);w(this,"impliedBasis",W.intrinsic.string.internal)}reduceJsonSchema(n,s){return n.pattern?s.fallback.patternIntersection({code:"patternIntersection",base:n,pattern:this.rule}):(n.pattern=this.rule,n)}}const _A={implementation:r2,Node:a2},Zu=(e,t)=>{const n=o2(e);return t&&!t.includes(n)?Z(`Root of kind ${n} should be one of ${t}`):n},o2=e=>{if(fe(e,"root"))return e.kind;if(typeof e=="string")return e[0]==="$"?"alias":e in $i?"domain":"proto";if(typeof e=="function")return"proto";if(typeof e!="object"||e===null)return Z(pS(e));if("morphs"in e)return"morph";if("branches"in e||It(e))return"union";if("unit"in e)return"unit";if("reference"in e)return"alias";const t=Object.keys(e);return t.length===0||t.some(n=>n in cA)?"intersection":"proto"in e?"proto":"domain"in e?"domain":Z(pS(e))},pS=e=>`${qe(e)} is not a valid type schema`,Vu={},l2=e=>It(e)?e.map(t=>t.collapsibleJson):e.collapsibleJson,kn={};W.nodesByRegisteredId=kn;const kA=e=>(Vu[e]??(Vu[e]=0),`${e}${++Vu[e]}`),DA=e=>{var p;const t=Jc[e.kind],n=((p=t.applyConfig)==null?void 0:p.call(t,e.def,e.$.resolvedConfig))??e.def,s={},{meta:a,...u}=n,c=a===void 0?{}:typeof a=="string"?{description:a}:a,d=Hw(u).sort(([y],[g])=>Xu(y)?Xu(g)?vc(y)-vc(g):1:Xu(g)||y<g?-1:1).filter(([y,g])=>{if(y.startsWith("meta.")){const v=y.slice(5);return c[v]=g,!1}return!0});for(const y of d){const g=y[0],v=t.keys[g];if(!v)return Z(`Key ${g} is not valid on ${e.kind} schema`);const S=v.parse?v.parse(y[1],e):y[1];S!==Mi&&(S!==void 0||v.preserveUndefined)&&(s[g]=S)}if(t.reduce&&!e.prereduced){const y=t.reduce(s,e.$);if(y)return y instanceof oe?y.throw():c2(y,c)}return Vm({id:e.id,kind:e.kind,inner:s,meta:c,$:e.$})},Vm=({id:e,kind:t,inner:n,meta:s,$:a,ignoreCache:u})=>{const c=Jc[t],d=Hw(n),h=[];let p={};for(const[k,$]of d){const C=c.keys[k],G=C.serialize??(C.child?l2:lr);if(p[k]=G($),C.child===!0){const z=$;It(z)?h.push(...z):h.push(z)}else typeof C.child=="function"&&h.push(...C.child($))}c.finalizeInnerJson&&(p=c.finalizeInnerJson(p));let y={...p},g={};ol(s)||(g=He(s,(k,$)=>[k,k==="examples"?$:lr($)]),y.meta=ju(g,"description",!0)),p=ju(p,c.collapsibleKey,!1);const v=JSON.stringify({kind:t,...p});y=ju(y,c.collapsibleKey,!1);const S=ju(y,c.collapsibleKey,!0),A=JSON.stringify({kind:t,...y});if(a.nodesByHash[A]&&!u)return a.nodesByHash[A];const E={id:e,kind:t,impl:c,inner:n,innerEntries:d,innerJson:p,innerHash:v,meta:s,metaJson:g,json:y,hash:A,collapsibleJson:S,children:h};if(t!=="intersection")for(const k in n)k!=="in"&&k!=="out"&&(E[k]=n[k]);const M=new p$[t](E,a);return a.nodesByHash[A]=M},u2=(e,t)=>e.id===t?e:(Ft(kn[t])&&bt(`Unexpected attempt to overwrite node id ${t}`),Vm({id:t,kind:e.kind,inner:e.inner,meta:e.meta,$:e.$,ignoreCache:!0})),c2=(e,t,n)=>Vm({id:kA(t.alias??e.kind),kind:e.kind,inner:e.inner,meta:t,$:e.$}),ju=(e,t,n)=>{const s=Object.keys(e);if(s.length===1&&s[0]===t){const a=e[t];if(n||ur(a,"object")&&(Object.keys(a).length===1||Array.isArray(a)))return a}return e},Cp=(e,t,n)=>{if(e.key!==t.key)return null;const s=e.key;let a=kt(e.value,t.value,n);const u=e.required||t.required?"required":"optional";if(a instanceof oe)if(u==="optional")a=W.intrinsic.never.internal;else return a.withPrefixKey(e.key,e.required&&t.required?"required":"optional");if(u==="required")return n.$.node("required",{key:s,value:a});const c=e.hasDefault()?t.hasDefault()?e.default===t.default?e.default:Z($A(e.default,t.default)):e.default:t.hasDefault()?t.default:Mi;return n.$.node("optional",{key:s,value:a,default:c})};class NA extends Ra{constructor(){super(...arguments);w(this,"required",this.kind==="required");w(this,"optional",this.kind==="optional");w(this,"impliedBasis",W.intrinsic.object.internal);w(this,"serializedKey",fl(this.key));w(this,"compiledKey",typeof this.key=="string"?this.key:this.serializedKey);w(this,"flatRefs",Ie(this.value.flatRefs.map(n=>ys([this.key,...n.path],n.node)),ys([this.key],this.value)));w(this,"traverseAllows",(n,s)=>this.key in n?Li(this.key,()=>this.value.traverseAllows(n[this.key],s),s):this.optional);w(this,"traverseApply",(n,s)=>{this.key in n?Li(this.key,()=>this.value.traverseApply(n[this.key],s),s):this.hasKind("required")&&s.errorFromNodeContext(this.errorContext)})}_transform(n,s){s.path.push(this.key);const a=super._transform(n,s);return s.path.pop(),a}hasDefault(){return"default"in this.inner}compile(n){n.if(`${this.serializedKey} in data`,()=>n.traverseKey(this.serializedKey,`data${n.prop(this.key)}`,this.value)),this.hasKind("required")&&n.else(()=>n.traversalKind==="Apply"?n.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):n.return(!1)),n.traversalKind==="Allows"&&n.return(!0)}}const $A=(e,t)=>`Invalid intersection of default values ${qe(e)} & ${qe(t)}`,f2=lt({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},default:{preserveUndefined:!0}},normalize:e=>e,reduce:(e,t)=>{if(t.resolvedConfig.exactOptionalPropertyTypes===!1&&!e.value.allows(void 0))return t.node("optional",{...e,value:e.value.or(pe.undefined)},{prereduced:!0})},defaults:{description:e=>`${e.compiledKey}?: ${e.value.description}`},intersections:{optional:Cp}});class d2 extends NA{constructor(...n){super(...n);w(this,"expression",this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${qe(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`);w(this,"defaultValueMorph",h2(this));w(this,"defaultValueMorphRef",this.defaultValueMorph&&Xt(this.defaultValueMorph));"default"in this.inner&&zm(this.value,this.inner.default,this.key)}get outProp(){if(!this.hasDefault())return this;const{default:n,...s}=this.inner;return this.cacheGetter("outProp",this.$.node("required",s,{prereduced:!0}))}}const jm={implementation:f2,Node:d2},$h={},h2=e=>{if(!e.hasDefault())return;const t=`{${e.compiledKey}: ${e.value.id} = ${lr(e.default)}}`;return $h[t]??($h[t]=BA(e.key,e.value,e.default))},BA=(e,t,n)=>{if(typeof n=="function")return t.includesTransform?(a,u)=>(Li(e,()=>t(a[e]=n(),u),u),a):a=>(a[e]=n(),a);const s=t.includesTransform?t.assert(n):n;return ur(s,"object")?(a,u)=>(Li(e,()=>t(a[e]=n,u),u),a):a=>(a[e]=s,a)},zm=(e,t,n)=>{const s=Hc(t);ur(t,"object")&&!s&&Z(p2(n));const a=e.in(s?t():t);if(a instanceof xs){n===null&&Z(`Default ${a.summary}`);const u=a.transform(c=>c.transform(d=>({...d,prefixPath:[n]})));Z(`Default for ${u.summary}`)}return t},p2=e=>`Non-primitive default ${e===null?"":typeof e=="number"?`for value at [${e}] `:`for ${fl(e)} `}must be specified as a function like () => ({my: 'object'})`;class dl extends hA{constructor(n,s){super(n,s);w(this,"branches",this.hasKind("union")?this.inner.branches:[this]);w(this,"_keyof");w(this,"pipe",Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)}));Object.defineProperty(this,Bi,{value:"root",enumerable:!1})}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:n=>{const s=this(n);return s instanceof xs?s:{value:s}}}}as(){return this}brand(n){return n===""?Z(m2):this}readonly(){return this}distribute(n,s){const a=this.branches.map(n);return(s==null?void 0:s(a))??a}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(n={}){const s=dA(this.$.resolvedConfig.toJsonSchema,n);s.useRefs||(s.useRefs=this.isCyclic);const a=typeof s.dialect=="string"?{$schema:s.dialect}:{};return Object.assign(a,this.toJsonSchemaRecurse(s)),s.useRefs&&(a.$defs=He(this.references,(u,c)=>c.isRoot()&&!c.alwaysExpandJsonSchema?[c.id,c.toResolvedJsonSchema(s)]:[])),a}toJsonSchemaRecurse(n){return n.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(n)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(n){const s=this.innerToJsonSchema(n);return Object.assign(s,this.metaJson)}intersect(n){const s=this.$.parseDefinition(n),a=this.rawIntersect(s);return a instanceof oe?a:this.$.finalize(a)}rawIntersect(n){return Vi(this,n,this.$)}toNeverIfDisjoint(){return this}and(n){const s=this.intersect(n);return s instanceof oe?s.throw():s}rawAnd(n){const s=this.rawIntersect(n);return s instanceof oe?s.throw():s}or(n){const s=this.$.parseDefinition(n);return this.$.finalize(this.rawOr(s))}rawOr(n){const s=[...this.branches,...n.branches];return this.$.node("union",s)}map(n){return this.$.schema(this.applyStructuralOperation("map",[n]))}pick(...n){return this.$.schema(this.applyStructuralOperation("pick",n))}omit(...n){return this.$.schema(this.applyStructuralOperation("omit",n))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}keyof(){if(this._keyof)return this._keyof;const n=this.applyStructuralOperation("keyof",[]).reduce((s,a)=>s.intersect(a).toNeverIfDisjoint(),W.intrinsic.unknown.internal);return n.branches.length===0&&Z(mA(`keyof ${this.expression}`)),this._keyof=this.$.finalize(n)}get props(){return this.branches.length!==1?Z(y2(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(n){const s=this.$.parseDefinition(n);return this.$.schema(s.distribute(a=>this.applyStructuralOperation("merge",[mS(a)??Z(yS("merge",a.expression))])))}applyStructuralOperation(n,s){return this.distribute(a=>{if(a.equals(W.intrinsic.object)&&n!=="merge")return a;const u=mS(a);if(u||Z(yS(n,a.expression)),n==="keyof")return u.keyof();if(n==="get")return u.get(...s);if(n==="props")return u.props;const c=n==="required"?"require":n==="partial"?"optionalize":n;return this.$.node("intersection",{...a.inner,structure:u[c](...s)})})}get(...n){return n[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",n))}extract(n){const s=this.$.parseDefinition(n);return this.$.schema(this.branches.filter(a=>a.extends(s)))}exclude(n){const s=this.$.parseDefinition(n);return this.$.schema(this.branches.filter(a=>!a.extends(s)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(n){return!(this.intersect(n)instanceof oe)}extends(n){const s=this.intersect(n);return!(s instanceof oe)&&this.equals(s)}ifExtends(n){return this.extends(n)?this:void 0}subsumes(n){return this.$.parseDefinition(n).extends(this)}configure(n,s="shallow"){return this.configureReferences(n,s)}describe(n,s="shallow"){return this.configure({description:n},s)}optional(){return[this,"?"]}default(n){return zm(this,n,null),[this,"=",n]}from(n){return this.assert(n)}_pipe(...n){const s=n.reduce((a,u)=>a.rawPipeOnce(u),this);return this.$.finalize(s)}tryPipe(...n){const s=n.reduce((a,u)=>a.rawPipeOnce(fe(u,"root")?u:(c,d)=>{try{return u(c,d)}catch(h){return d.error({code:"predicate",predicate:u,actual:`aborted due to error:
87
- ${h}
88
- `})}}),this);return this.$.finalize(s)}to(n){return this.$.finalize(this.toNode(this.$.parseDefinition(n)))}toNode(n){const s=Op(this,n,this.$);return s instanceof oe?s.throw():s}rawPipeOnce(n){return fe(n,"root")?this.toNode(n):this.distribute(s=>s.hasKind("morph")?this.$.node("morph",{in:s.inner.in,morphs:[...s.morphs,n]}):this.$.node("morph",{in:s,morphs:[n]}),this.$.parseSchema)}narrow(n){return this.constrainOut("predicate",n)}constrain(n,s){return this._constrain("root",n,s)}constrainIn(n,s){return this._constrain("in",n,s)}constrainOut(n,s){return this._constrain("out",n,s)}_constrain(n,s,a){const u=this.$.node(s,a);if(u.isRoot())return u.isUnknown()?this:bt(`Unexpected constraint node ${u}`);const c=n==="root"?this:this[n];if(c.hasKind("morph")||u.impliedBasis&&!c.extends(u.impliedBasis))return RN(s,u.impliedBasis,this);const d=this.$.node("intersection",{[u.kind]:u}),h=n==="out"?Op(this,d,this.$):Vi(this,d,this.$);return h instanceof oe&&h.throw(),this.$.finalize(h)}onUndeclaredKey(n){const s=typeof n=="string"?n:n.rule,a=typeof n=="string"?!1:n.deep;return this.$.finalize(this.transform((u,c)=>u==="structure"?s==="ignore"?xD(c,{undeclared:1}):{...c,undeclared:s}:c,a?void 0:{shouldTransform:u=>!Gs(Fc,u.kind)}))}hasEqualMorphs(n){return!this.includesTransform&&!n.includesTransform?!0:!(!ya(this.shallowMorphs,n.shallowMorphs)||!ya(this.flatMorphs,n.flatMorphs,{isEqual:(s,a)=>{var u,c;return s.propString===a.propString&&(s.node.hasKind("morph")&&a.node.hasKind("morph")?s.node.hasEqualMorphs(a.node):s.node.hasKind("intersection")&&a.node.hasKind("intersection")?((u=s.node.structure)==null?void 0:u.structuralMorphRef)===((c=a.node.structure)==null?void 0:c.structuralMorphRef):!1)}}))}onDeepUndeclaredKey(n){return this.onUndeclaredKey({rule:n,deep:!0})}filter(n){return this.constrainIn("predicate",n)}divisibleBy(n){return this.constrain("divisor",n)}matching(n){return this.constrain("pattern",n)}atLeast(n){return this.constrain("min",n)}atMost(n){return this.constrain("max",n)}moreThan(n){return this.constrain("min",Wr(n))}lessThan(n){return this.constrain("max",Wr(n))}atLeastLength(n){return this.constrain("minLength",n)}atMostLength(n){return this.constrain("maxLength",n)}moreThanLength(n){return this.constrain("minLength",Wr(n))}lessThanLength(n){return this.constrain("maxLength",Wr(n))}exactlyLength(n){return this.constrain("exactLength",n)}atOrAfter(n){return this.constrain("after",n)}atOrBefore(n){return this.constrain("before",n)}laterThan(n){return this.constrain("after",Wr(n))}earlierThan(n){return this.constrain("before",Wr(n))}}const m2="Expected a non-empty brand name after #",Wr=e=>typeof e=="object"&&!(e instanceof Date)?{...e,exclusive:!0}:{rule:e,exclusive:!0},zu=(e,t)=>fe(t,"root")?fe(e,"root")?e.extends(t):t.allows(e):fe(e,"root")?e.hasUnit(t):t===e,mS=e=>{var t;return e.hasKind("morph")?null:e.hasKind("intersection")?e.inner.structure??(((t=e.basis)==null?void 0:t.domain)==="object"?e.$.bindReference(W.intrinsic.emptyStructure):null):e.isBasis()&&e.domain==="object"?e.$.bindReference(W.intrinsic.emptyStructure):null},y2=e=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
89
- ${e}`,yS=(e,t)=>`${e} operand must be an object (was ${t})`,hl=(e,t)=>He(Bm(e),(n,s)=>[s,t]),g2=e=>typeof e=="string"?{reference:e}:e,gS=e=>e instanceof oe?W.intrinsic.never.internal:e,b2=lt({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:e=>e.startsWith("$")?e:`$ark.${e}`},resolve:{}},normalize:g2,defaults:{description:e=>e.reference},intersections:{alias:(e,t,n)=>n.$.lazilyResolve(()=>gS(kt(e.resolution,t.resolution,n)),`${e.reference}${n.pipe?"=>":"&"}${t.reference}`),...hl("alias",(e,t,n)=>t.isUnknown()?e:t.isNever()?t:t.isBasis()&&!t.overlaps(W.intrinsic.object)?oe.init("assignability",W.intrinsic.object,t):n.$.lazilyResolve(()=>gS(kt(e.resolution,t,n)),`${e.reference}${n.pipe?"=>":"&"}${t.id}`))}});class v2 extends dl{constructor(){super(...arguments);w(this,"expression",this.reference);w(this,"structure");w(this,"traverseAllows",(n,s)=>{const a=s.seen[this.reference];return a!=null&&a.includes(n)?!0:(s.seen[this.reference]=Ie(a,n),this.resolution.traverseAllows(n,s))});w(this,"traverseApply",(n,s)=>{const a=s.seen[this.reference];a!=null&&a.includes(n)||(s.seen[this.reference]=Ie(a,n),this.resolution.traverseApply(n,s))})}get resolution(){const n=this._resolve();return kn[this.id]=n}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));const n=this.reference;let s=kn[n];const a=[];for(;fe(s,"context");){if(a.includes(s.id))return Z(S2(s.id,a));a.push(s.id),s=kn[s.id]}return fe(s,"root")?s:bt(`Unexpected resolution for reference ${this.reference}
90
- Seen: [${a.join("->")}]
91
- Resolution: ${qe(s)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const n=this.reference.slice(1),s=this.$.resolutions[n];return typeof s=="string"?s:fe(s,"root")?s.id:bt(`Unexpected resolution for reference ${this.reference}: ${qe(s)}`)}get defaultShortDescription(){return $i.object}innerToJsonSchema(n){return this.resolution.toJsonSchemaRecurse(n)}compile(n){const s=this.resolutionId;n.if(`ctx.seen.${s} && ctx.seen.${s}.includes(data)`,()=>n.return(!0)),n.if(`!ctx.seen.${s}`,()=>n.line(`ctx.seen.${s} = []`)),n.line(`ctx.seen.${s}.push(data)`),n.return(n.invoke(s))}}const S2=(e,t)=>`Alias '${e}' has a shallow resolution cycle: ${[...t,e].join("->")}`,Um={implementation:b2,Node:v2};class qm extends dl{constructor(){super(...arguments);w(this,"traverseApply",(n,s)=>{this.traverseAllows(n,s)||s.errorFromNodeContext(this.errorContext)})}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Xc(this.errorContext)}compile(n){n.traversalKind==="Allows"?n.return(this.compiledCondition):n.if(this.compiledNegation,()=>n.line(`${n.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}}const x2=lt({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:e=>typeof e=="string"?{domain:e}:Cm(e,"numberAllowsNaN")&&e.domain!=="number"?Z(Km.writeBadAllowNanMessage(e.domain)):e,applyConfig:(e,t)=>e.numberAllowsNaN===void 0&&e.domain==="number"&&t.numberAllowsNaN?{...e,numberAllowsNaN:!0}:e,defaults:{description:e=>$i[e.domain],actual:e=>Number.isNaN(e)?"NaN":$i[Hn(e)]},intersections:{domain:(e,t)=>e.domain==="number"&&t.domain==="number"?e.numberAllowsNaN?t:e:oe.init("domain",e,t)}});class w2 extends qm{constructor(){super(...arguments);w(this,"requiresNaNCheck",this.domain==="number"&&!this.numberAllowsNaN);w(this,"traverseAllows",this.requiresNaNCheck?n=>typeof n=="number"&&!Number.isNaN(n):n=>Hn(n)===this.domain);w(this,"compiledCondition",this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`);w(this,"compiledNegation",this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`);w(this,"expression",this.numberAllowsNaN?"number | NaN":this.domain)}get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return $i[this.domain]}innerToJsonSchema(n){return this.domain==="bigint"||this.domain==="symbol"?n.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}}const Km={implementation:x2,Node:w2,writeBadAllowNanMessage:e=>`numberAllowsNaN may only be specified with domain "number" (was ${e})`},A2=lt({kind:"intersection",hasAssociatedError:!0,normalize:e=>{if(Ft(e))return e;const{structure:t,...n}=e,s=!!t,a=t??{},u=He(n,(c,d)=>ci(c,hN)?(s&&Z(`Flattened structure key ${c} cannot be specified alongside a root 'structure' key.`),a[c]=d,[]):[c,d]);return(fe(a,"constraint")||!ol(a))&&(u.structure=a),u},finalizeInnerJson:({structure:e,...t})=>ur(e,"object")?{...e,...t}:t,keys:{domain:{child:!0,parse:(e,t)=>t.$.node("domain",e)},proto:{child:!0,parse:(e,t)=>t.$.node("proto",e)},structure:{child:!0,parse:(e,t)=>t.$.node("structure",e),serialize:e=>{var c;if(!((c=e.sequence)!=null&&c.minLength))return e.collapsibleJson;const{sequence:t,...n}=e.collapsibleJson,{minVariadicLength:s,...a}=t,u=a.variadic&&Object.keys(a).length===1?a.variadic:a;return{...n,sequence:u}}},divisor:{child:!0,parse:tn("divisor")},max:{child:!0,parse:tn("max")},min:{child:!0,parse:tn("min")},maxLength:{child:!0,parse:tn("maxLength")},minLength:{child:!0,parse:tn("minLength")},exactLength:{child:!0,parse:tn("exactLength")},before:{child:!0,parse:tn("before")},after:{child:!0,parse:tn("after")},pattern:{child:!0,parse:tn("pattern")},predicate:{child:!0,parse:tn("predicate")}},reduce:(e,t)=>bS({},e,{$:t,invert:!1,pipe:!1}),defaults:{description:e=>{if(e.children.length===0)return"unknown";if(e.structure)return e.structure.description;const t=[];if(e.basis&&!e.refinements.some(n=>n.impl.obviatesBasisDescription)&&t.push(e.basis.description),e.refinements.length){const n=e.refinements.toSorted((s,a)=>s.kind==="min"&&a.kind==="max"?-1:0).map(s=>s.description);t.push(...n)}return e.inner.predicate&&t.push(...e.inner.predicate.map(n=>n.description)),t.join(" and ")},expected:e=>` โ—ฆ ${e.errors.map(t=>t.expected).join(`
92
- โ—ฆ `)}`,problem:e=>`(${e.actual}) must be...
93
- ${e.expected}`},intersections:{intersection:(e,t,n)=>bS(e.inner,t.inner,n),...hl("intersection",(e,t,n)=>{var h;if(e.children.length===0)return t;const{domain:s,proto:a,...u}=e.inner,c=a??s,d=c?kt(c,t,n):t;return d instanceof oe?d:(h=e==null?void 0:e.basis)!=null&&h.equals(d)?e:e.$.node("intersection",{...u,[d.kind]:d},{prereduced:!0})})}});class T2 extends dl{constructor(){super(...arguments);w(this,"basis",this.inner.domain??this.inner.proto??null);w(this,"refinements",this.children.filter(n=>n.isRefinement()));w(this,"structure",this.inner.structure);w(this,"expression",E2(this));w(this,"traverseAllows",(n,s)=>this.children.every(a=>a.traverseAllows(n,s)));w(this,"traverseApply",(n,s)=>{const a=s.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(n,s),s.currentErrorCount>a))){if(this.refinements.length){for(let u=0;u<this.refinements.length-1;u++)if(this.refinements[u].traverseApply(n,s),s.failFast&&s.currentErrorCount>a)return;if(this.refinements.at(-1).traverseApply(n,s),s.currentErrorCount>a)return}if(!(this.structure&&(this.structure.traverseApply(n,s),s.currentErrorCount>a))&&this.inner.predicate){for(let u=0;u<this.inner.predicate.length-1;u++)if(this.inner.predicate[u].traverseApply(n,s),s.failFast&&s.currentErrorCount>a)return;this.inner.predicate.at(-1).traverseApply(n,s)}}})}get shallowMorphs(){var n;return(n=this.inner.structure)!=null&&n.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){var n;return((n=this.basis)==null?void 0:n.defaultShortDescription)??"present"}innerToJsonSchema(n){return this.children.reduce((s,a)=>a.isBasis()?a.toJsonSchemaRecurse(n):a.reduceJsonSchema(s,n),{})}compile(n){if(n.traversalKind==="Allows"){for(const s of this.children)n.check(s);n.return(!0);return}if(n.initializeErrorCount(),this.basis&&(n.check(this.basis),this.children.length>1&&n.returnIfFail()),this.refinements.length){for(let s=0;s<this.refinements.length-1;s++)n.check(this.refinements[s]),n.returnIfFailFast();n.check(this.refinements.at(-1)),(this.structure||this.inner.predicate)&&n.returnIfFail()}if(this.structure&&(n.check(this.structure),this.inner.predicate&&n.returnIfFail()),this.inner.predicate){for(let s=0;s<this.inner.predicate.length-1;s++)n.check(this.inner.predicate[s]),n.returnIfFail();n.check(this.inner.predicate.at(-1))}}}const LA={implementation:A2,Node:T2},E2=e=>{var n;let t=((n=e.structure)==null?void 0:n.expression)||`${e.basis&&!e.refinements.some(s=>s.impl.obviatesBasisExpression)?e.basis.nestableExpression+" ":""}${e.refinements.map(s=>s.expression).join(" & ")}`||"unknown";return t==="Array == 0"&&(t="[]"),t},bS=(e,t,n)=>{const s={},a=e.proto??e.domain,u=t.proto??t.domain,c=a?u?kt(a,u,n):a:u;return c instanceof oe?c:(c&&(s[c.kind]=c),Sc({kind:"intersection",baseInner:s,l:xc(e),r:xc(t),roots:[],ctx:n}))},R2=lt({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},morphs:{parse:al,serialize:e=>e.map(t=>fe(t,"root")?t.json:Xt(t))},declaredIn:{child:!1,serialize:e=>e.json},declaredOut:{child:!1,serialize:e=>e.json}},normalize:e=>e,defaults:{description:e=>{var t;return`a morph from ${e.in.description} to ${((t=e.out)==null?void 0:t.description)??"unknown"}`}},intersections:{morph:(e,t,n)=>{if(!e.hasEqualMorphs(t))return Z(M2(e.expression,t.expression));const s=kt(e.in,t.in,n);if(s instanceof oe)return s;const a={morphs:e.morphs};if(e.declaredIn||t.declaredIn){const u=kt(e.in,t.in,n);if(u instanceof oe)return u.throw();a.declaredIn=u}if(e.declaredOut||t.declaredOut){const u=kt(e.out,t.out,n);if(u instanceof oe)return u.throw();a.declaredOut=u}return s.distribute(u=>n.$.node("morph",{...a,in:u}),n.$.parseSchema)},...hl("morph",(e,t,n)=>{const s=e.inner.in?kt(e.inner.in,t,n):t;return s instanceof oe?s:s.equals(e.inner.in)?e:n.$.node("morph",{...e.inner,in:s})})}});class O2 extends dl{constructor(){super(...arguments);w(this,"serializedMorphs",this.morphs.map(Xt));w(this,"compiledMorphs",`[${this.serializedMorphs}]`);w(this,"lastMorph",this.inner.morphs.at(-1));w(this,"lastMorphIfNode",fe(this.lastMorph,"root")?this.lastMorph:void 0);w(this,"introspectableIn",this.inner.in);w(this,"introspectableOut",this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.out:void 0);w(this,"expression",`(In: ${this.in.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.out.expression}>`);w(this,"traverseAllows",(n,s)=>!this.introspectableIn||this.introspectableIn.traverseAllows(n,s));w(this,"traverseApply",(n,s)=>{this.introspectableIn&&this.introspectableIn.traverseApply(n,s),s.queueMorphs(this.morphs)})}get shallowMorphs(){var n;return Array.isArray((n=this.inner.in)==null?void 0:n.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get in(){var n;return this.declaredIn??((n=this.inner.in)==null?void 0:n.in)??W.intrinsic.unknown.internal}get out(){return this.declaredOut??this.introspectableOut??W.intrinsic.unknown.internal}declareIn(n){return this.$.node("morph",{...this.inner,declaredIn:n})}declareOut(n){return this.$.node("morph",{...this.inner,declaredOut:n})}get defaultShortDescription(){return this.in.meta.description??this.in.defaultShortDescription}innerToJsonSchema(n){var s;return n.fallback.morph({code:"morph",base:this.in.toJsonSchemaRecurse(n),out:((s=this.introspectableOut)==null?void 0:s.toJsonSchemaRecurse(n))??null})}compile(n){if(n.traversalKind==="Allows"){if(!this.introspectableIn)return;n.return(n.invoke(this.introspectableIn));return}this.introspectableIn&&n.line(n.invoke(this.introspectableIn)),n.line(`ctx.queueMorphs(${this.compiledMorphs})`)}hasEqualMorphs(n){return ya(this.morphs,n.morphs,{isEqual:(s,a)=>s===a||fe(s,"root")&&fe(a,"root")&&s.equals(a)})}}const VA={implementation:R2,Node:O2},M2=(e,t)=>`The intersection of distinct morphs at a single path is indeterminate:
94
- Left: ${e}
95
- Right: ${t}`,C2=lt({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:e=>km(e)??lr(e)},dateAllowsInvalid:{}},normalize:e=>{const t=typeof e=="string"?{proto:ba[e]}:typeof e=="function"?Ft(e)?e:{proto:e}:typeof e.proto=="string"?{...e,proto:ba[e.proto]}:e;return typeof t.proto!="function"&&Z(Ac.writeInvalidSchemaMessage(t.proto)),Cm(t,"dateAllowsInvalid")&&t.proto!==Date&&Z(Ac.writeBadInvalidDateMessage(t.proto)),t},applyConfig:(e,t)=>e.dateAllowsInvalid===void 0&&e.proto===Date&&t.dateAllowsInvalid?{...e,dateAllowsInvalid:!0}:e,defaults:{description:e=>e.builtinName?CD[e.builtinName]:`an instance of ${e.proto.name}`,actual:e=>e instanceof Date&&e.toString()==="Invalid Date"?"an invalid Date":vp(e)},intersections:{proto:(e,t)=>e.proto===Date&&t.proto===Date?e.dateAllowsInvalid?t:e:aS(e.proto,t.proto)?e:aS(t.proto,e.proto)?t:oe.init("proto",e,t),domain:(e,t)=>t.domain==="object"?e:oe.init("domain",W.intrinsic.object.internal,t)}});class _2 extends qm{constructor(){super(...arguments);w(this,"builtinName",km(this.proto));w(this,"serializedConstructor",this.json.proto);w(this,"requiresInvalidDateCheck",this.proto===Date&&!this.dateAllowsInvalid);w(this,"traverseAllows",this.requiresInvalidDateCheck?n=>n instanceof Date&&n.toString()!=="Invalid Date":n=>n instanceof this.proto);w(this,"compiledCondition",`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`);w(this,"compiledNegation",`!(${this.compiledCondition})`);w(this,"expression",this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name);w(this,"domain","object")}innerToJsonSchema(n){var s,a;switch(this.builtinName){case"Array":return{type:"array"};case"Date":return((a=(s=n.fallback).date)==null?void 0:a.call(s,{code:"date",base:{}}))??n.fallback.proto({code:"proto",base:{},proto:this.proto});default:return n.fallback.proto({code:"proto",base:{},proto:this.proto})}}get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}get defaultShortDescription(){return this.description}}const Ac={implementation:C2,Node:_2,writeBadInvalidDateMessage:e=>`dateAllowsInvalid may only be specified with constructor Date (was ${e.name})`,writeInvalidSchemaMessage:e=>`instanceOf operand must be a function (was ${Hn(e)})`},k2=lt({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(e,t)=>{const n=[];for(const s of e){const a=fe(s,"root")?s.branches:t.$.parseSchema(s).branches;for(const u of a)if(u.hasKind("morph")){const c=n.findIndex(d=>d.hasKind("morph")&&d.hasEqualMorphs(u));if(c===-1)n.push(u);else{const d=n[c];n[c]=t.$.node("morph",{...d.inner,in:d.in.rawOr(u.in)})}}else n.push(u)}return t.def.ordered||n.sort((s,a)=>s.hash<a.hash?-1:1),n}}},normalize:e=>It(e)?{branches:e}:e,reduce:(e,t)=>{const n=K2(e);if(n.length===1)return n[0];if(n.length!==e.branches.length)return t.node("union",{...e,branches:n},{prereduced:!0})},defaults:{description:e=>e.distribute(t=>t.description,ca),expected:e=>{const t=pD(e.errors,"propString"),n=Object.entries(t).map(([s,a])=>{const u=[];for(const h of a)nr(u,h.expected);const c=ca(u),d=a.every(h=>h.actual===a[0].actual)?a[0].actual:qe(a[0].data);return`${s&&`${s} `}must be ${c}${d&&` (was ${d})`}`});return ca(n)},problem:e=>e.expected,message:e=>e.problem},intersections:{union:(e,t,n)=>{if(e.isNever!==t.isNever)return oe.init("presence",e,t);let s;return e.ordered?(t.ordered&&Z(I2(e.expression,t.expression)),s=Bh(t.branches,e.branches,n),s instanceof oe&&s.invert()):s=Bh(e.branches,t.branches,n),s instanceof oe?s:n.$.parseSchema(e.ordered||t.ordered?{branches:s,ordered:!0}:{branches:s})},...hl("union",(e,t,n)=>{const s=Bh(e.branches,[t],n);return s instanceof oe?s:s.length===1?s[0]:n.$.parseSchema(e.ordered?{branches:s,ordered:!0}:{branches:s})})}});class D2 extends dl{constructor(){super(...arguments);w(this,"isBoolean",this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0));w(this,"unitBranches",this.branches.filter(n=>n.in.hasKind("unit")));w(this,"discriminant",this.discriminate());w(this,"discriminantJson",this.discriminant?z2(this.discriminant):null);w(this,"expression",this.distribute(n=>n.nestableExpression,q2));w(this,"traverseAllows",(n,s)=>this.branches.some(a=>a.traverseAllows(n,s)));w(this,"traverseApply",(n,s)=>{const a=[];for(let u=0;u<this.branches.length;u++){if(s.pushBranch(),this.branches[u].traverseApply(n,s),!s.hasError())return this.branches[u].includesTransform?s.queuedMorphs.push(...s.popBranch().queuedMorphs):s.popBranch();a.push(s.popBranch().error)}s.errorFromNodeContext({code:"union",errors:a,meta:this.meta})});w(this,"traverseOptimistic",n=>{for(let s=0;s<this.branches.length;s++){const a=this.branches[s];if(a.traverseAllows(n))return a.contextFreeMorph?a.contextFreeMorph(n):n}return Mi})}get branchGroups(){const n=[];let s=-1;for(const a of this.branches){if(a.hasKind("unit")&&a.domain==="boolean"){s===-1?(s=n.length,n.push(a)):n[s]=W.intrinsic.boolean;continue}n.push(a)}return n}createBranchedOptimisticRootApply(){return(n,s)=>{const a=this.traverseOptimistic(n);if(a!==Mi)return a;const u=new na(n,this.$.resolvedConfig);return this.traverseApply(n,u),u.finalize(s)}}get shallowMorphs(){return this.branches.reduce((n,s)=>nr(n,s.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(n=>n.defaultShortDescription,ca)}innerToJsonSchema(n){if(this.branchGroups.length===1&&this.branchGroups[0].equals(W.intrinsic.boolean))return{type:"boolean"};const s=this.branchGroups.map(a=>a.toJsonSchemaRecurse(n));return s.every(a=>Object.keys(a).length===1&&Cm(a,"const"))?{enum:s.map(a=>a.const)}:{anyOf:s}}compile(n){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(n);let s=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(s=`typeof ${s} === "object" ? ${s} === null ? "null" : "object" : typeof ${s} === "function" ? "object" : typeof ${s}`);const a=this.discriminant.cases,u=Object.keys(a),{optimistic:c}=n;if(n.optimistic=!1,n.block(`switch(${s})`,()=>{for(const g in a){const v=a[g],S=g==="default"?g:`case ${g}`;n.line(`${S}: return ${v===!0?c?n.data:v:c?`${n.invoke(v)} ? ${v.contextFreeMorph?`${Xt(v.contextFreeMorph)}(${n.data})`:n.data} : "${Mi}"`:n.invoke(v)}`)}return n}),n.traversalKind==="Allows"){n.return(c?`"${Mi}"`:!1);return}const d=ca(this.discriminant.kind==="domain"?u.map(g=>{const v=g.slice(1,-1);return v==="function"?$i.object:$i[v]}):u),h=this.discriminant.path.map(g=>typeof g=="symbol"?Xt(g):JSON.stringify(g)),p=JSON.stringify(d),y=this.discriminant.kind==="domain"?`${V2}[${s}]`:`${j2}(${s})`;n.line(`ctx.errorFromNodeContext({
96
- code: "predicate",
97
- expected: ${p},
98
- actual: ${y},
99
- relativePath: [${h}],
100
- meta: ${this.compiledMeta}
101
- })`)}compileIndiscriminable(n){if(n.traversalKind==="Apply"){n.const("errors","[]");for(const s of this.branches)n.line("ctx.pushBranch()").line(n.invoke(s)).if("!ctx.hasError()",()=>n.return(s.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");n.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:s}=n;n.optimistic=!1;for(const a of this.branches)n.if(`${n.invoke(a)}`,()=>n.return(s?a.contextFreeMorph?`${Xt(a.contextFreeMorph)}(${n.data})`:n.data:!0));n.return(s?`"${Mi}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){var c,d;if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const h=He(this.unitBranches,(p,y)=>[`${y.in.serializedValue}`,y.hasKind("morph")?y:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:h}}const n=[];for(let h=0;h<this.branches.length-1;h++){const p=this.branches[h];for(let y=h+1;y<this.branches.length;y++){const g=this.branches[y],v=Vi(p.in,g.in,p.$);if(v instanceof oe)for(const S of v){if(!S.kind||S.optional)continue;let A,E;if(S.kind==="domain"){const k=S.l,$=S.r;A=`"${typeof k=="string"?k:k.domain}"`,E=`"${typeof $=="string"?$:$.domain}"`}else if(S.kind==="unit")A=S.l.serializedValue,E=S.r.serializedValue;else continue;const M=n.find(k=>ya(k.path,S.path)&&k.kind===S.kind);M?(M.cases[A]?M.cases[A].branchIndices=nr(M.cases[A].branchIndices,h):(c=M.cases)[A]??(c[A]={branchIndices:[h],condition:S.l}),M.cases[E]?M.cases[E].branchIndices=nr(M.cases[E].branchIndices,y):(d=M.cases)[E]??(d[E]={branchIndices:[y],condition:S.r})):n.push({kind:S.kind,cases:{[A]:{branchIndices:[h],condition:S.l},[E]:{branchIndices:[y],condition:S.r}},path:S.path})}}}const s=this.ordered?B2(n,this.branches):n;if(!s.length)return null;const a=N2(s,this),u={};for(const h in a.best.cases){const p=$2(a,h);if(p===null){u[h]=!0;continue}if(p.length===this.branches.length)return null;this.ordered&&p.sort((v,S)=>v.originalIndex-S.originalIndex);const y=p.map(v=>v.branch),g=y.length===1?y[0]:this.$.node("union",this.ordered?{branches:y,ordered:!0}:y);Object.assign(this.referencesById,g.referencesById),u[h]=g}if(a.defaultEntries.length){const h=a.defaultEntries.map(p=>p.branch);u.default=this.$.node("union",this.ordered?{branches:h,ordered:!0}:h,{prereduced:!0}),Object.assign(this.referencesById,u.default.referencesById)}return Object.assign(a.location,{cases:u})}}const N2=(e,t)=>{const n=e.sort((u,c)=>Object.keys(c.cases).length-Object.keys(u.cases).length)[0],s={kind:n.kind,path:n.path,optionallyChainedPropString:jA(n.path)},a=t.branches.map((u,c)=>({originalIndex:c,branch:u}));return{best:n,location:s,defaultEntries:a,node:t}},$2=(e,t)=>{const n=e.best.cases[t],s=L2(n.condition,e.location.path,e.node.$);let a=[];const u=[];for(let c=0;c<e.defaultEntries.length;c++){const d=e.defaultEntries[c];if(n.branchIndices.includes(d.originalIndex)){const h=vS(e.node.branches[d.originalIndex],e.location);h===null?a=null:a==null||a.push({originalIndex:d.originalIndex,branch:h})}else if(d.branch.hasKind("alias")&&s.hasKind("domain")&&s.domain==="object")a==null||a.push(d);else{if(d.branch.in.overlaps(s)){const h=vS(d.branch,e.location);a==null||a.push({originalIndex:d.originalIndex,branch:h})}u.push(d)}}return e.defaultEntries=u,a},B2=(e,t)=>e.filter(s=>{const a=Object.values(s.cases).map(u=>u.branchIndices);for(let u=0;u<a.length-1;u++){const c=a[u];for(let d=u+1;d<a.length;d++){const h=a[d];for(const p of c)for(const y of h)if(p>y&&t[p].overlaps(t[y]))return!1}}return!0}),L2=(e,t,n)=>{let s=e==="undefined"?n.node("unit",{unit:void 0}):e==="null"?n.node("unit",{unit:null}):e==="boolean"?n.units([!0,!1]):e;for(let a=t.length-1;a>=0;a--){const u=t[a];s=n.node("intersection",typeof u=="number"?{proto:"Array",sequence:[...dD(u).map(c=>({})),s]}:{domain:"object",required:[{key:u,value:s}]})}return s},jA=e=>e.reduce((t,n)=>t+aA(n,!0),"data"),V2=Xt(mD),j2=Xt(qe),zA={implementation:k2,Node:D2},z2=e=>({kind:e.kind,path:e.path.map(t=>typeof t=="string"?t:fl(t)),cases:He(e.cases,(t,n)=>[t,n===!0?n:n.hasKind("union")&&n.discriminantJson?n.discriminantJson:n.json])}),U2={delimiter:" | ",finalDelimiter:" | "},q2=e=>ca(e,U2),ca=(e,t)=>{const n=(t==null?void 0:t.delimiter)??", ",s=(t==null?void 0:t.finalDelimiter)??" or ";if(e.length===0)return"never";if(e.length===1)return e[0];if(e.length===2&&e[0]==="false"&&e[1]==="true"||e[0]==="true"&&e[1]==="false")return"boolean";const a={},u=e.filter(d=>a[d]?!1:a[d]=!0),c=u.pop();return`${u.join(n)}${u.length?s:""}${c}`},Bh=(e,t,n)=>{const s=t.map(()=>[]);for(let u=0;u<e.length;u++){let c={};for(let d=0;d<t.length;d++){if(s[d]===null)continue;if(e[u].equals(t[d])){s[d]=null,c={};break}const h=kt(e[u],t[d],n);if(!(h instanceof oe)){if(h.equals(e[u])){s[d].push(e[u]),c={};break}h.equals(t[d])?s[d]=null:c[d]=h}}for(const d in c)s[d][u]=c[d]}const a=s.flatMap((u,c)=>(u==null?void 0:u.flatMap(d=>d.branches))??t[c]);return a.length===0?oe.init("union",e,t):a},K2=({branches:e,ordered:t})=>{if(e.length<2)return e;const n=e.map(()=>!0);for(let s=0;s<e.length;s++)for(let a=s+1;a<e.length&&n[s]&&n[a];a++){if(e[s].equals(e[a])){n[a]=!1;continue}const u=Vi(e[s].in,e[a].in,e[0].$);u instanceof oe||(t||P2(e[s],e[a]),u.equals(e[s].in)?n[s]=!!t:u.equals(e[a].in)&&(n[a]=!1))}return e.filter((s,a)=>n[a])},P2=(e,t)=>{!e.includesTransform&&!t.includesTransform||(ya(e.shallowMorphs,t.shallowMorphs)||Z(SS(e.expression,t.expression)),ya(e.flatMorphs,t.flatMorphs,{isEqual:(n,s)=>{var a,u;return n.propString===s.propString&&(n.node.hasKind("morph")&&s.node.hasKind("morph")?n.node.hasEqualMorphs(s.node):n.node.hasKind("intersection")&&s.node.hasKind("intersection")?((a=n.node.structure)==null?void 0:a.structuralMorphRef)===((u=s.node.structure)==null?void 0:u.structuralMorphRef):!1)}})||Z(SS(e.expression,t.expression)))},vS=(e,t)=>e.transform((n,s)=>n==="domain"||n==="unit"?null:s,{shouldTransform:(n,s)=>{const a=jA(s.path);return t.optionallyChainedPropString.startsWith(a)?n.hasKind("domain")&&n.domain==="object"||(n.hasKind("domain")||t.kind==="unit")&&a===t.optionallyChainedPropString?!0:n.children.length!==0&&n.kind!=="index":!1}}),SS=(e,t)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
102
- Left: ${e}
103
- Right: ${t}`,I2=(e,t)=>`The intersection of two ordered unions is indeterminate:
104
- Left: ${e}
105
- Right: ${t}`,H2=lt({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:e=>e instanceof Date?e.toISOString():lr(e)}},normalize:e=>e,defaults:{description:e=>qe(e.unit),problem:({expected:e,actual:t})=>`${e===t?`must be reference equal to ${e} (serialized to the same value)`:`must be ${e} (was ${t})`}`},intersections:{unit:(e,t)=>oe.init("unit",e,t),...hl("unit",(e,t)=>{if(t.allows(e.unit))return e;const n=t.hasKind("intersection")?t.basis:t;if(n){const s=n.hasKind("domain")?n:W.intrinsic.object;if(e.domain!==s.domain){const a=e.domain==="undefined"||e.domain==="null"||e.domain==="boolean"?e.domain:W.intrinsic[e.domain];return oe.init("domain",a,s)}}return oe.init("assignability",e,t.hasKind("intersection")?t.children.find(s=>!s.allows(e.unit)):t)})}});class G2 extends qm{constructor(){super(...arguments);w(this,"compiledValue",this.json.unit);w(this,"serializedValue",typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`);w(this,"compiledCondition",xS(this.unit,this.serializedValue));w(this,"compiledNegation",xS(this.unit,this.serializedValue,"negated"));w(this,"expression",qe(this.unit));w(this,"domain",Hn(this.unit));w(this,"traverseAllows",this.unit instanceof Date?n=>n instanceof Date&&n.toISOString()===this.compiledValue:Number.isNaN(this.unit)?n=>Number.isNaN(n):n=>n===this.unit)}get defaultShortDescription(){return this.domain==="object"?$i.object:this.description}innerToJsonSchema(n){return this.unit===null?{type:"null"}:W.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:n.fallback.unit({code:"unit",base:{},unit:this.unit})}}const UA={implementation:H2,Node:G2},xS=(e,t,n)=>{if(e instanceof Date){const s=`data instanceof Date && data.toISOString() === ${t}`;return n?`!(${s})`:s}return Number.isNaN(e)?`${n?"!":""}Number.isNaN(data)`:`data ${n?"!":"="}== ${t}`},F2=lt({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(e,t)=>{const n=t.$.parseSchema(e);if(!n.extends(W.intrinsic.key))return Z(Z2(n.expression));const s=n.branches.filter(a=>a.hasKind("unit"));return s.length?Z(X2(s.map(a=>qe(a.unit)))):n}},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`[${e.signature.expression}]: ${e.value.description}`},intersections:{index:(e,t,n)=>{if(e.signature.equals(t.signature)){const s=kt(e.value,t.value,n),a=s instanceof oe?W.intrinsic.never.internal:s;return n.$.node("index",{signature:e.signature,value:a})}return e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:null}}});class Y2 extends Ra{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.object.internal);w(this,"expression",`[${this.signature.expression}]: ${this.value.expression}`);w(this,"flatRefs",Ie(this.value.flatRefs.map(n=>ys([this.signature,...n.path],n.node)),ys([this.signature],this.value)));w(this,"traverseAllows",(n,s)=>yc(n).every(a=>this.signature.traverseAllows(a[0],s)?Li(a[0],()=>this.value.traverseAllows(a[1],s),s):!0));w(this,"traverseApply",(n,s)=>{for(const a of yc(n))this.signature.traverseAllows(a[0],s)&&Li(a[0],()=>this.value.traverseApply(a[1],s),s)})}_transform(n,s){s.path.push(this.signature);const a=super._transform(n,s);return s.path.pop(),a}compile(){}}const qA={implementation:F2,Node:Y2},X2=e=>`Index keys ${e.join(", ")} should be specified as named props.`,Z2=e=>`Indexed key definition '${e}' must be a string or symbol`,J2=lt({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`${e.compiledKey}: ${e.value.description}`,expected:e=>e.missingValueDescription,actual:()=>"missing"},intersections:{required:Cp,optional:Cp}});class Q2 extends NA{constructor(){super(...arguments);w(this,"expression",`${this.compiledKey}: ${this.value.expression}`);w(this,"errorContext",Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta}));w(this,"compiledErrorContext",Xc(this.errorContext))}}const KA={implementation:J2,Node:Q2},W2=lt({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},optionals:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},defaultables:{child:e=>e.map(t=>t[0]),parse:(e,t)=>{if(e.length!==0)return e.map(n=>{const s=t.$.parseSchema(n[0]);return zm(s,n[1],null),[s,n[1]]})},serialize:e=>e.map(t=>[t[0].collapsibleJson,lr(t[1])])},variadic:{child:!0,parse:(e,t)=>t.$.parseSchema(e,t)},minVariadicLength:{parse:e=>e===0?void 0:e},postfix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}}},normalize:e=>{var t,n,s;if(typeof e=="string")return{variadic:e};if("variadic"in e||"prefix"in e||"defaultables"in e||"optionals"in e||"postfix"in e||"minVariadicLength"in e){if((t=e.postfix)!=null&&t.length){if(!e.variadic)return Z(i$);if((n=e.optionals)!=null&&n.length||(s=e.defaultables)!=null&&s.length)return Z(IA)}return e.minVariadicLength&&!e.variadic?Z("minVariadicLength may not be specified without a variadic element"):e}return{variadic:e}},reduce:(e,t)=>{var d,h,p,y,g,v,S;let n=e.minVariadicLength??0;const s=((d=e.prefix)==null?void 0:d.slice())??[],a=((h=e.defaultables)==null?void 0:h.slice())??[],u=((p=e.optionals)==null?void 0:p.slice())??[],c=((y=e.postfix)==null?void 0:y.slice())??[];if(e.variadic){for(;(g=u.at(-1))!=null&&g.equals(e.variadic);)u.pop();if(u.length===0&&a.length===0)for(;(v=s.at(-1))!=null&&v.equals(e.variadic);)s.pop(),n++;for(;(S=c[0])!=null&&S.equals(e.variadic);)c.shift(),n++}else u.length===0&&a.length===0&&s.push(...c.splice(0));if(n!==e.minVariadicLength||e.prefix&&e.prefix.length!==s.length)return t.node("sequence",{...e,prefix:s,defaultables:a,optionals:u,postfix:c,minVariadicLength:n},{prereduced:!0})},defaults:{description:e=>e.isVariadicOnly?`${e.variadic.nestableExpression}[]`:`[${e.tuple.map(n=>n.kind==="defaultables"?`${n.node.nestableExpression} = ${qe(n.default)}`:n.kind==="optionals"?`${n.node.nestableExpression}?`:n.kind==="variadic"?`...${n.node.nestableExpression}[]`:n.node.expression).join(", ")}]`},intersections:{sequence:(e,t,n)=>{const s=Bo({l:e.tuple,r:t.tuple,disjoint:new oe,result:[],fixedVariants:[],ctx:n}),a=s.disjoint.length===0?[s,...s.fixedVariants]:s.fixedVariants;return a.length===0?s.disjoint:a.length===1?n.$.node("sequence",wS(a[0].result)):n.$.node("union",a.map(u=>({proto:Array,sequence:wS(u.result)})))}}});var Nx,$x,Bx,Lx;class e$ extends Ra{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.Array.internal);w(this,"tuple",n$(this.inner));w(this,"prefixLength",((Nx=this.prefix)==null?void 0:Nx.length)??0);w(this,"defaultablesLength",(($x=this.defaultables)==null?void 0:$x.length)??0);w(this,"optionalsLength",((Bx=this.optionals)==null?void 0:Bx.length)??0);w(this,"postfixLength",((Lx=this.postfix)==null?void 0:Lx.length)??0);w(this,"defaultablesAndOptionals",[]);w(this,"prevariadic",this.tuple.filter(n=>n.kind==="defaultables"||n.kind==="optionals"?(this.defaultablesAndOptionals.push(n.node),!0):n.kind==="prefix"));w(this,"variadicOrPostfix",Js(this.variadic&&[this.variadic],this.postfix));w(this,"flatRefs",this.addFlatRefs());w(this,"isVariadicOnly",this.prevariadic.length+this.postfixLength===0);w(this,"minVariadicLength",this.inner.minVariadicLength??0);w(this,"minLength",this.prefixLength+this.minVariadicLength+this.postfixLength);w(this,"minLengthNode",this.minLength===0?null:this.$.node("minLength",this.minLength));w(this,"maxLength",this.variadic?null:this.tuple.length);w(this,"maxLengthNode",this.maxLength===null?null:this.$.node("maxLength",this.maxLength));w(this,"impliedSiblings",this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[]);w(this,"defaultValueMorphs",t$(this));w(this,"defaultValueMorphsReference",this.defaultValueMorphs.length?Xt(this.defaultValueMorphs):void 0);w(this,"traverseAllows",(n,s)=>{for(let a=0;a<n.length;a++)if(!this.elementAtIndex(n,a).node.traverseAllows(n[a],s))return!1;return!0});w(this,"traverseApply",(n,s)=>{let a=0;for(;a<n.length;a++)Li(a,()=>this.elementAtIndex(n,a).node.traverseApply(n[a],s),s)});w(this,"expression",this.description)}addFlatRefs(){return fS(this.flatRefs,this.prevariadic.flatMap((n,s)=>Ie(n.node.flatRefs.map(a=>ys([`${s}`,...a.path],a.node)),ys([`${s}`],n.node)))),fS(this.flatRefs,this.variadicOrPostfix.flatMap(n=>Ie(n.flatRefs.map(s=>ys([W.intrinsic.nonNegativeIntegerString.internal,...s.path],s.node)),ys([W.intrinsic.nonNegativeIntegerString.internal],n)))),this.flatRefs}elementAtIndex(n,s){if(s<this.prevariadic.length)return this.tuple[s];const a=n.length-this.postfixLength;return s>=a?{kind:"postfix",node:this.postfix[s-a]}:{kind:"variadic",node:this.variadic??bt(`Unexpected attempt to access index ${s} on ${this}`)}}get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(n){if(this.prefix)for(const[s,a]of this.prefix.entries())n.traverseKey(`${s}`,`data[${s}]`,a);for(const[s,a]of this.defaultablesAndOptionals.entries()){const u=`${s+this.prefixLength}`;n.if(`${u} >= ${n.data}.length`,()=>n.traversalKind==="Allows"?n.return(!0):n.return()),n.traverseKey(u,`data[${u}]`,a)}if(this.variadic&&(this.postfix&&n.const("firstPostfixIndex",`${n.data}.length${this.postfix?`- ${this.postfix.length}`:""}`),n.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>n.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[s,a]of this.postfix.entries()){const u=`firstPostfixIndex + ${s}`;n.traverseKey(u,`data[${u}]`,a)}n.traversalKind==="Allows"&&n.return(!0)}_transform(n,s){s.path.push(W.intrinsic.nonNegativeIntegerString.internal);const a=super._transform(n,s);return s.path.pop(),a}reduceJsonSchema(n,s){if(this.prevariadic.length&&(n.prefixItems=this.prevariadic.map(a=>{const u=a.node.toJsonSchemaRecurse(s);if(a.kind==="defaultables"){const c=typeof a.default=="function"?a.default():a.default;u.default=W.intrinsic.jsonData.allows(c)?c:s.fallback.defaultValue({code:"defaultValue",base:u,value:c})}return u})),this.minLength&&(n.minItems=this.minLength),this.variadic){const a=Object.assign(n,{items:this.variadic.toJsonSchemaRecurse(s)});if(this.maxLength&&(a.maxItems=this.maxLength),this.postfix){const u=this.postfix.map(c=>c.toJsonSchemaRecurse(s));n=s.fallback.arrayPostfix({code:"arrayPostfix",base:a,elements:u})}}else n.items=!1,delete n.maxItems;return n}}const Lh={},t$=e=>{if(!e.defaultables)return[];const t=[];let n="[";const s=e.prefixLength+e.defaultablesLength-1;for(let a=e.prefixLength;a<=s;a++){const[u,c]=e.defaultables[a-e.prefixLength];t.push(BA(a,u,c)),n+=`${a}: ${u.id} = ${lr(c)}, `}return n+="]",Lh[n]??(Lh[n]=t)},PA={implementation:W2,Node:e$},n$=e=>{const t=[];if(e.prefix)for(const n of e.prefix)t.push({kind:"prefix",node:n});if(e.defaultables)for(const[n,s]of e.defaultables)t.push({kind:"defaultables",node:n,default:s});if(e.optionals)for(const n of e.optionals)t.push({kind:"optionals",node:n});if(e.variadic&&t.push({kind:"variadic",node:e.variadic}),e.postfix)for(const n of e.postfix)t.push({kind:"postfix",node:n});return t},wS=e=>e.reduce((t,n)=>(n.kind==="variadic"?t.variadic=n.node:n.kind==="defaultables"?t.defaultables=Ie(t.defaultables,[[n.node,n.default]]):t[n.kind]=Ie(t[n.kind],n.node),t),{}),IA="A postfix required element cannot follow an optional or defaultable element",i$="A postfix element requires a variadic element",Bo=e=>{var g,v;const[t,...n]=e.l,[s,...a]=e.r;if(!t||!s)return e;const u=((g=n.at(-1))==null?void 0:g.kind)==="postfix",c=((v=a.at(-1))==null?void 0:v.kind)==="postfix",d=t.kind==="prefix"||s.kind==="prefix"?"prefix":t.kind==="postfix"||s.kind==="postfix"?"postfix":t.kind==="variadic"&&s.kind==="variadic"?"variadic":u||c?"prefix":t.kind==="defaultables"||s.kind==="defaultables"?"defaultables":"optionals";if(t.kind==="prefix"&&s.kind==="variadic"&&c){const S=Bo({...e,fixedVariants:[],r:a.map(A=>({...A,kind:"prefix"}))});S.disjoint.length===0&&e.fixedVariants.push(S)}else if(s.kind==="prefix"&&t.kind==="variadic"&&u){const S=Bo({...e,fixedVariants:[],l:n.map(A=>({...A,kind:"prefix"}))});S.disjoint.length===0&&e.fixedVariants.push(S)}const h=kt(t.node,s.node,e.ctx);if(h instanceof oe)if(d==="prefix"||d==="postfix")e.disjoint.push(...h.withPrefixKey(d==="prefix"?e.result.length:`-${n.length+1}`,"required")),e.result=[...e.result,{kind:d,node:W.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?e:Bo({...e,fixedVariants:[],l:n.map(S=>({...S,kind:"prefix"})),r:n.map(S=>({...S,kind:"prefix"}))});else d==="defaultables"?(t.kind==="defaultables"&&s.kind==="defaultables"&&t.default!==s.default&&Z($A(t.default,s.default)),e.result=[...e.result,{kind:d,node:h,default:t.kind==="defaultables"?t.default:s.kind==="defaultables"?s.default:bt(`Unexpected defaultable intersection from ${t.kind} and ${s.kind} elements.`)}]):e.result=[...e.result,{kind:d,node:h}];const p=e.l.length,y=e.r.length;return(t.kind!=="variadic"||p>=y&&(s.kind==="variadic"||y===1))&&(e.l=n),(s.kind!=="variadic"||y>=p&&(t.kind==="variadic"||p===1))&&(e.r=a),Bo(e)},HA=e=>t=>{var n,s;if(t.props.length||t.index){const a=((n=t.index)==null?void 0:n.map(c=>c[e]))??[];for(const c of t.props)a.push(c[e]);t.undeclared&&a.push(`+ (undeclared): ${t.undeclared}`);const u=`{ ${a.join(", ")} }`;return t.sequence?`${u} & ${t.sequence.description}`:u}return((s=t.sequence)==null?void 0:s.description)??"{}"},s$=HA("description"),r$=HA("expression"),AS=(e,t,n)=>{const s=e.required?"required":"optional";if(!t.signature.allows(e.key))return null;const a=Vi(e.value,t.value,n);return a instanceof oe?s==="optional"?n.node("optional",{key:e.key,value:W.intrinsic.never.internal}):a.withPrefixKey(e.key,e.kind):null},a$=lt({kind:"structure",hasAssociatedError:!1,normalize:e=>e,applyConfig:(e,t)=>!e.undeclared&&t.onUndeclaredKey!=="ignore"?{...e,undeclared:t.onUndeclaredKey}:e,keys:{required:{child:!0,parse:tn("required"),reduceIo:(e,t,n)=>{t.required=Ie(t.required,n.map(s=>s[e]))}},optional:{child:!0,parse:tn("optional"),reduceIo:(e,t,n)=>{if(e==="in"){t.optional=n.map(s=>s.in);return}for(const s of n)t[s.outProp.kind]=Ie(t[s.outProp.kind],s.outProp.out)}},index:{child:!0,parse:tn("index")},sequence:{child:!0,parse:tn("sequence")},undeclared:{parse:e=>e==="ignore"?void 0:e,reduceIo:(e,t,n)=>{n==="delete"&&(e==="in"?delete t.undeclared:t.undeclared="reject")}}},defaults:{description:s$},intersections:{structure:(e,t,n)=>{const s={...e.inner},a={...t.inner},u=new oe;if(e.undeclared){const h=e.keyof();for(const p of t.requiredKeys)h.allows(p)||u.add("presence",W.intrinsic.never.internal,t.propsByKey[p].value,{path:[p]});a.optional&&(a.optional=a.optional.filter(p=>h.allows(p.key))),a.index&&(a.index=a.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=Vi(h,p.signature,n.$);if(y instanceof oe)return[];const g=_p(y,p.value,n.$);return g.required&&(a.required=Js(a.required,g.required)),g.optional&&(a.optional=Js(a.optional,g.optional)),g.index??[]}))}if(t.undeclared){const h=t.keyof();for(const p of e.requiredKeys)h.allows(p)||u.add("presence",e.propsByKey[p].value,W.intrinsic.never.internal,{path:[p]});s.optional&&(s.optional=s.optional.filter(p=>h.allows(p.key))),s.index&&(s.index=s.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=Vi(h,p.signature,n.$);if(y instanceof oe)return[];const g=_p(y,p.value,n.$);return g.required&&(s.required=Js(s.required,g.required)),g.optional&&(s.optional=Js(s.optional,g.optional)),g.index??[]}))}const c={};(e.undeclared||t.undeclared)&&(c.undeclared=e.undeclared==="reject"||t.undeclared==="reject"?"reject":"delete");const d=Sc({kind:"structure",baseInner:c,l:xc(s),r:xc(a),roots:[],ctx:n});return d instanceof oe&&u.push(...d),u.length?u:d}},reduce:(e,t)=>{if(e.index){if(!(e.required||e.optional))return;let n=!1;const s=e.required??[],a=e.optional??[],u=[...a];for(const c of e.index){for(const d of s){const h=AS(d,c,t);if(h instanceof oe)return h}for(const[d,h]of a.entries()){const p=AS(h,c,t);if(p instanceof oe)return p;p!==null&&(u[d]=p,n=!0)}}if(n)return t.node("structure",{...e,optional:u},{prereduced:!0})}}});var Vx,jx;class o$ extends Ra{constructor(){super(...arguments);w(this,"impliedBasis",W.intrinsic.object.internal);w(this,"impliedSiblings",this.children.flatMap(n=>n.impliedSiblings??[]));w(this,"props",Js(this.required,this.optional));w(this,"propsByKey",He(this.props,(n,s)=>[s.key,s]));w(this,"propsByKeyReference",Xt(this.propsByKey));w(this,"expression",r$(this));w(this,"requiredKeys",((Vx=this.required)==null?void 0:Vx.map(n=>n.key))??[]);w(this,"optionalKeys",((jx=this.optional)==null?void 0:jx.map(n=>n.key))??[]);w(this,"literalKeys",[...this.requiredKeys,...this.optionalKeys]);w(this,"_keyof");w(this,"traverseAllows",(n,s)=>this._traverse("Allows",n,s));w(this,"traverseApply",(n,s)=>this._traverse("Apply",n,s));w(this,"_traverse",(n,s,a)=>{const u=(a==null?void 0:a.currentErrorCount)??0;for(let c=0;c<this.props.length;c++)if(n==="Allows"){if(!this.props[c].traverseAllows(s,a))return!1}else if(this.props[c].traverseApply(s,a),a.failFast&&a.currentErrorCount>u)return!1;if(this.sequence){if(n==="Allows"){if(!this.sequence.traverseAllows(s,a))return!1}else if(this.sequence.traverseApply(s,a),a.failFast&&a.currentErrorCount>u)return!1}if(this.index||this.undeclared==="reject"){const c=Object.keys(s);c.push(...Object.getOwnPropertySymbols(s));for(let d=0;d<c.length;d++){const h=c[d];if(this.index){for(const p of this.index)if(p.signature.traverseAllows(h,a)){if(n==="Allows"){if(!Li(h,()=>p.value.traverseAllows(s[h],a),a))return!1}else if(Li(h,()=>p.value.traverseApply(s[h],a),a),a.failFast&&a.currentErrorCount>u)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(h)&&(n==="Allows"||(a.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[h],meta:this.meta}),a.failFast)))return!1}}return this.structuralMorph&&a&&!a.hasError()&&a.queueMorphs([this.structuralMorph]),!0});w(this,"declaresKey",n=>{var s;return n in this.propsByKey||((s=this.index)==null?void 0:s.some(a=>a.signature.allows(n)))||this.sequence!==void 0&&W.intrinsic.nonNegativeIntegerString.allows(n)});w(this,"structuralMorphRef",this.structuralMorph&&Xt(this.structuralMorph))}keyof(){if(this._keyof)return this._keyof;let n=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:s}of this.index)n=n.concat(s.branches);return this._keyof=this.$.node("union",n)}map(n){return this.$.node("structure",this.props.flatMap(n).reduce((s,a)=>{const u=this.propsByKey[a.key];if(Ft(a))return a.kind!=="required"&&a.kind!=="optional"?Z(`Map result must have kind "required" or "optional" (was ${a.kind})`):(s[a.kind]=Ie(s[a.kind],a),s);const c=a.kind??(u==null?void 0:u.kind)??"required",d=He(a,(h,p)=>h in jm.implementation.keys?[h,p]:[]);return s[c]=Ie(s[c],this.$.node(c,d)),s},{}))}assertHasKeys(n){const s=n.filter(a=>!zu(a,this.keyof()));if(s.length)return Z(TS(this.expression,s))}get(n,...s){var h;let a,u=!1;const c=f$(n);if((typeof c=="string"||typeof c=="symbol")&&this.propsByKey[c]&&(a=this.propsByKey[c].value,u=this.propsByKey[c].required),this.index)for(const p of this.index)zu(c,p.signature)&&(a=(a==null?void 0:a.and(p.value))??p.value);if(this.sequence&&zu(c,W.intrinsic.nonNegativeIntegerString))if(fe(c,"root"))this.sequence.variadic&&(a=(a==null?void 0:a.and(this.sequence.element))??this.sequence.element);else{const p=Number.parseInt(c);if(p<this.sequence.prevariadic.length){const y=this.sequence.prevariadic[p].node;a=(a==null?void 0:a.and(y))??y,u||(u=p<this.sequence.prefixLength)}else if(this.sequence.variadic){const y=this.$.node("union",this.sequence.variadicOrPostfix);a=(a==null?void 0:a.and(y))??y}}if(!a)return(h=this.sequence)!=null&&h.variadic&&fe(c,"root")&&c.extends(W.intrinsic.number)?Z(d$(c.expression,this.sequence.expression)):Z(TS(this.expression,[c]));const d=a.get(...s);return u?d:d.or(W.intrinsic.undefined)}pick(...n){return this.assertHasKeys(n),this.$.node("structure",this.filterKeys("pick",n))}omit(...n){return this.assertHasKeys(n),this.$.node("structure",this.filterKeys("omit",n))}optionalize(){const{required:n,...s}=this.inner;return this.$.node("structure",{...s,optional:this.props.map(a=>a.hasKind("required")?this.$.node("optional",a.inner):a)})}require(){const{optional:n,...s}=this.inner;return this.$.node("structure",{...s,required:this.props.map(a=>a.hasKind("optional")?{key:a.key,value:a.value}:a)})}merge(n){const s=this.filterKeys("omit",[n.keyof()]);return n.required&&(s.required=Ie(s.required,n.required)),n.optional&&(s.optional=Ie(s.optional,n.optional)),n.index&&(s.index=Ie(s.index,n.index)),n.sequence&&(s.sequence=n.sequence),n.undeclared?s.undeclared=n.undeclared:delete s.undeclared,this.$.node("structure",s)}filterKeys(n,s){const a=lA(this.inner),u=c=>{const d=s.some(h=>zu(c,h));return n==="pick"?d:!d};return a.required&&(a.required=a.required.filter(c=>u(c.key))),a.optional&&(a.optional=a.optional.filter(c=>u(c.key))),a.index&&(a.index=a.index.filter(c=>u(c.signature))),a}get defaultable(){var n;return this.cacheGetter("defaultable",((n=this.optional)==null?void 0:n.filter(s=>s.hasDefault()))??[])}_compileDeclaresKey(n){const s=[];if(this.props.length&&s.push(`k in ${this.propsByKeyReference}`),this.index)for(const a of this.index)s.push(n.invoke(a.signature,{kind:"Allows",arg:"k"}));return this.sequence&&s.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),s.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",u$(this))}compile(n){n.traversalKind==="Apply"&&n.initializeErrorCount();for(const s of this.props)n.check(s),n.traversalKind==="Apply"&&n.returnIfFailFast();if(this.sequence&&(n.check(this.sequence),n.traversalKind==="Apply"&&n.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(n.const("keys","Object.keys(data)"),n.line("keys.push(...Object.getOwnPropertySymbols(data))"),n.for("i < keys.length",()=>this.compileExhaustiveEntry(n))),n.traversalKind==="Allows")return n.return(!0);this.structuralMorphRef&&n.if("ctx && !ctx.hasError()",()=>(n.line("ctx.queueMorphs(["),c$(n,this),n.line("])")))}compileExhaustiveEntry(n){if(n.const("k","keys[i]"),this.index)for(const s of this.index)n.if(`${n.invoke(s.signature,{arg:"k",kind:"Allows"})}`,()=>n.traverseKey("k","data[k]",s.value));return this.undeclared==="reject"&&n.if(`!(${this._compileDeclaresKey(n)})`,()=>n.traversalKind==="Allows"?n.return(!1):n.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>n.return())),n}reduceJsonSchema(n,s){var a;switch(n.type){case"object":return this.reduceObjectJsonSchema(n,s);case"array":const u=((a=this.sequence)==null?void 0:a.reduceJsonSchema(n,s))??n;return this.props.length||this.index?s.fallback.arrayObject({code:"arrayObject",base:u,object:this.reduceObjectJsonSchema({type:"object"},s)}):u;default:return xt.throwInternalOperandError("structure",n)}}reduceObjectJsonSchema(n,s){if(this.props.length){n.properties={};for(const a of this.props){const u=a.value.toJsonSchemaRecurse(s);if(typeof a.key=="symbol"){s.fallback.symbolKey({code:"symbolKey",base:n,key:a.key,value:u,optional:a.optional});continue}if(a.hasDefault()){const c=typeof a.default=="function"?a.default():a.default;u.default=W.intrinsic.jsonData.allows(c)?c:s.fallback.defaultValue({code:"defaultValue",base:u,value:c})}n.properties[a.key]=u}this.requiredKeys.length&&n.properties&&(n.required=this.requiredKeys.filter(a=>typeof a=="string"&&a in n.properties))}if(this.index)for(const a of this.index){const u=a.value.toJsonSchemaRecurse(s);if(a.signature.equals(W.intrinsic.string)){n.additionalProperties=u;continue}for(const c of a.signature.branches){if(!c.extends(W.intrinsic.string)){n=s.fallback.symbolKey({code:"symbolKey",base:n,key:null,value:u,optional:!1});continue}let d={type:"string"};if(c.hasKind("morph")&&(d=s.fallback.morph({code:"morph",base:c.in.toJsonSchemaRecurse(s),out:c.out.toJsonSchemaRecurse(s)})),!c.hasKind("intersection"))return bt(`Unexpected index branch kind ${c.kind}.`);const{pattern:h}=c.inner;if(h){const p=Object.assign(d,{pattern:h[0].rule});for(let y=1;y<h.length;y++)d=s.fallback.patternIntersection({code:"patternIntersection",base:p,pattern:h[y].rule});n.patternProperties??(n.patternProperties={}),n.patternProperties[p.pattern]=u}}}return this.undeclared&&!n.additionalProperties&&(n.additionalProperties=!1),n}}const Vh={},l$=e=>{var n,s;let t="";for(let a=0;a<e.defaultable.length;a++)t+=e.defaultable[a].defaultValueMorphRef;if((n=e.sequence)!=null&&n.defaultValueMorphsReference&&(t+=(s=e.sequence)==null?void 0:s.defaultValueMorphsReference),e.undeclared==="delete"){if(t+="delete !(",e.required)for(const a of e.required)t+=a.compiledKey+" | ";if(e.optional)for(const a of e.optional)t+=a.compiledKey+" | ";if(e.index)for(const a of e.index)t+=a.signature.id+" | ";if(e.sequence)if(e.sequence.maxLength===null)t+=pe.nonNegativeIntegerString.id;else for(let a=0;a<e.sequence.tuple.length;a++)t+=a+" | ";t+=")"}return t},u$=e=>{const t=l$(e);if(!t)return;if(Vh[t])return Vh[t];const n=(s,a)=>{var u;for(let c=0;c<e.defaultable.length;c++)e.defaultable[c].key in s||e.defaultable[c].defaultValueMorph(s,a);if((u=e.sequence)!=null&&u.defaultables)for(let c=s.length-e.sequence.prefixLength;c<e.sequence.defaultables.length;c++)e.sequence.defaultValueMorphs[c](s,a);if(e.undeclared==="delete")for(const c in s)e.declaresKey(c)||delete s[c];return s};return Vh[t]=n},c$=(e,t)=>{var a;const s=`(data${t.defaultable.some(u=>u.defaultValueMorph.length===2)||((a=t.sequence)==null?void 0:a.defaultValueMorphs.some(u=>u.length===2))?", ctx":""})`;return e.block(`${s} => `,u=>{var c;for(let d=0;d<t.defaultable.length;d++){const{serializedKey:h,defaultValueMorphRef:p}=t.defaultable[d];u.if(`!(${h} in data)`,y=>y.line(`${p}${s}`))}return(c=t.sequence)!=null&&c.defaultables&&u.for(`i < ${t.sequence.defaultables.length}`,d=>d.set("data[i]",5),`data.length - ${t.sequence.prefixLength}`),t.undeclared==="delete"&&u.forIn("data",d=>d.if(`!(${t._compileDeclaresKey(d)})`,h=>h.line("delete data[k]"))),u.return("data")})},GA={implementation:a$,Node:o$},f$=e=>(fe(e,"root")&&e.hasKind("unit")&&(e=e.unit),typeof e=="number"&&(e=`${e}`),e),d$=(e,t)=>`${e} is not allowed as an array index on ${t}. Use the 'nonNegativeIntegerString' keyword instead.`,_p=(e,t,n)=>{const[s,a]=fD(e.branches,c=>c.hasKind("unit"));if(!s.length)return{index:n.node("index",{signature:e,value:t})};const u={};for(const c of s){const d=n.node("required",{key:c.unit,value:t});u[d.kind]=Ie(u[d.kind],d)}return a.length&&(u.index=n.node("index",{signature:a,value:t})),u},h$=e=>fe(e,"root")?e.expression:qe(e),TS=(e,t)=>`Key${t.length===1?"":"s"} ${t.map(h$).join(", ")} ${t.length===1?"does":"do"} not exist on ${e}`,Jc={...i2,alias:Um.implementation,domain:Km.implementation,unit:UA.implementation,proto:Ac.implementation,union:zA.implementation,morph:VA.implementation,intersection:LA.implementation,divisor:bA.implementation,pattern:_A.implementation,predicate:gA.implementation,required:KA.implementation,optional:jm.implementation,index:qA.implementation,sequence:PA.implementation,structure:GA.implementation};W.defaultConfig=AD(Object.assign(He(Jc,(e,t)=>[e,t.defaults]),{jitless:ND(),clone:_D,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:xt.defaultConfig}));W.resolvedConfig=Ep(W.defaultConfig,W.config);const p$={...s2,alias:Um.Node,domain:Km.Node,unit:UA.Node,proto:Ac.Node,union:zA.Node,morph:VA.Node,intersection:LA.Node,divisor:bA.Node,pattern:_A.Node,predicate:gA.Node,required:KA.Node,optional:jm.Node,index:qA.Node,sequence:PA.Node,structure:GA.Node};class kp extends bD{get[Bi](){return"module"}}const FA=(e,t)=>new kp(He(e,(n,s)=>[n,fe(s,"module")?FA(s,t):t.bindReference(s)])),m$=e=>It(e)?e:"branches"in e&&It(e.branches)?e.branches:void 0,y$=(e,t)=>Z(`Node of kind ${t} is not valid as a ${e} definition`),ES=e=>`#${e} duplicates public alias ${e}`,jh={};W.ambient??(W.ambient={});let RS;const YA="function $",g$=e=>XA(e,ZA(e)),XA=(e,t)=>{const n=t.write(YA,4),s=t.compile()();for(const a of e)a.precompilation||(a.traverseAllows=s[`${a.id}Allows`].bind(s),a.isRoot()&&!a.allowsRequiresContext&&(a.allows=a.traverseAllows),a.traverseApply=s[`${a.id}Apply`].bind(s),s[`${a.id}Optimistic`]&&(a.traverseOptimistic=s[`${a.id}Optimistic`].bind(s)),a.precompilation=n)},ZA=e=>new rA().return(e.reduce((t,n)=>{const s=new Nh({kind:"Allows"}).indent();n.compile(s);const a=s.write(`${n.id}Allows`),u=new Nh({kind:"Apply"}).indent();n.compile(u);const c=u.write(`${n.id}Apply`),d=`${t}${a},
106
- ${c},
107
- `;if(!n.hasKind("union"))return d;const h=new Nh({kind:"Allows",optimistic:!0}).indent();n.compile(h);const p=h.write(`${n.id}Optimistic`);return`${d}${p},
108
- `},`{
109
- `)+"}");class JA{constructor(t,n){w(this,"config");w(this,"resolvedConfig");w(this,"name");w(this,"referencesById",{});w(this,"references",[]);w(this,"resolutions",{});w(this,"exportedNames",[]);w(this,"aliases",{});w(this,"resolved",!1);w(this,"nodesByHash",{});w(this,"intrinsic");w(this,"_json");w(this,"generic",(...t)=>{const n=this;return(s,a)=>new wc(t,a?new yA(s):s,n,n,a??null)});w(this,"units",(t,n)=>{const s=[];for(const u of t)s.includes(u)||s.push(u);const a=s.map(u=>this.node("unit",{unit:u},n));return this.node("union",a,{...n,prereduced:!0})});w(this,"lazyResolutions",[]);w(this,"schema",(t,n)=>this.finalize(this.parseSchema(t,n)));w(this,"parseSchema",(t,n)=>this.node(Zu(t),t,n));w(this,"precompilation");w(this,"_exportedResolutions");w(this,"_exports");w(this,"node",(t,n,s={})=>{const a=this.preparseNode(t,n,s);if(Ft(a))return this.bindReference(a);const u=this.createParseContext(a),c=DA(u),d=this.bindReference(c);return kn[u.id]=d});w(this,"parse",(t,n={})=>this.finalize(this.parseDefinition(t,n)));this.config=Ep(W.config,n),this.resolvedConfig=Ep(W.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(jh).length}`,this.name in jh&&Z(`A Scope already named ${this.name} already exists`),jh[this.name]=this;const s=Object.entries(t).map(a=>this.preparseOwnAliasEntry(...a));for(const[a,u]of s){let c=a;if(a[0]==="#"?(c=a.slice(1),c in this.aliases&&Z(ES(c)),this.aliases[c]=u):(c in this.aliases&&Z(ES(a)),this.aliases[c]=u,this.exportedNames.push(c)),!fe(u,"module")&&!fe(u,"generic")&&!Hc(u)){const d=this.preparseOwnDefinitionFormat(u,{alias:c});this.resolutions[c]=fe(d,"root")?this.bindReference(d):this.createParseContext(d).id}}RS??(RS=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0})),this.nodesByHash[RS.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=W.intrinsic?He(W.intrinsic,(a,u)=>a.startsWith("json")?[]:[a,this.bindReference(u)]):{}}get[Bi](){return"scope"}cacheGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}get internal(){return this}get json(){return this._json||this.export(),this._json}defineSchema(t){return t}lazilyResolve(t,n){const s=this.node("alias",{reference:n??"synthetic",resolve:t},{prereduced:!0});return this.resolved||this.lazyResolutions.push(s),s}preparseNode(t,n,s){var d;let a=typeof t=="string"?t:Zu(n,t);if(Ft(n)&&n.kind===a)return n;if(a==="alias"&&!(s!=null&&s.prereduced)){const{reference:h}=Um.implementation.normalize(n,this);if(h.startsWith("$")){const p=this.resolveRoot(h.slice(1));n=p,a=p.kind}}else if(a==="union"&&ur(n,"object")){const h=m$(n);(h==null?void 0:h.length)===1&&(n=h[0],a=Zu(n))}if(Ft(n)&&n.kind===a)return n;const u=Jc[a],c=((d=u.normalize)==null?void 0:d.call(u,n,this))??n;return Ft(c)?c.kind===a?c:y$(a,c.kind):{...s,$:this,kind:a,def:c,prefix:s.alias??a}}bindReference(t){let n;return Ft(t)?n=t.$===this?t:new t.constructor(t.attachments,this):n=t.$===this?t:new wc(t.params,t.bodyDef,t.$,this,t.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(t){return this.maybeResolveRoot(t)??Z(tT(t))}maybeResolveRoot(t){const n=this.maybeResolve(t);if(!fe(n,"generic"))return n}maybeResolveSubalias(t){return Dp(this.aliases,t)??Dp(this.ambient,t)}get ambient(){return W.ambient}maybeResolve(t){var a;const n=this.resolutions[t];if(n){if(typeof n!="string")return this.bindReference(n);const u=kn[n];if(fe(u,"root"))return this.resolutions[t]=u;if(fe(u,"context")){if(u.phase==="resolving")return this.node("alias",{reference:`$${t}`},{prereduced:!0});if(u.phase==="resolved")return bt(`Unexpected resolved context for was uncached by its scope: ${qe(u)}`);u.phase="resolving";const c=this.bindReference(this.parseOwnDefinitionFormat(u.def,u));return u.phase="resolved",kn[c.id]=c,kn[u.id]=c,this.resolutions[t]=c}return bt(`Unexpected nodesById entry for ${n}: ${qe(u)}`)}let s=this.aliases[t]??((a=this.ambient)==null?void 0:a[t]);return s?(s=this.normalizeRootScopeValue(s),fe(s,"generic")?this.resolutions[t]=this.bindReference(s):fe(s,"module")?(s.root||Z(nT(t)),this.resolutions[t]=this.bindReference(s.root)):this.resolutions[t]=this.parse(s,{alias:t})):this.maybeResolveSubalias(t)}createParseContext(t){const n=t.id??kA(t.prefix);return kn[n]=Object.assign(t,{[Bi]:"context",$:this,id:n,phase:"unresolved"})}traversal(t){return new na(t,this.resolvedConfig)}import(...t){return new kp(He(this.export(...t),(n,s)=>[`#${n}`,s]))}export(...t){if(!this._exports){this._exports={};for(const s of this.exportedNames){const a=this.aliases[s];this._exports[s]=fe(a,"module")?FA(a,this):OS(this.maybeResolve(s))}for(const s of this.lazyResolutions)s.resolution;if(this._exportedResolutions=eT(this,this._exports),this._json=WA(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const s=ZA(this.references);this.precompilation=s.write(YA,4),XA(this.references,s)}this.resolved=!0}const n=t.length?t:this.exportedNames;return new kp(He(n,(s,a)=>[a,this._exports[a]]))}resolve(t){return this.export()[t]}parseDefinition(t,n={}){if(fe(t,"root"))return this.bindReference(t);const s=this.preparseOwnDefinitionFormat(t,n);if(fe(s,"root"))return this.bindReference(s);const a=this.createParseContext(s);kn[a.id]=a;let u=this.bindReference(this.parseOwnDefinitionFormat(t,a));return u.isCyclic&&(u=u2(u,a.id)),kn[a.id]=u,u}finalize(t){return OS(t),!t.precompilation&&!this.resolvedConfig.jitless&&g$(t.references),t}}class QA extends JA{parseOwnDefinitionFormat(t,n){return DA(n)}preparseOwnDefinitionFormat(t,n){return this.preparseNode(Zu(t),t,n)}preparseOwnAliasEntry(t,n){return[t,n]}normalizeRootScopeValue(t){return t}}const OS=e=>{const t=e.references.filter(n=>n.hasKind("alias"));for(const n of t){Object.assign(n.referencesById,n.resolution.referencesById);for(const s of e.references)n.id in s.referencesById&&Object.assign(s.referencesById,n.referencesById)}return e},WA=e=>He(e,(t,n)=>[t,fe(n,"root")||fe(n,"generic")?n.json:fe(n,"module")?WA(n):bt(`Unexpected resolution ${qe(n)}`)]),Dp=(e,t)=>{const n=t.indexOf(".");if(n===-1)return;const s=t.slice(0,n),a=e[s];if(a===void 0)return;if(!fe(a,"module"))return Z(b$(s));const u=t.slice(n+1),c=a[u];if(c===void 0)return Dp(a,u);if(fe(c,"root")||fe(c,"generic"))return c;if(fe(c,"module"))return c.root??Z(nT(t));bt(`Unexpected resolution for alias '${t}': ${qe(c)}`)},Pm=(e,t)=>new QA(e,t),pl=new QA({}),eT=(e,t)=>{const n={};for(const s in t){const a=t[s];if(fe(a,"module")){const u=eT(e,a),c=He(u,(d,h)=>[`${s}.${d}`,h]);Object.assign(n,c)}else fe(a,"root")||fe(a,"generic")?n[s]=a:bt(`Unexpected scope resolution ${qe(a)}`)}return n},tT=e=>`'${e}' is unresolvable`,b$=e=>`'${e}' must reference a module to be accessed using dot syntax`,nT=e=>`Reference to submodule '${e}' must specify an alias`;pl.export();const Ye=pl.schema,Im=pl.node;pl.defineSchema;const qi=pl.generic,iT="^(?:0|[1-9]\\d*)$",v$=new RegExp(iT);Xt(v$);const sT=Pm({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();W.intrinsic={...sT};const rT=Pm({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:iT}},{prereducedAliases:!0}).export();Object.assign(W.intrinsic,rT);const S$=Pm({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),pe={...sT,...rT,...S$,emptyStructure:Im("structure",{},{prereduced:!0})};W.intrinsic={...pe};const x$=e=>typeof e=="string"&&e[0]==="d"&&(e[1]==="'"||e[1]==='"')&&e.at(-1)===e[1],MS=e=>e.toString()!=="Invalid Date",w$=e=>e.slice(2,-1),aT=e=>`'${e}' could not be parsed by the Date constructor`,A$=(e,t)=>T$(e,t),T$=(e,t)=>{const n=new Date(e);if(MS(n))return n;const s=ZD(e);if(s!==void 0){const a=new Date(s);if(MS(a))return a}return t?Z(t===!0?aT(e):t):void 0},CS=(e,t)=>{const n=e.scanner.shiftUntil(R$[lT[t]]);if(e.scanner.lookahead==="")return e.error(M$(n,t));if(e.scanner.shift(),t==="/"){try{new RegExp(n)}catch(s){Z(String(s))}e.root=e.ctx.$.node("intersection",{domain:"string",pattern:n},{prereduced:!0})}else if(ci(t,oT))e.root=e.ctx.$.node("unit",{unit:n});else{const s=A$(n,aT(n));e.root=e.ctx.$.node("unit",{meta:n,unit:s})}},oT={"'":1,'"':1},E$={"/":1,"'":1,'"':1},lT={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},R$={"'":e=>e.lookahead==="'",'"':e=>e.lookahead==='"',"/":e=>e.lookahead==="/"},O$={'"':"double-quote","'":"single-quote","/":"forward slash"},M$=(e,t)=>`${t}${e} requires a closing ${O$[lT[t]]}`,C$=e=>`Private type references should not include '#'. Use '${e}' instead.`,uT="Optional definitions like 'string?' are only valid as properties in an object or tuple",cT="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",_$={">":!0,">=":!0},k$={"<":!0,"<=":!0},Tc={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},D$=e=>`Unmatched )${e===""?"":` before ${e}`}`,fT=e=>`Missing ${e}`,N$=(e,t)=>`Left bounds are only valid when paired with right bounds (try ...${t}${e})`,dT=e=>`Left-bounded expressions must specify their limits using < or <= (was ${e})`,$$=(e,t,n,s)=>`An expression may have at most one left bound (parsed ${e}${Tc[t]}, ${n}${Tc[s]})`,B$=(e,t,n)=>hT(e,t,n,[]),hT=(e,t,n,s)=>{const a=n.parseUntilFinalizer();return s.push(a.root),a.finalizer===">"?s.length!==t.params.length?n.error(pT(e,t.names,s.map(u=>u.expression))):s:a.finalizer===","?hT(e,t,n,s):a.error(fT(">"))},pT=(e,t,n)=>`${e}<${t.join(", ")}> requires exactly ${t.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,_S=e=>{const t=e.scanner.shiftUntilNextTerminator();t==="keyof"?e.addPrefix("keyof"):e.root=V$(e,t)},L$=(e,t,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(pT(e,t.names,[]));const a=B$(e,t,n);return t(...a)},V$=(e,t)=>j$(e,t)??z$(e,t)??e.error(t===""?e.scanner.lookahead==="#"?C$(e.shiftedByOne().scanner.shiftUntilNextTerminator()):mT(e):tT(t)),j$=(e,t)=>{var s;if((s=e.ctx.args)!=null&&s[t]){const a=e.ctx.args[t];return typeof a!="string"?a:e.ctx.$.node("alias",{reference:a},{prereduced:!0})}const n=e.ctx.$.maybeResolve(t);if(fe(n,"root"))return n;if(n!==void 0)return fe(n,"generic")?L$(t,n,e):Z(`Unexpected resolution ${qe(n)}`)},z$=(e,t)=>{const n=JD(t);if(n!==void 0)return e.ctx.$.node("unit",{unit:n});const s=WD(t);if(s!==void 0)return e.ctx.$.node("unit",{unit:s})},mT=e=>{const t=e.previousOperator();return t?yT(t,e.scanner.unscanned):U$(e.scanner.unscanned)},yT=(e,t="")=>`Token '${e}' requires a right operand${t?` before '${t}'`:""}`,U$=e=>`Expected an expression${e?` before '${e}'`:""}`,gT=e=>e.scanner.lookahead===""?e.error(mT(e)):e.scanner.lookahead==="("?e.shiftedByOne().reduceGroupOpen():e.scanner.lookaheadIsIn(E$)?CS(e,e.scanner.shift()):e.scanner.lookaheadIsIn(Gc)?gT(e.shiftedByOne()):e.scanner.lookahead==="d"&&e.scanner.nextLookahead in oT?CS(e,`${e.scanner.shift()}${e.scanner.shift()}`):_S(e),Zs=class Zs extends oN{shiftUntilNextTerminator(){return this.shiftUntilNonWhitespace(),this.shiftUntil(()=>this.lookahead in Zs.terminatingChars)}};w(Zs,"terminatingChars",{"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...Gc}),w(Zs,"finalizingLookaheads",{">":1,",":1,"":1,"=":1,"?":1}),w(Zs,"lookaheadIsFinalizing",(t,n)=>t===">"?n[0]==="="?n[1]==="=":n.trimStart()===""||ci(n.trimStart()[0],Zs.terminatingChars):t==="="?n[0]!=="=":t===","||t==="?");let Fo=Zs;const q$=(e,t)=>{const n=P$(e,t);if(e.root.hasKind("unit")){if(typeof e.root.unit=="number"){e.reduceLeftBound(e.root.unit,n),e.unsetRoot();return}if(e.root.unit instanceof Date){const s=`d'${e.root.description??e.root.unit.toISOString()}'`;e.unsetRoot(),e.reduceLeftBound(s,n);return}}return H$(e,n)},K$={"<":1,">":1,"=":1},P$=(e,t)=>e.scanner.lookaheadIs("=")?`${t}${e.scanner.shift()}`:t,kS=(e,t,n,s)=>n.extends(W.intrinsic.number)?typeof t!="number"?Z(Np(e,t,s)):e==="=="?["min","max"]:e[0]===">"?["min"]:["max"]:n.extends(W.intrinsic.lengthBoundable)?typeof t!="number"?Z(Np(e,t,s)):e==="=="?["exactLength"]:e[0]===">"?["minLength"]:["maxLength"]:n.extends(W.intrinsic.Date)?e==="=="?["after","before"]:e[0]===">"?["after"]:["before"]:Z(KN(n.expression)),I$=e=>({rule:x$(e.limit)?w$(e.limit):e.limit,exclusive:e.comparator.length===1}),H$=(e,t)=>{const n=e.unsetRoot(),s=e.scanner.location;e.parseOperand();const a=e.unsetRoot(),u=e.scanner.sliceChars(s,e.scanner.location);if(e.root=n,!a.hasKind("unit")||typeof a.unit!="number"&&!(a.unit instanceof Date))return e.error(Np(t,u,"right"));const c=a.unit,d=t.length===1,h=kS(t,typeof c=="number"?c:u,n,"right");for(const y of h)e.constrainRoot(y,t==="=="?{rule:c}:{rule:c,exclusive:d});if(!e.branches.leftBound)return;if(!ci(t,k$))return e.error(dT(t));const p=kS(e.branches.leftBound.comparator,e.branches.leftBound.limit,n,"left");e.constrainRoot(p[0],I$(e.branches.leftBound)),e.branches.leftBound=null},Np=(e,t,n)=>`Comparator ${n==="left"?Tc[e]:e} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${t})`,G$=e=>{e.scanner.shiftUntilNonWhitespace();const t=e.scanner.shiftUntilNextTerminator();e.root=e.root.brand(t)},F$=e=>{const t=e.scanner.shiftUntilNextTerminator(),n=QD(t,{errorOnFail:DS(t)});n===0&&e.error(DS(0)),e.root=e.root.constrain("divisor",n)},DS=e=>`% operator must be followed by a non-zero integer literal (was ${e})`,bT=e=>{const t=e.scanner.shift();return t===""?e.finalize(""):t==="["?e.scanner.shift()==="]"?e.setRoot(e.root.array()):e.error(Y$):t==="|"?e.scanner.lookahead===">"?e.shiftedByOne().pushRootToBranch("|>"):e.pushRootToBranch(t):t==="&"?e.pushRootToBranch(t):t===")"?e.finalizeGroup():Fo.lookaheadIsFinalizing(t,e.scanner.unscanned)?e.finalize(t):ci(t,K$)?q$(e,t):t==="%"?F$(e):t==="#"?G$(e):t in Gc?bT(e):e.error(Hm(t))},Hm=(e,t="")=>`'${e}' is not allowed here${t&&` (should be ${t})`}`,Y$="Missing expected ']'",X$=e=>{const t=e.unsetRoot();e.parseOperand();const n=e.unsetRoot();if(!n.hasKind("unit"))return e.error(Z$(n.expression));const s=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[t,"=",s]},Z$=e=>`Default value '${e}' must a literal value`,NS=(e,t)=>{const n=t.$.maybeResolveRoot(e);if(n)return n;if(e.endsWith("[]")){const u=t.$.maybeResolveRoot(e.slice(0,-2));if(u)return u.array()}const s=new Qc(new Fo(e),t),a=J$(s);return s.finalizer===">"&&Z(Hm(">")),a},J$=e=>{e.parseOperand();let t=Gm(e).root;return t?(e.finalizer==="="?t=X$(e):e.finalizer==="?"&&(t=[t,"?"]),e.scanner.shiftUntilNonWhitespace(),e.scanner.lookahead&&Z(Hm(e.scanner.lookahead)),t):bt(`Root was unexpectedly unset after parsing string '${e.scanner.scanned}'`)},Gm=e=>{for(;e.finalizer===void 0;)Q$(e);return e},Q$=e=>e.hasRoot()?e.parseOperator():e.parseOperand();class Qc{constructor(t,n){w(this,"root");w(this,"branches",{prefixes:[],leftBound:null,intersection:null,union:null,pipe:null});w(this,"finalizer");w(this,"groups",[]);w(this,"scanner");w(this,"ctx");this.scanner=t,this.ctx=n}error(t){return Z(t)}hasRoot(){return this.root!==void 0}setRoot(t){this.root=t}unsetRoot(){const t=this.root;return this.root=void 0,t}constrainRoot(...t){this.root=this.root.constrain(t[0],t[1])}finalize(t){if(this.groups.length)return this.error(fT(")"));this.finalizeBranches(),this.finalizer=t}reduceLeftBound(t,n){const s=Tc[n];if(!ci(s,_$))return this.error(dT(n));if(this.branches.leftBound)return this.error($$(this.branches.leftBound.limit,this.branches.leftBound.comparator,t,s));this.branches.leftBound={comparator:s,limit:t}}finalizeBranches(){if(this.assertRangeUnset(),this.branches.pipe){this.pushRootToBranch("|>"),this.root=this.branches.pipe;return}if(this.branches.union){this.pushRootToBranch("|"),this.root=this.branches.union;return}if(this.branches.intersection){this.pushRootToBranch("&"),this.root=this.branches.intersection;return}this.applyPrefixes()}finalizeGroup(){this.finalizeBranches();const t=this.groups.pop();if(!t)return this.error(D$(this.scanner.unscanned));this.branches=t}addPrefix(t){this.branches.prefixes.push(t)}applyPrefixes(){for(;this.branches.prefixes.length;){const t=this.branches.prefixes.pop();this.root=t==="keyof"?this.root.keyof():bt(`Unexpected prefix '${t}'`)}}pushRootToBranch(t){var s,a,u;this.assertRangeUnset(),this.applyPrefixes();const n=this.root;this.root=void 0,this.branches.intersection=((s=this.branches.intersection)==null?void 0:s.rawAnd(n))??n,t!=="&"&&(this.branches.union=((a=this.branches.union)==null?void 0:a.rawOr(this.branches.intersection))??this.branches.intersection,this.branches.intersection=null,t!=="|"&&(this.branches.pipe=((u=this.branches.pipe)==null?void 0:u.rawPipeOnce(this.branches.union))??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return Gm(new Qc(this.scanner,this.ctx))}parseOperator(){return bT(this)}parseOperand(){return gT(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(N$(this.branches.leftBound.limit,this.branches.leftBound.comparator))}reduceGroupOpen(){this.groups.push(this.branches),this.branches={prefixes:[],leftBound:null,union:null,intersection:null,pipe:null}}previousOperator(){var t;return((t=this.branches.leftBound)==null?void 0:t.comparator)??this.branches.prefixes.at(-1)??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const W$="An empty string is not a valid generic parameter name",$p=(e,t,n)=>{e.shiftUntilNonWhitespace();const s=e.shiftUntilNextTerminator();return s===""?e.lookahead===""&&t.length?t:Z(W$):(e.shiftUntilNonWhitespace(),e3(e,s,t,n))},$S="extends ",e3=(e,t,n,s)=>{if(e.shiftUntilNonWhitespace(),e.unscanned.startsWith($S))e.jumpForward($S.length);else return e.lookahead===","&&e.shift(),n.push(t),$p(e,n,s);const a=Gm(new Qc(e,s));return n.push([t,a.root]),$p(e,n,s)};class t3 extends Ea{constructor(n){super((...s)=>new Uu(n)(...s),{bind:n});w(this,"$");this.$=n}in(n){return new Uu(this.$,n===void 0?void 0:this.$.parse(n))}at(n,s){return new Uu(this.$).at(n,s)}case(n,s){return new Uu(this.$).case(n,s)}}class Uu extends Ea{constructor(n,s){super(a=>this.caseEntries(Object.entries(a).map(([u,c])=>u==="default"?[u,c]:[this.$.parse(u),c])));w(this,"$");w(this,"in");w(this,"key");w(this,"branches",[]);this.$=n,this.in=s}at(n,s){return this.key&&Z(i3),this.branches.length&&Z(n3),this.key=n,s?this.match(s):this}case(n,s){return this.caseEntry(this.$.parse(n),s)}caseEntry(n,s){const u=(this.key?this.$.parse({[this.key]:n}):n).pipe(s);return this.branches.push(u),this}match(n){return this(n)}strings(n){return this.caseEntries(Object.entries(n).map(([s,a])=>s==="default"?[s,a]:[this.$.node("unit",{unit:s}),a]))}caseEntries(n){for(let s=0;s<n.length;s++){const[a,u]=n[s];if(a==="default")return s!==n.length-1&&Z("default may only be specified as the last key of a switch definition"),this.default(u);if(typeof u!="function")return Z(`Value for case "${a}" must be a function (was ${Hn(u)})`);this.caseEntry(a,u)}return this}default(n){typeof n=="function"&&this.case(pe.unknown,n);const s={branches:this.branches,ordered:!0};(n==="never"||n==="assert")&&(s.meta={onFail:BS});const a=this.$.node("union",s);if(!this.in)return this.$.finalize(a);let u=this.in.pipe(a);return(n==="never"||n==="assert")&&(u=u.configureReferences({onFail:BS},"self")),this.$.finalize(u)}}const BS=e=>e.throw(),n3="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",i3="At most one key matcher may be specified per expression",vT=(e,t)=>{if(It(e)){if(e[1]==="=")return[t.$.parseOwnDefinitionFormat(e[0],t),"=",e[2]];if(e[1]==="?")return[t.$.parseOwnDefinitionFormat(e[0],t),"?"]}return RT(e,t)},s3="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",r3="Only required keys may specify default values, e.g. { value: 'number = 0' }",a3=(e,t)=>{var c;let n;const s={},a=yc(e);for(const[d,h]of a){const p=u3(d);if(p.kind==="spread"){if(!ol(s))return Z(l3);const A=t.$.parseOwnDefinitionFormat(h,t);if(A.equals(pe.object))continue;if(!A.hasKind("intersection")||!((c=A.basis)!=null&&c.equals(pe.object)))return Z(c3(A.expression));n=A.structure;continue}if(p.kind==="undeclared"){h!=="reject"&&h!=="delete"&&h!=="ignore"&&Z(o3(h)),s.undeclared=h;continue}const y=vT(h,t),g=p;if(p.kind==="required"){It(y)?zh(s,"optional",y[1]==="="?{key:p.normalized,value:y[0],default:y[2]}:{key:p.normalized,value:y[0]},t):zh(s,"required",{key:p.normalized,value:y},t);continue}if(It(y)&&(y[1]==="?"&&Z(s3),y[1]==="="&&Z(r3)),p.kind==="optional"){zh(s,"optional",{key:p.normalized,value:y},t);continue}const v=t.$.parseOwnDefinitionFormat(g.normalized,t),S=_p(v,y,t.$);S.index&&(s.index=Ie(s.index,S.index)),S.required&&(s.required=Ie(s.required,S.required))}const u=t.$.node("structure",s);return t.$.parseSchema({domain:"object",structure:(n==null?void 0:n.merge(u))??u})},zh=(e,t,n,s)=>{e[t]=Ie(e[t],s.$.node(t,n))},o3=e=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${qe(e)})`,l3="Spread operator may only be used as the first key in an object",u3=e=>typeof e=="symbol"?{kind:"required",normalized:e}:e.at(-1)==="?"?e.at(-2)===Sp?{kind:"required",normalized:`${e.slice(0,-2)}?`}:{kind:"optional",normalized:e.slice(0,-1)}:e[0]==="["&&e.at(-1)==="]"?{kind:"index",normalized:e.slice(1,-1)}:e[0]===Sp&&e[1]==="["&&e.at(-1)==="]"?{kind:"required",normalized:e.slice(1)}:e==="..."?{kind:"spread"}:e==="+"?{kind:"undeclared"}:{kind:"required",normalized:e==="\\..."?"...":e==="\\+"?"+":e},c3=e=>`Spread operand must resolve to an object literal type (was ${e})`,f3=(e,t)=>x3(e)?AT[e[0]](e,t):v3(e)?wT[e[1]](e,t):null,d3=(e,t)=>t.$.parseOwnDefinitionFormat(e[1],t).keyof(),Uh=(e,t)=>{if(e[2]===void 0)return Z(yT(e[1],""));const n=t.$.parseOwnDefinitionFormat(e[0],t),s=t.$.parseOwnDefinitionFormat(e[2],t);if(e[1]==="|")return t.$.node("union",{branches:[n,s]});const a=e[1]==="&"?Vi(n,s,t.$):Op(n,s,t.$);return a instanceof oe?a.throw():a},h3=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).array(),p3=(e,t)=>typeof e[2]!="function"?Z(ST("=>",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).pipe(e[2]),ST=(e,t)=>`${e===":"?"Narrow":"Morph"} expression requires a function following '${e}' (was ${typeof t})`,m3=(e,t)=>typeof e[2]!="function"?Z(ST(":",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).constrain("predicate",e[2]),y3=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).configureReferences(e[2],"shallow"),xT=e=>e,g3=xT({"[]":h3,"?":()=>Z(uT)}),b3=xT({"|":Uh,"&":Uh,":":m3,"=>":p3,"|>":Uh,"@":y3,"=":()=>Z(cT)}),wT={...g3,...b3},v3=e=>wT[e[1]]!==void 0,S3=e=>e,AT=S3({keyof:d3,instanceof:(e,t)=>{if(typeof e[1]!="function")return Z(LS(vp(e[1])));const n=e.slice(1).map(s=>typeof s=="function"?t.$.node("proto",{proto:s}):Z(LS(vp(s))));return n.length===1?n[0]:t.$.node("union",{branches:n})},"===":(e,t)=>t.$.units(e.slice(1))}),x3=e=>AT[e[0]]!==void 0,LS=e=>`Expected a constructor following 'instanceof' operator (was ${e})`,w3=(e,t)=>{let n=[{}],s=0;for(;s<e.length;){let a=!1;e[s]==="..."&&s<e.length-1&&(a=!0,s++);const u=vT(e[s],t),[c,d,h]=It(u)?u:[u];if(s++,a){if(!c.extends(W.intrinsic.Array))return Z(E3(c.expression));n=n.flatMap(p=>c.distribute(y=>T3(lA(p),y)))}else n=n.map(p=>d==="?"?TT(p,c):d==="="?A3(p,c,h):Bp(p,c))}return t.$.parseSchema(n.map(a=>ol(a)?{proto:Array,exactLength:0}:{proto:Array,sequence:a}))},Bp=(e,t)=>e.defaultables||e.optionals?Z(e.variadic?IA:R3):(e.variadic?e.postfix=Ie(e.postfix,t):e.prefix=Ie(e.prefix,t),e),TT=(e,t)=>e.variadic?Z(ET):(e.optionals=Ie(e.optionals,t),e),A3=(e,t,n)=>e.variadic?Z(ET):e.optionals?Z(O3):(e.defaultables=Ie(e.defaultables,[[t,n]]),e),VS=(e,t)=>(e.postfix&&Z(jS),e.variadic?e.variadic.equals(t)||Z(jS):e.variadic=t.internal,e),T3=(e,t)=>{const n=t.select({method:"find",kind:"sequence"});if(!n)return VS(e,W.intrinsic.unknown);if(n.prefix)for(const s of n.prefix)Bp(e,s);if(n.optionals)for(const s of n.optionals)TT(e,s);if(n.variadic&&VS(e,n.variadic),n.postfix)for(const s of n.postfix)Bp(e,s);return e},E3=e=>`Spread element must be an array (was ${e})`,jS="A tuple may have at most one variadic element",R3="A required element may not follow an optional element",ET="An optional element may not follow a variadic element",O3="A defaultable element may not follow an optional element without a default",qh={},RT=(e,t)=>{var n;if(typeof e=="string"){if(t.args&&Object.keys(t.args).some(a=>e.includes(a)))return NS(e,t);const s=qh[n=t.$.name]??(qh[n]={});return s[e]??(s[e]=NS(e,t))}return ur(e,"object")?M3(e,t):Z(Lp(Hn(e)))},M3=(e,t)=>{const n=_m(e);switch(n){case void 0:return fe(e,"root")?e:a3(e,t);case"Array":return C3(e,t);case"RegExp":return t.$.node("intersection",{domain:"string",pattern:e},{prereduced:!0});case"Function":{const s=Hc(e)?e():e;return fe(s,"root")?s:Z(Lp("Function"))}default:return Z(Lp(n??qe(e)))}},C3=(e,t)=>f3(e,t)??w3(e,t),Lp=e=>`Type definitions must be strings or objects (was ${e})`;class _3 extends Ea{constructor(t){const n=Object.assign({errors:xs,hkt:fi,$:t,raw:t.parse,module:t.constructor.module,scope:t.constructor.scope,define:t.define,match:t.match,generic:t.generic,schema:t.schema,keywords:t.ambient,unit:t.unit,enumerated:t.enumerated,instanceOf:t.instanceOf,valueOf:t.valueOf,or:t.or,and:t.and,merge:t.merge,pipe:t.pipe},t.ambientAttachments);super((...s)=>{if(s.length===1)return t.parse(s[0]);if(s.length===2&&typeof s[0]=="string"&&s[0][0]==="<"&&s[0].at(-1)===">"){const a=s[0].slice(1,-1),u=t.parseGenericParams(a,{});return new wc(u,s[1],t,t,null)}return t.parse(s)},{bind:t,attach:n})}}const Yo=W,la=class la extends JA{constructor(){super(...arguments);w(this,"unit",n=>this.units([n]));w(this,"valueOf",n=>this.units(TD(n)));w(this,"enumerated",(...n)=>this.units(n));w(this,"instanceOf",n=>this.node("proto",{proto:n},{prereduced:!0}));w(this,"or",(...n)=>this.schema(n.map(s=>this.parse(s))));w(this,"and",(...n)=>n.reduce((s,a)=>s.and(this.parse(a)),this.intrinsic.unknown));w(this,"merge",(...n)=>n.reduce((s,a)=>s.merge(this.parse(a)),this.intrinsic.object));w(this,"pipe",(...n)=>this.intrinsic.unknown.pipe(...n));w(this,"match",new t3(this));w(this,"declare",()=>({type:this.type}));w(this,"type",new _3(this))}get ambientAttachments(){if(Yo.typeAttachments)return this.cacheGetter("ambientAttachments",He(Yo.typeAttachments,(n,s)=>[n,this.bindReference(s)]))}preparseOwnAliasEntry(n,s){var d;const a=n.indexOf("<");if(a===-1){if(fe(s,"module")||fe(s,"generic"))return[n,s];const h=this.name==="ark"?n:n==="root"?this.name:`${this.name}.${n}`,p=(d=this.resolvedConfig.keywords)==null?void 0:d[h];return p&&(s=[s,"@",p]),[n,s]}n.at(-1)!==">"&&Z("'>' must be the last character of a generic declaration in a scope");const u=n.slice(0,a),c=n.slice(a+1,-1);return[u,()=>{const h=this.parseGenericParams(c,{alias:u});return MN(h,s,this)}]}parseGenericParams(n,s){return $p(new Fo(n),[],this.createParseContext({...s,def:n,prefix:"generic"}))}normalizeRootScopeValue(n){return Hc(n)&&!fe(n,"generic")?n():n}preparseOwnDefinitionFormat(n,s){return{...s,def:n,prefix:s.alias??"type"}}parseOwnDefinitionFormat(n,s){!(s.alias&&s.alias in this.aliases)&&!s.args&&(s.args={this:s.id});const u=RT(n,s);if(It(u)){if(u[1]==="=")return Z(cT);if(u[1]==="?")return Z(uT)}return u}define(n){return n}};w(la,"scope",(n,s={})=>new la(n,s)),w(la,"module",(n,s={})=>la.scope(n,s).export());let Ec=la;const k3=Object.assign(Ec.scope,{define:e=>e}),Be=Ec;class D3 extends fi{constructor(){super(...arguments);w(this,"description",'merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`')}}const N3=qi(["base",pe.object],["props",pe.object])(e=>e.base.merge(e.props),D3),$3=Be.module({Key:pe.key,Merge:N3});class B3 extends fi{}const L3=qi("element")(e=>{const t=e.element.exclude(pe.Array),n=t.array();return t.rawOr(n).pipe(al).distribute(s=>s.assertHasKind("morph").declareOut(n),Ye)},B3),V3=Be.module({root:pe.Array,readonly:"root",index:pe.nonNegativeIntegerString,liftFrom:L3},{name:"Array"}),Vp=Ye(["string",ll.FileConstructor]),j3=Vp.rawOr(Vp.array()),zS=Ye({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:j3}}),z3=Be.module({root:["instanceof",FormData],value:Vp,parsed:zS,parse:Ye({in:FormData,morphs:e=>{const t={};for(const[n,s]of e)if(n in t){const a=t[n];typeof a=="string"||a instanceof ll.FileConstructor?t[n]=[a,s]:a.push(s)}else t[n]=s;return t},declaredOut:zS})},{name:"FormData"}),U3=Be.module({Int8:["instanceof",Int8Array],Uint8:["instanceof",Uint8Array],Uint8Clamped:["instanceof",Uint8ClampedArray],Int16:["instanceof",Int16Array],Uint16:["instanceof",Uint16Array],Int32:["instanceof",Int32Array],Uint32:["instanceof",Uint32Array],Float32:["instanceof",Float32Array],Float64:["instanceof",Float64Array],BigInt64:["instanceof",BigInt64Array],BigUint64:["instanceof",BigUint64Array]},{name:"TypedArray"}),q3={Boolean:1,Number:1,String:1},K3=Be.module({...He({...Fw,...Xw},(e,t)=>e in q3?[]:[e,["instanceof",t]]),Array:V3,TypedArray:U3,FormData:z3}),P3=Ye({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),I3=Ye({domain:"number",divisor:1}),OT=Be.module({root:pe.number,integer:I3,epoch:P3,safe:Ye({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"}),Je=(e,t,n)=>{const s={domain:"string",pattern:{rule:e.source,flags:e.flags,meta:t}};return n&&(s.meta={format:n}),Im("intersection",s)},US=Je(gc,"a well-formed integer string"),MT=Be.module({root:US,parse:Ye({in:US,morphs:(e,t)=>{const n=Number.parseInt(e);return Number.isSafeInteger(n)?n:t.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:pe.integer})},{name:"string.integer"}),H3=Je(/^[\dA-Fa-f]+$/,"hex characters only"),G3=Be.module({root:Je(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:Je(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),qS=Je(/^[A-Z].*$/,"capitalized"),F3=Be.module({root:Ye({in:"string",morphs:e=>e.charAt(0).toUpperCase()+e.slice(1),declaredOut:qS}),preformatted:qS},{name:"string.capitalize"}),Y3=e=>{const t=e.replaceAll(/[ -]+/g,"");let n=0,s,a,u=!1;for(let c=t.length-1;c>=0;c--)s=t.substring(c,c+1),a=Number.parseInt(s,10),u?(a*=2,n+=a>=10?a%10+1:a):n+=a,u=!u;return!!(n%10===0&&t)},X3=/^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/,Z3=Ye({domain:"string",pattern:{meta:"a credit card number",rule:X3.source},predicate:{meta:"a credit card number",predicate:Y3}}),J3=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,Q3=e=>!Number.isNaN(new Date(e).valueOf()),KS=Ye({domain:"string",predicate:{meta:"a parsable date",predicate:Q3}}).assertHasKind("intersection"),PS=MT.root.internal.narrow((e,t)=>{const n=Number.parseInt(e),s=OT.epoch(n);return s instanceof xs?(t.errors.merge(s),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),W3=Be.module({root:PS,parse:Ye({in:PS,morphs:e=>new Date(e),declaredOut:pe.Date})},{name:"string.date.epoch"}),IS=Je(J3,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),eB=Be.module({root:IS,parse:Ye({in:IS,morphs:e=>new Date(e),declaredOut:pe.Date})},{name:"string.date.iso"}),tB=Be.module({root:KS,parse:Ye({declaredIn:KS,in:"string",morphs:(e,t)=>{const n=new Date(e);return Number.isNaN(n.valueOf())?t.error("a parsable date"):n},declaredOut:pe.Date}),iso:eB,epoch:W3},{name:"string.date"}),nB=Je(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),HS="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",hs=`(${HS}[.]){3}${HS}`,iB=new RegExp(`^${hs}$`),mt="(?:[0-9a-fA-F]{1,4})",sB=new RegExp(`^((?:${mt}:){7}(?:${mt}|:)|(?:${mt}:){6}(?:${hs}|:${mt}|:)|(?:${mt}:){5}(?::${hs}|(:${mt}){1,2}|:)|(?:${mt}:){4}(?:(:${mt}){0,1}:${hs}|(:${mt}){1,3}|:)|(?:${mt}:){3}(?:(:${mt}){0,2}:${hs}|(:${mt}){1,4}|:)|(?:${mt}:){2}(?:(:${mt}){0,3}:${hs}|(:${mt}){1,5}|:)|(?:${mt}:){1}(?:(:${mt}){0,4}:${hs}|(:${mt}){1,6}|:)|(?::((?::${mt}){0,5}:${hs}|(?::${mt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),rB=Be.module({root:["v4 | v6","@","an IP address"],v4:Je(iB,"an IPv4 address","ipv4"),v6:Je(sB,"an IPv6 address","ipv6")},{name:"string.ip"}),fa="a JSON string",CT=e=>{if(!(e instanceof SyntaxError))throw e;return`must be ${fa} (${e})`},aB=Ye({meta:fa,domain:"string",predicate:{meta:fa,predicate:(e,t)=>{try{return JSON.parse(e),!0}catch(n){return t.reject({code:"predicate",expected:fa,problem:CT(n)})}}}}),oB=(e,t)=>{if(e.length===0)return t.error({code:"predicate",expected:fa,actual:"empty"});try{return JSON.parse(e)}catch(n){return t.error({code:"predicate",expected:fa,problem:CT(n)})}},lB=Be.module({root:aB,parse:Ye({meta:"safe JSON string parser",in:"string",morphs:oB,declaredOut:pe.jsonObject})},{name:"string.json"}),GS=Je(/^[a-z]*$/,"only lowercase letters"),uB=Be.module({root:Ye({in:"string",morphs:e=>e.toLowerCase(),declaredOut:GS}),preformatted:GS},{name:"string.lower"}),_T=["NFC","NFD","NFKC","NFKD"],ml=He(_T,(e,t)=>[t,Ye({domain:"string",predicate:n=>n.normalize(t)===n,meta:`${t}-normalized unicode`})]),Wc=He(_T,(e,t)=>[t,Ye({in:"string",morphs:n=>n.normalize(t),declaredOut:ml[t]})]),cB=Be.module({root:Wc.NFC,preformatted:ml.NFC},{name:"string.normalize.NFC"}),fB=Be.module({root:Wc.NFD,preformatted:ml.NFD},{name:"string.normalize.NFD"}),dB=Be.module({root:Wc.NFKC,preformatted:ml.NFKC},{name:"string.normalize.NFKC"}),hB=Be.module({root:Wc.NFKD,preformatted:ml.NFKD},{name:"string.normalize.NFKD"}),pB=Be.module({root:"NFC",NFC:cB,NFD:fB,NFKC:dB,NFKD:hB},{name:"string.normalize"}),FS=Je(xp,"a well-formed numeric string"),mB=Be.module({root:FS,parse:Ye({in:FS,morphs:e=>Number.parseFloat(e),declaredOut:pe.number})},{name:"string.numeric"}),YS="a regex pattern",yB=Ye({domain:"string",predicate:{meta:YS,predicate:(e,t)=>{try{return new RegExp(e),!0}catch(n){return t.reject({code:"predicate",expected:YS,problem:String(n)})}}},meta:{format:"regex"}}),gB=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/,bB=Je(gB,"a semantic version (see https://semver.org/)"),XS=Je(/^\S.*\S$|^\S?$/,"trimmed"),vB=Be.module({root:Ye({in:"string",morphs:e=>e.trim(),declaredOut:XS}),preformatted:XS},{name:"string.trim"}),ZS=Je(/^[A-Z]*$/,"only uppercase letters"),SB=Be.module({root:Ye({in:"string",morphs:e=>e.toUpperCase(),declaredOut:ZS}),preformatted:ZS},{name:"string.upper"}),xB=e=>{if(URL.canParse)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},JS=Ye({domain:"string",predicate:{meta:"a URL string",predicate:xB},meta:{format:"uri"}}),wB=Be.module({root:JS,parse:Ye({declaredIn:JS,in:"string",morphs:(e,t)=>{try{return new URL(e)}catch{return t.error("a URL string")}},declaredOut:Ye(URL)})},{name:"string.url"}),AB=Be.module({root:["versioned | nil | max","@",{description:"a UUID",format:"uuid"}],"#nil":"'00000000-0000-0000-0000-000000000000'","#max":"'ffffffff-ffff-ffff-ffff-ffffffffffff'","#versioned":/[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,v1:Je(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:Je(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:Je(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:Je(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:Je(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:Je(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:Je(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:Je(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),TB=Be.module({root:pe.string,alpha:Je(/^[A-Za-z]*$/,"only letters"),alphanumeric:Je(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:H3,base64:G3,capitalize:F3,creditCard:Z3,date:tB,digits:Je(/^\d*$/,"only digits 0-9"),email:nB,integer:MT,ip:rB,json:lB,lower:uB,normalize:pB,numeric:mB,regex:yB,semver:bB,trim:vB,upper:SB,url:wB,uuid:AB},{name:"string"}),EB=Be.module({bigint:pe.bigint,boolean:pe.boolean,false:pe.false,never:pe.never,null:pe.null,number:pe.number,object:pe.object,string:pe.string,symbol:pe.symbol,true:pe.true,unknown:pe.unknown,undefined:pe.undefined}),RB=Be.module({root:pe.unknown,any:pe.unknown},{name:"unknown"}),OB=Be.module({root:pe.jsonObject,stringify:Im("morph",{in:pe.jsonObject,morphs:e=>JSON.stringify(e),declaredOut:pe.string})},{name:"object.json"}),MB=Be.module({root:pe.object,json:OB},{name:"object"});class CB extends fi{constructor(){super(...arguments);w(this,"description",'instantiate an object from an index signature and corresponding value type like `Record("string", "number")`')}}const _B=qi(["K",pe.key],"V")(e=>({domain:"object",index:{signature:e.K,value:e.V}}),CB);class kB extends fi{constructor(){super(...arguments);w(this,"description",'pick a set of properties from an object like `Pick(User, "name | age")`')}}const DB=qi(["T",pe.object],["K",pe.key])(e=>e.T.pick(e.K),kB);class NB extends fi{constructor(){super(...arguments);w(this,"description",'omit a set of properties from an object like `Omit(User, "age")`')}}const $B=qi(["T",pe.object],["K",pe.key])(e=>e.T.omit(e.K),NB);class BB extends fi{constructor(){super(...arguments);w(this,"description","make all named properties of an object optional like `Partial(User)`")}}const LB=qi(["T",pe.object])(e=>e.T.partial(),BB);class VB extends fi{constructor(){super(...arguments);w(this,"description","make all named properties of an object required like `Required(User)`")}}const jB=qi(["T",pe.object])(e=>e.T.required(),VB);class zB extends fi{constructor(){super(...arguments);w(this,"description",'exclude branches of a union like `Exclude("boolean", "true")`')}}const UB=qi("T","U")(e=>e.T.exclude(e.U),zB);class qB extends fi{constructor(){super(...arguments);w(this,"description",'extract branches of a union like `Extract("0 | false | 1", "number")`')}}const KB=qi("T","U")(e=>e.T.extract(e.U),qB),PB=Be.module({Exclude:UB,Extract:KB,Omit:$B,Partial:LB,Pick:DB,Record:_B,Required:jB}),cr=k3({...EB,...PB,...K3,...$3,string:TB,number:OT,object:MB,unknown:RB},{prereducedAliases:!0,name:"ark"}),_t=cr.export();Object.assign(Yo.ambient,_t);Yo.typeAttachments={string:_t.string.root,number:_t.number.root,bigint:_t.bigint,boolean:_t.boolean,symbol:_t.symbol,undefined:_t.undefined,null:_t.null,object:_t.object.root,unknown:_t.unknown.root,false:_t.false,true:_t.true,never:_t.never,arrayIndex:_t.Array.index,Key:_t.Key,Record:_t.Record,Array:_t.Array.root,Date:_t.Date};const ot=Object.assign(cr.type,Yo.typeAttachments);cr.match;cr.generic;cr.schema;cr.define;cr.declare;const kT={100:'"Continue"',101:'"Switching Protocols"',102:'"Processing"',103:'"Early Hints"',200:'"OK"',201:'"Created"',202:'"Accepted"',203:'"Non-Authoritative Information"',204:'"No Content"',205:'"Reset Content"',206:'"Partial Content"',207:'"Multi-Status"',208:'"Already Reported"',226:'"IM Used"',300:'"Multiple Choices"',301:'"Moved Permanently"',302:'"Found"',303:'"See Other"',304:'"Not Modified"',305:'"Use Proxy"',306:'"Switch Proxy"',307:'"Temporary Redirect"',308:'"Permanent Redirect"',400:'"Bad Request"',401:'"Unauthorized"',402:'"Payment Required"',403:'"Forbidden"',404:'"Not Found"',405:'"Method Not Allowed"',406:'"Not Acceptable"',407:'"Proxy Authentication Required"',408:'"Request Timeout"',409:'"Conflict"',410:'"Gone"',411:'"Length Required"',412:'"Precondition Failed"',413:'"Payload Too Large"',414:'"URI Too Long"',415:'"Unsupported Media Type"',416:'"Range Not Satisfiable"',417:'"Expectation Failed"',418:`"I'm a teapot"`,421:'"Misdirected Request"',422:'"Unprocessable Entity"',423:'"Locked"',424:'"Failed Dependency"',425:'"Too Early"',426:'"Upgrade Required"',428:'"Precondition Required"',429:'"Too Many Requests"',431:'"Request Header Fields Too Large"',451:'"Unavailable For Legal Reasons"',500:'"Internal Server Error"',501:'"Not Implemented"',502:'"Bad Gateway"',503:'"Service Unavailable"',504:'"Gateway Timeout"',505:'"HTTP Version Not Supported"',506:'"Variant Also Negotiates"',507:'"Insufficient Storage"',508:'"Loop Detected"',510:'"Not Extended"',511:'"Network Authentication Required"'};function IB(e){return Number.parseInt(e,10)}const HB=ot(kT),GB=HB.keyof().pipe(e=>IB(e));ot([GB,"string"]);function FB(e){return U.jsxs("svg",{id:"uuid-3d2d6be6-f179-42a3-9511-1e9ddeb8575f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...e,children:[U.jsx("title",{children:"Tempest Games Logo"}),U.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M202.91,7.86h-13.18v17.03h13.18v6.84h-13.18v22.24h13.18v6.84h-30.29V.93h30.29v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M289.49.93v59.89h-17.11V7.78h-.43c-8.21,0-11.21,5.82-11.21,17.03v36.02h-16.25V24.8c0-11.21-2.99-17.03-11.21-17.03h-.43v53.04h-17.11V.93h18.74c9.92,0,15.31,4.96,18.14,11.21,2.82-6.25,8.21-11.21,18.14-11.21h18.73Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M352.82,29.68c0,11.72-6.42,19.16-24.55,19.16h-4.53v11.98h-17.11V1.1l46.2-.17v28.75ZM323.73,7.78v34.22h2.48c7.36,0,9.5-4.11,9.5-12.15V7.78h-11.98Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M396.8,7.86h-13.17v17.03h13.17v6.84h-13.17v22.24h13.17v6.84h-30.28V.93h30.28v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M425.9,12.57v14.03h27.89v16.94c0,12.75-1.71,18.13-16.43,18.13h-14.54c-9.58,0-14.03-2.74-14.03-11.97v-5.99h15.4v5.13c0,4.53.77,5.99,4.62,5.99h1.71c5.05,0,6.16-1.46,6.16-6.84v-14.54h-27.89v-16.68c0-13.52,3.85-16.68,18.82-16.68h12.83c8.81,0,13.17,1.54,13.17,10.78v7.19h-15.4v-6.5c0-3.42-1.03-4.62-4.45-4.62h-1.45c-4.28,0-6.42,1.46-6.42,5.65Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M155.96,93.78v-3.57h-5.58v-7.14h13.39v17.85h-24.76v-28.56h24.76v7.14h-16.96v14.28h9.15Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M224.26,100.92h-8.25v-10.71h-8.25v3.57h4.68v7.14h-12.94v-17.85h16.51v-3.57h-16.51v-7.14h24.76v28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M259.99,72.36h30.57v28.56h-7.81v-21.42h-3.57v21.42h-7.81v-21.42h-3.57v21.42h-7.81v-28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M343.24,83.08v-3.57h-9.14v14.28h16.96v7.14h-24.76v-28.56h24.76v17.85h-13.38v-7.14h5.57Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M394.59,79.5v3.57h16.96v17.85h-24.76v-7.14h16.96v-3.57h-16.96v-17.85h24.76v7.14h-16.96Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),U.jsx("path",{d:"M0,63.42v-20.84h20.83L0,63.42ZM100,.92v32.29h-35.42v8.33h-8.33V14.46h-22.92l1.04,7.29h9.38v19.79h-8.33v-8.33H0V.92h100ZM0,100.92v-26.04l6.25-1.04,25-26.04,1.04,1.05-10.42,18.75-4.16,7.29h13.54l3.13-3.12,8.33-22.92h1.04v41.66h3.12l9.38-8.33v-33.33h1.04l8.33,22.92,3.12,3.12h13.54l-4.17-7.29-10.42-19.8,1.04-1.04,25,27.09,6.25,1.04v26.04H0ZM100,42.59v20.84l-20.83-20.84h20.83Z",style:{fill:"var(--logo-color)",strokeWidth:0}})]})}function DT(e){return U.jsx("a",{...e})}const YB={class:"_class_1nbks_1"},Kh=["โ ‹","โ ™","โ ธ","โ ด","โ ฆ","โ ‡"];function XB({input:e}){const t=j.useRef(null),[n,s]=j.useState(typeof e=="string"?e:null);return j.useEffect(()=>{let a=!0,u;if(typeof e=="string")s(e);else{let c=0;u=setInterval(()=>{t.current&&(t.current.textContent=Kh[c],c=(c+1)%Kh.length)},100),e.then(d=>{a&&(clearInterval(u),s(d))})}return()=>{a=!1,u&&clearInterval(u)}},[e]),U.jsx("span",{ref:t,children:n??Kh[0]})}function ef(e){const t={subscribe(n){let s=null,a=!1,u=!1,c=!1;function d(){if(s===null){c=!0;return}u||(u=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=e({next(h){var p;a||(p=n.next)==null||p.call(n,h)},error(h){var p;a||(a=!0,(p=n.error)==null||p.call(n,h),d())},complete(){var h;a||(a=!0,(h=n.complete)==null||h.call(n),d())}}),c&&d(),{unsubscribe:d}},pipe(...n){return n.reduce(ZB,t)}};return t}function ZB(e,t){return t(e)}function JB(e){const t=new AbortController;return new Promise((s,a)=>{let u=!1;function c(){u||(u=!0,d.unsubscribe())}t.signal.addEventListener("abort",()=>{a(t.signal.reason)});const d=e.subscribe({next(h){u=!0,s(h),c()},error(h){a(h)},complete(){t.abort(),c()}})})}function QB(e){return t=>{let n=0,s=null;const a=[];function u(){s||(s=t.subscribe({next(d){var h;for(const p of a)(h=p.next)==null||h.call(p,d)},error(d){var h;for(const p of a)(h=p.error)==null||h.call(p,d)},complete(){var d;for(const h of a)(d=h.complete)==null||d.call(h)}}))}function c(){if(n===0&&s){const d=s;s=null,d.unsubscribe()}}return ef(d=>(n++,a.push(d),u(),{unsubscribe(){n--,c();const h=a.findIndex(p=>p===d);h>-1&&a.splice(h,1)}}))}}function WB(e){let t=e;const n=[],s=c=>{t!==void 0&&c.next(t),n.push(c)},a=c=>{n.splice(n.indexOf(c),1)},u=ef(c=>(s(c),()=>{a(c)}));return u.next=c=>{if(t!==c){t=c;for(const d of n)d.next(c)}},u.get=()=>t,u}function eL(e){return ef(t=>{function n(a=0,u=e.op){const c=e.links[a];if(!c)throw new Error("No more links to execute - did you forget to add an ending link?");return c({op:u,next(h){return n(a+1,h)}})}return n().subscribe(t)})}const NT=()=>{},QS=e=>{Object.freeze&&Object.freeze(e)};function $T(e,t,n){var s,a;const u=t.join(".");return(s=n)[a=u]??(s[a]=new Proxy(NT,{get(c,d){if(!(typeof d!="string"||d==="then"))return $T(e,[...t,d],n)},apply(c,d,h){const p=t[t.length-1];let y={args:h,path:t};return p==="call"?y={args:h.length>=2?[h[1]]:[],path:t.slice(0,-1)}:p==="apply"&&(y={args:h.length>=2?h[1]:[],path:t.slice(0,-1)}),QS(y.args),QS(y.path),e(y)}})),n[u]}const tL=e=>$T(e,[],Object.create(null)),nL=e=>new Proxy(NT,{get(t,n){if(n!=="then")return e(n)}});function Xo(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function iL(e,t){if("error"in e){const s=t.deserialize(e.error);return{ok:!1,error:{...e,error:s}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class Ph extends Error{constructor(){super("Unable to transform response from server")}}function sL(e,t){let n;try{n=iL(e,t)}catch{throw new Ph}if(!n.ok&&(!Xo(n.error.error)||typeof n.error.error.code!="number"))throw new Ph;if(n.ok&&!Xo(n.result))throw new Ph;return n}var WS,e1;(WS=Symbol).dispose??(WS.dispose=Symbol());(e1=Symbol).asyncDispose??(e1.asyncDispose=Symbol());var zx,Ux,qx,Kx,Px,Ix;typeof window>"u"||"Deno"in window||((Ux=(zx=globalThis.process)==null?void 0:zx.env)==null?void 0:Ux.NODE_ENV)==="test"||(Kx=(qx=globalThis.process)==null?void 0:qx.env)!=null&&Kx.JEST_WORKER_ID||(Ix=(Px=globalThis.process)==null?void 0:Px.env)!=null&&Ix.VITEST_WORKER_ID;function qu(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function rL(e){return e instanceof ti||e instanceof Error&&e.name==="TRPCClientError"}function aL(e){return Xo(e)&&Xo(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function oL(e,t){return typeof e=="string"?e:Xo(e)&&typeof e.message=="string"?e.message:t}class ti extends Error{static from(t,n={}){const s=t;return rL(s)?(n.meta&&(s.meta={...s.meta,...n.meta}),s):aL(s)?new ti(s.error.message,{...n,result:s}):new ti(oL(s,"Unknown error"),{...n,cause:s})}constructor(t,n){var a,u;const s=n==null?void 0:n.cause;super(t,{cause:s}),qu(this,"cause",void 0),qu(this,"shape",void 0),qu(this,"data",void 0),qu(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=s,this.shape=(a=n==null?void 0:n.result)==null?void 0:a.error,this.data=(u=n==null?void 0:n.result)==null?void 0:u.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,ti.prototype)}}function Ih(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class lL{$request(t){return eL({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe(QB())}async requestAsPromise(t){try{const n=this.$request(t);return(await JB(n)).result.data}catch(n){throw ti.from(n)}}query(t,n,s){return this.requestAsPromise({type:"query",path:t,input:n,context:s==null?void 0:s.context,signal:s==null?void 0:s.signal})}mutation(t,n,s){return this.requestAsPromise({type:"mutation",path:t,input:n,context:s==null?void 0:s.context,signal:s==null?void 0:s.signal})}subscription(t,n,s){return this.$request({type:"subscription",path:t,input:n,context:s.context,signal:s.signal}).subscribe({next(u){var c,d,h,p;switch(u.result.type){case"state":{(c=s.onConnectionStateChange)==null||c.call(s,u.result);break}case"started":{(d=s.onStarted)==null||d.call(s,{context:u.context});break}case"stopped":{(h=s.onStopped)==null||h.call(s);break}case"data":case void 0:{(p=s.onData)==null||p.call(s,u.result.data);break}}},error(u){var c;(c=s.onError)==null||c.call(s,u)},complete(){var u;(u=s.onComplete)==null||u.call(s)}})}constructor(t){Ih(this,"links",void 0),Ih(this,"runtime",void 0),Ih(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(n=>n(this.runtime))}}const uL=Symbol.for("trpc_untypedClient"),cL={query:"query",mutate:"mutation",subscribe:"subscription"},fL=e=>cL[e];function dL(e){const t=tL(({path:n,args:s})=>{const a=[...n],u=fL(a.pop()),c=a.join(".");return e[u](c,...s)});return nL(n=>n===uL?e:t[n])}function hL(e){const t=new lL(e);return dL(t)}const t1=e=>typeof e=="function";function pL(e){if(e)return e;if(typeof window<"u"&&t1(window.fetch))return window.fetch;if(typeof globalThis<"u"&&t1(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const n1=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function i1(e){let t=null,n=null;const s=()=>{clearTimeout(n),n=null,t=null};function a(d){var y,g;const h=[[]];let p=0;for(;;){const v=d[p];if(!v)break;const S=h[h.length-1];if(v.aborted){(y=v.reject)==null||y.call(v,new Error("Aborted")),p++;continue}if(e.validate(S.concat(v).map(E=>E.key))){S.push(v),p++;continue}if(S.length===0){(g=v.reject)==null||g.call(v,new Error("Input is too big for a single dispatch")),p++;continue}h.push([])}return h}function u(){const d=a(t);s();for(const h of d){if(!h.length)continue;const p={items:h};for(const g of h)g.batch=p;e.fetch(p.items.map(g=>g.key)).then(async g=>{var v;await Promise.all(g.map(async(S,A)=>{var M,k;const E=p.items[A];try{const $=await Promise.resolve(S);(M=E.resolve)==null||M.call(E,$)}catch($){(k=E.reject)==null||k.call(E,$)}E.batch=null,E.reject=null,E.resolve=null}));for(const S of p.items)(v=S.reject)==null||v.call(S,new Error("Missing result")),S.batch=null}).catch(g=>{var v;for(const S of p.items)(v=S.reject)==null||v.call(S,g),S.batch=null})}}function c(d){const h={aborted:!1,key:d,batch:null,resolve:n1,reject:n1},p=new Promise((y,g)=>{h.reject=g,h.resolve=y,t||(t=[]),t.push(h)});return n||(n=setTimeout(u)),p}return{load:c}}function mL(...e){const t=new AbortController,n=e.length;let s=0;const a=()=>{++s===n&&t.abort()};for(const u of e)u!=null&&u.aborted?a():u==null||u.addEventListener("abort",a,{once:!0});return t.signal}function yL(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}function gL(e){return{url:e.url.toString(),fetch:e.fetch,transformer:yL(e.transformer),methodOverride:e.methodOverride}}function bL(e){const t={};for(let n=0;n<e.length;n++){const s=e[n];t[n]=s}return t}const vL={query:"GET",mutation:"POST",subscription:"PATCH"};function BT(e){return"input"in e?e.transformer.input.serialize(e.input):bL(e.inputs.map(t=>e.transformer.input.serialize(t)))}const LT=e=>{const t=e.url.split("?");let s=t[0].replace(/\/$/,"")+"/"+e.path;const a=[];if(t[1]&&a.push(t[1]),"inputs"in e&&a.push("batch=1"),e.type==="query"||e.type==="subscription"){const u=BT(e);u!==void 0&&e.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(u))}`)}return a.length&&(s+="?"+a.join("&")),s},SL=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=BT(e);return t!==void 0?JSON.stringify(t):void 0},xL=e=>EL({...e,contentTypeHeader:"application/json",getUrl:LT,getBody:SL});class wL extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}}const AL=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new wL};async function TL(e){AL(e.signal);const t=e.getUrl(e),n=e.getBody(e),{type:s}=e,a=await(async()=>{const c=await e.headers();return Symbol.iterator in c?Object.fromEntries(c):c})(),u={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...a};return pL(e.fetch)(t,{method:e.methodOverride??vL[s],signal:e.signal,body:n,headers:u})}async function EL(e){const t={},n=await TL(e);t.response=n;const s=await n.json();return t.responseJSON=s,{json:s,meta:t}}function RL(e){const t=gL(e),n=e.maxURLLength??1/0,s=e.maxItems??1/0;return()=>{const a=h=>({validate(p){if(n===1/0&&s===1/0)return!0;if(p.length>s)return!1;const y=p.map(S=>S.path).join(","),g=p.map(S=>S.input);return LT({...t,type:h,path:y,inputs:g,signal:null}).length<=n},async fetch(p){const y=p.map(M=>M.path).join(","),g=p.map(M=>M.input),v=mL(...p.map(M=>M.signal)),S=await xL({...t,path:y,inputs:g,type:h,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:p}):e.headers:{}},signal:v});return(Array.isArray(S.json)?S.json:p.map(()=>S.json)).map(M=>({meta:S.meta,json:M}))}}),u=i1(a("query")),c=i1(a("mutation")),d={query:u,mutation:c};return({op:h})=>ef(p=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const g=d[h.type].load(h);let v;return g.then(S=>{v=S;const A=sL(S.json,t.transformer.output);if(!A.ok){p.error(ti.from(A.error,{meta:S.meta}));return}p.next({context:S.meta,result:A.result}),p.complete()}).catch(S=>{p.error(ti.from(S,{meta:v==null?void 0:v.meta}))}),()=>{}})}}const VT=(e,...t)=>typeof e=="function"?e(...t):e;function OL(){let e,t;return{promise:new Promise((s,a)=>{e=s,t=a}),resolve:e,reject:t}}async function ML(e){const t=await VT(e.url);if(!e.connectionParams)return t;const s=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+s}async function CL(e){const t={method:"connectionParams",data:await VT(e)};return JSON.stringify(t)}function Fs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _L(e){const{promise:t,resolve:n,reject:s}=OL();return e.addEventListener("open",()=>{e.removeEventListener("error",s),n()}),e.addEventListener("error",s),t}function kL(e,{intervalMs:t,pongTimeoutMs:n}){let s,a;function u(){s=setTimeout(()=>{e.send("PING"),a=setTimeout(()=>{e.close()},n)},t)}function c(){clearTimeout(s),u()}function d(){clearTimeout(a),c()}e.addEventListener("open",u),e.addEventListener("message",({data:h})=>{clearTimeout(s),u(),h==="PONG"&&d()}),e.addEventListener("close",()=>{clearTimeout(s),clearTimeout(a)})}class Rc{get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Rc.connectCount;const t=ML(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&kL(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await _L(n),this.urlOptions.connectionParams&&n.send(await CL(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){var t;try{await this.openPromise}finally{(t=this.ws)==null||t.close()}}constructor(t){if(Fs(this,"id",++Rc.connectCount),Fs(this,"WebSocketPonyfill",void 0),Fs(this,"urlOptions",void 0),Fs(this,"keepAliveOpts",void 0),Fs(this,"wsObservable",WB(null)),Fs(this,"openPromise",null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}}Fs(Rc,"connectCount",0);var DL={};function jT(e,t){if(e instanceof Promise)throw new Error(t)}function NL(e,t){const n={},s=[];for(const a in e){const u=e[a]["~standard"].validate(t[a]);if(jT(u,`Validation must be synchronous, but ${a} returned a Promise.`),u.issues){s.push(...u.issues.map(c=>({...c,path:[a,...c.path??[]]})));continue}n[a]=u.value}return s.length?{issues:s}:{value:n}}function $L(e){var $;const t=e.runtimeEnvStrict??e.runtimeEnv??DL;if(e.emptyStringAsUndefined??!1)for(const[C,G]of Object.entries(t))G===""&&delete t[C];if(!!e.skipValidation)return t;const a=typeof e.client=="object"?e.client:{},u=typeof e.server=="object"?e.server:{},c=typeof e.shared=="object"?e.shared:{},d=e.isServer??(typeof window>"u"||"Deno"in window),h=d?{...u,...c,...a}:{...a,...c},p=(($=e.createFinalSchema)==null?void 0:$.call(e,h,d)["~standard"].validate(t))??NL(h,t);jT(p,"Validation must be synchronous");const y=e.onValidationError??(C=>{throw console.error("โŒ Invalid environment variables:",C),new Error("Invalid environment variables")}),g=e.onInvalidAccess??(()=>{throw new Error("โŒ Attempted to access a server-side environment variable on the client")});if(p.issues)return y(p.issues);const v=C=>e.clientPrefix?!C.startsWith(e.clientPrefix)&&!(C in c):!0,S=C=>d||!v(C),A=C=>C==="__esModule"||C==="$$typeof",E=(e.extends??[]).reduce((C,G)=>Object.assign(C,G),{}),M=Object.assign(E,p.value);return new Proxy(M,{get(C,G){if(typeof G=="string"&&!A(G))return S(G)?Reflect.get(C,G):g(G)}})}const BL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},LL="__vite_start_time"in globalThis,VL=typeof window<"u",Oi=ot("string"),s1=ot('"true" | "false" | undefined'),zT=$L({isServer:!LL&&!VL,server:{CI:ot("string | undefined").pipe(Boolean),POSTGRES_USER:Oi,POSTGRES_PASSWORD:Oi,POSTGRES_DATABASE:Oi,POSTGRES_HOST:Oi,POSTGRES_PORT:Oi.pipe(e=>Number.parseInt(e,10)),BACKEND_PORT:Oi.pipe(e=>Number.parseInt(e,10)),RUN_WORKERS_FROM_SOURCE:s1.pipe(e=>e==="true"),FRONTEND_PORT:Oi.pipe(e=>Number.parseInt(e,10)),FRONTEND_ORIGINS:Oi.pipe.try(e=>JSON.parse(e),ot("string[]")),API_KEY_OPENAI:ot("string | undefined"),API_KEY_RESEND:ot("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Oi,VITE_DEV_FRONTEND_HOST:ot("string | undefined"),VITE_DEV_HTTPS:s1.pipe(e=>e==="true")},runtimeEnv:BL,emptyStringAsUndefined:!0}),jL="modulepreload",zL=function(e){return"/"+e},r1={},UL=function(t,n,s){let a=Promise.resolve();if(n&&n.length>0){let c=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));a=c(n.map(p=>{if(p=zL(p),p in r1)return;r1[p]=!0;const y=p.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=y?"stylesheet":jL,y||(v.as="script"),v.crossOrigin="",v.href=p,h&&v.setAttribute("nonce",h),document.head.appendChild(v),y)return new Promise((S,A)=>{v.addEventListener("load",S),v.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return a.then(c=>{for(const d of c||[])d.status==="rejected"&&u(d.reason);return t().catch(u)})},oi=Object.create(null);oi.open="0";oi.close="1";oi.ping="2";oi.pong="3";oi.message="4";oi.upgrade="5";oi.noop="6";const Ju=Object.create(null);Object.keys(oi).forEach(e=>{Ju[oi[e]]=e});const jp={type:"error",data:"parser error"},UT=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",qT=typeof ArrayBuffer=="function",KT=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Fm=({type:e,data:t},n,s)=>UT&&t instanceof Blob?n?s(t):a1(t,s):qT&&(t instanceof ArrayBuffer||KT(t))?n?s(t):a1(new Blob([t]),s):s(oi[e]+(t||"")),a1=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function o1(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Hh;function qL(e,t){if(UT&&e.data instanceof Blob)return e.data.arrayBuffer().then(o1).then(t);if(qT&&(e.data instanceof ArrayBuffer||KT(e.data)))return t(o1(e.data));Fm(e,!1,n=>{Hh||(Hh=new TextEncoder),t(Hh.encode(n))})}const l1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lo=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<l1.length;e++)Lo[l1.charCodeAt(e)]=e;const KL=e=>{let t=e.length*.75,n=e.length,s,a=0,u,c,d,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const p=new ArrayBuffer(t),y=new Uint8Array(p);for(s=0;s<n;s+=4)u=Lo[e.charCodeAt(s)],c=Lo[e.charCodeAt(s+1)],d=Lo[e.charCodeAt(s+2)],h=Lo[e.charCodeAt(s+3)],y[a++]=u<<2|c>>4,y[a++]=(c&15)<<4|d>>2,y[a++]=(d&3)<<6|h&63;return p},PL=typeof ArrayBuffer=="function",Ym=(e,t)=>{if(typeof e!="string")return{type:"message",data:PT(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:IL(e.substring(1),t)}:Ju[n]?e.length>1?{type:Ju[n],data:e.substring(1)}:{type:Ju[n]}:jp},IL=(e,t)=>{if(PL){const n=KL(e);return PT(n,t)}else return{base64:!0,data:e}},PT=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},IT="",HL=(e,t)=>{const n=e.length,s=new Array(n);let a=0;e.forEach((u,c)=>{Fm(u,!1,d=>{s[c]=d,++a===n&&t(s.join(IT))})})},GL=(e,t)=>{const n=e.split(IT),s=[];for(let a=0;a<n.length;a++){const u=Ym(n[a],t);if(s.push(u),u.type==="error")break}return s};function FL(){return new TransformStream({transform(e,t){qL(e,n=>{const s=n.length;let a;if(s<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,s);else if(s<65536){a=new Uint8Array(3);const u=new DataView(a.buffer);u.setUint8(0,126),u.setUint16(1,s)}else{a=new Uint8Array(9);const u=new DataView(a.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(a[0]|=128),t.enqueue(a),t.enqueue(n)})}})}let Gh;function Ku(e){return e.reduce((t,n)=>t+n.length,0)}function Pu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let a=0;a<t;a++)n[a]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function YL(e,t){Gh||(Gh=new TextDecoder);const n=[];let s=0,a=-1,u=!1;return new TransformStream({transform(c,d){for(n.push(c);;){if(s===0){if(Ku(n)<1)break;const h=Pu(n,1);u=(h[0]&128)===128,a=h[0]&127,a<126?s=3:a===126?s=1:s=2}else if(s===1){if(Ku(n)<2)break;const h=Pu(n,2);a=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),s=3}else if(s===2){if(Ku(n)<8)break;const h=Pu(n,8),p=new DataView(h.buffer,h.byteOffset,h.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(jp);break}a=y*Math.pow(2,32)+p.getUint32(4),s=3}else{if(Ku(n)<a)break;const h=Pu(n,a);d.enqueue(Ym(u?h:Gh.decode(h),t)),s=0}if(a===0||a>e){d.enqueue(jp);break}}}})}const HT=4;function gt(e){if(e)return XL(e)}function XL(e){for(var t in gt.prototype)e[t]=gt.prototype[t];return e}gt.prototype.on=gt.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};gt.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};gt.prototype.off=gt.prototype.removeListener=gt.prototype.removeAllListeners=gt.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,a=0;a<n.length;a++)if(s=n[a],s===t||s.fn===t){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+e],this};gt.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,a=n.length;s<a;++s)n[s].apply(this,t)}return this};gt.prototype.emitReserved=gt.prototype.emit;gt.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};gt.prototype.hasListeners=function(e){return!!this.listeners(e).length};const tf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Dn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),ZL="arraybuffer";function GT(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const JL=Dn.setTimeout,QL=Dn.clearTimeout;function nf(e,t){t.useNativeTimers?(e.setTimeoutFn=JL.bind(Dn),e.clearTimeoutFn=QL.bind(Dn)):(e.setTimeoutFn=Dn.setTimeout.bind(Dn),e.clearTimeoutFn=Dn.clearTimeout.bind(Dn))}const WL=1.33;function eV(e){return typeof e=="string"?tV(e):Math.ceil((e.byteLength||e.size)*WL)}function tV(e){let t=0,n=0;for(let s=0,a=e.length;s<a;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function FT(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function nV(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function iV(e){let t={},n=e.split("&");for(let s=0,a=n.length;s<a;s++){let u=n[s].split("=");t[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return t}class sV extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class Xm extends gt{constructor(t){super(),this.writable=!1,nf(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new sV(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Ym(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=nV(t);return n.length?"?"+n:""}}class rV extends Xm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};GL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,HL(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=FT()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let YT=!1;try{YT=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const aV=YT;function oV(){}class lV extends rV{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(a,u)=>{this.onError("xhr post error",a,u)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}let da=class Qu extends gt{constructor(t,n,s){super(),this.createRequest=t,nf(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=GT(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&s.setRequestHeader(a,this._opts.extraHeaders[a])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var a;s.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=Qu.requestsCount++,Qu.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=oV,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Qu.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};da.requestsCount=0;da.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",u1);else if(typeof addEventListener=="function"){const e="onpagehide"in Dn?"pagehide":"unload";addEventListener(e,u1,!1)}}function u1(){for(let e in da.requests)da.requests.hasOwnProperty(e)&&da.requests[e].abort()}const uV=function(){const e=XT({xdomain:!1});return e&&e.responseType!==null}();class cV extends lV{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=uV&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new da(XT,this.uri(),t)}}function XT(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||aV))return new XMLHttpRequest}catch{}if(!t)try{return new Dn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const ZT=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class fV extends Xm{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=ZT?{}:GT(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],a=n===t.length-1;Fm(s,this.supportsBinary,u=>{try{this.doWrite(s,u)}catch{}a&&tf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=FT()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Fh=Dn.WebSocket||Dn.MozWebSocket;class dV extends fV{createSocket(t,n,s){return ZT?new Fh(t,n,s):n?new Fh(t,n):new Fh(t)}doWrite(t,n){this.ws.send(n)}}class hV extends Xm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=YL(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),a=FL();a.readable.pipeTo(t.writable),this._writer=a.writable.getWriter();const u=()=>{s.read().then(({done:d,value:h})=>{d||(this.onPacket(h),u())}).catch(d=>{})};u();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],a=n===t.length-1;this._writer.write(s).then(()=>{a&&tf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const pV={websocket:dV,webtransport:hV,polling:cV},mV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,yV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function zp(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let a=mV.exec(e||""),u={},c=14;for(;c--;)u[yV[c]]=a[c]||"";return n!=-1&&s!=-1&&(u.source=t,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=gV(u,u.path),u.queryKey=bV(u,u.query),u}function gV(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function bV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,a,u){a&&(n[a]=u)}),n}const Up=typeof addEventListener=="function"&&typeof removeEventListener=="function",Wu=[];Up&&addEventListener("offline",()=>{Wu.forEach(e=>e())},!1);class vs extends gt{constructor(t,n){if(super(),this.binaryType=ZL,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=zp(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=zp(n.host).host);nf(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const a=s.prototype.name;this.transports.push(a),this._transportsByName[a]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=iV(this.opts.query)),Up&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Wu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=HT,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&vs.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",vs.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const a=this.writeBuffer[s].data;if(a&&(n+=eV(a)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,tf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,a){if(typeof n=="function"&&(a=n,n=void 0),typeof s=="function"&&(a=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const u={type:t,data:n,options:s};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),a&&this.once("flush",a),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(vs.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Up&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Wu.indexOf(this._offlineEventListener);s!==-1&&Wu.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}vs.protocol=HT;class vV extends vs{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;vs.priorWebsocketSuccess=!1;const a=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!s)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;vs.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=n.name,this.emitReserved("upgradeError",v)}}))};function u(){s||(s=!0,y(),n.close(),n=null)}const c=g=>{const v=new Error("probe error: "+g);v.transport=n.name,u(),this.emitReserved("upgradeError",v)};function d(){c("transport closed")}function h(){c("socket closed")}function p(g){n&&g.name!==n.name&&u()}const y=()=>{n.removeListener("open",a),n.removeListener("error",c),n.removeListener("close",d),this.off("close",h),this.off("upgrading",p)};n.once("open",a),n.once("error",c),n.once("close",d),this.once("close",h),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let SV=class extends vV{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(a=>pV[a]).filter(a=>!!a)),super(t,s)}};function xV(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=zp(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const u=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+u+":"+s.port+t,s.href=s.protocol+"://"+u+(n&&n.port===s.port?"":":"+s.port),s}const wV=typeof ArrayBuffer=="function",AV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,JT=Object.prototype.toString,TV=typeof Blob=="function"||typeof Blob<"u"&&JT.call(Blob)==="[object BlobConstructor]",EV=typeof File=="function"||typeof File<"u"&&JT.call(File)==="[object FileConstructor]";function Zm(e){return wV&&(e instanceof ArrayBuffer||AV(e))||TV&&e instanceof Blob||EV&&e instanceof File}function ec(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(ec(e[n]))return!0;return!1}if(Zm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return ec(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&ec(e[n]))return!0;return!1}function RV(e){const t=[],n=e.data,s=e;return s.data=qp(n,t),s.attachments=t.length,{packet:s,buffers:t}}function qp(e,t){if(!e)return e;if(Zm(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=qp(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=qp(e[s],t));return n}return e}function OV(e,t){return e.data=Kp(e.data,t),delete e.attachments,e}function Kp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Kp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Kp(e[n],t));return e}const MV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],CV=5;var Oe;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(Oe||(Oe={}));class _V{constructor(t){this.replacer=t}encode(t){return(t.type===Oe.EVENT||t.type===Oe.ACK)&&ec(t)?this.encodeAsBinary({type:t.type===Oe.EVENT?Oe.BINARY_EVENT:Oe.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===Oe.BINARY_EVENT||t.type===Oe.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=RV(t),s=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(s),a}}function c1(e){return Object.prototype.toString.call(e)==="[object Object]"}class Jm extends gt{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===Oe.BINARY_EVENT;s||n.type===Oe.BINARY_ACK?(n.type=s?Oe.EVENT:Oe.ACK,this.reconstructor=new kV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Zm(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(Oe[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===Oe.BINARY_EVENT||s.type===Oe.BINARY_ACK){const u=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(u,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(c)}if(t.charAt(n+1)==="/"){const u=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(u,n)}else s.nsp="/";const a=t.charAt(n+1);if(a!==""&&Number(a)==a){const u=n+1;for(;++n;){const c=t.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===t.length)break}s.id=Number(t.substring(u,n+1))}if(t.charAt(++n)){const u=this.tryParse(t.substr(n));if(Jm.isPayloadValid(s.type,u))s.data=u;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case Oe.CONNECT:return c1(n);case Oe.DISCONNECT:return n===void 0;case Oe.CONNECT_ERROR:return typeof n=="string"||c1(n);case Oe.EVENT:case Oe.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&MV.indexOf(n[0])===-1);case Oe.ACK:case Oe.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class kV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=OV(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const DV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Jm,Encoder:_V,get PacketType(){return Oe},protocol:CV},Symbol.toStringTag,{value:"Module"}));function qn(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const NV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class QT extends gt{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[qn(t,"open",this.onopen.bind(this)),qn(t,"packet",this.onpacket.bind(this)),qn(t,"error",this.onerror.bind(this)),qn(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,a,u;if(NV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:Oe.EVENT,data:n};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const y=this.ids++,g=n.pop();this._registerAckCallback(y,g),c.id=y}const d=(a=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||a===void 0?void 0:a.writable,h=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!d||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(t,n){var s;const a=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(a===void 0){this.acks[t]=n;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===t&&this.sendBuffer.splice(d,1);n.call(this,new Error("operation has timed out"))},a),c=(...d)=>{this.io.clearTimeoutFn(u),n.apply(this,d)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((s,a)=>{const u=(c,d)=>c?a(c):s(d);u.withError=!0,n.push(u),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((a,...u)=>s!==this._queue[0]?void 0:(a!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...u)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:Oe.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case Oe.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case Oe.EVENT:case Oe.BINARY_EVENT:this.onevent(t);break;case Oe.ACK:case Oe.BINARY_ACK:this.onack(t);break;case Oe.DISCONNECT:this.ondisconnect();break;case Oe.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...a){s||(s=!0,n.packet({type:Oe.ACK,id:t,data:a}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:Oe.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function Ma(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ma.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Ma.prototype.reset=function(){this.attempts=0};Ma.prototype.setMin=function(e){this.ms=e};Ma.prototype.setMax=function(e){this.max=e};Ma.prototype.setJitter=function(e){this.jitter=e};class Pp extends gt{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,nf(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Ma({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const a=n.parser||DV;this.encoder=new a.Encoder,this.decoder=new a.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new SV(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const a=qn(n,"open",function(){s.onopen(),t&&t()}),u=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),t?t(d):this.maybeReconnectOnOpen()},c=qn(n,"error",u);if(this._timeout!==!1){const d=this._timeout,h=this.setTimeoutFn(()=>{a(),u(new Error("timeout")),n.close()},d);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(a),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(qn(t,"ping",this.onping.bind(this)),qn(t,"data",this.ondata.bind(this)),qn(t,"error",this.onerror.bind(this)),qn(t,"close",this.onclose.bind(this)),qn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){tf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new QT(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(a=>{a?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",a)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Do={};function tc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=xV(e,t.path||"/socket.io"),s=n.source,a=n.id,u=n.path,c=Do[a]&&u in Do[a].nsps,d=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return d?h=new Pp(s,t):(Do[a]||(Do[a]=new Pp(s,t)),h=Do[a]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(tc,{Manager:Pp,Socket:QT,io:tc,connect:tc});const $V=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"],BV=3,LV=15,VV=/^[a-zA-Z0-9_-]+$/,jV=ot(VV).pipe(ot(`string > ${BV} & string < ${LV}`)).brand("username"),f1=20,d1={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function zV(e){let t="";for(const n of e)n in d1?t+=d1[n]:t+=n;return t}function UV(e){const t=e.toLocaleLowerCase(),n=zV(t);for(const s of $V)if(n.includes(s)||t.includes(s))return!0;return!1}function qV(e){const t=new Set(e).size;return e.length*Math.log2(t)}function KV(e){let t=0;return UV(e)&&(t-=100),t+=qV(e)*.5,Math.max(t,0)}const PV=ot("string").narrow((e,t)=>{const n=KV(e);return n>=f1?!0:t.mustBe(`Of complexity ${f1} or more. Was ${n.toFixed(2)}.`)}).brand("password");ot({"+":"delete",email:"string",password:"string"});const IV=ot("string").brand("email");ot({"+":"delete",username:"string",password:"string",email:"string"});const HV=ot({email:"string",userId:"string",username:"string",password:"boolean",sessionKey:"string",verification:"'unverified' | 'verified'"}),ni=tc(zT.VITE_BACKEND_ORIGIN,{auth:e=>{const t=Pn(Et);t&&e(t)},autoConnect:!1});ni.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),In(Et,null)}).on("usernameChanged",e=>{In(Et,t=>t===null?null:{...t,username:e})});const Et=Ht({key:"auth",default:function(){const t=localStorage.getItem("auth");if(t)try{const n=Ta(t),s=HV(n);return s instanceof ot.errors?(console.error("failed to parse auth data",s),null):(s.verification==="verified"&&(console.log("connecting..."),ni.connect()),s)}catch(n){return console.error("failed to parse auth data",n),null}return null},effects:[function({onSet:t}){t(async({newValue:n})=>{console.log("setting auth",n),n?(console.log("setting auth",n),In(ir,n.username),localStorage.setItem("auth",Nn(n)),n.verification==="verified"?(console.log("connecting..."),ni.connect()):await UL(async()=>{const{navigate:s}=await Promise.resolve().then(()=>QV);return{navigate:s}},void 0).then(({navigate:s})=>{s("/verify")})):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]});var Hx;const ir=Ht({key:"username",default:((Hx=Pn(Et))==null?void 0:Hx.username)??""}),Yh=Ht({key:"usernameDebounce",default:!0}),GV=Ht({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:e})=>{vC(ir,()=>{Pn(Yh)&&(e(Pn(ir)),In(Yh,!1),setTimeout(()=>{In(Yh,!0),e(Pn(ir))},2e3))})}]}),FV=Ui({key:"isUsernameTakenQuery",get:async({get:e})=>{const t=e(GV);if(!t)return!1;const n=Pn(Et);return t===(n==null?void 0:n.username)?!1:gs.isUsernameTaken.query({username:t})}}),WT=Ui({key:"usernameIssues",get:({get:e})=>{const t=e(ir),n=jV(t);return n instanceof ot.errors?n:null}}),xa=Ht({key:"password0",default:""}),eE=Ui({key:"password0Issues",get:({get:e})=>{const t=e(xa),n=PV(t);return n instanceof ot.errors?n:null}}),Ip=Ht({key:"password1",default:""}),tE=Ui({key:"password1Issues",get:({get:e})=>{const t=e(xa),n=e(Ip),s=ot(`"${t}"`)(n);return s instanceof ot.errors?s:null}}),Zo=Ht({key:"email",default:""}),nE=Ui({key:"emailIssues",get:({get:e})=>{const t=e(Zo),n=IV(t);return n instanceof ot.errors?n:null}});Ui({key:"signupReady",get:({get:e})=>{const t=e(WT),n=e(eE),s=e(tE),a=e(nE);return!(t??n??s??a)}});const Jo=Ht({key:"oneTimeCode",default:""}),gs=hL({links:[RL({url:zT.VITE_BACKEND_ORIGIN,headers(){const e=Pn(Et);if(!e)return{};const{userId:t,sessionKey:n}=e;return{Authorization:`${t} ${n}`}}})]}),YV=Ht({key:"appVersionQuery",default:gs.version.query});Ht({key:"lastKnownVersion",default:null,effects:[hw(localStorage,JSON,"lastKnownVersion")]});const XV=Ui({key:"appVersion",get:async({get:e})=>{const t=e(YV);return t instanceof Promise?t.then(n=>n.version):t.version}});function Xh(e){return["optional",e]}function ZV(e,t){let n=[e];for(const s of t){if(typeof s!="string")return!1;n=n.flatMap(a=>{if(a===null)return[];const u=[],c=a[1],d=c[s];d!==void 0&&u.push(d);const h=Object.keys(c).find(p=>p.startsWith("$"));if(h){const p=c[h];p&&u.push(p)}return u})}for(const s of n)if(s===null||s[0]==="optional")return!0;return!1}const Qm=Xh({verify:Xh({$token:null}),game:Xh({clicker:null}),account:null,admin:null});function iE(e){return ZV(Qm,e)}const sE=[[]];function JV(e){return sE.some(t=>t.join("/")===e.join("/"))}function Ss(e){history.pushState(null,"",e),In(Wm,e)}const Wm=Ht({key:"pathName",default:window.location.pathname,effects:[({onSet:e,setSelf:t})=>{const n=a=>{history.replaceState(null,"",a),t(a)},s=a=>{switch(a){case"/":{const u=Pn(Et);switch(console.log("/","auth",u),u==null?void 0:u.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{const u=Pn(Et);(u==null?void 0:u.verification)==="verified"&&n("/game");break}case"/game":case"/game/clicker":{const u=Pn(Et);(u==null?void 0:u.verification)==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const u=Pn(Et);if(!u){n("/");break}u.verification==="unverified"&&n("/verify");break}}};s(window.location.pathname),e(({newValue:a})=>{s(a)})},({setSelf:e})=>{document.addEventListener("click",t=>{const n=t.target.closest("a");if(n&&n instanceof HTMLAnchorElement){const s=n.getAttribute("href");s!=null&&s.startsWith("/")&&(t.preventDefault(),history.pushState(null,"",s),e(s))}}),window.addEventListener("popstate",()=>{e(window.location.pathname)})}]}),rE=Ui({key:"route",get:({get:e})=>{const n=e(Wm).split("/").slice(1).filter(Boolean);return iE(n)?JV(n)||e(Et)?n:401:404}}),QV=Object.freeze(Object.defineProperty({__proto__:null,PUBLIC_ROUTES:sE,ROUTES:Qm,isRoute:iE,navigate:Ss,pathnameAtom:Wm,routeSelector:rE},Symbol.toStringTag,{value:"Module"}));function WV(){const e=Ci(ir),t=Ci(xa),n=Ci(Ip),s=Ci(Zo),a=yt(Et);yt(Jo);const u=yt(ir),c=yt(xa),d=yt(Ip),h=yt(Zo),p=yt(WT),y=yt(eE),g=yt(tE),v=yt(nE),S=yt(FV),[A,E]=Un.useState(!1),[M,k]=Un.useState(null),[$,C]=Un.useState(null),[G,z]=Un.useState(!1),te=Un.useRef(null),ie=Un.useRef(null),ne=Un.useRef(null);return Un.useEffect(()=>{var ee,me;switch(M){case"username":{(ee=te.current)==null||ee.focus();break}case"password":{(me=ne.current)==null||me.focus();break}}}),ac(()=>{a&&s(a.email)}),a?U.jsxs("article",{"data-css":"editor",children:[U.jsxs("form",{onSubmit:ee=>{if(ee.preventDefault(),G){z(!1);return}console.log("submitted! changing username to",u),ni.emit("changeUsername",u),k(null)},children:[M==="username"?U.jsx("button",{type:"button",onClick:()=>{k(null)},children:"x"}):null,U.jsx("main",{children:U.jsxs("label",{htmlFor:"username",children:[u&&(p||S===!0)?U.jsxs("aside",{children:[S===!0?U.jsx("span",{children:"This username is taken."}):null,p==null?void 0:p.map(ee=>U.jsx("span",{children:ee.message},ee.path.join(".")))]}):null,U.jsx("span",{children:"Username"}),U.jsx("input",{id:"username",type:"text",ref:te,value:u,onChange:ee=>{e(ee.target.value)},autoComplete:"username",autoCapitalize:"none",disabled:M!=="username"})]})}),M==="username"?U.jsx("button",{type:"submit",disabled:A,children:"->"}):U.jsx("button",{type:"button",onMouseDown:()=>{z(!0),k("username")},onMouseUp:()=>{z(!1)},children:"/"})]}),U.jsxs("form",{onSubmit:ee=>{ee.preventDefault()},children:[M==="email"?U.jsx("button",{type:"button",onClick:()=>{k(null)},children:"x"}):null,U.jsxs("main",{children:[$?U.jsx("aside",{children:$}):null,U.jsxs("label",{htmlFor:"email",children:[h&&v?U.jsx("aside",{children:v.map(ee=>U.jsx("span",{children:ee.message},ee.path.join(".")))}):null,U.jsx("span",{children:"Email"}),U.jsx("input",{id:"email",type:"text",ref:ie,value:h,onChange:ee=>{s(ee.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:M!=="email"})]})]}),M==="email"?U.jsx("button",{type:"submit",disabled:A,children:"->"}):U.jsx("button",{type:"button",onClick:()=>{k("email")},children:"/"})]}),U.jsxs("form",{onSubmit:ee=>{ee.preventDefault()},children:[M==="password"?U.jsx("button",{type:"button",onClick:()=>{k(null)},children:"x"}):null,U.jsxs("main",{children:[$?U.jsx("aside",{children:$}):null,U.jsxs("label",{htmlFor:"password",children:[c&&y?U.jsx("aside",{children:y.map(ee=>U.jsx("span",{children:ee.message},ee.path.join(".")))}):null,U.jsx("span",{children:"Password"}),U.jsx("input",{id:"password0",ref:ne,type:"password",placeholder:M==="password"?"":a.password?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"none",value:c,onChange:ee=>{t(ee.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":a.password?"green":void 0},disabled:M!=="password"})]}),M==="password"?U.jsxs("label",{htmlFor:"password",children:[d&&g?U.jsx("aside",{children:g.map(ee=>U.jsx("span",{children:ee.message},ee.path.join(".")))}):null,U.jsx("span",{children:"Confirm Password"}),U.jsx("input",{id:"password1",type:"password",placeholder:M==="password"?"":a.password?"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข":"none",value:d,onChange:ee=>{n(ee.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":a.password?"green":void 0},disabled:M!=="password"})]}):null]}),M==="password"?U.jsx("button",{type:"submit",disabled:A,children:"->"}):a.password?U.jsx("button",{type:"button",onClick:()=>{k("password")},children:"/"}):U.jsx("button",{type:"button",onClick:()=>{k("password")},children:"+ add password"})]})]}):U.jsx("p",{children:"You must be logged in to verify your account."})}function ej(){return U.jsx("article",{children:U.jsx("h1",{children:"admin"})})}class tj extends Map{set(t,n){return this.has(t)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:t,value:n}),this):super.set(t,n)}clear(){throw new Error("Cannot clear an InvariantMap")}}const Ho=class Ho{constructor(t){w(this,"type","continuity");w(this,"globals",[]);w(this,"actions",[]);w(this,"perspectives",[]);w(this,"key");this.key=t}static create(t,n){const s=new Ho(t),{type:a,globals:u,actions:c,perspectives:d}=n(s),h={type:a,key:t,globals:u,actions:c,perspectives:d};return Ho.existing.set(t,h),h}add(...t){switch(t[0].type){case"atom":case"mutable_atom":this.globals.push(...t);break;case"transaction":this.actions.push(...t);break;case"atom_family":case"mutable_atom_family":{const[s,a]=t;this.perspectives.push({type:"realtime_perspective",resourceAtoms:s,viewAtoms:a})}break}return this}};w(Ho,"existing",new tj);let Hp=Ho;function nj(e){const{key:t,config:n}=e,s=Hp.create(t,n),{actions:a}=s;for(const u of a)sw(vn.STORE,t,u.key);return vm(vn.STORE,t,-1),s}const ey=Ht({key:"count",default:0}),aE=SC({key:"incrementTX",do:({set:e})=>{e(ey,t=>t+1)}}),ij=nj({key:"countContinuity",config:e=>e.add(ey).add(aE)});function sj({route:[,e]}){return U.jsx("article",{children:e?U.jsx(aj,{gameId:e}):U.jsx(rj,{})})}function rj(){return U.jsx("nav",{children:U.jsx(DT,{href:"/game/clicker",children:"Clicker"})})}hC(Qm[1].game[1]);function aj({gameId:e}){console.log(e);const t=yt(ey),n=xC(aE);return p_(ij),U.jsxs("article",{children:[U.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",t]}),U.jsx("p",{children:"Let's see how high we can count!"})]})}const oE=j.createContext({});function oj(e){const t=j.useRef(null);return t.current===null&&(t.current=e()),t.current}const ty=typeof window<"u",lj=ty?j.useLayoutEffect:j.useEffect,ny=j.createContext(null),lE=j.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function uE(e){return typeof e=="object"&&e!==null}function cE(e){return uE(e)&&"offsetHeight"in e}function uj(e=!0){const t=j.useContext(ny);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:a}=t,u=j.useId();j.useEffect(()=>{if(e)return a(u)},[e]);const c=j.useCallback(()=>e&&s&&s(u),[u,s,e]);return!n&&s?[!1,c]:[!0]}const Iu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],h1={value:null};function cj(e,t){let n=new Set,s=new Set,a=!1,u=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1},h=0;function p(g){c.has(g)&&(y.schedule(g),e()),h++,g(d)}const y={schedule:(g,v=!1,S=!1)=>{const E=S&&a?n:s;return v&&c.add(g),E.has(g)||E.add(g),g},cancel:g=>{s.delete(g),c.delete(g)},process:g=>{if(d=g,a){u=!0;return}a=!0,[n,s]=[s,n],n.forEach(p),t&&h1.value&&h1.value.frameloop[t].push(h),h=0,n.clear(),a=!1,u&&(u=!1,y.process(g))}};return y}const ji={},fj=40;function fE(e,t){let n=!1,s=!0;const a={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,c=Iu.reduce((C,G)=>(C[G]=cj(u,t?G:void 0),C),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:y,update:g,preRender:v,render:S,postRender:A}=c,E=()=>{const C=ji.useManualTiming?a.timestamp:performance.now();n=!1,ji.useManualTiming||(a.delta=s?1e3/60:Math.max(Math.min(C-a.timestamp,fj),1)),a.timestamp=C,a.isProcessing=!0,d.process(a),h.process(a),p.process(a),y.process(a),g.process(a),v.process(a),S.process(a),A.process(a),a.isProcessing=!1,n&&t&&(s=!1,e(E))},M=()=>{n=!0,s=!0,a.isProcessing||e(E)};return{schedule:Iu.reduce((C,G)=>{const z=c[G];return C[G]=(te,ie=!1,ne=!1)=>(n||M(),z.schedule(te,ie,ne)),C},{}),cancel:C=>{for(let G=0;G<Iu.length;G++)c[Iu[G]].cancel(C)},state:a,steps:c}}const $n=e=>e,{schedule:it,cancel:ws,state:Lt,steps:Zh}=fE(typeof requestAnimationFrame<"u"?requestAnimationFrame:$n,!0),dE=j.createContext({strict:!1}),p1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},wa={};for(const e in p1)wa[e]={isEnabled:t=>p1[e].some(n=>!!t[n])};function dj(e){for(const t in e)wa[t]={...wa[t],...e[t]}}const hj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Oc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||hj.has(e)}let hE=e=>!Oc(e);function pj(e){e&&(hE=t=>t.startsWith("on")?!Oc(t):e(t))}try{pj(require("@emotion/is-prop-valid").default)}catch{}function mj(e,t,n){const s={};for(const a in e)a==="values"&&typeof e.values=="object"||(hE(a)||n===!0&&Oc(a)||!t&&!Oc(a)||e.draggable&&a.startsWith("onDrag"))&&(s[a]=e[a]);return s}function yj(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,a)=>a==="create"?e:(t.has(a)||t.set(a,e(a)),t.get(a))})}const sf=j.createContext({});function rf(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Qo(e){return typeof e=="string"||Array.isArray(e)}const iy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],sy=["initial",...iy];function af(e){return rf(e.animate)||sy.some(t=>Qo(e[t]))}function pE(e){return!!(af(e)||e.variants)}function gj(e,t){if(af(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Qo(n)?n:void 0,animate:Qo(s)?s:void 0}}return e.inherit!==!1?t:{}}function bj(e){const{initial:t,animate:n}=gj(e,j.useContext(sf));return j.useMemo(()=>({initial:t,animate:n}),[m1(t),m1(n)])}function m1(e){return Array.isArray(e)?e.join(" "):e}const vj=Symbol.for("motionComponentSymbol");function ia(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Sj(e,t,n){return j.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):ia(n)&&(n.current=s))},[t])}const ry=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),xj="framerAppearId",mE="data-"+ry(xj),yE=j.createContext({}),{schedule:ay}=fE(queueMicrotask,!1);function wj(e,t,n,s,a){var E,M;const{visualElement:u}=j.useContext(sf),c=j.useContext(dE),d=j.useContext(ny),h=j.useContext(lE).reducedMotion,p=j.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:u,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const y=p.current,g=j.useContext(yE);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&Aj(p.current,n,a,g);const v=j.useRef(!1);j.useInsertionEffect(()=>{y&&v.current&&y.update(n,d)});const S=n[mE],A=j.useRef(!!S&&!((E=window.MotionHandoffIsComplete)!=null&&E.call(window,S))&&((M=window.MotionHasOptimisedAnimation)==null?void 0:M.call(window,S)));return lj(()=>{y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),ay.render(y.render),A.current&&y.animationState&&y.animationState.animateChanges())}),j.useEffect(()=>{y&&(!A.current&&y.animationState&&y.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)==null||k.call(window,S)}),A.current=!1))}),y}function Aj(e,t,n,s){const{layoutId:a,layout:u,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:p,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:gE(e.parent)),e.projection.setOptions({layoutId:a,layout:u,alwaysMeasureLayout:!!c||d&&ia(d),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,crossfade:y,layoutScroll:h,layoutRoot:p})}function gE(e){if(e)return e.options.allowProjection!==!1?e.projection:gE(e.parent)}let oy=()=>{};function Tj({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:a}){e&&dj(e);function u(d,h){let p;const y={...j.useContext(lE),...d,layoutId:Ej(d)},{isStatic:g}=y,v=bj(d),S=s(d,g);if(!g&&ty){Rj();const A=Oj(y);p=A.MeasureLayout,v.visualElement=wj(a,S,y,t,A.ProjectionNode)}return U.jsxs(sf.Provider,{value:v,children:[p&&v.visualElement?U.jsx(p,{visualElement:v.visualElement,...y}):null,n(a,d,Sj(S,v.visualElement,h),S,g,v.visualElement)]})}u.displayName=`motion.${typeof a=="string"?a:`create(${a.displayName??a.name??""})`}`;const c=j.forwardRef(u);return c[vj]=a,c}function Ej({layoutId:e}){const t=j.useContext(oE).id;return t&&e!==void 0?t+"-"+e:e}function Rj(e,t){j.useContext(dE).strict}function Oj(e){const{drag:t,layout:n}=wa;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const bE=e=>t=>typeof t=="string"&&t.startsWith(e),ly=bE("--"),Mj=bE("var(--"),uy=e=>Mj(e)?Cj.test(e.split("/*")[0].trim()):!1,Cj=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wo={};function _j(e){for(const t in e)Wo[t]=e[t],ly(t)&&(Wo[t].isCSSVariable=!0)}const Ca=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_a=new Set(Ca);function vE(e,{layout:t,layoutId:n}){return _a.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Wo[e]||e==="opacity")}const SE=(e,t)=>t&&typeof e=="number"?t.transform(e):e,zi=(e,t,n)=>n>t?t:n<e?e:n,ka={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},el={...ka,transform:e=>zi(0,1,e)},Hu={...ka,default:1},y1={...ka,transform:Math.round},yl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),ps=yl("deg"),ii=yl("%"),he=yl("px"),kj=yl("vh"),Dj=yl("vw"),g1={...ii,parse:e=>ii.parse(e)/100,transform:e=>ii.transform(e*100)},Nj={rotate:ps,rotateX:ps,rotateY:ps,rotateZ:ps,scale:Hu,scaleX:Hu,scaleY:Hu,scaleZ:Hu,skew:ps,skewX:ps,skewY:ps,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:el,originX:g1,originY:g1,originZ:he},cy={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...Nj,zIndex:y1,fillOpacity:el,strokeOpacity:el,numOctaves:y1},$j={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Bj=Ca.length;function Lj(e,t,n){let s="",a=!0;for(let u=0;u<Bj;u++){const c=Ca[u],d=e[c];if(d===void 0)continue;let h=!0;if(typeof d=="number"?h=d===(c.startsWith("scale")?1:0):h=parseFloat(d)===0,!h||n){const p=SE(d,cy[c]);if(!h){a=!1;const y=$j[c]||c;s+=`${y}(${p}) `}n&&(t[c]=p)}}return s=s.trim(),n?s=n(t,a?"":s):a&&(s="none"),s}function fy(e,t,n){const{style:s,vars:a,transformOrigin:u}=e;let c=!1,d=!1;for(const h in t){const p=t[h];if(_a.has(h)){c=!0;continue}else if(ly(h)){a[h]=p;continue}else{const y=SE(p,cy[h]);h.startsWith("origin")?(d=!0,u[h]=y):s[h]=y}}if(t.transform||(c||n?s.transform=Lj(t,e.transform,n):s.transform&&(s.transform="none")),d){const{originX:h="50%",originY:p="50%",originZ:y=0}=u;s.transformOrigin=`${h} ${p} ${y}`}}const dy=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Kt=e=>!!(e&&e.getVelocity);function xE(e,t,n){for(const s in t)!Kt(t[s])&&!vE(s,n)&&(e[s]=t[s])}function Vj({transformTemplate:e},t){return j.useMemo(()=>{const n=dy();return fy(n,t,e),Object.assign({},n.vars,n.style)},[t])}function jj(e,t){const n=e.style||{},s={};return xE(s,n,e),Object.assign(s,Vj(e,t)),s}function zj(e,t){const n={},s=jj(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const Uj={offset:"stroke-dashoffset",array:"stroke-dasharray"},qj={offset:"strokeDashoffset",array:"strokeDasharray"};function Kj(e,t,n=1,s=0,a=!0){e.pathLength=1;const u=a?Uj:qj;e[u.offset]=he.transform(-s);const c=he.transform(t),d=he.transform(n);e[u.array]=`${c} ${d}`}function wE(e,{attrX:t,attrY:n,attrScale:s,pathLength:a,pathSpacing:u=1,pathOffset:c=0,...d},h,p,y){if(fy(e,d,p),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v}=e;g.transform&&(v.transform=g.transform,delete g.transform),(v.transform||g.transformOrigin)&&(v.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),v.transform&&(v.transformBox=(y==null?void 0:y.transformBox)??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),s!==void 0&&(g.scale=s),a!==void 0&&Kj(g,a,u,c,!1)}const AE=()=>({...dy(),attrs:{}}),TE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Pj(e,t,n,s){const a=j.useMemo(()=>{const u=AE();return wE(u,t,TE(s),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};xE(u,e.style,e),a.style={...u,...a.style}}return a}const Ij=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function hy(e){return typeof e!="string"||e.includes("-")?!1:!!(Ij.indexOf(e)>-1||/[A-Z]/u.test(e))}function Hj(e=!1){return(n,s,a,{latestValues:u},c)=>{const h=(hy(n)?Pj:zj)(s,u,c,n),p=mj(s,typeof n=="string",e),y=n!==j.Fragment?{...p,...h,ref:a}:{},{children:g}=s,v=j.useMemo(()=>Kt(g)?g.get():g,[g]);return j.createElement(n,{...y,children:v})}}function b1(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function py(e,t,n,s){if(typeof t=="function"){const[a,u]=b1(s);t=t(n!==void 0?n:e.custom,a,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[a,u]=b1(s);t=t(n!==void 0?n:e.custom,a,u)}return t}function nc(e){return Kt(e)?e.get():e}function Gj({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,a){return{latestValues:Fj(n,s,a,e),renderState:t()}}const EE=e=>(t,n)=>{const s=j.useContext(sf),a=j.useContext(ny),u=()=>Gj(e,t,s,a);return n?u():oj(u)};function Fj(e,t,n,s){const a={},u=s(e,{});for(const v in u)a[v]=nc(u[v]);let{initial:c,animate:d}=e;const h=af(e),p=pE(e);t&&p&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?d:c;if(g&&typeof g!="boolean"&&!rf(g)){const v=Array.isArray(g)?g:[g];for(let S=0;S<v.length;S++){const A=py(e,v[S]);if(A){const{transitionEnd:E,transition:M,...k}=A;for(const $ in k){let C=k[$];if(Array.isArray(C)){const G=y?C.length-1:0;C=C[G]}C!==null&&(a[$]=C)}for(const $ in E)a[$]=E[$]}}}return a}function my(e,t,n){var u;const{style:s}=e,a={};for(const c in s)(Kt(s[c])||t.style&&Kt(t.style[c])||vE(c,e)||((u=n==null?void 0:n.getValue(c))==null?void 0:u.liveStyle)!==void 0)&&(a[c]=s[c]);return a}const Yj={useVisualState:EE({scrapeMotionValuesFromProps:my,createRenderState:dy})};function RE(e,t,n){const s=my(e,t,n);for(const a in e)if(Kt(e[a])||Kt(t[a])){const u=Ca.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;s[u]=e[a]}return s}const Xj={useVisualState:EE({scrapeMotionValuesFromProps:RE,createRenderState:AE})};function Zj(e,t){return function(s,{forwardMotionProps:a}={forwardMotionProps:!1}){const c={...hy(s)?Xj:Yj,preloadedFeatures:e,useRender:Hj(a),createVisualElement:t,Component:s};return Tj(c)}}function tl(e,t,n){const s=e.getProps();return py(s,t,n!==void 0?n:s.custom,e)}const Gp=e=>Array.isArray(e);let ic;function Jj(){ic=void 0}const sn={now:()=>(ic===void 0&&sn.set(Lt.isProcessing||ji.useManualTiming?Lt.timestamp:performance.now()),ic),set:e=>{ic=e,queueMicrotask(Jj)}};function yy(e,t){e.indexOf(t)===-1&&e.push(t)}function gy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class by{constructor(){this.subscriptions=[]}add(t){return yy(this.subscriptions,t),()=>gy(this.subscriptions,t)}notify(t,n,s){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](t,n,s);else for(let u=0;u<a;u++){const c=this.subscriptions[u];c&&c(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function OE(e,t){return t?e*(1e3/t):0}const v1=30,Qj=e=>!isNaN(parseFloat(e));class Wj{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,a=!0)=>{var c,d;const u=sn.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((c=this.events.change)==null||c.notify(this.current),this.dependents))for(const h of this.dependents)h.dirty();a&&((d=this.events.renderRequest)==null||d.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=sn.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Qj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new by);const s=this.events[t].add(n);return t==="change"?()=>{s(),it.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=sn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>v1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,v1);return OE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Aa(e,t){return new Wj(e,t)}function e4(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Aa(n))}function t4(e){return Gp(e)?e[e.length-1]||0:e}function n4(e,t){const n=tl(e,t);let{transitionEnd:s={},transition:a={},...u}=n||{};u={...u,...s};for(const c in u){const d=t4(u[c]);e4(e,c,d)}}function i4(e){return!!(Kt(e)&&e.add)}function Fp(e,t){const n=e.getValue("willChange");if(i4(n))return n.add(t);if(!n&&ji.WillChange){const s=new ji.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function ME(e){return e.props[mE]}const s4=e=>e!==null;function r4(e,{repeat:t,repeatType:n="loop"},s){const a=e.filter(s4),u=t&&n!=="loop"&&t%2===1?0:a.length-1;return a[u]}const a4={type:"spring",stiffness:500,damping:25,restSpeed:10},o4=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),l4={type:"keyframes",duration:.8},u4={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},c4=(e,{keyframes:t})=>t.length>2?l4:_a.has(e)?e.startsWith("scale")?o4(t[1]):a4:u4;function f4({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:a,repeat:u,repeatType:c,repeatDelay:d,from:h,elapsed:p,...y}){return!!Object.keys(y).length}function vy(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const si=e=>e*1e3,ri=e=>e/1e3,Uo=e=>Math.round(e*1e5)/1e5,Sy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function d4(e){return e==null}const h4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,xy=(e,t)=>n=>!!(typeof n=="string"&&h4.test(n)&&n.startsWith(e)||t&&!d4(n)&&Object.prototype.hasOwnProperty.call(n,t)),CE=(e,t,n)=>s=>{if(typeof s!="string")return s;const[a,u,c,d]=s.match(Sy);return{[e]:parseFloat(a),[t]:parseFloat(u),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},p4=e=>zi(0,255,e),Jh={...ka,transform:e=>Math.round(p4(e))},Qs={test:xy("rgb","red"),parse:CE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Jh.transform(e)+", "+Jh.transform(t)+", "+Jh.transform(n)+", "+Uo(el.transform(s))+")"};function m4(e){let t="",n="",s="",a="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),a=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),a=e.substring(4,5),t+=t,n+=n,s+=s,a+=a),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:a?parseInt(a,16)/255:1}}const Yp={test:xy("#"),parse:m4,transform:Qs.transform},sa={test:xy("hsl","hue"),parse:CE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+ii.transform(Uo(t))+", "+ii.transform(Uo(n))+", "+Uo(el.transform(s))+")"},qt={test:e=>Qs.test(e)||Yp.test(e)||sa.test(e),parse:e=>Qs.test(e)?Qs.parse(e):sa.test(e)?sa.parse(e):Yp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Qs.transform(e):sa.transform(e)},y4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function g4(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Sy))==null?void 0:t.length)||0)+(((n=e.match(y4))==null?void 0:n.length)||0)>0}const _E="number",kE="color",b4="var",v4="var(",S1="${}",S4=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function nl(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},a=[];let u=0;const d=t.replace(S4,h=>(qt.test(h)?(s.color.push(u),a.push(kE),n.push(qt.parse(h))):h.startsWith(v4)?(s.var.push(u),a.push(b4),n.push(h)):(s.number.push(u),a.push(_E),n.push(parseFloat(h))),++u,S1)).split(S1);return{values:n,split:d,indexes:s,types:a}}function DE(e){return nl(e).values}function NE(e){const{split:t,types:n}=nl(e),s=t.length;return a=>{let u="";for(let c=0;c<s;c++)if(u+=t[c],a[c]!==void 0){const d=n[c];d===_E?u+=Uo(a[c]):d===kE?u+=qt.transform(a[c]):u+=a[c]}return u}}const x4=e=>typeof e=="number"?0:e;function w4(e){const t=DE(e);return NE(e)(t.map(x4))}const As={test:g4,parse:DE,createTransformer:NE,getAnimatableNone:w4};function Qh(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function A4({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let a=0,u=0,c=0;if(!t)a=u=c=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;a=Qh(h,d,e+1/3),u=Qh(h,d,e),c=Qh(h,d,e-1/3)}return{red:Math.round(a*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:s}}function Mc(e,t){return n=>n>0?t:e}const nt=(e,t,n)=>e+(t-e)*n,Wh=(e,t,n)=>{const s=e*e,a=n*(t*t-s)+s;return a<0?0:Math.sqrt(a)},T4=[Yp,Qs,sa],E4=e=>T4.find(t=>t.test(e));function x1(e){const t=E4(e);if(!t)return!1;let n=t.parse(e);return t===sa&&(n=A4(n)),n}const w1=(e,t)=>{const n=x1(e),s=x1(t);if(!n||!s)return Mc(e,t);const a={...n};return u=>(a.red=Wh(n.red,s.red,u),a.green=Wh(n.green,s.green,u),a.blue=Wh(n.blue,s.blue,u),a.alpha=nt(n.alpha,s.alpha,u),Qs.transform(a))},Xp=new Set(["none","hidden"]);function R4(e,t){return Xp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}const O4=(e,t)=>n=>t(e(n)),gl=(...e)=>e.reduce(O4);function M4(e,t){return n=>nt(e,t,n)}function wy(e){return typeof e=="number"?M4:typeof e=="string"?uy(e)?Mc:qt.test(e)?w1:k4:Array.isArray(e)?$E:typeof e=="object"?qt.test(e)?w1:C4:Mc}function $E(e,t){const n=[...e],s=n.length,a=e.map((u,c)=>wy(u)(u,t[c]));return u=>{for(let c=0;c<s;c++)n[c]=a[c](u);return n}}function C4(e,t){const n={...e,...t},s={};for(const a in n)e[a]!==void 0&&t[a]!==void 0&&(s[a]=wy(e[a])(e[a],t[a]));return a=>{for(const u in s)n[u]=s[u](a);return n}}function _4(e,t){const n=[],s={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const u=t.types[a],c=e.indexes[u][s[u]],d=e.values[c]??0;n[a]=d,s[u]++}return n}const k4=(e,t)=>{const n=As.createTransformer(t),s=nl(e),a=nl(t);return s.indexes.var.length===a.indexes.var.length&&s.indexes.color.length===a.indexes.color.length&&s.indexes.number.length>=a.indexes.number.length?Xp.has(e)&&!a.values.length||Xp.has(t)&&!s.values.length?R4(e,t):gl($E(_4(s,a),a.values),n):Mc(e,t)};function BE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?nt(e,t,n):wy(e)(e,t)}const D4=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>it.update(t,n),stop:()=>ws(t),now:()=>Lt.isProcessing?Lt.timestamp:sn.now()}},LE=(e,t,n=10)=>{let s="";const a=Math.max(Math.round(t/n),2);for(let u=0;u<a;u++)s+=e(u/(a-1))+", ";return`linear(${s.substring(0,s.length-2)})`},Cc=2e4;function Ay(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Cc;)t+=n,s=e.next(t);return t>=Cc?1/0:t}function N4(e,t=100,n){const s=n({...e,keyframes:[0,t]}),a=Math.min(Ay(s),Cc);return{type:"keyframes",ease:u=>s.next(a*u).value/t,duration:ri(a)}}const $4=5;function VE(e,t,n){const s=Math.max(t-$4,0);return OE(n-e(s),t-s)}const at={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},A1=.001;function B4({duration:e=at.duration,bounce:t=at.bounce,velocity:n=at.velocity,mass:s=at.mass}){let a,u,c=1-t;c=zi(at.minDamping,at.maxDamping,c),e=zi(at.minDuration,at.maxDuration,ri(e)),c<1?(a=p=>{const y=p*c,g=y*e,v=y-n,S=Zp(p,c),A=Math.exp(-g);return A1-v/S*A},u=p=>{const g=p*c*e,v=g*n+n,S=Math.pow(c,2)*Math.pow(p,2)*e,A=Math.exp(-g),E=Zp(Math.pow(p,2),c);return(-a(p)+A1>0?-1:1)*((v-S)*A)/E}):(a=p=>{const y=Math.exp(-p*e),g=(p-n)*e+1;return-.001+y*g},u=p=>{const y=Math.exp(-p*e),g=(n-p)*(e*e);return y*g});const d=5/e,h=V4(a,u,d);if(e=si(e),isNaN(h))return{stiffness:at.stiffness,damping:at.damping,duration:e};{const p=Math.pow(h,2)*s;return{stiffness:p,damping:c*2*Math.sqrt(s*p),duration:e}}}const L4=12;function V4(e,t,n){let s=n;for(let a=1;a<L4;a++)s=s-e(s)/t(s);return s}function Zp(e,t){return e*Math.sqrt(1-t*t)}const j4=["duration","bounce"],z4=["stiffness","damping","mass"];function T1(e,t){return t.some(n=>e[n]!==void 0)}function U4(e){let t={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...e};if(!T1(e,z4)&&T1(e,j4))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),a=s*s,u=2*zi(.05,1,1-(e.bounce||0))*Math.sqrt(a);t={...t,mass:at.mass,stiffness:a,damping:u}}else{const n=B4(e);t={...t,...n,mass:at.mass},t.isResolvedFromDuration=!0}return t}function _c(e=at.visualDuration,t=at.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:a}=n;const u=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],d={done:!1,value:u},{stiffness:h,damping:p,mass:y,duration:g,velocity:v,isResolvedFromDuration:S}=U4({...n,velocity:-ri(n.velocity||0)}),A=v||0,E=p/(2*Math.sqrt(h*y)),M=c-u,k=ri(Math.sqrt(h/y)),$=Math.abs(M)<5;s||(s=$?at.restSpeed.granular:at.restSpeed.default),a||(a=$?at.restDelta.granular:at.restDelta.default);let C;if(E<1){const z=Zp(k,E);C=te=>{const ie=Math.exp(-E*k*te);return c-ie*((A+E*k*M)/z*Math.sin(z*te)+M*Math.cos(z*te))}}else if(E===1)C=z=>c-Math.exp(-k*z)*(M+(A+k*M)*z);else{const z=k*Math.sqrt(E*E-1);C=te=>{const ie=Math.exp(-E*k*te),ne=Math.min(z*te,300);return c-ie*((A+E*k*M)*Math.sinh(ne)+z*M*Math.cosh(ne))/z}}const G={calculatedDuration:S&&g||null,next:z=>{const te=C(z);if(S)d.done=z>=g;else{let ie=z===0?A:0;E<1&&(ie=z===0?si(A):VE(C,z,te));const ne=Math.abs(ie)<=s,ee=Math.abs(c-te)<=a;d.done=ne&&ee}return d.value=d.done?c:te,d},toString:()=>{const z=Math.min(Ay(G),Cc),te=LE(ie=>G.next(z*ie).value,z,30);return z+"ms "+te},toTransition:()=>{}};return G}_c.applyToOptions=e=>{const t=N4(e,100,_c);return e.ease=t.ease,e.duration=si(t.duration),e.type="keyframes",e};function Jp({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:a=10,bounceStiffness:u=500,modifyTarget:c,min:d,max:h,restDelta:p=.5,restSpeed:y}){const g=e[0],v={done:!1,value:g},S=ne=>d!==void 0&&ne<d||h!==void 0&&ne>h,A=ne=>d===void 0?h:h===void 0||Math.abs(d-ne)<Math.abs(h-ne)?d:h;let E=n*t;const M=g+E,k=c===void 0?M:c(M);k!==M&&(E=k-g);const $=ne=>-E*Math.exp(-ne/s),C=ne=>k+$(ne),G=ne=>{const ee=$(ne),me=C(ne);v.done=Math.abs(ee)<=p,v.value=v.done?k:me};let z,te;const ie=ne=>{S(v.value)&&(z=ne,te=_c({keyframes:[v.value,A(v.value)],velocity:VE(C,ne,v.value),damping:a,stiffness:u,restDelta:p,restSpeed:y}))};return ie(0),{calculatedDuration:null,next:ne=>{let ee=!1;return!te&&z===void 0&&(ee=!0,G(ne),ie(ne)),z!==void 0&&ne>=z?te.next(ne-z):(!ee&&G(ne),v)}}}const il=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};function q4(e,t,n){const s=[],a=n||ji.mix||BE,u=e.length-1;for(let c=0;c<u;c++){let d=a(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||$n:t;d=gl(h,d)}s.push(d)}return s}function K4(e,t,{clamp:n=!0,ease:s,mixer:a}={}){const u=e.length;if(oy(u===t.length),u===1)return()=>t[0];if(u===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=q4(t,s,a),h=d.length,p=y=>{if(c&&y<e[0])return t[0];let g=0;if(h>1)for(;g<e.length-2&&!(y<e[g+1]);g++);const v=il(e[g],e[g+1],y);return d[g](v)};return n?y=>p(zi(e[0],e[u-1],y)):p}function P4(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const a=il(0,t,s);e.push(nt(n,1,a))}}function I4(e){const t=[0];return P4(t,e.length-1),t}function H4(e,t){return e.map(n=>n*t)}const jE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,G4=1e-7,F4=12;function Y4(e,t,n,s,a){let u,c,d=0;do c=t+(n-t)/2,u=jE(c,s,a)-e,u>0?n=c:t=c;while(Math.abs(u)>G4&&++d<F4);return c}function bl(e,t,n,s){if(e===t&&n===s)return $n;const a=u=>Y4(u,0,1,e,n);return u=>u===0||u===1?u:jE(a(u),t,s)}const X4=bl(.42,0,1,1),Z4=bl(0,0,.58,1),zE=bl(.42,0,.58,1),J4=e=>Array.isArray(e)&&typeof e[0]!="number",UE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,qE=e=>t=>1-e(1-t),KE=bl(.33,1.53,.69,.99),Ty=qE(KE),PE=UE(Ty),IE=e=>(e*=2)<1?.5*Ty(e):.5*(2-Math.pow(2,-10*(e-1))),Ey=e=>1-Math.sin(Math.acos(e)),HE=qE(Ey),GE=UE(Ey),FE=e=>Array.isArray(e)&&typeof e[0]=="number",Q4={linear:$n,easeIn:X4,easeInOut:zE,easeOut:Z4,circIn:Ey,circInOut:GE,circOut:HE,backIn:Ty,backInOut:PE,backOut:KE,anticipate:IE},W4=e=>typeof e=="string",E1=e=>{if(FE(e)){oy(e.length===4);const[t,n,s,a]=e;return bl(t,n,s,a)}else if(W4(e))return Q4[e];return e};function ez(e,t){return e.map(()=>t||zE).splice(0,e.length-1)}function qo({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const a=J4(s)?s.map(E1):E1(s),u={done:!1,value:t[0]},c=H4(n&&n.length===t.length?n:I4(t),e),d=K4(c,t,{ease:Array.isArray(a)?a:ez(t,a)});return{calculatedDuration:e,next:h=>(u.value=d(h),u.done=h>=e,u)}}const tz=e=>e!==null;function Ry(e,{repeat:t,repeatType:n="loop"},s,a=1){const u=e.filter(tz),d=a<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!d||s===void 0?u[d]:s}const nz={decay:Jp,inertia:Jp,tween:qo,keyframes:qo,spring:_c};function YE(e){typeof e.type=="string"&&(e.type=nz[e.type])}class Oy{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const iz=e=>e/100;class My extends Oy{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=(n=!0)=>{var s,a;if(n){const{motionValue:u}=this.options;u&&u.updatedAt!==sn.now()&&this.tick(sn.now())}this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(a=(s=this.options).onStop)==null||a.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;YE(t);const{type:n=qo,repeat:s=0,repeatDelay:a=0,repeatType:u,velocity:c=0}=t;let{keyframes:d}=t;const h=n||qo;h!==qo&&typeof d[0]!="number"&&(this.mixKeyframes=gl(iz,BE(d[0],d[1])),d=[0,100]);const p=h({...t,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-c})),p.calculatedDuration===null&&(p.calculatedDuration=Ay(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+a,this.totalDuration=this.resolvedDuration*(s+1)-a,this.generator=p}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:a,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return s.next(0);const{delay:p=0,keyframes:y,repeat:g,repeatType:v,repeatDelay:S,type:A,onUpdate:E,finalKeyframe:M}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-a/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const k=this.currentTime-p*(this.playbackSpeed>=0?1:-1),$=this.playbackSpeed>=0?k<0:k>a;this.currentTime=Math.max(k,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let C=this.currentTime,G=s;if(g){const ne=Math.min(this.currentTime,a)/d;let ee=Math.floor(ne),me=ne%1;!me&&ne>=1&&(me=1),me===1&&ee--,ee=Math.min(ee,g+1),!!(ee%2)&&(v==="reverse"?(me=1-me,S&&(me-=S/d)):v==="mirror"&&(G=c)),C=zi(0,1,me)*d}const z=$?{done:!1,value:y[0]}:G.next(C);u&&(z.value=u(z.value));let{done:te}=z;!$&&h!==null&&(te=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const ie=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&te);return ie&&A!==Jp&&(z.value=Ry(y,this.options,M,this.speed)),E&&E(z.value),ie&&this.finish(),z}then(t,n){return this.finished.then(t,n)}get duration(){return ri(this.calculatedDuration)}get time(){return ri(this.currentTime)}set time(t){var n;t=si(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(sn.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ri(this.currentTime))}play(){var a,u;if(this.isStopped)return;const{driver:t=D4,startTime:n}=this.options;this.driver||(this.driver=t(c=>this.tick(c))),(u=(a=this.options).onPlay)==null||u.call(a);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(sn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function sz(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const Ws=e=>e*180/Math.PI,Qp=e=>{const t=Ws(Math.atan2(e[1],e[0]));return Wp(t)},rz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Qp,rotateZ:Qp,skewX:e=>Ws(Math.atan(e[1])),skewY:e=>Ws(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Wp=e=>(e=e%360,e<0&&(e+=360),e),R1=Qp,O1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),M1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),az={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:O1,scaleY:M1,scale:e=>(O1(e)+M1(e))/2,rotateX:e=>Wp(Ws(Math.atan2(e[6],e[5]))),rotateY:e=>Wp(Ws(Math.atan2(-e[2],e[0]))),rotateZ:R1,rotate:R1,skewX:e=>Ws(Math.atan(e[4])),skewY:e=>Ws(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function em(e){return e.includes("scale")?1:0}function tm(e,t){if(!e||e==="none")return em(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,a;if(n)s=az,a=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=rz,a=d}if(!a)return em(t);const u=s[t],c=a[1].split(",").map(lz);return typeof u=="function"?u(c):c[u]}const oz=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return tm(n,t)};function lz(e){return parseFloat(e.trim())}const C1=e=>e===ka||e===he,uz=new Set(["x","y","z"]),cz=Ca.filter(e=>!uz.has(e));function fz(e){const t=[];return cz.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const sr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>tm(t,"x"),y:(e,{transform:t})=>tm(t,"y")};sr.translateX=sr.x;sr.translateY=sr.y;const rr=new Set;let nm=!1,im=!1,sm=!1;function XE(){if(im){const e=Array.from(rr).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const a=fz(s);a.length&&(n.set(s,a),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const a=n.get(s);a&&a.forEach(([u,c])=>{var d;(d=s.getValue(u))==null||d.set(c)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}im=!1,nm=!1,rr.forEach(e=>e.complete(sm)),rr.clear()}function ZE(){rr.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(im=!0)})}function dz(){sm=!0,ZE(),XE(),sm=!1}class Cy{constructor(t,n,s,a,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=a,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(rr.add(this),nm||(nm=!0,it.read(ZE),it.resolveKeyframes(XE))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:a}=this;if(t[0]===null){const u=a==null?void 0:a.get(),c=t[t.length-1];if(u!==void 0)t[0]=u;else if(s&&n){const d=s.readValue(n,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),a&&u===void 0&&a.set(t[0])}sz(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),rr.delete(this)}cancel(){this.state==="scheduled"&&(rr.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const hz=e=>e.startsWith("--");function pz(e,t,n){hz(t)?e.style.setProperty(t,n):e.style[t]=n}function _y(e){let t;return()=>(t===void 0&&(t=e()),t)}const mz=_y(()=>window.ScrollTimeline!==void 0),yz={};function gz(e,t){const n=_y(e);return()=>yz[t]??n()}const JE=gz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Vo=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,_1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vo([0,.65,.55,1]),circOut:Vo([.55,0,1,.45]),backIn:Vo([.31,.01,.66,-.59]),backOut:Vo([.33,1.53,.69,.99])};function QE(e,t){if(e)return typeof e=="function"?JE()?LE(e,t):"ease-out":FE(e)?Vo(e):Array.isArray(e)?e.map(n=>QE(n,t)||_1.easeOut):_1[e]}function bz(e,t,n,{delay:s=0,duration:a=300,repeat:u=0,repeatType:c="loop",ease:d="easeOut",times:h}={},p=void 0){const y={[t]:n};h&&(y.offset=h);const g=QE(d,a);Array.isArray(g)&&(y.easing=g);const v={delay:s,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return p&&(v.pseudoElement=p),e.animate(y,v)}function WE(e){return typeof e=="function"&&"applyToOptions"in e}function vz({type:e,...t}){return WE(e)&&JE()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Sz extends Oy{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:a,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=t,oy(typeof t.type!="string");const p=vz(t);this.animation=bz(n,s,a,p,u),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const y=Ry(a,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(y):pz(n,s,y),this.animation.cancel()}h==null||h(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return ri(Number(t))}get time(){return ri(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=si(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&mz()?(this.animation.timeline=t,$n):n(this)}}const eR={anticipate:IE,backInOut:PE,circInOut:GE};function xz(e){return e in eR}function wz(e){typeof e.ease=="string"&&xz(e.ease)&&(e.ease=eR[e.ease])}const k1=10;class Az extends Sz{constructor(t){wz(t),YE(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:a,element:u,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new My({...c,autoplay:!1}),h=si(this.finishedTime??this.time);n.setWithVelocity(d.sample(h-k1).value,d.sample(h).value,k1),d.stop()}}const D1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(As.test(e)||e==="0")&&!e.startsWith("url("));function Tz(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Ez(e,t,n,s){const a=e[0];if(a===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],c=D1(a,t),d=D1(u,t);return!c||!d?!1:Tz(e)||(n==="spring"||WE(n))&&s}const Rz=new Set(["opacity","clipPath","filter","transform"]),Oz=_y(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Mz(e){var p;const{motionValue:t,name:n,repeatDelay:s,repeatType:a,damping:u,type:c}=e;if(!cE((p=t==null?void 0:t.owner)==null?void 0:p.current))return!1;const{onUpdate:d,transformTemplate:h}=t.owner.getProps();return Oz()&&n&&Rz.has(n)&&(n!=="transform"||!h)&&!d&&!s&&a!=="mirror"&&u!==0&&c!=="inertia"}const Cz=40;class _z extends Oy{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:a=0,repeatDelay:u=0,repeatType:c="loop",keyframes:d,name:h,motionValue:p,element:y,...g}){var A;super(),this.stop=()=>{var E,M;this._animation&&(this._animation.stop(),(E=this.stopTimeline)==null||E.call(this)),(M=this.keyframeResolver)==null||M.cancel()},this.createdAt=sn.now();const v={autoplay:t,delay:n,type:s,repeat:a,repeatDelay:u,repeatType:c,name:h,motionValue:p,element:y,...g},S=(y==null?void 0:y.KeyframeResolver)||Cy;this.keyframeResolver=new S(d,(E,M,k)=>this.onKeyframesResolved(E,M,v,!k),h,p,y),(A=this.keyframeResolver)==null||A.scheduleResolve()}onKeyframesResolved(t,n,s,a){this.keyframeResolver=void 0;const{name:u,type:c,velocity:d,delay:h,isHandoff:p,onUpdate:y}=s;this.resolvedAt=sn.now(),Ez(t,u,c,d)||((ji.instantAnimations||!h)&&(y==null||y(Ry(t,s,n))),t[0]=t[t.length-1],s.duration=0,s.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>Cz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},S=!p&&Mz(v)?new Az({...v,element:v.motionValue.owner.current}):new My(v);S.finished.then(()=>this.notifyFinished()).catch($n),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),dz()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const ky=(e,t,n,s={},a,u)=>c=>{const d=vy(s,e)||{},h=d.delay||s.delay||0;let{elapsed:p=0}=s;p=p-si(h);const y={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-p,onUpdate:v=>{t.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:u?void 0:a};f4(d)||Object.assign(y,c4(e,y)),y.duration&&(y.duration=si(y.duration)),y.repeatDelay&&(y.repeatDelay=si(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let g=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(g=!0)),(ji.instantAnimations||ji.skipAnimations)&&(g=!0,y.duration=0,y.delay=0),y.allowFlatten=!d.type&&!d.ease,g&&!u&&t.get()!==void 0){const v=r4(y.keyframes,d);if(v!==void 0){it.update(()=>{y.onUpdate(v),y.onComplete()});return}}return d.isSync?new My(y):new _z(y)},tR=new Set(["width","height","top","left","right","bottom",...Ca]);function kz({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function nR(e,t,{delay:n=0,transitionOverride:s,type:a}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:c,...d}=t;s&&(u=s);const h=[],p=a&&e.animationState&&e.animationState.getState()[a];for(const y in d){const g=e.getValue(y,e.latestValues[y]??null),v=d[y];if(v===void 0||p&&kz(p,y))continue;const S={delay:n,...vy(u||{},y)},A=g.get();if(A!==void 0&&!g.isAnimating&&!Array.isArray(v)&&v===A&&!S.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const k=ME(e);if(k){const $=window.MotionHandoffAnimation(k,y,it);$!==null&&(S.startTime=$,E=!0)}}Fp(e,y),g.start(ky(y,g,v,e.shouldReduceMotion&&tR.has(y)?{type:!1}:S,e,E));const M=g.animation;M&&h.push(M)}return c&&Promise.all(h).then(()=>{it.update(()=>{c&&n4(e,c)})}),h}function rm(e,t,n={}){var h;const s=tl(e,t,n.type==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(a=n.transitionOverride);const u=s?()=>Promise.all(nR(e,s,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:y=0,staggerChildren:g,staggerDirection:v}=a;return Dz(e,t,y+p,g,v,n)}:()=>Promise.resolve(),{when:d}=a;if(d){const[p,y]=d==="beforeChildren"?[u,c]:[c,u];return p().then(()=>y())}else return Promise.all([u(),c(n.delay)])}function Dz(e,t,n=0,s=0,a=1,u){const c=[],d=(e.variantChildren.size-1)*s,h=a===1?(p=0)=>p*s:(p=0)=>d-p*s;return Array.from(e.variantChildren).sort(Nz).forEach((p,y)=>{p.notify("AnimationStart",t),c.push(rm(p,t,{...u,delay:n+h(y)}).then(()=>p.notify("AnimationComplete",t)))}),Promise.all(c)}function Nz(e,t){return e.sortNodePosition(t)}function $z(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const a=t.map(u=>rm(e,u,n));s=Promise.all(a)}else if(typeof t=="string")s=rm(e,t,n);else{const a=typeof t=="function"?tl(e,t,n.custom):t;s=Promise.all(nR(e,a,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function iR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Bz=sy.length;function sR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?sR(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Bz;n++){const s=sy[n],a=e.props[s];(Qo(a)||a===!1)&&(t[s]=a)}return t}const Lz=[...iy].reverse(),Vz=iy.length;function jz(e){return t=>Promise.all(t.map(({animation:n,options:s})=>$z(e,n,s)))}function zz(e){let t=jz(e),n=N1(),s=!0;const a=h=>(p,y)=>{var v;const g=tl(e,y,h==="exit"?(v=e.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:S,transitionEnd:A,...E}=g;p={...p,...E,...A}}return p};function u(h){t=h(e)}function c(h){const{props:p}=e,y=sR(e.parent)||{},g=[],v=new Set;let S={},A=1/0;for(let M=0;M<Vz;M++){const k=Lz[M],$=n[k],C=p[k]!==void 0?p[k]:y[k],G=Qo(C),z=k===h?$.isActive:null;z===!1&&(A=M);let te=C===y[k]&&C!==p[k]&&G;if(te&&s&&e.manuallyAnimateOnMount&&(te=!1),$.protectedKeys={...S},!$.isActive&&z===null||!C&&!$.prevProp||rf(C)||typeof C=="boolean")continue;const ie=Uz($.prevProp,C);let ne=ie||k===h&&$.isActive&&!te&&G||M>A&&G,ee=!1;const me=Array.isArray(C)?C:[C];let ve=me.reduce(a(k),{});z===!1&&(ve={});const{prevResolvedValues:ke={}}=$,Ge={...ke,...ve},_e=I=>{ne=!0,v.has(I)&&(ee=!0,v.delete(I)),$.needsAnimating[I]=!0;const F=e.getValue(I);F&&(F.liveStyle=!1)};for(const I in Ge){const F=ve[I],J=ke[I];if(S.hasOwnProperty(I))continue;let T=!1;Gp(F)&&Gp(J)?T=!iR(F,J):T=F!==J,T?F!=null?_e(I):v.add(I):F!==void 0&&v.has(I)?_e(I):$.protectedKeys[I]=!0}$.prevProp=C,$.prevResolvedValues=ve,$.isActive&&(S={...S,...ve}),s&&e.blockInitialAnimation&&(ne=!1),ne&&(!(te&&ie)||ee)&&g.push(...me.map(I=>({animation:I,options:{type:k}})))}if(v.size){const M={};if(typeof p.initial!="boolean"){const k=tl(e,Array.isArray(p.initial)?p.initial[0]:p.initial);k&&k.transition&&(M.transition=k.transition)}v.forEach(k=>{const $=e.getBaseTarget(k),C=e.getValue(k);C&&(C.liveStyle=!0),M[k]=$??null}),g.push({animation:M})}let E=!!g.length;return s&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(E=!1),s=!1,E?t(g):Promise.resolve()}function d(h,p){var g;if(n[h].isActive===p)return Promise.resolve();(g=e.variantChildren)==null||g.forEach(v=>{var S;return(S=v.animationState)==null?void 0:S.setActive(h,p)}),n[h].isActive=p;const y=c(h);for(const v in n)n[v].protectedKeys={};return y}return{animateChanges:c,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=N1(),s=!0}}}function Uz(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!iR(t,e):!1}function Is(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function N1(){return{animate:Is(!0),whileInView:Is(),whileHover:Is(),whileTap:Is(),whileDrag:Is(),whileFocus:Is(),exit:Is()}}class Es{constructor(t){this.isMounted=!1,this.node=t}update(){}}class qz extends Es{constructor(t){super(t),t.animationState||(t.animationState=zz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();rf(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Kz=0;class Pz extends Es{constructor(){super(...arguments),this.id=Kz++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const a=this.node.animationState.setActive("exit",!t);n&&!t&&a.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Iz={animation:{Feature:qz},exit:{Feature:Pz}};function sl(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}const Dy=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function vl(e){return{point:{x:e.pageX,y:e.pageY}}}const Hz=e=>t=>Dy(t)&&e(t,vl(t));function Ko(e,t,n,s){return sl(e,t,Hz(n),s)}function rR({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function Gz({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Fz(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const aR=1e-4,Yz=1-aR,Xz=1+aR,oR=.01,Zz=0-oR,Jz=0+oR;function Yt(e){return e.max-e.min}function Qz(e,t,n){return Math.abs(e-t)<=n}function $1(e,t,n,s=.5){e.origin=s,e.originPoint=nt(t.min,t.max,e.origin),e.scale=Yt(n)/Yt(t),e.translate=nt(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Yz&&e.scale<=Xz||isNaN(e.scale))&&(e.scale=1),(e.translate>=Zz&&e.translate<=Jz||isNaN(e.translate))&&(e.translate=0)}function Po(e,t,n,s){$1(e.x,t.x,n.x,s?s.originX:void 0),$1(e.y,t.y,n.y,s?s.originY:void 0)}function B1(e,t,n){e.min=n.min+t.min,e.max=e.min+Yt(t)}function Wz(e,t,n){B1(e.x,t.x,n.x),B1(e.y,t.y,n.y)}function L1(e,t,n){e.min=t.min-n.min,e.max=e.min+Yt(t)}function Io(e,t,n){L1(e.x,t.x,n.x),L1(e.y,t.y,n.y)}const V1=()=>({translate:0,scale:1,origin:0,originPoint:0}),ra=()=>({x:V1(),y:V1()}),j1=()=>({min:0,max:0}),ft=()=>({x:j1(),y:j1()});function _n(e){return[e("x"),e("y")]}function ep(e){return e===void 0||e===1}function am({scale:e,scaleX:t,scaleY:n}){return!ep(e)||!ep(t)||!ep(n)}function Ys(e){return am(e)||lR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function lR(e){return z1(e.x)||z1(e.y)}function z1(e){return e&&e!=="0%"}function kc(e,t,n){const s=e-n,a=t*s;return n+a}function U1(e,t,n,s,a){return a!==void 0&&(e=kc(e,a,s)),kc(e,n,s)+t}function om(e,t=0,n=1,s,a){e.min=U1(e.min,t,n,s,a),e.max=U1(e.max,t,n,s,a)}function uR(e,{x:t,y:n}){om(e.x,t.translate,t.scale,t.originPoint),om(e.y,n.translate,n.scale,n.originPoint)}const q1=.999999999999,K1=1.0000000000001;function eU(e,t,n,s=!1){const a=n.length;if(!a)return;t.x=t.y=1;let u,c;for(let d=0;d<a;d++){u=n[d],c=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(s&&u.options.layoutScroll&&u.scroll&&u!==u.root&&oa(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,uR(e,c)),s&&Ys(u.latestValues)&&oa(e,u.latestValues))}t.x<K1&&t.x>q1&&(t.x=1),t.y<K1&&t.y>q1&&(t.y=1)}function aa(e,t){e.min=e.min+t,e.max=e.max+t}function P1(e,t,n,s,a=.5){const u=nt(e.min,e.max,a);om(e,t,n,u,s)}function oa(e,t){P1(e.x,t.x,t.scaleX,t.scale,t.originX),P1(e.y,t.y,t.scaleY,t.scale,t.originY)}function cR(e,t){return rR(Fz(e.getBoundingClientRect(),t))}function tU(e,t,n){const s=cR(e,n),{scroll:a}=t;return a&&(aa(s.x,a.offset.x),aa(s.y,a.offset.y)),s}const fR=({current:e})=>e?e.ownerDocument.defaultView:null,I1=(e,t)=>Math.abs(e-t);function nU(e,t){const n=I1(e.x,t.x),s=I1(e.y,t.y);return Math.sqrt(n**2+s**2)}class dR{constructor(t,n,{transformPagePoint:s,contextWindow:a,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=np(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,S=nU(g.offset,{x:0,y:0})>=3;if(!v&&!S)return;const{point:A}=g,{timestamp:E}=Lt;this.history.push({...A,timestamp:E});const{onStart:M,onMove:k}=this.handlers;v||(M&&M(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),k&&k(this.lastMoveEvent,g)},this.handlePointerMove=(g,v)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=tp(v,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(g,v)=>{this.end();const{onEnd:S,onSessionEnd:A,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=np(g.type==="pointercancel"?this.lastMoveEventInfo:tp(v,this.transformPagePoint),this.history);this.startEvent&&S&&S(g,M),A&&A(g,M)},!Dy(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=s,this.contextWindow=a||window;const c=vl(t),d=tp(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=Lt;this.history=[{...h,timestamp:p}];const{onSessionStart:y}=n;y&&y(t,np(d,this.history)),this.removeListeners=gl(Ko(this.contextWindow,"pointermove",this.handlePointerMove),Ko(this.contextWindow,"pointerup",this.handlePointerUp),Ko(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ws(this.updatePoint)}}function tp(e,t){return t?{point:t(e.point)}:e}function H1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function np({point:e},t){return{point:e,delta:H1(e,hR(t)),offset:H1(e,iU(t)),velocity:sU(t,.1)}}function iU(e){return e[0]}function hR(e){return e[e.length-1]}function sU(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const a=hR(e);for(;n>=0&&(s=e[n],!(a.timestamp-s.timestamp>si(t)));)n--;if(!s)return{x:0,y:0};const u=ri(a.timestamp-s.timestamp);if(u===0)return{x:0,y:0};const c={x:(a.x-s.x)/u,y:(a.y-s.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function rU(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?nt(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?nt(n,e,s.max):Math.min(e,n)),e}function G1(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function aU(e,{top:t,left:n,bottom:s,right:a}){return{x:G1(e.x,n,a),y:G1(e.y,t,s)}}function F1(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function oU(e,t){return{x:F1(e.x,t.x),y:F1(e.y,t.y)}}function lU(e,t){let n=.5;const s=Yt(e),a=Yt(t);return a>s?n=il(t.min,t.max-s,e.min):s>a&&(n=il(e.min,e.max-a,t.min)),zi(0,1,n)}function uU(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const lm=.35;function cU(e=lm){return e===!1?e=0:e===!0&&(e=lm),{x:Y1(e,"left","right"),y:Y1(e,"top","bottom")}}function Y1(e,t,n){return{min:X1(e,t),max:X1(e,n)}}function X1(e,t){return typeof e=="number"?e:e[t]||0}const zn={x:!1,y:!1};function pR(){return zn.x||zn.y}function fU(e){return e==="x"||e==="y"?zn[e]?null:(zn[e]=!0,()=>{zn[e]=!1}):zn.x||zn.y?null:(zn.x=zn.y=!0,()=>{zn.x=zn.y=!1})}const dU=new WeakMap;class hU{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ft(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=y=>{const{dragSnapToOrigin:g}=this.getProps();g?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(vl(y).point)},u=(y,g)=>{const{drag:v,dragPropagation:S,onDragStart:A}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=fU(v),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),_n(M=>{let k=this.getAxisMotionValue(M).get()||0;if(ii.test(k)){const{projection:$}=this.visualElement;if($&&$.layout){const C=$.layout.layoutBox[M];C&&(k=Yt(C)*(parseFloat(k)/100))}}this.originPoint[M]=k}),A&&it.postRender(()=>A(y,g)),Fp(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(y,g)=>{const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:A,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:M}=g;if(S&&this.currentDirection===null){this.currentDirection=pU(M),this.currentDirection!==null&&A&&A(this.currentDirection);return}this.updateAxis("x",g.point,M),this.updateAxis("y",g.point,M),this.visualElement.render(),E&&E(y,g)},d=(y,g)=>this.stop(y,g),h=()=>_n(y=>{var g;return this.getAnimationState(y)==="paused"&&((g=this.getAxisMotionValue(y).animation)==null?void 0:g.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new dR(t,{onSessionStart:a,onStart:u,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:fR(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:a}=n;this.startAnimation(a);const{onDragEnd:u}=this.getProps();u&&it.postRender(()=>u(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:a}=this.getProps();if(!s||!Gu(t,a,this.currentDirection))return;const u=this.getAxisMotionValue(t);let c=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(c=rU(c,this.constraints[t],this.elastic[t])),u.set(c)}resolveConstraints(){var u;const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(u=this.visualElement.projection)==null?void 0:u.layout,a=this.constraints;t&&ia(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=aU(s.layoutBox,t):this.constraints=!1,this.elastic=cU(n),a!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&_n(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=uU(s.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ia(t))return!1;const s=t.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const u=tU(s,a.root,this.visualElement.getTransformPagePoint());let c=oU(a.layout.layoutBox,u);if(n){const d=n(Gz(c));this.hasMutatedConstraints=!!d,d&&(c=rR(d))}return c}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:a,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},p=_n(y=>{if(!Gu(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=a?200:1e6,S=a?40:1e7,A={type:"inertia",velocity:s?t[y]:0,bounceStiffness:v,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...g};return this.startAxisValueAnimation(y,A)});return Promise.all(p).then(d)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return Fp(this.visualElement,t),s.start(ky(t,s,0,n,this.visualElement,!1))}stopAnimation(){_n(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){_n(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),a=s[n];return a||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){_n(n=>{const{drag:s}=this.getProps();if(!Gu(n,s,this.currentDirection))return;const{projection:a}=this.visualElement,u=this.getAxisMotionValue(n);if(a&&a.layout){const{min:c,max:d}=a.layout.layoutBox[n];u.set(t[n]-nt(c,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ia(n)||!s||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};_n(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();a[c]=lU({min:h,max:h},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),_n(c=>{if(!Gu(c,t,null))return;const d=this.getAxisMotionValue(c),{min:h,max:p}=this.constraints[c];d.set(nt(h,p,a[c]))})}addListeners(){if(!this.visualElement.current)return;dU.set(this.visualElement,this);const t=this.visualElement.current,n=Ko(t,"pointerdown",h=>{const{drag:p,dragListener:y=!0}=this.getProps();p&&y&&this.start(h)}),s=()=>{const{dragConstraints:h}=this.getProps();ia(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,u=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),it.read(s);const c=sl(window,"resize",()=>this.scalePositionWithinConstraints()),d=a.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(_n(y=>{const g=this.getAxisMotionValue(y);g&&(this.originPoint[y]+=h[y].translate,g.set(g.get()+h[y].translate))}),this.visualElement.render())});return()=>{c(),n(),u(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:a=!1,dragConstraints:u=!1,dragElastic:c=lm,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:a,dragConstraints:u,dragElastic:c,dragMomentum:d}}}function Gu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pU(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mU extends Es{constructor(t){super(t),this.removeGroupControls=$n,this.removeListeners=$n,this.controls=new hU(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$n}unmount(){this.removeGroupControls(),this.removeListeners()}}const Z1=e=>(t,n)=>{e&&it.postRender(()=>e(t,n))};class yU extends Es{constructor(){super(...arguments),this.removePointerDownListener=$n}onPointerDown(t){this.session=new dR(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:fR(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:a}=this.node.getProps();return{onSessionStart:Z1(t),onStart:Z1(n),onMove:s,onEnd:(u,c)=>{delete this.session,a&&it.postRender(()=>a(u,c))}}}mount(){this.removePointerDownListener=Ko(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const sc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function J1(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const No={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=J1(e,t.target.x),s=J1(e,t.target.y);return`${n}% ${s}%`}},gU={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,a=As.parse(e);if(a.length>5)return s;const u=As.createTransformer(e),c=typeof a[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;a[0+c]/=d,a[1+c]/=h;const p=nt(d,h,.5);return typeof a[2+c]=="number"&&(a[2+c]/=p),typeof a[3+c]=="number"&&(a[3+c]/=p),u(a)}};class bU extends j.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:a}=this.props,{projection:u}=t;_j(vU),u&&(n.group&&n.group.add(u),s&&s.register&&a&&s.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),sc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:a,isPresent:u}=this.props,{projection:c}=s;return c&&(c.isPresent=u,a||t.layoutDependency!==n||n===void 0||t.isPresent!==u?c.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?c.promote():c.relegate()||it.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ay.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:a}=t;a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),s&&s.deregister&&s.deregister(a))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function mR(e){const[t,n]=uj(),s=j.useContext(oE);return U.jsx(bU,{...e,layoutGroup:s,switchLayoutGroup:j.useContext(yE),isPresent:t,safeToRemove:n})}const vU={borderRadius:{...No,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:No,borderTopRightRadius:No,borderBottomLeftRadius:No,borderBottomRightRadius:No,boxShadow:gU};function SU(e,t,n){const s=Kt(e)?e:Aa(e);return s.start(ky("",s,t,n)),s.animation}const xU=(e,t)=>e.depth-t.depth;class wU{constructor(){this.children=[],this.isDirty=!1}add(t){yy(this.children,t),this.isDirty=!0}remove(t){gy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(xU),this.isDirty=!1,this.children.forEach(t)}}function AU(e,t){const n=sn.now(),s=({timestamp:a})=>{const u=a-n;u>=t&&(ws(s),e(u-t))};return it.setup(s,!0),()=>ws(s)}const yR=["TopLeft","TopRight","BottomLeft","BottomRight"],TU=yR.length,Q1=e=>typeof e=="string"?parseFloat(e):e,W1=e=>typeof e=="number"||he.test(e);function EU(e,t,n,s,a,u){a?(e.opacity=nt(0,n.opacity??1,RU(s)),e.opacityExit=nt(t.opacity??1,0,OU(s))):u&&(e.opacity=nt(t.opacity??1,n.opacity??1,s));for(let c=0;c<TU;c++){const d=`border${yR[c]}Radius`;let h=ex(t,d),p=ex(n,d);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||W1(h)===W1(p)?(e[d]=Math.max(nt(Q1(h),Q1(p),s),0),(ii.test(p)||ii.test(h))&&(e[d]+="%")):e[d]=p}(t.rotate||n.rotate)&&(e.rotate=nt(t.rotate||0,n.rotate||0,s))}function ex(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const RU=gR(0,.5,HE),OU=gR(.5,.95,$n);function gR(e,t,n){return s=>s<e?0:s>t?1:n(il(e,t,s))}function tx(e,t){e.min=t.min,e.max=t.max}function Cn(e,t){tx(e.x,t.x),tx(e.y,t.y)}function nx(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function ix(e,t,n,s,a){return e-=t,e=kc(e,1/n,s),a!==void 0&&(e=kc(e,1/a,s)),e}function MU(e,t=0,n=1,s=.5,a,u=e,c=e){if(ii.test(t)&&(t=parseFloat(t),t=nt(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=nt(u.min,u.max,s);e===u&&(d-=t),e.min=ix(e.min,t,n,d,a),e.max=ix(e.max,t,n,d,a)}function sx(e,t,[n,s,a],u,c){MU(e,t[n],t[s],t[a],t.scale,u,c)}const CU=["x","scaleX","originX"],_U=["y","scaleY","originY"];function rx(e,t,n,s){sx(e.x,t,CU,n?n.x:void 0,s?s.x:void 0),sx(e.y,t,_U,n?n.y:void 0,s?s.y:void 0)}function ax(e){return e.translate===0&&e.scale===1}function bR(e){return ax(e.x)&&ax(e.y)}function ox(e,t){return e.min===t.min&&e.max===t.max}function kU(e,t){return ox(e.x,t.x)&&ox(e.y,t.y)}function lx(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function vR(e,t){return lx(e.x,t.x)&&lx(e.y,t.y)}function ux(e){return Yt(e.x)/Yt(e.y)}function cx(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class DU{constructor(){this.members=[]}add(t){yy(this.members,t),t.scheduleRender()}remove(t){if(gy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(a=>t===a);if(n===0)return!1;let s;for(let a=n;a>=0;a--){const u=this.members[a];if(u.isPresent!==!1){s=u;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:a}=t.options;a===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function NU(e,t,n){let s="";const a=e.x.translate/t.x,u=e.y.translate/t.y,c=(n==null?void 0:n.z)||0;if((a||u||c)&&(s=`translate3d(${a}px, ${u}px, ${c}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:p,rotate:y,rotateX:g,rotateY:v,skewX:S,skewY:A}=n;p&&(s=`perspective(${p}px) ${s}`),y&&(s+=`rotate(${y}deg) `),g&&(s+=`rotateX(${g}deg) `),v&&(s+=`rotateY(${v}deg) `),S&&(s+=`skewX(${S}deg) `),A&&(s+=`skewY(${A}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(s+=`scale(${d}, ${h})`),s||"none"}function SR(e){return uE(e)&&"ownerSVGElement"in e}function $U(e){return SR(e)&&e.tagName==="svg"}const ip=["","X","Y","Z"],BU={visibility:"hidden"},LU=1e3;let VU=0;function sp(e,t,n,s){const{latestValues:a}=t;a[e]&&(n[e]=a[e],t.setStaticValue(e,0),s&&(s[e]=0))}function xR(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=ME(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(a||u))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&xR(s)}function wR({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:a}){return class{constructor(c={},d=t==null?void 0:t()){this.id=VU++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(UU),this.nodes.forEach(HU),this.nodes.forEach(GU),this.nodes.forEach(qU)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new wU)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new by),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const h=this.eventHandlers.get(c);h&&h.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=SR(c)&&!$U(c),this.instance=c;const{layoutId:d,layout:h,visualElement:p}=this.options;if(p&&!p.current&&p.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let y;const g=()=>this.root.updateBlockedByResize=!1;e(c,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=AU(g,250),sc.hasAnimatedSinceResize&&(sc.hasAnimatedSinceResize=!1,this.nodes.forEach(dx))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&p&&(d||h)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||p.getDefaultTransition()||JU,{onLayoutAnimationStart:E,onLayoutAnimationComplete:M}=p.getProps(),k=!this.targetLayout||!vR(this.targetLayout,S),$=!g&&v;if(this.options.layoutRoot||this.resumeFrom||$||g&&(k||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,$);const C={...vy(A,"layout"),onPlay:E,onComplete:M};(p.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C)}else g||dx(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ws(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(FU),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&xR(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const g=this.path[y];g.shouldResetTransform=!0,g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(fx);return}this.isUpdating||this.nodes.forEach(PU),this.isUpdating=!1,this.nodes.forEach(IU),this.nodes.forEach(jU),this.nodes.forEach(zU),this.clearAllSnapshots();const d=sn.now();Lt.delta=zi(0,1e3/60,d-Lt.timestamp),Lt.timestamp=d,Lt.isProcessing=!0,Zh.update.process(Lt),Zh.preRender.process(Lt),Zh.render.process(Lt),Lt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ay.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(KU),this.sharedNodes.forEach(YU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Yt(this.snapshot.measuredBox.x)&&!Yt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ft(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&this.instance){const h=s(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!bR(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;c&&this.instance&&(d||Ys(this.latestValues)||y)&&(a(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return c&&(h=this.removeTransform(h)),QU(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var p;const{visualElement:c}=this.options;if(!c)return ft();const d=c.measureViewportBox();if(!(((p=this.scroll)==null?void 0:p.wasRoot)||this.path.some(WU))){const{scroll:y}=this.root;y&&(aa(d.x,y.offset.x),aa(d.y,y.offset.y))}return d}removeElementScroll(c){var h;const d=ft();if(Cn(d,c),(h=this.scroll)!=null&&h.wasRoot)return d;for(let p=0;p<this.path.length;p++){const y=this.path[p],{scroll:g,options:v}=y;y!==this.root&&g&&v.layoutScroll&&(g.wasRoot&&Cn(d,c),aa(d.x,g.offset.x),aa(d.y,g.offset.y))}return d}applyTransform(c,d=!1){const h=ft();Cn(h,c);for(let p=0;p<this.path.length;p++){const y=this.path[p];!d&&y.options.layoutScroll&&y.scroll&&y!==y.root&&oa(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Ys(y.latestValues)&&oa(h,y.latestValues)}return Ys(this.latestValues)&&oa(h,this.latestValues),h}removeTransform(c){const d=ft();Cn(d,c);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!Ys(p.latestValues))continue;am(p.latestValues)&&p.updateSnapshot();const y=ft(),g=p.measurePageBox();Cn(y,g),rx(d,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,y)}return Ys(this.latestValues)&&rx(d,this.latestValues),d}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Lt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){var v;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:g}=this.options;if(!(!this.layout||!(y||g))){if(this.resolvedRelativeTargetAt=Lt.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ft(),this.relativeTargetOrigin=ft(),Io(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Cn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ft(),this.targetWithTransforms=ft()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Wz(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Cn(this.target,this.layout.layoutBox),uR(this.target,this.targetDelta)):Cn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ft(),this.relativeTargetOrigin=ft(),Io(this.relativeTargetOrigin,this.target,S.target),Cn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||am(this.parent.latestValues)||lR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var A;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||(A=this.parent)!=null&&A.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Lt.timestamp&&(h=!1),h)return;const{layout:p,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||y))return;Cn(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;eU(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=ft());const{target:S}=c;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(nx(this.prevProjectionDelta.x,this.projectionDelta.x),nx(this.prevProjectionDelta.y,this.projectionDelta.y)),Po(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!cx(this.projectionDelta.x,this.prevProjectionDelta.x)||!cx(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",S))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){var d;if((d=this.options.visualElement)==null||d.scheduleRender(),c){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ra(),this.projectionDelta=ra(),this.projectionDeltaWithTransform=ra()}setAnimationOrigin(c,d=!1){const h=this.snapshot,p=h?h.latestValues:{},y={...this.latestValues},g=ra();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=ft(),S=h?h.source:void 0,A=this.layout?this.layout.source:void 0,E=S!==A,M=this.getStack(),k=!M||M.members.length<=1,$=!!(E&&!k&&this.options.crossfade===!0&&!this.path.some(ZU));this.animationProgress=0;let C;this.mixTargetDelta=G=>{const z=G/1e3;hx(g.x,c.x,z),hx(g.y,c.y,z),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Io(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),XU(this.relativeTarget,this.relativeTargetOrigin,v,z),C&&kU(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=ft()),Cn(C,this.relativeTarget)),E&&(this.animationValues=y,EU(y,p,this.latestValues,z,$,k)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){var d,h,p;this.notifyListeners("animationStart"),(d=this.currentAnimation)==null||d.stop(!1),(p=(h=this.resumingFrom)==null?void 0:h.currentAnimation)==null||p.stop(!1),this.pendingAnimation&&(ws(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{sc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Aa(0)),this.currentAnimation=SU(this.motionValue,[0,1e3],{...c,isSync:!0,onUpdate:y=>{this.mixTargetDelta(y),c.onUpdate&&c.onUpdate(y)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(LU),this.currentAnimation.stop(!1)),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:h,layout:p,latestValues:y}=c;if(!(!d||!h||!p)){if(this!==c&&this.layout&&p&&AR(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||ft();const g=Yt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Yt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Cn(d,h),oa(d,y),Po(this.projectionDeltaWithTransform,this.layoutCorrected,d,y)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new DU),this.sharedNodes.get(c).add(d);const p=d.options.initialPromotionConfig;d.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var d;const{layoutId:c}=this.options;return c?((d=this.getStack())==null?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:c}=this.options;return c?(d=this.getStack())==null?void 0:d.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:h}={}){const p=this.getStack();p&&p.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const p={};h.z&&sp("z",c,p,this.animationValues);for(let y=0;y<ip.length;y++)sp(`rotate${ip[y]}`,c,p,this.animationValues),sp(`skew${ip[y]}`,c,p,this.animationValues);c.render();for(const y in p)c.setStaticValue(y,p[y]),this.animationValues&&(this.animationValues[y]=p[y]);c.scheduleRender()}getProjectionStyles(c){if(!this.instance||this.isSVG)return;if(!this.isVisible)return BU;const d={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,d.opacity="",d.pointerEvents=nc(c==null?void 0:c.pointerEvents)||"",d.transform=h?h(this.latestValues,""):"none",d;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=nc(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Ys(this.latestValues)&&(S.transform=h?h({},""):"none",this.hasProjected=!1),S}const y=p.animationValues||p.latestValues;this.applyTransformsToTarget(),d.transform=NU(this.projectionDeltaWithTransform,this.treeScale,y),h&&(d.transform=h(y,d.transform));const{x:g,y:v}=this.projectionDelta;d.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,p.animationValues?d.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:d.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const S in Wo){if(y[S]===void 0)continue;const{correct:A,applyTo:E,isCSSVariable:M}=Wo[S],k=d.transform==="none"?y[S]:A(y[S],p);if(E){const $=E.length;for(let C=0;C<$;C++)d[E[C]]=k}else M?this.options.visualElement.renderState.vars[S]=k:d[S]=k}return this.options.layoutId&&(d.pointerEvents=p===this?nc(c==null?void 0:c.pointerEvents)||"":"none"),d}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>{var d;return(d=c.currentAnimation)==null?void 0:d.stop(!1)}),this.root.nodes.forEach(fx),this.root.sharedNodes.clear()}}}function jU(e){e.updateLayout()}function zU(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:a}=e.layout,{animationType:u}=e.options,c=t.source!==e.layout.source;u==="size"?_n(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Yt(v);v.min=s[g].min,v.max=v.min+S}):AR(u,t.layoutBox,s)&&_n(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Yt(s[g]);v.max=v.min+S,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+S)});const d=ra();Po(d,s,t.layoutBox);const h=ra();c?Po(h,e.applyTransform(a,!0),t.measuredBox):Po(h,s,t.layoutBox);const p=!bR(d);let y=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:v,layout:S}=g;if(v&&S){const A=ft();Io(A,t.layoutBox,v.layoutBox);const E=ft();Io(E,s,S.layoutBox),vR(A,E)||(y=!0),g.options.layoutRoot&&(e.relativeTarget=E,e.relativeTargetOrigin=A,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:h,layoutDelta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:y})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function UU(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function qU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function KU(e){e.clearSnapshot()}function fx(e){e.clearMeasurements()}function PU(e){e.isLayoutDirty=!1}function IU(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function dx(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function HU(e){e.resolveTargetDelta()}function GU(e){e.calcProjection()}function FU(e){e.resetSkewAndRotation()}function YU(e){e.removeLeadSnapshot()}function hx(e,t,n){e.translate=nt(t.translate,0,n),e.scale=nt(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function px(e,t,n,s){e.min=nt(t.min,n.min,s),e.max=nt(t.max,n.max,s)}function XU(e,t,n,s){px(e.x,t.x,n.x,s),px(e.y,t.y,n.y,s)}function ZU(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const JU={duration:.45,ease:[.4,0,.1,1]},mx=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),yx=mx("applewebkit/")&&!mx("chrome/")?Math.round:$n;function gx(e){e.min=yx(e.min),e.max=yx(e.max)}function QU(e){gx(e.x),gx(e.y)}function AR(e,t,n){return e==="position"||e==="preserve-aspect"&&!Qz(ux(t),ux(n),.2)}function WU(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const eq=wR({attachResizeListener:(e,t)=>sl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rp={current:void 0},TR=wR({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rp.current){const e=new eq({});e.mount(window),e.setOptions({layoutScroll:!0}),rp.current=e}return rp.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),tq={pan:{Feature:yU},drag:{Feature:mU,ProjectionNode:TR,MeasureLayout:mR}};function nq(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const a=(n==null?void 0:n[e])??s.querySelectorAll(e);return a?Array.from(a):[]}return Array.from(e)}function ER(e,t){const n=nq(e),s=new AbortController,a={passive:!0,...t,signal:s.signal};return[n,a,()=>s.abort()]}function bx(e){return!(e.pointerType==="touch"||pR())}function iq(e,t,n={}){const[s,a,u]=ER(e,n),c=d=>{if(!bx(d))return;const{target:h}=d,p=t(h,d);if(typeof p!="function"||!h)return;const y=g=>{bx(g)&&(p(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,a)};return s.forEach(d=>{d.addEventListener("pointerenter",c,a)}),u}function vx(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,u=s[a];u&&it.postRender(()=>u(t,vl(t)))}class sq extends Es{mount(){const{current:t}=this.node;t&&(this.unmount=iq(t,(n,s)=>(vx(this.node,s,"Start"),a=>vx(this.node,a,"End"))))}unmount(){}}class rq extends Es{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=gl(sl(this.node.current,"focus",()=>this.onFocus()),sl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const RR=(e,t)=>t?e===t?!0:RR(e,t.parentElement):!1,aq=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function oq(e){return aq.has(e.tagName)||e.tabIndex!==-1}const rc=new WeakSet;function Sx(e){return t=>{t.key==="Enter"&&e(t)}}function ap(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const lq=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=Sx(()=>{if(rc.has(n))return;ap(n,"down");const a=Sx(()=>{ap(n,"up")}),u=()=>ap(n,"cancel");n.addEventListener("keyup",a,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function xx(e){return Dy(e)&&!pR()}function uq(e,t,n={}){const[s,a,u]=ER(e,n),c=d=>{const h=d.currentTarget;if(!xx(d))return;rc.add(h);const p=t(h,d),y=(S,A)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),rc.has(h)&&rc.delete(h),xx(S)&&typeof p=="function"&&p(S,{success:A})},g=S=>{y(S,h===window||h===document||n.useGlobalTarget||RR(h,S.target))},v=S=>{y(S,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return s.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,a),cE(d)&&(d.addEventListener("focus",p=>lq(p,a)),!oq(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function wx(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),u=s[a];u&&it.postRender(()=>u(t,vl(t)))}class cq extends Es{mount(){const{current:t}=this.node;t&&(this.unmount=uq(t,(n,s)=>(wx(this.node,s,"Start"),(a,{success:u})=>wx(this.node,a,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const um=new WeakMap,op=new WeakMap,fq=e=>{const t=um.get(e.target);t&&t(e)},dq=e=>{e.forEach(fq)};function hq({root:e,...t}){const n=e||document;op.has(n)||op.set(n,{});const s=op.get(n),a=JSON.stringify(t);return s[a]||(s[a]=new IntersectionObserver(dq,{root:e,...t})),s[a]}function pq(e,t,n){const s=hq(t);return um.set(e,n),s.observe(e),()=>{um.delete(e),s.unobserve(e)}}const mq={some:0,all:1};class yq extends Es{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:a="some",once:u}=t,c={root:n?n.current:void 0,rootMargin:s,threshold:typeof a=="number"?a:mq[a]},d=h=>{const{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,u&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:y,onViewportLeave:g}=this.node.getProps(),v=p?y:g;v&&v(h)};return pq(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(gq(t,n))&&this.startObserver()}unmount(){}}function gq({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const bq={inView:{Feature:yq},tap:{Feature:cq},focus:{Feature:rq},hover:{Feature:sq}},vq={layout:{ProjectionNode:TR,MeasureLayout:mR}},cm={current:null},OR={current:!1};function Sq(){if(OR.current=!0,!!ty)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>cm.current=e.matches;e.addListener(t),t()}else cm.current=!1}const xq=new WeakMap;function wq(e,t,n){for(const s in t){const a=t[s],u=n[s];if(Kt(a))e.addValue(s,a);else if(Kt(u))e.addValue(s,Aa(a,{owner:e}));else if(u!==a)if(e.hasValue(s)){const c=e.getValue(s);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=e.getStaticValue(s);e.addValue(s,Aa(c!==void 0?c:a,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const MR=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),CR=e=>/^0[^.\s]+$/u.test(e),Aq={test:e=>e==="auto",parse:e=>e},_R=e=>t=>t.test(e),kR=[ka,he,ii,ps,Dj,kj,Aq],Ax=e=>kR.find(_R(e)),Tq=[...kR,qt,As],Eq=e=>Tq.find(_R(e)),Rq=new Set(["brightness","contrast","saturate","opacity"]);function Oq(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Sy)||[];if(!s)return e;const a=n.replace(s,"");let u=Rq.has(t)?1:0;return s!==n&&(u*=100),t+"("+u+a+")"}const Mq=/\b([a-z-]*)\(.*?\)/gu,fm={...As,getAnimatableNone:e=>{const t=e.match(Mq);return t?t.map(Oq).join(" "):e}},Cq={...cy,color:qt,backgroundColor:qt,outlineColor:qt,fill:qt,stroke:qt,borderColor:qt,borderTopColor:qt,borderRightColor:qt,borderBottomColor:qt,borderLeftColor:qt,filter:fm,WebkitFilter:fm},DR=e=>Cq[e];function NR(e,t){let n=DR(e);return n!==fm&&(n=As),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Tx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class _q{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:a,blockInitialAnimation:u,visualState:c},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Cy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=sn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,it.render(this.render,!1,!0))};const{latestValues:h,renderState:p}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=a,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=af(n),this.isVariantNode=pE(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const S=g[v];h[v]!==void 0&&Kt(S)&&S.set(h[v],!1)}}mount(t){this.current=t,xq.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),OR.current||Sq(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:cm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ws(this.notifyUpdate),ws(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=_a.has(t);s&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",d=>{this.latestValues[t]=d,this.props.onUpdate&&it.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),u=n.on("renderRequest",this.scheduleRender);let c;window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{a(),u(),c&&c(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in wa){const n=wa[t];if(!n)continue;const{isEnabled:s,Feature:a}=n;if(!this.features[t]&&a&&s(this.props)&&(this.features[t]=new a(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ft()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Tx.length;s++){const a=Tx[s];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const u="on"+a,c=t[u];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=wq(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Aa(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(MR(s)||CR(s))?s=parseFloat(s):!Eq(s)&&As.test(n)&&(s=NR(t,n)),this.setBaseTarget(t,Kt(s)?s.get():s)),Kt(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var u;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const c=py(this.props,n,(u=this.presenceContext)==null?void 0:u.custom);c&&(s=c[t])}if(n&&s!==void 0)return s;const a=this.getBaseTargetFromProps(this.props,t);return a!==void 0&&!Kt(a)?a:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new by),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}const kq=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dq(e){const t=kq.exec(e);if(!t)return[,];const[,n,s,a]=t;return[`--${n??s}`,a]}function $R(e,t,n=1){const[s,a]=Dq(e);if(!s)return;const u=window.getComputedStyle(t).getPropertyValue(s);if(u){const c=u.trim();return MR(c)?parseFloat(c):c}return uy(a)?$R(a,t,n+1):a}function Nq(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||CR(e):!0}const $q=new Set(["auto","none","0"]);function Bq(e,t,n){let s=0,a;for(;s<e.length&&!a;){const u=e[s];typeof u=="string"&&!$q.has(u)&&nl(u).values.length&&(a=e[s]),s++}if(a&&n)for(const u of t)e[u]=NR(n,a)}class Lq extends Cy{constructor(t,n,s,a,u){super(t,n,s,a,u,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<t.length;h++){let p=t[h];if(typeof p=="string"&&(p=p.trim(),uy(p))){const y=$R(p,n.current);y!==void 0&&(t[h]=y),h===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!tR.has(s)||t.length!==2)return;const[a,u]=t,c=Ax(a),d=Ax(u);if(c!==d)if(C1(c)&&C1(d))for(let h=0;h<t.length;h++){const p=t[h];typeof p=="string"&&(t[h]=parseFloat(p))}else sr[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let a=0;a<t.length;a++)(t[a]===null||Nq(t[a]))&&s.push(a);s.length&&Bq(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=sr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&t.getValue(s,a).jump(a,!1)}measureEndState(){var d;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const a=t.getValue(n);a&&a.jump(this.measuredOrigin,!1);const u=s.length-1,c=s[u];s[u]=sr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(d=this.removedTransforms)!=null&&d.length&&this.removedTransforms.forEach(([h,p])=>{t.getValue(h).set(p)}),this.resolveNoneKeyframes()}}class BR extends _q{constructor(){super(...arguments),this.KeyframeResolver=Lq}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Kt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function LR(e,{style:t,vars:n},s,a){Object.assign(e.style,t,a&&a.getProjectionStyles(s));for(const u in n)e.style.setProperty(u,n[u])}function Vq(e){return window.getComputedStyle(e)}class jq extends BR{constructor(){super(...arguments),this.type="html",this.renderInstance=LR}readValueFromInstance(t,n){var s;if(_a.has(n))return(s=this.projection)!=null&&s.isProjecting?em(n):oz(t,n);{const a=Vq(t),u=(ly(n)?a.getPropertyValue(n):a[n])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(t,{transformPagePoint:n}){return cR(t,n)}build(t,n,s){fy(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return my(t,n,s)}}const VR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function zq(e,t,n,s){LR(e,t,void 0,s);for(const a in t.attrs)e.setAttribute(VR.has(a)?a:ry(a),t.attrs[a])}class Uq extends BR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ft}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(_a.has(n)){const s=DR(n);return s&&s.default||0}return n=VR.has(n)?n:ry(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return RE(t,n,s)}build(t,n,s){wE(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,a){zq(t,n,s,a)}mount(t){this.isSVGTag=TE(t.tagName),super.mount(t)}}const qq=(e,t)=>hy(e)?new Uq(t):new jq(t,{allowProjection:e!==j.Fragment}),Kq=Zj({...Iz,...bq,...tq,...vq},qq),Pq=yj(Kq);function Iq(){const e=Ci(Zo),t=Ci(xa),n=Ci(Jo),s=yt(Zo),a=yt(xa),u=yt(Jo),[c,d]=j.useState(null),[h,p]=j.useState(null),[y,g]=j.useState("email");return U.jsx("form",{onSubmit:async v=>{v.preventDefault();try{switch(y){case"email":{const{nextStep:S,userKey:A}=await gs.declareAuthTarget.query({email:s});switch(p(A),S){case"otp_login":case"otp_verify":{g("otp");break}case"password_login":{g("email");break}}break}case"otp":{if(!h){console.error("somehow userKey is null");return}const S=await gs.verifyAccountAction.mutate({oneTimeCode:u,userKey:h});In(Et,S),ni.once("connect",()=>{Ss("/game"),e(""),n("")});break}case"password":{const S=await gs.openSession.mutate({email:s,password:a});In(Et,S),ni.once("connect",()=>{Ss("/game"),e(""),t("")});break}default:{const S=await gs.openSession.mutate({email:s,password:a});e(""),t(""),In(Et,S),ni.once("connect",()=>{console.log("โœจ connected"),Ss("/game")})}}}catch(S){S instanceof ti&&d(S.message)}},children:U.jsxs("main",{children:[c?U.jsx("aside",{children:c}):null,U.jsxs(Pq.label,{htmlFor:"email",children:[U.jsx("span",{children:"Email"}),U.jsx("input",{id:"email",type:"text",value:s,onChange:v=>{e(v.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:y!=="email"})]}),y==="password"?U.jsxs("label",{htmlFor:"password",children:[U.jsx("span",{children:"Password"}),U.jsx("input",{id:"password",type:"password",value:a,onChange:v=>{t(v.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:y==="password"})]}):null,y==="otp"?U.jsxs("label",{htmlFor:"otp",children:[U.jsx("span",{children:"One-time Code"}),U.jsx("input",{id:"otp",type:"otp",value:u,onChange:v=>{n(v.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:y==="otp"})]}):null,U.jsx("button",{type:"submit",disabled:!s&&y==="email"||!a&&y==="password",children:">>->"})]})})}function Hq({route:[,e]}){const t=yt(Et),n=yt(Jo),s=Ci(Jo);Un.useState(!1);const[a,u]=Un.useState(null);if(ac(()=>{e&&s(e)}),!t)return U.jsx("p",{children:"You must be logged in to verify your account."});const{verification:c}=t;return ac(()=>{n&&console.log("verifying token",n)}),U.jsx("form",{onSubmit:async d=>{d.preventDefault();try{const h=await gs.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});In(Et,h),h.action==="resetPassword"?Ss("/account"):Ss("/game")}catch(h){h instanceof ti&&u(h.message)}},children:U.jsxs("main",{children:[U.jsx("p",{children:"Check your email for a verification code."}),U.jsxs("label",{htmlFor:"code",children:[U.jsx("span",{children:"Verification code"}),U.jsx("input",{id:"code",type:"text",value:n,onChange:d=>{s(d.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})})}function Gq(){const e=yt(rE),t=yt(Et),[n,s]=j.useState(!1),{refs:a,floatingStyles:u,context:c}=oD({open:n,onOpenChange:s,placement:"bottom-end",middleware:[Nk(5),Bk(),$k()],whileElementsMounted:Ok}),d=nD(c),h=rD(c),p=cD(c),{getReferenceProps:y,getFloatingProps:g}=lD([d,h,p]),v=yt(XV);return U.jsxs("main",{className:YB.class,children:[U.jsxs("header",{children:[U.jsxs("main",{children:[U.jsx(FB,{}),U.jsx("span",{children:U.jsx(XB,{input:v})})]}),U.jsx("button",{"data-css":"profile",ref:a.setReference,...y(),children:t!=null&&t.username?t.username.slice(0,2):""}),n&&t&&U.jsx(eD,{context:c,modal:!1,children:U.jsxs("div",{"data-css":"profile-actions",ref:a.setFloating,style:u,...g(),children:[U.jsx("span",{children:t.username}),U.jsx("button",{type:"button",onClick:()=>{Ss("/account")},children:"Account"}),U.jsx("button",{type:"button",onClick:async()=>{t&&(await gs.closeSession.mutate({username:t.username,sessionKey:t.sessionKey}),ni.once("disconnect",()=>{In(Et,null),Ss("/")}),ni.disconnect())},children:"Sign out"})]})})]}),U.jsx("main",{children:typeof e=="number"?U.jsxs("article",{children:[U.jsx("h1",{children:e}),U.jsx("h2",{children:JSON.parse(kT[e])}),U.jsx(DT,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(e[0]){case void 0:return U.jsx(Iq,{});case"admin":return U.jsx(ej,{});case"game":return U.jsx(sj,{route:e});case"verify":return U.jsx(Hq,{route:e});case"account":return U.jsx(WV,{})}})()})]})}S_.createRoot(document.getElementById("root")).render(U.jsx(j.StrictMode,{children:U.jsx(d_,{socket:ni,children:U.jsx(Gq,{})})}));