tempest.games 0.2.62 → 0.2.63

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,108 +0,0 @@
1
- function Ik(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(t,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function Hk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Uh={exports:{}},Ia={};/**
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 lS;function Fk(){if(lS)return Ia;lS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:t,type:r,key:c,ref:o!==void 0?o:null,props:l}}return Ia.Fragment=e,Ia.jsx=n,Ia.jsxs=n,Ia}var uS;function Gk(){return uS||(uS=1,Uh.exports=Fk()),Uh.exports}var H=Gk();function lt(t){return nf(Ut.STORE,t,void 0)}function g1(t){return ry(Ut.STORE,t,void 0)}function Yk(t){return Xm(Ut.STORE,t)}function Ze(...t){return vn(Ut.STORE,...t)}function Xk(t){return KM(Ut.STORE,t)}function Jk(t){return qM(t,Ut.STORE)}const Dr={atom_family:"atom family",atom:"atom",continuity:"continuity",key:"key",mutable_atom_family:"atom family [m]",mutable_atom:"atom [m]",readonly_held_selector_family:"selector family [h]",readonly_held_selector:"selector [h]",readonly_pure_selector_family:"selector family",readonly_pure_selector:"selector",state:"state",timeline:"timeline",transaction:"transaction",unknown:"unknown",writable_held_selector_family:"selector family [wh]",writable_held_selector:"selector [wh]",writable_pure_selector_family:"selector family [w]",writable_pure_selector:"selector [w]"},Kh=t=>(e,n,r,o,...l)=>{console[t](`${e} ${Dr[n]} \`${r}\` ${o}`,...l)},Zk={error:Kh("error"),info:Kh("info"),warn:Kh("warn")};var Qk=class{logLevel;filter;logger;constructor(t,e,n=Zk){this.logLevel=t,this.filter=e,this.logger=n}error=(...t)=>{if(this.logLevel!==null){const e=this.filter?.(...t)??!0;e===!0?this.logger.error(...t):e&&this.logger.error(...e)}};info=(...t)=>{if(this.logLevel==="info"){const e=this.filter?.(...t)??!0;e===!0?this.logger.info(...t):e&&this.logger.info(...e)}};warn=(...t)=>{if(this.logLevel!=="error"&&this.logLevel!==null){const e=this.filter?.(...t)??!0;e===!0?this.logger.warn(...t):e&&this.logger.warn(...e)}}};function dc(t,e){return[t,e].sort().join("")}function Wk(t){if(typeof t!="string")return null;const[e,n]=t.split("==");if(!n)return null;const r=e.slice(4),[o,l]=n.split("++");return r&&o&&l?[r,o,l]:null}function hi(t){return V1(Ut.STORE,t)}function eM(t){return OM(Ut.STORE,t)}function De(...t){jt(Ut.STORE,...t)}function tM(t,e,n=Qc()){return LM(Ut.STORE,t,e,n)}function nM(t){return M1(Ut.STORE,t)}function iM(t,e=Qc()){return Im(Ut.STORE,t,e)}function rM(t){return Object.entries(t)}function Nr(t){return JSON.parse(t)}const $t=t=>JSON.stringify(t);function sM(t){const e={};let n=0;for(const r of t)e[r]=n,e[n]=r,++n;return e}const b1="",v1="",S1="",w1="",cS=t=>{switch(typeof t){case"string":return S1+t;case"number":return w1+t;case"boolean":return b1+ +t;case"object":return v1}},fS=t=>{switch(t[0]){case S1:return t.slice(1);case w1:return+t.slice(1);case b1:return t.slice(1)==="1";case v1:return null}},dS=sM(["add","delete","clear"]);var Pm=class Ya extends Set{mode="record";subject=new Ye;constructor(e){super(e)}READONLY_VIEW=this;toJSON(){return[...this]}static fromJSON(e){return new Ya(e)}add(e){const n=super.add(e);return this.mode==="record"&&this.emit({type:"add",value:e}),n}clear(){const e=this.mode==="record"?[...this]:null;super.clear(),e&&this.emit({type:"clear",values:e})}delete(e){const n=super.delete(e);return this.mode==="record"&&this.emit({type:"delete",value:e}),n}subscribe(e,n){return this.subject.subscribe(e,n)}emit(e){this.subject.next(Ya.packUpdate(e))}do(e){this.mode="playback";const n=Ya.unpackUpdate(e);switch(n.type){case"add":this.add(n.value);break;case"delete":this.delete(n.value);break;case"clear":this.clear()}return this.mode="record",null}undo(e){const n=Ya.unpackUpdate(e);switch(this.mode="playback",n.type){case"add":this.delete(n.value);break;case"delete":this.add(n.value);break;case"clear":{const r=n.values;for(const o of r)this.add(o)}}return this.mode="record",null}static packUpdate(e){const n=dS[e.type]+"";return e.type==="clear"?n+e.values.map(cS).join(""):n+cS(e.value)}static unpackUpdate(e){const[n,r]=e.split(""),o=dS[n];return o==="clear"?{type:"clear",values:r.split("").map(fS)}:{type:o,value:fS(r)}}};function Qc(t=Math.random){return t().toString(36).slice(2)}function Oe(t){for(;t.child!==null;)t=t.child;return t}function qm(t){for(;t.parent!==null;)t=t.parent;return t}const oM=/^\[object (?:Async|Generator|AsyncGenerator)?Function\]$/;function _o(t){const e=Object.prototype.toString.call(t);return oM.test(e)}function Np(t,e){return _o(t)?t(e):t}var $p=class extends Promise{fate;resolve;reject;done=!1;constructor(t){let e,n;super((r,o)=>{e=r,n=o}),this.resolve=e,this.reject=n,this.use(t instanceof Promise?t:new Promise(t))}pass(t,e){t===this.fate&&(this.resolve(e),this.done=!0)}fail(t,e){t===this.fate&&(this.reject(e),this.done=!0)}use(t){if(this!==t)if(t instanceof Promise){const e=t;this.fate=e,e.then(n=>{this.pass(e,n)},n=>{this.fail(e,n)})}else this.resolve(t),this.fate=void 0}},Ye=class{Subscriber;subscribers=new Map;subscribe(t,e){return this.subscribers.set(t,e),()=>{this.unsubscribe(t)}}unsubscribe(t){this.subscribers.delete(t)}next(t){const e=this.subscribers.values();for(const n of e)n(t)}},aM=class extends Ye{state;constructor(t){super(),this.state=t}next(t){this.state=t,super.next(t)}},lM=class x1{_buffer;_index=0;constructor(e){let n;typeof e=="number"?n=e:n=e.length,this._buffer=Array.from({length:n})}get buffer(){return this._buffer}get index(){return this._index}add(e){this._buffer[this._index]=e,this._index=(this._index+1)%this._buffer.length}copy(){const e=new x1([...this._buffer]);return e._index=this._index,e}};function _r(t){const e={key:t.key,type:t.type};return"family"in t&&(e.family=t.family),e}var Hn=class extends Map{deleted=new Set;changed=new Set;source;constructor(t){super(),this.source=t}get(t){if(super.has(t))return super.get(t);if(!this.deleted.has(t)&&this.source.has(t))return this.source.get(t)}set(t,e){return this.deleted.delete(t),this.source.has(t)&&this.changed.add(t),super.set(t,e)}hasOwn(t){return super.has(t)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.source.has(t)&&(this.deleted.add(t),this.changed.delete(t)),super.delete(t)}clear(){this.deleted=new Set(this.source.keys()),this.changed.clear(),super.clear()}*[Symbol.iterator](){yield*super[Symbol.iterator]();for(const[t,e]of this.source)!this.deleted.has(t)&&!this.changed.has(t)&&(yield[t,e])}*entries(){yield*this[Symbol.iterator]()}*keys(){yield*super.keys();for(const t of this.source.keys())!this.deleted.has(t)&&!this.changed.has(t)&&(yield t)}*values(){for(const[,t]of this[Symbol.iterator]())yield t}forEach(t){for(const[e,n]of this[Symbol.iterator]())t(n,e,this)}get size(){return super.size+this.source.size-this.changed.size-this.deleted.size}},T1=class extends Set{deleted=new Set;source;constructor(t){super(),this.source=t}add(t){return this.source.has(t)?(this.deleted.delete(t),this):super.add(t)}hasOwn(t){return super.has(t)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.source.has(t)?(this.deleted.add(t),!0):super.delete(t)}clear(){this.deleted=new Set(this.source),super.clear()}*[Symbol.iterator](){yield*super[Symbol.iterator]();for(const t of this.source)this.deleted.has(t)||(yield t)}*iterateOwn(){yield*super[Symbol.iterator]()}get size(){return super.size+this.source.size-this.deleted.size}},uM=class extends Map{deleted=new Set;source;constructor(t){super(),this.source=t}get(t){if(super.has(t))return super.get(t);if(!this.deleted.has(t)&&this.source.has(t)){const e=this.source.get(t),n=new T1(e);return super.set(t,n),n}}set(t,e){return this.deleted.delete(t),super.set(t,e)}has(t){return!this.deleted.has(t)&&(super.has(t)||this.source.has(t))}delete(t){return this.deleted.add(t),super.delete(t)}},ji=class A1{a;b;cardinality;relations=new Map;contents=new Map;isAType;isBType;isContent;makeContentKey=(e,n)=>`${e}:${n}`;warn;getRelatedKeys(e){return this.relations.get(e)}addRelation(e,n){let r=this.relations.get(e),o=this.relations.get(n);r?r.add(n):(r=new Set([n]),this.relations.set(e,r)),o?o.add(e):(o=new Set([e]),this.relations.set(n,o))}deleteRelation(e,n){const r=this.relations.get(e);if(r){r.delete(n),r.size===0&&this.relations.delete(e);const o=this.relations.get(n);o&&(o.delete(e),o.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(e,n){this.relations.set(e,new Set(n));for(const r of n){const o=new Set().add(e);this.relations.set(r,o)}}replaceRelationsSafely(e,n){const r=this.relations.get(e);let o=this.isAType?.(e)?e:void 0,l=o===void 0?e:void 0;if(r)for(const c of r){o??=c,l??=c;const d=this.relations.get(c);d&&(d.size===1?this.relations.delete(c):d.delete(e),this.contents.delete(this.makeContentKey(o,l)))}this.relations.set(e,new Set(n));for(const c of n){let d=this.relations.get(c);d?d.add(e):(d=new Set().add(e),this.relations.set(c,d))}}getContentInternal(e){return this.contents.get(e)}setContent(e,n){this.contents.set(e,n)}deleteContent(e){this.contents.delete(e)}constructor(e,n){if(this.a=e.between[0],this.b=e.between[1],this.cardinality=e.cardinality,this.isAType=n?.isAType??null,this.isBType=n?.isBType??null,this.isContent=n?.isContent??null,n?.makeContentKey&&(this.makeContentKey=n.makeContentKey),!n?.externalStore){const r=n?.source;r===void 0&&(this.relations=new Map(e.relations?.map(([o,l])=>[o,new Set(l)])),this.contents=new Map(e.contents)),r&&(this.relations=new uM(r.relations),this.contents=new Hn(r.contents))}if(n?.externalStore){const r=n.externalStore;this.has=(o,l)=>r.has(o,l),this.addRelation=(o,l)=>{r.addRelation(o,l)},this.deleteRelation=(o,l)=>{r.deleteRelation(o,l)},this.replaceRelationsSafely=(o,l)=>{r.replaceRelationsSafely(o,l)},this.replaceRelationsUnsafely=(o,l)=>{r.replaceRelationsUnsafely(o,l)},this.getRelatedKeys=(o=>r.getRelatedKeys(o)),r.getContent&&(this.getContentInternal=o=>r.getContent(o),this.setContent=(o,l)=>{r.setContent(o,l)},this.deleteContent=o=>{r.deleteContent(o)});for(const[o,l]of e.relations??[]){let c=this.isAType?.(o)?o:void 0,d=c===void 0?o:void 0;for(const h of l)c??=h,d??=h,this.addRelation(c,d)}for(const[o,l]of e.contents??[])this.setContent(o,l)}n?.warn&&(this.warn=n.warn)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([e,n])=>[e,[...n]]),contents:[...this.contents.entries()]}}set(...e){let n,r,o;switch(e.length){case 1:{const l=e[0];n=l[this.a],r=l[this.b],o=void 0;break}case 2:{const l=e[0];typeof l=="string"?[n,r]=e:(n=l[this.a],r=l[this.b],o=e[1]);break}default:n=e[0],r=e[1],o=e[2];break}switch(this.cardinality){case"1:1":{const l=this.getRelatedKey(n);l&&l!==r&&this.delete(n,l)}case"1:n":{const l=this.getRelatedKey(r);l&&l!==n&&this.delete(l,r)}break}if(o){const l=this.makeContentKey(n,r);this.setContent(l,o)}return this.addRelation(n,r),this}delete(e,n){n=typeof n=="string"?n:e[this.b];const r=typeof e=="string"?e:e[this.a];if(r===void 0&&typeof n=="string"){const o=this.getRelatedKeys(n);if(o)for(const l of o)this.delete(l,n)}else if(typeof r=="string"&&n===void 0){const o=this.getRelatedKeys(r);if(o)for(const l of o)this.delete(r,l)}else if(typeof r=="string"&&typeof n=="string"){this.deleteRelation(r,n);const o=this.makeContentKey(r,n);this.deleteContent(o)}return this}getRelatedKey(e){const n=this.getRelatedKeys(e);if(n){n.size>1&&this.warn?.(`${n.size} related keys were found for key "${e}": (${[...n].map(o=>`"${o}"`).join(", ")}). Only one related key was expected.`);let r;for(const o of n){r=o;break}return r}}replaceRelations(e,n,r){const o=!Array.isArray(n),l=o?Object.keys(n):n;if(r?.reckless?this.replaceRelationsUnsafely(e,l):this.replaceRelationsSafely(e,l),o)for(const c of l){const d=this.makeContentKey(e,c),h=n[c];this.setContent(d,h)}return this}getContent(e,n){const r=this.makeContentKey(e,n);return this.getContentInternal(r)}getRelationEntries(e){const n=e[this.a],r=e[this.b];if(n!==void 0&&r===void 0){const o=this.getRelatedKeys(n);if(o)return[...o].map(l=>[l,this.getContent(n,l)])}if(n===void 0&&r!==void 0){const o=this.getRelatedKeys(r);if(o)return[...o].map(l=>[l,this.getContent(l,r)])}return[]}has(e,n){return n?this.getRelatedKeys(e)?.has(n)??!1:this.relations.has(e)}overlay(){const e={source:this,makeContentKey:this.makeContentKey};return this.isAType&&(e.isAType=this.isAType),this.isBType&&(e.isBType=this.isBType),this.isContent&&(e.isContent=this.isContent),this.warn&&(e.warn=this.warn),new A1({between:[this.a,this.b],cardinality:this.cardinality},e)}incorporate(e){const{relations:n,contents:r}=e;for(const[o,l]of n)if(l instanceof T1){const{source:c}=l;for(const d of l.iterateOwn())c.add(d)}else this.relations.set(o,l);for(const o of n.deleted)this.relations.delete(o);for(const[o,l]of r)this.contents.set(o,l);for(const o of r.deleted)this.contents.delete(o)}};function cM(t){return t.startsWith("🔍 ")}const fM=t=>{t.logger.info("🪂","transaction",t.transactionMeta.update.token.key,"Aborting transaction"),t.parent.child=null};function Im(t,e,n){return(...r)=>at(t,e).run(r,n)}function dM(t,e,n){const{token:r,update:{newValue:o,oldValue:l}}=e;jt(t,r,n==="newValue"?o:l)}function hM(t){const{stack:e}=t;return e?`
10
- `+e.split(`
11
- `)?.slice(1)?.join(`
12
- `):""}function E1(t,e,n,r="any"){const o=e,l=$t(n),c=[],d=Oe(t);if(Array.isArray(o))for(const y of o){const g=$t(y);d.molecules.get(g)?t.moleculeGraph.set(g,l,{source:g}):c.push(g)}else{const y=$t(o);d.molecules.get(y)?t.moleculeGraph.set(y,l,{source:y}):c.push(y)}const h=new Ye;c.length===0&&d.molecules.set(l,{key:n,stringKey:l,dependsOn:r,subject:h});const p={type:"molecule_creation",key:n,provenance:o,timestamp:Date.now()};bn(d)&&d.transactionMeta.phase==="building"?d.transactionMeta.update.subEvents.push(p):d.on.moleculeCreation.next(p);for(const y of c){const g=t.disposalTraces.buffer.find(v=>v?.key===y);t.logger.error("❌","key",n,"allocation failed:",`Could not allocate to ${y} in store "${t.config.name}".`,g?`
13
- ${y} was most recently disposed
14
- ${g.trace}`:`No previous disposal trace for ${y} was found.`)}return n}function Hm(t,e){const n=$t(e),r=t.molecules.get(n);if(!r){const v=t.disposalTraces.buffer.find(S=>S?.key===n);t.logger.error("❌","key",e,"deallocation failed:",`Could not find allocation for ${n} in store "${t.config.name}".`,v?`
15
- This state was most recently deallocated
16
- ${v.trace}`:`No previous disposal trace for ${n} was found.`);return}r.subject.next();const o=t.keyRefsInJoins.getRelatedKeys(n);if(o)for(const v of o){const S=t.joins.get(v);S&&S.relations.delete(e)}else{const v=Wk(e);if(v){const[,S,x]=v,T=t.keyRefsInJoins.getRelatedKey(dc(S,x));if(T){const C=t.joins.get(T);C&&C.relations.delete(S,x)}}}t.keyRefsInJoins.delete(n);const l=[],c=[],d=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:n});if(d)for(const[v,{source:S}]of d)if(S===n){const x=Nr(v);Hm(t,x)}else l.push(S);const h=t.moleculeData.getRelatedKeys(r.stringKey);if(h)for(const v of h){const S=t.families.get(v),x=vn(t,S,e);c.push([S.key,x]),Wc(t,S,e)}const p={type:"molecule_disposal",key:r.key,values:c,provenance:l,timestamp:Date.now()};t.molecules.delete(n);const y=bn(t)&&t.transactionMeta.phase==="building";y&&t.transactionMeta.update.subEvents.push(p),t.moleculeGraph.delete(r.stringKey),t.keyRefsInJoins.delete(r.stringKey),t.moleculeData.delete(r.stringKey),y||t.on.moleculeDisposal.next(p),t.molecules.delete(r.stringKey);const g=hM(new Error);t.disposalTraces.add({key:n,trace:g})}function hS(t,e,n,r){const o=$t(n),l=Oe(t),c=l.molecules.get(o);if(!c){const g=t.disposalTraces.buffer.find(v=>v?.key===o);return t.logger.error("❌","key",o,"claim failed:",`Could not allocate to ${o} in store "${t.config.name}".`,g?`
17
- ${o} was most recently disposed
18
- ${g.trace}`:`No previous disposal trace for ${o} was found.`),n}const d=$t(e),h=l.molecules.get(d);if(!h){const g=t.disposalTraces.buffer.find(v=>v?.key===d);return t.logger.error("❌","key",n,"claim failed:",`Could not allocate to ${d} in store "${t.config.name}".`,g?`
19
- ${d} was most recently disposed
20
- ${g.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:g}])=>g!==o).map(([g])=>Nr(g));r&&l.moleculeGraph.delete(o),l.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,exclusive:!!r,from:p,to:[h.key],timestamp:Date.now()};return bn(l)&&l.transactionMeta.phase==="building"&&l.transactionMeta.update.subEvents.push(y),n}function pM(t,e,n){switch(n){case"newValue":R1(t,e);break;case"oldValue":Wc(t,e.token);break}}function mM(t,e,n){switch(n){case"newValue":Wc(t,e.token);break;case"oldValue":R1(t,e),e.subType==="atom"&&t.valueMap.set(e.token.key,e.value);break}}function R1(t,e){const{token:n}=e;e.subType==="writable"&&e.value?jt(t,n,e.value):vn(t,n)}function yM(t,e,n){switch(n){case"newValue":E1(t,e.provenance,e.key);break;case"oldValue":Hm(t,e.key);break}}function gM(t,e,n){switch(n){case"newValue":Hm(t,e.key);break;case"oldValue":{const r=e.provenance.map(Nr);E1(t,r,e.key);for(const[o,l]of e.values){const c=t.families.get(o);if(c){vn(t,c,e.key);const d=`${o}(${$t(e.key)})`;t.valueMap.set(d,l)}}}break}}function bM(t,e,n){switch(n){case"newValue":for(const r of e.to)hS(t,r,e.key,e.exclusive?"exclusive":void 0);break;case"oldValue":{let r="exclusive";for(const o of e.from)hS(t,o,e.key,r),r=void 0}break}}function ho(t,e,n){const r=n==="newValue"?e.subEvents:[...e.subEvents].reverse();for(const o of r)switch(o.type){case"atom_update":dM(t,o,n);break;case"state_creation":pM(t,o,n);break;case"state_disposal":mM(t,o,n);break;case"molecule_creation":yM(t,o,n);break;case"molecule_disposal":gM(t,o,n);break;case"molecule_transfer":bM(t,o,n);break;case"transaction_outcome":ho(t,o,n);break}}function ol(t){return"epoch"in t.transactionMeta}function bn(t){return"phase"in t.transactionMeta}function O1(t,e){return t.transactionMeta.actionContinuities.getRelatedKey(e)}function _1(t,e){return t.transactionMeta.epoch.get(e)}function vM(t,e){const n=O1(t,e);if(n!==void 0)return _1(t,n)}function Fm(t,e,n){t.transactionMeta.epoch.set(e,n)}function SM(t,e,n){const r=O1(t,e);r!==void 0&&t.transactionMeta.epoch.set(r,n)}function wM(t,e){const n=Oe(t),{parent:r}=n;n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,r.child=null,r.on.transactionApplying.next(n.transactionMeta);const{subEvents:o}=n.transactionMeta.update;t.logger.info("🛄","transaction",n.transactionMeta.update.token.key,`applying ${o.length} subEvents:`,o),ho(r,n.transactionMeta.update,"newValue"),ol(r)?(SM(r,n.transactionMeta.update.token.key,n.transactionMeta.update.epoch),at(t,{key:n.transactionMeta.update.token.key,type:"transaction"})?.subject.next(n.transactionMeta.update),t.logger.info("🛬","transaction",n.transactionMeta.update.token.key,"applied")):bn(r)&&r.transactionMeta.update.subEvents.push(n.transactionMeta.update),r.on.transactionApplying.next(null)}function k1(t,e,n){const{epoch:r,actionContinuities:o}=t.transactionMeta;o.set(e,n),r.has(e)||r.set(e,-1)}function xM(t){return{store:t}}const TM=(t,e,n,r)=>{const o=Oe(t),l={parent:o,child:null,on:o.on,loggers:o.loggers,logger:o.logger,config:o.config,atoms:new Hn(o.atoms),atomsThatAreDefault:new Set(o.atomsThatAreDefault),families:new Hn(o.families),joins:new Hn(o.joins),operation:{open:!1},readonlySelectors:new Hn(o.readonlySelectors),timelines:new Hn(o.timelines),timelineTopics:o.timelineTopics.overlay(),trackers:new Map,transactions:new Hn(o.transactions),selectorAtoms:o.selectorAtoms.overlay(),selectorGraph:o.selectorGraph.overlay(),writableSelectors:new Hn(o.writableSelectors),valueMap:new Hn(o.valueMap),defaults:o.defaults,disposalTraces:t.disposalTraces.copy(),molecules:new Hn(o.molecules),moleculeGraph:o.moleculeGraph.overlay(),moleculeData:o.moleculeData.overlay(),keyRefsInJoins:o.keyRefsInJoins.overlay(),miscResources:new Hn(o.miscResources)},c=vM(t,e.key),d={phase:"building",update:{type:"transaction_outcome",token:e,id:r,epoch:c===void 0?NaN:c+1,timestamp:Date.now(),subEvents:[],params:n,output:void 0},toolkit:{get:((...p)=>vn(h,...p)),set:((...p)=>{jt(h,...p)}),reset:((...p)=>{Zm(h,...p)}),run:(p,y=Qc())=>Im(h,p,y),find:((...p)=>$r(t,...p)),json:p=>bs(h,p),dispose:((...p)=>{Wc(h,...p)}),env:()=>xM(h)}},h=Object.assign(l,{transactionMeta:d});return o.child=h,t.logger.info("🛫","transaction",e.key,"building with params:",n),h};function M1(t,e){const{key:n}=e,r=t.transactions.has(n),o={key:n,type:"transaction",run:(c,d)=>{const h=_r(o),p=TM(t,h,c,d);try{const{toolkit:y}=p.transactionMeta,g=e.do(y,...c);return wM(p,g),g}catch(y){throw fM(p),t.logger.warn("💥","transaction",n,"caught:",y),y}},install:c=>M1(c,e),subject:new Ye};Oe(t).transactions.set(n,o);const l=_r(o);return r||t.on.transactionCreation.next(l),l}var AM=class{parent=null;child=null;valueMap=new Map;defaults=new Map;atoms=new Map;writableSelectors=new Map;readonlySelectors=new Map;atomsThatAreDefault=new Set;selectorAtoms=new ji({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new ji({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});trackers=new Map;families=new Map;joins=new Map;transactions=new Map;transactionMeta={epoch:new Map,actionContinuities:new ji({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new ji({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new lM(100);molecules=new Map;moleculeGraph=new ji({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});moleculeData=new ji({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});keyRefsInJoins=new ji({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});miscResources=new Map;on={atomCreation:new Ye,atomDisposal:new Ye,selectorCreation:new Ye,selectorDisposal:new Ye,timelineCreation:new Ye,transactionCreation:new Ye,transactionApplying:new aM(null),operationClose:new Ye,moleculeCreation:new Ye,moleculeDisposal:new Ye};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral"};loggers=[new Qk("warn",(t,e,n)=>!cM(n))];logger={error:(...t)=>{for(const e of this.loggers)e.error(...t)},info:(...t)=>{for(const e of this.loggers)e.info(...t)},warn:(...t)=>{for(const e of this.loggers)e.warn(...t)}};constructor(t,e=null){if(this.config={...e?.config,...t},e!==null){this.operation={...e?.operation},ol(e)&&(this.transactionMeta={epoch:new Map(e?.transactionMeta.epoch),actionContinuities:new ji(e?.transactionMeta.actionContinuities.toJSON())});for(const[,r]of e.families)r.internalRoles?.includes("mutable")||r.internalRoles?.includes("join")||r.install(this);const n=new Set;for(const[,r]of e.atoms)if(!n.has(r.key)&&(r.install(this),r.type==="mutable_atom")){const o=bs(e,r),l=P1(r);n.add(o.key),n.add(l.key)}for(const[,r]of e.readonlySelectors)r.install(this);for(const[,r]of e.writableSelectors)n.has(r.key)||r.install(this);for(const[,r]of e.transactions)r.install(this);for(const[,r]of e.timelines)r.install(this)}}};const Ut={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??=new AM({name:"IMPLICIT_STORE",lifespan:"ephemeral"}),globalThis.ATOM_IO_IMPLICIT_STORE}};var EM=class extends Error{constructor(t,e){super(`${Dr[t.type]} ${$t(t.key)} not found in store "${e.config.name}".`)}};function at(t,e){let n,r=t;for(;r!==null;){switch(e.type){case"atom":case"mutable_atom":n=r.atoms.get(e.key);break;case"writable_pure_selector":case"writable_held_selector":n=r.writableSelectors.get(e.key);break;case"readonly_pure_selector":case"readonly_held_selector":n=r.readonlySelectors.get(e.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=r.families.get(e.key);break;case"timeline":n=r.timelines.get(e.key);break;case"transaction":n=r.transactions.get(e.key);break}if(n)return n;r=r.child}throw new EM(e,t)}function C1(t,e,n,r){const o=t.disposalTraces.buffer.find(l=>l?.key===$t(r));switch(t.logger.error("❌",e.type,e.key,"gets a fallback value because key",r,"is not allocated",o?`This key was previously disposed:
21
- ${o.trace}`:"(no previous disposal trace found)"),n.type){case"mutable_atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const l=new n.class;return t.defaults.set(n.key,l),l.READONLY_VIEW}case"atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const l=n.default,c=l(r);return t.defaults.set(n.key,c),c}case"readonly_pure_selector_family":case"writable_pure_selector_family":case"readonly_held_selector_family":case"writable_held_selector_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const l=n.default(r);return t.defaults.set(n.key,l),l}}}function Oc(t,e){const{type:n,key:r,catch:o}=e;switch(n){case"readonly_pure_selector":case"writable_pure_selector":{let l;t.logger.info("🧮",n,r,"computing value");try{if(l=e.getFrom(t),l instanceof Promise)return l.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),o){for(const d of o)if(c instanceof d)return c}throw c})}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),o){for(const d of o)if(c instanceof d)return Ln(t,e,c)}throw c}return Ln(t,e,l)}case"atom":{let l;if(_o(e.default))try{l=e.default(),l instanceof Promise&&(l=l.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),o){for(const d of o)if(c instanceof d)return c}throw c}))}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),o){for(const d of o)if(c instanceof d)return l=Ln(t,e,c),t.logger.info("✨",e.type,r,"computed default",l),l}throw c}else l=e.default,t.logger.info("✨",e.type,r,"using static default",l);return Ln(t,e,l)}}}function gs(t,e,n){if(t.valueMap.has(e.key))return UM(t,e,n);t.logger.info("❔",e.type,e.key,"value not found in cache");const{key:r}=e;switch(e.type){case"readonly_held_selector":case"writable_held_selector":return t.logger.info("🧮",e.type,r,"computing value"),e.getFrom(t);case"writable_pure_selector":case"readonly_pure_selector":case"atom":return Oc(t,e);case"mutable_atom":{const o=new e.class;return t.logger.info("✨",e.type,r,"created new instance",o),Ln(t,e,o)}}}function Gm(t,e){return at(t,{key:e.family.key,type:`${e.type}_family`})}const pS={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"},al=Symbol("MUST_CREATE"),RM=Symbol("DO_NOT_CREATE");function ll(t,e,n,r){const o=$t(r),l=e.molecules.get(o);if(!l&&e.config.lifespan==="immortal"){const{type:d,key:h}=n;e.logger.warn("💣","key",o,"was used to mint a counterfeit token for",d,`"${h}"`);const p=`${h}(${o})`,y=pS[d];return{counterfeit:!0,key:p,type:y,family:{key:h,subKey:o}}}let c;if(t===al)e.logger.info("👪",n.type,n.key,"adds member",typeof r=="string"?`\`${r}\``:r),c=n.create(r),l&&e.moleculeData.set(o,n.key);else{const{type:d,key:h}=n,p=`${h}(${o})`,y=pS[d];return{key:p,type:y,family:{key:h,subKey:o}}}return c}function Ym(t,...e){let n,r,o,l,c;if(e.length===1){if(c=e[0],"family"in c){const h=Gm(t,c);if(o=at(t,h),l=Nr(c.family.subKey),n=ul(t,h,l),"counterfeit"in c)return{token:c,family:o,subKey:l,isNew:!1};n?c=n:(r=ll(al,t,h,l),c=r)}}else o=at(t,e[0]),l=e[1],n=ul(t,o,l),n?c=n:(r=ll(al,t,o,l),c=r);const d="counterfeit"in c;if(r&&d===!1&&o){let h;switch(c.type){case"readonly_pure_selector":case"readonly_held_selector":h="readable";break;case"atom":case"mutable_atom":case"writable_pure_selector":case"writable_held_selector":h="writable";break}const p={type:"state_creation",subType:h,token:c,timestamp:Date.now()};o.subject.next(p);const y=Oe(t);if(c.family)if(ol(y))switch(c.type){case"atom":case"mutable_atom":t.on.atomCreation.next(c);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":t.on.selectorCreation.next(c);break}else bn(y)&&y.on.transactionApplying.state===null&&y.transactionMeta.update.subEvents.push(p)}return{token:c,family:o,subKey:l,isNew:!!r}}function vn(t,...e){const{token:n,family:r,subKey:o}=Ym(t,...e);if("counterfeit"in n&&r&&o)return C1(t,n,r,o);const l=at(t,n);return gs(t,l)}function ul(t,e,n){const r=$t(n),o=`${e.key}(${r})`,l=Oe(t);let c;switch(e.type){case"atom_family":case"mutable_atom_family":c=l.atoms.get(o);break;case"writable_held_selector_family":case"writable_pure_selector_family":c=l.writableSelectors.get(o);break;case"readonly_held_selector_family":case"readonly_pure_selector_family":c=l.readonlySelectors.get(o);break}return c&&_r(c)}function $r(t,e,n){const r=at(t,e),o=ul(t,e,n);return o||ll(RM,t,r,n)}function _c(t,e,n){const r=e.key,o="readonly_pure_selector_family",l={key:r,type:o},c=t.families.get(r);c&&t.logger.error("❗",o,r,`Overwriting an existing ${Dr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const d=new Ye,p={...l,create:y=>{const g=$t(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Oe(t),T={key:S,get:e.get(y)};return e.catch&&(T.catch=e.catch),ey(x,T,v)},internalRoles:n,subject:d,install:y=>_c(y,e),default:y=>e.get(y)({get:((...g)=>vn(t,...g)),find:((...g)=>$r(t,...g)),json:g=>bs(t,g)})};return t.families.set(r,p),l}function Xm(t,e,n){const r={key:e.key,type:"atom_family"},o=t.families.get(e.key);o&&t.logger.error("❗","atom_family",e.key,`Overwriting an existing ${Dr[o.type]} "${o.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const l=new Ye,d={...r,create:h=>{const p=$t(h),y={key:e.key,subKey:p},g=`${e.key}(${p})`,v=Oe(t),S=e.default,x={key:g,default:_o(S)?()=>S(h):S};return e.effects&&(x.effects=e.effects(h)),e.catch&&(x.catch=e.catch),nf(v,x,y)},default:e.default,subject:l,install:h=>Xm(h,e),internalRoles:n};return t.families.set(e.key,d),_o(e.default)===!1&&t.defaults.set(e.key,e.default),r}function D1(t,e,n){const r=e.key,o="readonly_held_selector_family",l={key:r,type:o},c=t.families.get(r);c&&t.logger.error("❗",o,r,`Overwriting an existing ${Dr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const d=new Ye,p={...l,create:y=>{const g=$t(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Oe(t);return Wm(x,{key:S,const:e.const(y),get:e.get(y)},v)},internalRoles:n,subject:d,install:y=>D1(y,e),default:e.const};return t.families.set(r,p),l}function N1(t,e,n){const r=e.key,o="writable_held_selector_family",l={key:r,type:o},c=t.families.get(r);c&&t.logger.error("❗",o,r,`Overwriting an existing ${Dr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const d=new Ye,p={...l,create:y=>{const g=$t(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Oe(t);return ty(x,{key:S,const:e.const(y),get:e.get(y),set:e.set(y)},v)},internalRoles:n,subject:d,install:y=>N1(y,e),default:e.const};return t.families.set(r,p),l}function Jm(t,e,n){const r=e.key,o="writable_pure_selector_family",l={key:r,type:o},c=t.families.get(r);c&&t.logger.error("❗",o,r,`Overwriting an existing ${Dr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const d=new Ye,p={...l,create:y=>{const g=$t(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Oe(t),T={key:S,get:e.get(y),set:e.set(y)};return e.catch&&(T.catch=e.catch),ny(x,T,v)},internalRoles:n,subject:d,install:y=>Jm(y,e),default:y=>e.get(y)({get:((...g)=>vn(t,...g)),find:((...g)=>$r(t,...g)),json:g=>bs(t,g)})};return t.families.set(r,p),l}function OM(t,e){const n="set"in e,r="const"in e;return r&&n?N1(t,e,void 0):r?D1(t,e,void 0):n?Jm(t,e):_c(t,e)}function Wc(t,...e){let n;if(e.length===1)n=e[0];else{const r=e[0],o=e[1];n=$r(t,r,o)}try{at(t,n)}catch{t.logger.error("❌",n.type,n.key,`could not be disposed because it was not found in the store "${t.config.name}".`);return}switch(n.type){case"atom":case"mutable_atom":ay(t,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":jM(t,n);break}}function $1(t,e){if(t.operation.open){const n=performance.now();return t.logger.info("🚫",e.type,e.key,`deferring setState at T-${n} until setState for "${t.operation.token.key}" is done`),n}return t.operation={open:!0,done:new Set,prev:new Map,timestamp:Date.now(),token:e,subEvents:[]},t.logger.info("⭕",e.type,e.key,`operation start in store "${t.config.name}"${bn(t)?` ${t.transactionMeta.phase} "${t.transactionMeta.update.token.key}"`:""}`),t}function j1(t){t.operation.open&&t.logger.info("🔴",t.operation.token.type,t.operation.token.key,`operation done in store "${t.config.name}"`),t.operation={open:!1},t.on.operationClose.next(t.operation)}const B1=(t,e)=>t.operation.open?t.operation.done.has(e):(t.logger.error("🐞","unknown",e,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),ef=(t,e)=>{if(!t.operation.open){t.logger.error("🐞","unknown",e,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}t.operation.done.add(e)};function jp(t,e,{oldValue:n,newValue:r},o,l){const c=_r(e);if(o&&l){e.subject.next({newValue:r});const g={checkpoint:!0,type:"state_creation",subType:"writable",token:c,timestamp:Date.now(),value:r};t.operation.subEvents.push(g),l.subject.next(g);const v=Oe(t);if(c.family)if(ol(v))switch(c.type){case"atom":case"mutable_atom":t.on.atomCreation.next(c);break;case"writable_pure_selector":case"writable_held_selector":t.on.selectorCreation.next(c);break}else bn(v)&&v.on.transactionApplying.state===null&&v.transactionMeta.update.subEvents.push(g);return}const{key:d,subject:h,type:p}=e,y={oldValue:qh(n)?n.READONLY_VIEW:n,newValue:qh(r)?r.READONLY_VIEW:r};if(ol(t)){switch(p){case"mutable_atom":t.logger.info("📢",p,d,"is now (",r,") subscribers:",h.subscribers.keys());break;case"atom":case"writable_pure_selector":case"writable_held_selector":t.logger.info("📢",p,d,"went (",n,"->",r,") subscribers:",h.subscribers.keys())}h.next(y)}if(bn(t)&&(p==="mutable_atom"||p==="atom")){if(t.on.transactionApplying.state===null){if(qh(r))return;const{timestamp:g}=t.operation,v={type:"atom_update",token:c,timestamp:g,update:y};t.transactionMeta.update.subEvents.push(v),t.logger.info("📁","atom",d,"stowed (",n,"->",r,")");return}if(oy(e,"tracker:signal")){const g=d.slice(1),v=t.atoms.get(g);gs(t,v,"mut").do(y.newValue)===null&&sy(t,v)}}}const Bp=(t,e,n)=>{const r=gs(t,e,"mut");let o=Np(n,r);return t.logger.info("⭐","atom",e.key,"setting value",o),o=Ln(t,e,o),ef(t,e.key),sy(t,e),{oldValue:r,newValue:o}};function Ph(t,e){switch(e.type){case"mutable_atom":return Bp(t,e,new e.class);case"atom":{let n;return _o(e.default)?n=Oc(t,e):n=e.default,Bp(t,e,n)}}}function _M(t,e){let n;switch(e.type){case"atom":case"mutable_atom":n=Ph(t,e);break;case"writable_held_selector":{const r=cl(t,e.key);for(const l of r.values()){const c=Ph(t,l);jp(t,e,c,!1)}const o=e.getFrom(t);n={oldValue:o,newValue:o}}break;case"writable_pure_selector":{const r=Oc(t,e),o=cl(t,e.key);for(const c of o.values()){const d=Ph(t,c);jp(t,e,d,!1)}const l=Oc(t,e);n={oldValue:r,newValue:l}}break}return n}function jt(t,...e){wl(Vp,t,...e)}const Lp=Symbol("RESET");function Zm(t,...e){const n=[...e,Lp];jt(t,...n)}function kM(t,e,n){let r,o,l;const{type:c,key:d}=e;switch(e.type){case"writable_pure_selector":r=gs(t,e,"mut"),o=Np(n,r),o=Ln(t,e,o);break;case"writable_held_selector":l=e.const,Np(n,l),r=l,o=l}return t.logger.info("⭐",c,d,"setting to",o),ef(t,d),e.setSelf(o),{oldValue:r,newValue:o}}const MM=(t,e,n)=>{let r;switch(e.type){case"atom":case"mutable_atom":r=Bp(t,e,n);break;case"writable_pure_selector":case"writable_held_selector":r=kM(t,e,n);break}return r},Vp=Symbol("OWN_OP"),Qm=Symbol("JOIN_OP");function wl(t,e,...n){let r,o,l,c,d,h;n.length===2?(l=n[0],h=n[1],"family"in l&&(c=Gm(e,l),d=Nr(l.family.subKey),r=ul(e,c,d),r?l=r:l=o=ll(al,e,c,d))):(c=at(e,n[0]),d=n[1],h=n[2],r=ul(e,c,d),r?l=r:l=o=ll(al,e,c,d));const p=h===Lp?"reset":"set";let y;if(t===Vp){const S=$1(e,l);if(typeof S=="number"){const x=S,T=e.on.operationClose.subscribe(`waiting to ${p} "${l.key}" at T-${x}`,function(){T(),e.logger.info("🟢",l.type,l.key,"resuming deferred",p,`from T-${x}`),wl(t,e,l,h)});return}y=S}else y=e;if("counterfeit"in l&&"family"in l){const S=l.family.subKey,x=e.disposalTraces.buffer.find(T=>T?.key===S);e.logger.error("❌",l.type,l.key,"could not be",p,"because key",S,"is not allocated.",x?`this key was previously disposed:${x.trace}`:"(no previous disposal trace found)");return}const g=at(y,l);let v;h===Lp?v=_M(y,g):v=MM(y,g,h),jp(y,g,v,!!o,c),t===Vp&&j1(y)}const L1=(t,e)=>Oe(t).atoms.has(e),CM=(t,e)=>Oe(t).writableSelectors.has(e),DM=(t,e)=>Oe(t).readonlySelectors.has(e),NM=(t,e)=>L1(t,e)||CM(t,e)||DM(t,e);function mS(t,e){return Oe(t).selectorGraph.getRelationEntries({downstreamSelectorKey:e}).filter(([n,{source:r}])=>r!==e).map(([n,{source:r}])=>r).filter(n=>NM(t,n))}function cl(t,e,n=new Set){const r=mS(t,e),o=new Map;for(;r.length>0;){const l=r.pop();if(!n.has(l))if(n.add(l),L1(t,l)){const c=t.atoms.get(l);o.set(c.key,c)}else r.push(...mS(t,l))}return o}function $M(t,e,n,r,o){const l=Oe(t),{type:c,key:d}=r;if(c==="atom"||c==="mutable_atom")l.selectorAtoms.set({selectorKey:n,atomKey:d}),t.logger.info("🔍",e,n,`discovers root atom "${d}"`);else{const h=cl(t,d,o);t.logger.info("🔍",e,n,`discovers root atoms: [ ${[...h.values()].map(p=>`"${p.key}"`).join(", ")} ]`);for(const{key:p}of h.values())l.selectorAtoms=l.selectorAtoms.set({selectorKey:n,atomKey:p})}o.add(d)}function tf(t,e,n,r){return{get:(...o)=>{const l=Oe(t),{token:c,family:d,subKey:h}=Ym(t,...o);let p;if("counterfeit"in c&&d&&h)p=C1(t,c,d,h);else{const y=at(t,c);p=gs(t,y)}return t.logger.info("🔌",e,n,`registers dependency ( "${c.key}" =`,p,")"),l.selectorGraph.set({upstreamSelectorKey:c.key,downstreamSelectorKey:n},{source:c.key}),$M(t,e,n,c,r),p},set:((...o)=>{const l=Oe(t);wl(Qm,l,...o)}),find:((...o)=>$r(t,...o)),json:o=>bs(t,o)}}function Wm(t,e,n){const r=Oe(t),o=new Ye,l=new Set,{key:c,const:d}=e,h="readonly_held_selector";t.logger.info("🔨",h,c,"is being created");const{get:p,find:y,json:g}=tf(r,h,c,l),S={...e,type:h,subject:o,getFrom:T=>{const C=T.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[M,{source:O}]of C)O!==c&&T.selectorGraph.delete(M,c);return T.selectorAtoms.delete(c),e.get({get:p,find:y,json:g},d),Ln(T,S,d),t.logger.info("✨",h,c,"=",d),l.clear(),d},install:T=>Wm(T,e,n)};n&&(S.family=n),r.readonlySelectors.set(c,S);const x={key:c,type:h};return n&&(x.family=n),x}function ey(t,e,n){const r=Oe(t),o=new Ye,l=new Set,c=e.key,d="readonly_pure_selector";t.logger.info("🔨",d,c,"is being created");const{get:h,find:p,json:y}=tf(r,d,c,l),v={...e,type:d,subject:o,getFrom:()=>{const x=Oe(t),T=x.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[O,{source:_}]of T)_!==c&&x.selectorGraph.delete(O,c);x.selectorAtoms.delete(c);const C=e.get({get:h,find:p,json:y}),M=Ln(x,v,C);return t.logger.info("✨",d,c,"=",M),l.clear(),M},install:x=>ey(x,e,n)};n&&(v.family=n),r.readonlySelectors.set(c,v);const S={key:c,type:d};return n&&(S.family=n),S}function ty(t,e,n){const r=Oe(t),o=new Ye,l=new Set,{key:c,const:d}=e,h="writable_held_selector";t.logger.info("🔨",h,c,"is being created");const p=tf(r,h,c,l),{find:y,get:g,json:v}=p,S={find:y,get:g,json:v},C={...e,type:h,subject:o,getFrom:O=>{const _=O.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[G,{source:z}]of _)z!==c&&O.selectorGraph.delete(G,c);return O.selectorAtoms.delete(c),e.get(S,d),Ln(O,C,d),t.logger.info("✨",h,c,"=",d),l.clear(),d},setSelf:()=>{e.set(p,d)},install:O=>ty(O,e,n)};n&&(C.family=n),r.writableSelectors.set(c,C);const M={key:c,type:h};return n&&(M.family=n),M}function ny(t,e,n){const r=Oe(t),o=new Ye,l=new Set,c=e.key,d="writable_pure_selector";t.logger.info("🔨",d,c,"is being created");const h=tf(r,d,c,l),{find:p,get:y,json:g}=h,v={find:p,get:y,json:g},T={...e,type:d,subject:o,getFrom:M=>{const O=M.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[z,{source:ee}]of O)ee!==c&&M.selectorGraph.delete(z,c);M.selectorAtoms.delete(c);const _=e.get(v),G=Ln(M,T,_);return t.logger.info("✨",d,c,"=",G),l.clear(),G},setSelf:M=>{e.set(h,M)},install:M=>ny(M,e,n)};n&&(T.family=n),r.writableSelectors.set(c,T);const C={key:c,type:d};return n&&(C.family=n),C}function V1(t,e){const n="set"in e,r="const"in e;if(r&&n){const l=ty(t,e,void 0);return t.on.selectorCreation.next(l),l}if(r){const l=Wm(t,e,void 0);return t.on.selectorCreation.next(l),l}if(n){const l=ny(t,e,void 0);return t.on.selectorCreation.next(l),l}const o=ey(t,e,void 0);return t.on.selectorCreation.next(o),o}function jM(t,e){const n=Oe(t),{key:r,type:o,family:l}=e;if(!l)t.logger.error("❌",o,r,"Standalone selectors cannot be disposed.");else{n.molecules.get(l.subKey)&&n.moleculeData.delete(l.subKey,l.key);let c;switch(e.type){case"writable_held_selector":n.writableSelectors.delete(r),c={key:l.key,type:"writable_held_selector_family"},at(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"writable_pure_selector":n.writableSelectors.delete(r),c={key:l.key,type:"writable_pure_selector_family"},at(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"readonly_held_selector":n.readonlySelectors.delete(r),c={key:l.key,type:"readonly_held_selector_family"},at(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break;case"readonly_pure_selector":n.readonlySelectors.delete(r),c={key:l.key,type:"readonly_pure_selector_family"},at(t,c).subject.next({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()});break}n.valueMap.delete(r),n.selectorAtoms.delete(r),n.selectorGraph.delete(r),n.moleculeData.delete(l.key,l.subKey),t.logger.info("🔥",e.type,r,"deleted"),bn(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.subEvents.push({type:"state_disposal",subType:"selector",token:e,timestamp:Date.now()}):t.on.selectorDisposal.next(e)}}const BM=(t,e)=>{const n=Oe(t);return n.operation.open?n.operation.prev.get(e.key):n.valueMap.get(e.key)},yS=(t,e,n)=>n.subject.subscribe(`${e.type}:${e.key}`,r=>{t.logger.info("📢",e.type,e.key,"root",n.key,"went",r.oldValue,"->",r.newValue);const o=BM(t,e),l=gs(t,e);t.logger.info("✨",e.type,e.key,"went",o,"->",l),e.subject.next({newValue:l,oldValue:o})});function ko(t,e,n,r){function o(g){if(t.operation.open){if(l?.type==="atom"&&oy(l,"tracker:signal")&&"*"+t.operation.token.key===e.key&&"inboundTracker"in r)return;const v=t.on.operationClose.subscribe(`state subscription ${n}`,()=>{v(),r(g)})}else r(g)}Ym(t,e);const l=at(t,e);t.logger.info("👀",l.type,l.key,`Adding subscription "${n}"`);const c=l.type==="writable_pure_selector"||l.type==="readonly_pure_selector",d=new Map;let h=o;if(c){gs(t,l);for(const[g,v]of cl(t,l.key))d.set(g,yS(t,l,v));h=function(v){const S=cl(t,l.key);for(const[x,T]of d)S.get(x)?S.delete(x):(T(),d.delete(x));for(const[x,T]of S)d.set(x,yS(t,l,T));o(v)}}const p=l.subject.subscribe(n,h);return()=>{t.logger.info("🙈",l.type,l.key,`Removing subscription "${n}"`),p();for(const g of d.values())g()}}const z1=(t,e,n,r)=>{const o=at(t,e);t.logger.info("👀","timeline",e.key,`Adding subscription "${n}"`);const l=o.subject.subscribe(n,r);return()=>{t.logger.info("🙈","timeline",e.key,`Removing subscription "${n}" from timeline`),l()}},U1=(t,e,n,r)=>{const o=at(t,e);t.logger.info("👀","transaction",e.key,`Adding subscription "${n}"`);const l=o.subject.subscribe(n,r);return()=>{t.logger.info("🙈","transaction",e.key,`Removing subscription "${n}"`),l()}};function LM(t,e,n,r=Qc()){switch(e.type){case"atom":case"mutable_atom":case"readonly_pure_selector":case"readonly_held_selector":case"writable_pure_selector":case"writable_held_selector":return ko(t,e,r,n);case"transaction":return U1(t,e,r,n);case"timeline":return z1(t,e,r,n)}}var iy=class{initializeSignalAtom(t,e){const n=`*${t.key}`;e.atoms.delete(n),e.valueMap.delete(n);const r=t.family?{key:`*${t.family.key}`,subKey:t.family.subKey}:void 0,o=nf(e,{key:n,default:null},r,["tracker:signal"]);if(e.parent?.valueMap.has(n)){const l=e.parent.valueMap.get(n);e.valueMap.set(n,l)}return o}unsubscribeFromInnerValue;unsubscribeFromState;captureSignalsFromCore(t,e,n){const r=t.key,o=n.config.name,l=bn(n)?n.transactionMeta.update.token.key:"main",c=`tracker-from-core:${o}:${l}:${r}`,d=h=>{wl(Qm,n,e,h)};this.unsubscribeFromInnerValue=vn(n,t).subscribe(c,d),this.unsubscribeFromState=ko(n,t,c,(function(p){p.newValue!==p.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=p.newValue.subscribe(c,d))}).bind(this))}supplySignalsToCore(t,e,n){const r=t.key,o=n.config.name,l=bn(n)?n.transactionMeta.update.token.key:"main",c=`tracker-to-core:${o}:${l}:${r}`;ko(n,e,c,Object.assign(function({newValue:h,oldValue:p}){const y=n.timelineTopics.getRelatedKey(e.key);if(y&&n.timelines.get(y)?.timeTraveling){const g=z1(n,{key:y,type:"timeline"},c,function(S){g(),jt(n,t,x=>(S==="redo"&&h?x.do(h):S==="undo"&&p&&x.undo(p),x))});return}jt(n,t,g=>(g.do(h),g))},{inboundTracker:!0}))}mutableAtomToken;latestSignalToken;[Symbol.dispose];constructor(t,e){const n=Oe(e),r=this.initializeSignalAtom(t,n);this.mutableAtomToken=t,this.latestSignalToken=r,this.captureSignalsFromCore(t,r,n),this.supplySignalsToCore(t,r,n),n.trackers.set(t.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),n.trackers.delete(t.key)}}};function ry(t,e,n){t.logger.info("🔨","atom",e.key,`creating in store "${t.config.name}"`);const r=Oe(t),{key:o}=e,l=r.atoms.get(o),c="mutable_atom";if(l&&l.type===c)return t.logger.error("❌",c,o,"Tried to create atom, but it already exists in the store."),_r(l);const d=new Ye,h={...e,type:c,install:y=>(y.logger.info("🛠️","atom",o,`installing in store "${y.config.name}"`),ry(y,e,n)),subject:d};n&&(h.family=n),r.atoms.set(h.key,h);const p=_r(h);if(new iy(p,t),n||V1(t,{key:`${o}:JSON`,get:({get:y})=>y(p).toJSON(),set:({set:y},g)=>{y(p,e.class.fromJSON(g))}}),e.effects){let y=0;const g=[];for(const v of e.effects){const S=v({resetSelf:()=>{Zm(t,p)},setSelf:x=>{jt(t,p,x)},onSet:x=>ko(t,p,`effect[${y}]`,x),token:p,store:qm(t)});S&&g.push(S),++y}h.cleanup=()=>{for(const v of g)v()}}return t.on.atomCreation.next(p),p}var VM=class{trackers=new Map;latestSignalAtoms;mutableAtoms;constructor(t,e){const n=Xm(e,{key:`*${t.key}`,default:null},["mutable","updates"]);this.latestSignalAtoms=at(e,n),this.mutableAtoms=t;const r=o=>{const{type:l,token:c}=o;if(c.family){const d=Nr(c.family.subKey);switch(l){case"state_creation":this.trackers.set(d,new iy(c,e));break;case"state_disposal":{const h=this.trackers.get(d);h&&(h[Symbol.dispose](),this.trackers.delete(d))}}}};this.mutableAtoms.subject.subscribe(`store=${e.config.name}::tracker-atom-family`,r)}};function K1(t,e,n){const r={key:e.key,type:"mutable_atom_family"},o=t.families.get(e.key);o&&t.logger.error("❗","mutable_atom_family",e.key,`Overwriting an existing ${Dr[o.type]} "${o.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const l=new Ye,d={...r,create:h=>{const p=$t(h),y={key:e.key,subKey:p},g=`${e.key}(${p})`,v=Oe(t),S={key:g,class:e.class};return e.effects&&(S.effects=e.effects(h)),ry(v,S,y)},class:e.class,subject:l,install:h=>K1(h,e),internalRoles:n};return t.families.set(e.key,d),Jm(t,{key:`${e.key}:JSON`,get:h=>({get:p})=>p(r,h).toJSON(),set:h=>({set:p},y)=>{p(r,h,e.class.fromJSON(y))}},["mutable","json"]),new VM(d,t),r}const zM=(t,e)=>{const n=Oe(e),r=`${t.key}:JSON`;return n.families.get(r)},bs=(t,e)=>{if(e.family){const n=Oe(t),r={key:`${e.family.key}:JSON`,type:"writable_pure_selector_family"},o=at(n,r),l=Nr(e.family.subKey);return $r(t,o,l)}return{type:"writable_pure_selector",key:`${e.key}:JSON`}},P1=t=>{const e={type:"atom",key:`*${t.key}`};return t.family&&(e.family={key:`*${t.family.key}`,subKey:t.family.subKey}),e};function qh(t){return typeof t=="object"&&t!==null&&"do"in t&&"undo"in t&&"subscribe"in t&&"READONLY_VIEW"in t&&"toJSON"in t}function Ln(t,e,n){const{key:r,subject:o,type:l}=e,c=t.valueMap.get(r);if(c instanceof $p&&!c.done){const d=c;return n instanceof Promise?(d.use(n),d):(t.valueMap.set(r,n),n)}if(n instanceof Promise){const d=new $p(n);return t.valueMap.set(r,d),d.then(function(p){if(t.valueMap.get(r)===d){switch($1(t,e),Ln(t,e,p),l){case"atom":sy(t,e);break;case"readonly_pure_selector":case"writable_pure_selector":I1(t,r);break}j1(t),o.next({newValue:p,oldValue:d})}}).catch(h=>{t.logger.error("💥",e.type,r,"rejected:",h)}),d}return t.logger.info("📝",e.type,e.key,"writing to cache",n),t.valueMap.set(r,n),n}function UM(t,e,n){t.logger.info("📖",e.type,e.key,"reading cached value");let r=t.valueMap.get(e.key);if(n==="mut"&&e.type==="mutable_atom"&&bn(t)){const o=e,{parent:l}=t;if(t.valueMap.hasOwn(o.key))return r;const c=l.valueMap.get(o.key);t.logger.info("📃","atom",o.key,"copying");const d=c.toJSON(),h=o.class.fromJSON(d);t.valueMap.set(o.key,h),new iy(o,l),r=h}return r}function q1(t,e){const n=t.valueMap.get(e);if(n instanceof $p){const r=t.writableSelectors.get(e)??t.readonlySelectors.get(e);r&&r.getFrom(t);return}t.operation.open&&t.operation.prev.set(e,n),t.valueMap.delete(e),t.logger.info("🗑","state",e,"evicted")}function sy(t,e){const n=Oe(t),{key:r,type:o}=e,l=n.selectorAtoms.getRelatedKeys(r);if(n.logger.info("🧹",o,r,l?`evicting ${l.size} states downstream:`:"no downstream states",l??"to evict"),l){n.operation.open&&n.logger.info("🧹",o,r,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const c of l)B1(n,c)||(q1(n,c),ef(n,c))}}function I1(t,e){const n=Oe(t),r=n.selectorGraph.getRelationEntries({upstreamSelectorKey:e}).filter(([o,{source:l}])=>l===e);for(const[o]of r)B1(n,o)||(q1(n,o),ef(n,o),I1(t,o))}function nf(t,e,n,r){const o="atom",{key:l}=e;t.logger.info("🔨",o,l,"is being created");const c=Oe(t),d=c.atoms.get(l);if(d&&d.type===o)return t.logger.error("❌","atom",l,"Tried to create atom, but it already exists in the store."),_r(d);const h=new Ye,p={...e,type:o,install:g=>(g.logger.info("🛠️",o,l,`installing in store "${g.config.name}"`),nf(g,e,n)),subject:h};n&&(p.family=n),r&&(p.internalRoles=r),c.atoms.set(l,p);const y=_r(p);if(e.effects){let g=0;const v=[];for(const S of e.effects){const x=S({resetSelf:()=>{Zm(t,y)},setSelf:T=>{jt(t,y,T)},onSet:T=>ko(t,y,`effect[${g}]`,T),token:y,store:qm(t)});x&&v.push(x),++g}p.cleanup=()=>{for(const S of v)S()}}return t.on.atomCreation.next(y),y}function oy(t,e){return"internalRoles"in t?t.internalRoles.includes(e):!1}function ay(t,e){const n=Oe(t),{key:r,family:o}=e,l=at(n,e);if(!o)t.logger.error("❌","atom",r,"Standalone atoms cannot be disposed.");else{l.cleanup?.();const c=t.valueMap.get(l.key),d=Gm(t,e),h=at(t,d).subject,p={type:"state_disposal",subType:"atom",token:e,value:c,timestamp:Date.now()};h.next(p);const y=bn(n);if(n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),n.moleculeData.delete(o.key,o.subKey),t.timelineTopics.delete(r),e.type==="mutable_atom"){const g=P1(e);ay(t,g),t.trackers.delete(r)}if(t.logger.info("🔥","atom",r,"deleted"),y&&n.transactionMeta.phase==="building"){const g=n.transactionMeta.update.subEvents.at(-1),v=g?.type==="molecule_disposal"&&g.values.some(([x])=>x===l.family?.key),S=oy(l,"tracker:signal");!v&&!S&&n.transactionMeta.update.subEvents.push(p)}else t.on.atomDisposal.next(e)}}function ns(t){return t[0].toUpperCase()+t.slice(1)}var H1=class{toolkit;options;relations;states;relatedKeysAtoms;transact(t,e){const n=this.toolkit;this.toolkit=t,e(this),this.toolkit=n}store;[Symbol.dispose](){}constructor(t,e=Ut.STORE){this.store=e,this.options=t,this.store.miscResources.set(`join:${t.key}`,this),this.toolkit={get:((...y)=>vn(e,...y)),set:((...y)=>{jt(e,...y)}),find:((...y)=>$r(e,...y)),json:y=>bs(e,y)};const n=t.between[0],r=t.between[1],o=K1(e,{key:`${t.key}/relatedKeys`,class:Pm},["join","relations"]);this.relatedKeysAtoms=o;const l=(y,g,v)=>{const{find:S,get:x,set:T}=y,C=S(o,g),M=x(C);for(const O of M)v.includes(O)||T(o,O,_=>(_.delete(g),_));T(C,O=>{O.clear();for(const _ of v){const G=S(o,_),z=x(G),ee=z.has(g);if(this.relations.cardinality==="1:n"){const te=[];for(const X of z){if(X===g)continue;let pe;wl(Qm,this.store,o,X,me=>(me.delete(_),pe=me.size,me)),pe===0&&te.push(X)}!ee&&z.size>0&&T(G,X=>(X.clear(),X));for(const X of te)e.keyRefsInJoins.delete(dc(_,X))}ee||T(G,te=>(te.add(g),te)),O.add(_)}return O})},c=(y,g,v)=>{const{set:S}=y;S(o,g,x=>{for(const T of v)x.add(T);return x});for(const x of v)S(o,x,T=>(T.add(g),T));return!0},d=new ji(t,{externalStore:{getRelatedKeys:y=>this.toolkit.get(o,y),addRelation:(y,g)=>{this.store.keyRefsInJoins.set(`"${y}"`,t.key),this.store.keyRefsInJoins.set(`"${g}"`,t.key),this.store.keyRefsInJoins.set(dc(y,g),t.key),this.toolkit.set(o,y,v=>v.add(g)),this.toolkit.set(o,g,v=>v.add(y))},deleteRelation:(y,g)=>{this.toolkit.set(o,y,S=>(S.delete(g),S)),this.toolkit.set(o,g,S=>(S.delete(y),S));const v=dc(y,g);this.store.keyRefsInJoins.delete(v)},replaceRelationsSafely:(y,g)=>{l(this.toolkit,y,g)},replaceRelationsUnsafely:(y,g)=>{c(this.toolkit,y,g)},has:(y,g)=>{const v=this.toolkit.get(o,y);return g?v.has(g):v.size>0}},isAType:t.isAType,isBType:t.isBType}),h=()=>_c(e,{key:`${t.key}/singleRelatedKey`,get:y=>({get:g})=>{const v=g(o,y);for(const S of v)return S;return null}},["join","keys"]),p=()=>_c(e,{key:`${t.key}/multipleRelatedKeys`,get:y=>({get:g})=>{const v=zM(o,e);return g(v,y)}},["join","keys"]);switch(t.cardinality){case"1:1":{const y=h(),g=`${n}KeyOf${ns(r)}`,v=`${r}KeyOf${ns(n)}`;this.relations=d,this.states={[g]:y,[v]:y};break}case"1:n":{const y=h(),g=p(),v=`${n}KeyOf${ns(r)}`,S=`${r}KeysOf${ns(n)}`,x={[v]:y,[S]:g};this.relations=d,this.states=x;break}case"n:n":{const y=p(),g=`${n}KeysOf${ns(r)}`,v=`${r}KeysOf${ns(n)}`;this.relations=d,this.states={[g]:y,[v]:y}}}}};function KM(t,e){return t.joins.set(e.key,new H1(e)),{key:e.key,type:"join",a:e.between[0],b:e.between[1],cardinality:e.cardinality}}function PM(t,e){let n=e.joins.get(t.key);if(n===void 0){const r=Ut.STORE.joins.get(t.key);if(r===void 0)throw new Error(`Join "${t.key}" not found in store "${e.config.name}"`);const o=qm(e);n=new H1(r.options,o),e.joins.set(t.key,n)}return n}function qM(t,e){return PM(t,e).relatedKeysAtoms}var Ih={exports:{}},be={};/**
22
- * @license React
23
- * react.production.js
24
- *
25
- * Copyright (c) Meta Platforms, Inc. and affiliates.
26
- *
27
- * This source code is licensed under the MIT license found in the
28
- * LICENSE file in the root directory of this source tree.
29
- */var gS;function IM(){if(gS)return be;gS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=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(A){return A===null||typeof A!="object"?null:(A=g&&A[g]||A["@@iterator"],typeof A=="function"?A:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,T={};function C(A,q,Z){this.props=A,this.context=q,this.refs=T,this.updater=Z||S}C.prototype.isReactComponent={},C.prototype.setState=function(A,q){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,q,"setState")},C.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function M(){}M.prototype=C.prototype;function O(A,q,Z){this.props=A,this.context=q,this.refs=T,this.updater=Z||S}var _=O.prototype=new M;_.constructor=O,x(_,C.prototype),_.isPureReactComponent=!0;var G=Array.isArray,z={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function te(A,q,Z,F,re,le){return Z=le.ref,{$$typeof:t,type:A,key:q,ref:Z!==void 0?Z:null,props:le}}function X(A,q){return te(A.type,q,void 0,void 0,void 0,A.props)}function pe(A){return typeof A=="object"&&A!==null&&A.$$typeof===t}function me(A){var q={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(Z){return q[Z]})}var Se=/\/+/g;function Ce(A,q){return typeof A=="object"&&A!==null&&A.key!=null?me(""+A.key):q.toString(36)}function ge(){}function J(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(ge,ge):(A.status="pending",A.then(function(q){A.status==="pending"&&(A.status="fulfilled",A.value=q)},function(q){A.status==="pending"&&(A.status="rejected",A.reason=q)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function W(A,q,Z,F,re){var le=typeof A;(le==="undefined"||le==="boolean")&&(A=null);var oe=!1;if(A===null)oe=!0;else switch(le){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(A.$$typeof){case t:case e:oe=!0;break;case y:return oe=A._init,W(oe(A._payload),q,Z,F,re)}}if(oe)return re=re(A),oe=F===""?"."+Ce(A,0):F,G(re)?(Z="",oe!=null&&(Z=oe.replace(Se,"$&/")+"/"),W(re,q,Z,"",function(Sn){return Sn})):re!=null&&(pe(re)&&(re=X(re,Z+(re.key==null||A&&A.key===re.key?"":(""+re.key).replace(Se,"$&/")+"/")+oe)),q.push(re)),1;oe=0;var nt=F===""?".":F+":";if(G(A))for(var Ve=0;Ve<A.length;Ve++)F=A[Ve],le=nt+Ce(F,Ve),oe+=W(F,q,Z,le,re);else if(Ve=v(A),typeof Ve=="function")for(A=Ve.call(A),Ve=0;!(F=A.next()).done;)F=F.value,le=nt+Ce(F,Ve++),oe+=W(F,q,Z,le,re);else if(le==="object"){if(typeof A.then=="function")return W(J(A),q,Z,F,re);throw q=String(A),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return oe}function B(A,q,Z){if(A==null)return A;var F=[],re=0;return W(A,F,"","",function(le){return q.call(Z,le,re++)}),F}function K(A){if(A._status===-1){var q=A._result;q=q(),q.then(function(Z){(A._status===0||A._status===-1)&&(A._status=1,A._result=Z)},function(Z){(A._status===0||A._status===-1)&&(A._status=2,A._result=Z)}),A._status===-1&&(A._status=0,A._result=q)}if(A._status===1)return A._result.default;throw A._result}var V=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)};function ne(){}return be.Children={map:B,forEach:function(A,q,Z){B(A,function(){q.apply(this,arguments)},Z)},count:function(A){var q=0;return B(A,function(){q++}),q},toArray:function(A){return B(A,function(q){return q})||[]},only:function(A){if(!pe(A))throw Error("React.Children.only expected to receive a single React element child.");return A}},be.Component=C,be.Fragment=n,be.Profiler=o,be.PureComponent=O,be.StrictMode=r,be.Suspense=h,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,be.__COMPILER_RUNTIME={__proto__:null,c:function(A){return z.H.useMemoCache(A)}},be.cache=function(A){return function(){return A.apply(null,arguments)}},be.cloneElement=function(A,q,Z){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var F=x({},A.props),re=A.key,le=void 0;if(q!=null)for(oe in q.ref!==void 0&&(le=void 0),q.key!==void 0&&(re=""+q.key),q)!ee.call(q,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&q.ref===void 0||(F[oe]=q[oe]);var oe=arguments.length-2;if(oe===1)F.children=Z;else if(1<oe){for(var nt=Array(oe),Ve=0;Ve<oe;Ve++)nt[Ve]=arguments[Ve+2];F.children=nt}return te(A.type,re,void 0,void 0,le,F)},be.createContext=function(A){return A={$$typeof:c,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:l,_context:A},A},be.createElement=function(A,q,Z){var F,re={},le=null;if(q!=null)for(F in q.key!==void 0&&(le=""+q.key),q)ee.call(q,F)&&F!=="key"&&F!=="__self"&&F!=="__source"&&(re[F]=q[F]);var oe=arguments.length-2;if(oe===1)re.children=Z;else if(1<oe){for(var nt=Array(oe),Ve=0;Ve<oe;Ve++)nt[Ve]=arguments[Ve+2];re.children=nt}if(A&&A.defaultProps)for(F in oe=A.defaultProps,oe)re[F]===void 0&&(re[F]=oe[F]);return te(A,le,void 0,void 0,null,re)},be.createRef=function(){return{current:null}},be.forwardRef=function(A){return{$$typeof:d,render:A}},be.isValidElement=pe,be.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:K}},be.memo=function(A,q){return{$$typeof:p,type:A,compare:q===void 0?null:q}},be.startTransition=function(A){var q=z.T,Z={};z.T=Z;try{var F=A(),re=z.S;re!==null&&re(Z,F),typeof F=="object"&&F!==null&&typeof F.then=="function"&&F.then(ne,V)}catch(le){V(le)}finally{z.T=q}},be.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},be.use=function(A){return z.H.use(A)},be.useActionState=function(A,q,Z){return z.H.useActionState(A,q,Z)},be.useCallback=function(A,q){return z.H.useCallback(A,q)},be.useContext=function(A){return z.H.useContext(A)},be.useDebugValue=function(){},be.useDeferredValue=function(A,q){return z.H.useDeferredValue(A,q)},be.useEffect=function(A,q,Z){var F=z.H;if(typeof Z=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return F.useEffect(A,q)},be.useId=function(){return z.H.useId()},be.useImperativeHandle=function(A,q,Z){return z.H.useImperativeHandle(A,q,Z)},be.useInsertionEffect=function(A,q){return z.H.useInsertionEffect(A,q)},be.useLayoutEffect=function(A,q){return z.H.useLayoutEffect(A,q)},be.useMemo=function(A,q){return z.H.useMemo(A,q)},be.useOptimistic=function(A,q){return z.H.useOptimistic(A,q)},be.useReducer=function(A,q,Z){return z.H.useReducer(A,q,Z)},be.useRef=function(A){return z.H.useRef(A)},be.useState=function(A){return z.H.useState(A)},be.useSyncExternalStore=function(A,q,Z){return z.H.useSyncExternalStore(A,q,Z)},be.useTransition=function(){return z.H.useTransition()},be.version="19.1.1",be}var bS;function ly(){return bS||(bS=1,Ih.exports=IM()),Ih.exports}var $=ly();const HM=Hk($),F1=Ik({__proto__:null,default:HM},[$]),uy=$.createContext(Ut.STORE);function G1(t,...e){let n;if(e.length===2){const r=e[0],o=e[1];n=$r(t,r,o)}else n=e[0];return n}function Yn(...t){const e=$.useContext(uy),n=G1(e,...t),r=$.useRef(null);return r.current??=o=>{jt(e,n,o)},r.current}function vt(...t){const e=$.useContext(uy),n=G1(e,...t),r=$.useId();return $.useSyncExternalStore(o=>ko(e,n,`use-o:${r}`,o),()=>vn(e,n),()=>vn(e,n))}const Y1=(t,{stringify:e,parse:n},r)=>({setSelf:o,onSet:l})=>{if(!t)return;const c=t.getItem(r);c!=null&&o(n(c)),l(({newValue:d})=>{if(d==null){t.removeItem(r);return}t.setItem(r,e(d))})};Yk({key:"mutex",default:!1});var FM=class extends Map{set(t,e){return this.has(t)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:t,value:e}),this):super.set(t,e)}},GM=class zp{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(e){this.key=e}static existing=new FM;static create(e,n){const r=new zp(e),{type:o,globals:l,actions:c,perspectives:d}=n(r),h={type:o,key:e,globals:l,actions:c,perspectives:d};return zp.existing.set(e,h),h}add(...e){switch(e[0].type){case"atom":case"mutable_atom":this.globals.push(...e);break;case"transaction":this.actions.push(...e);break;case"atom_family":case"mutable_atom_family":{const[n,r]=e;this.perspectives.push({type:"realtime_perspective",resourceAtoms:n,viewAtoms:r})}break}return this}};function YM(t){const{key:e,config:n}=t,r=GM.create(e,n),{actions:o}=r;for(const l of o)k1(Ut.STORE,e,l.key);return Fm(Ut.STORE,e,-1),r}g1({key:"usersInRoomIndex",class:Pm});g1({key:"roomIndex",class:Pm});const XM=Xk({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:t=>typeof t=="string",isBType:t=>typeof t=="string"});eM({key:"usersInMyRoomView",get:t=>({find:e})=>{const n=Jk(XM);return[e(n,t)]}});const JM=(t,e,n,r,o)=>l=>{function c(h,p){if(t.logger.info("🧑‍⚖️","continuity",e,"reconciling updates"),jt(t,hc,g=>(g.shift(),g)),h.id===p.id){const g=JSON.stringify(h.subEvents),v=JSON.stringify(p.subEvents);if(g===v){t.logger.info("✅","continuity",e,`results for ${h.id} match between client and server`),n.emit(`ack:${e}`,p.epoch);return}}else t.logger.info("❌","continuity",e,`thought update #${p.epoch} was ${h.token.key}:${h.id}, but it was actually ${p.token.key}:${p.id}`);t.logger.info("🧑‍⚖️","continuity",e,"updates do not match",h,p);const y=r.toReversed();for(const g of y)ho(t,g,"oldValue");t.logger.info("⏪","continuity",e,"undid optimistic updates:",y),ho(t,h,"oldValue"),t.logger.info("⏪","continuity",e,"undid zeroth optimistic update",h),ho(t,p,"newValue"),t.logger.info("⏩","continuity",e,"applied confirmed update",p),n.emit(`ack:${e}`,p.epoch);for(const g of r){const v={type:"transaction",key:g.token.key},{id:S,params:x}=g;Im(t,v,S)(...x)}t.logger.info("⏩","continuity",e,"reapplied subsequent optimistic updates:",r)}t.logger.info("🧑‍⚖️","continuity",e,"integrating confirmed update",{confirmedUpdate:l,confirmedUpdates:o,optimisticUpdates:r});const d=r[0];if(d)if(t.logger.info("🧑‍⚖️","continuity",e,"has optimistic updates to reconcile"),l.epoch===d.epoch){t.logger.info("🧑‍⚖️","continuity",e,`epoch of confirmed update #${l.epoch} matches zeroth optimistic update`),c(d,l);for(const h of o){const p=r[0];if(h.epoch===p?.epoch)c(p,h);else break}}else t.logger.info("🧑‍⚖️","continuity",e,`epoch of confirmed update #${l.epoch} does not match zeroth optimistic update #${d.epoch}`),o.some(h=>h.epoch===l.epoch)||(t.logger.info("👈","continuity",e,"pushing confirmed update to queue",l),jt(t,Up,h=>(h.push(l),h.sort((p,y)=>p.epoch-y.epoch),h)));else{t.logger.info("🧑‍⚖️","continuity",e,"has no optimistic updates to deal with");let h;h=_1(t,e),h===l.epoch-1?(t.logger.info("✅","continuity",e,`integrating update #${l.epoch} (${l.token.key} ${l.id})`),ho(t,l,"newValue"),n.emit(`ack:${e}`,l.epoch),Fm(t,e,l.epoch)):h!==void 0&&(t.logger.info("🧑‍⚖️","continuity",e,`received update #${l.epoch} but still waiting for update #${h+1}`,{clientEpoch:h,serverEpoch:l.epoch}),o.some(p=>p.epoch===l.epoch)?t.logger.info("👍","continuity",e,`confirmed update #${l.epoch} is already enqueued`):(t.logger.info("👈","continuity",e,`pushing confirmed update #${l.epoch} to queue`),jt(t,Up,p=>(p.push(l),p.sort((y,g)=>y.epoch-g.epoch),p))))}};function ZM(t){return e=>{for(const n of e)ay(t,n)}}function QM(t){return e=>{let n=0,r,o;for(const l of e)n%2===0?r=l:(o=l,jt(t,r,o)),n++}}const X1=lt({key:"mySocketId__INTERNAL",default:void 0});hi({key:"mySocketId",get:({get:t})=>t(X1)});lt({key:"myName",default:null,effects:[Y1(globalThis.localStorage,JSON,"myUsername")]});const hc=lt({key:"updateQueue",default:()=>[]}),Up=lt({key:"serverConfirmedUpdateQueue",default:()=>[]});function WM(t,e,n){const r=n.key,o=vn(t,hc),l=vn(t,Up),c=(g,v)=>{e.off(`continuity-init:${r}`,c);let S=0,x,T;for(const C of v)S%2===0?x=C:(T=C,"type"in x&&x.type==="mutable_atom"&&(x=bs(t,x)),jt(t,x,T)),S++;Fm(t,r,g)};e.off(`continuity-init:${r}`),e.on(`continuity-init:${r}`,c);const d=JM(t,r,e,o,l);e.off(`tx-new:${r}`),e.on(`tx-new:${r}`,d);const h=n.actions.map(g=>(k1(t,r,g.key),U1(t,g,`tx-run:${r}`,v=>{t.logger.info("🤞","continuity",r,"enqueuing optimistic update");const S=o.findIndex(x=>x.id===v.id);S===-1?(t.logger.info("🤞","continuity",r,"enqueuing new optimistic update"),jt(t,hc,x=>(x.push(v),x.sort((T,C)=>T.epoch-C.epoch),x))):(t.logger.info("🤞","continuity",r,`replacing existing optimistic update at index ${S}`),jt(t,hc,x=>(x[S]=v,x))),e.emit(`tx-run:${r}`,{id:v.id,token:g,params:v.params})}))),p=QM(t),y=ZM(t);return e.on(`reveal:${r}`,p),e.on(`conceal:${r}`,y),e.emit(`get:${r}`),()=>{e.off(`continuity-init:${r}`),e.off(`tx-new:${r}`);for(const g of h)g()}}const J1=$.createContext({socket:null,services:null}),eC=({children:t,socket:e})=>{const n=$.useRef(new Map).current,r=Yn(X1);return $.useEffect(()=>{r(e?.id),e?.on("connect",()=>{r(e.id)}),e?.on("disconnect",()=>{r(void 0)})},[e,r]),H.jsx(J1.Provider,{value:{socket:e,services:n},children:t})};function tC(t,e){if(globalThis.env?.NODE_ENV==="development"){const n=$.useRef(!1);$.useEffect(()=>{let r=n.current;if(r===!1)r=t()??!0,n.current=r;else return()=>{_o(r)&&r(),n.current=!1}},e)}else $.useEffect(t,e)}function nC(t,e){const{socket:n,services:r}=$.useContext(J1);tC(()=>{let o=r?.get(t);return o?++o.consumerCount:n&&(o={consumerCount:1,dispose:e(n)},r?.set(t,o)),()=>{o&&(--o.consumerCount,o.consumerCount===0&&(o.dispose?.(),r?.delete(t)))}},[n,t])}function iC(t){const e=$.useContext(uy);nC(`tx-sync:${t.key}`,n=>WM(e,n,t))}var Hh={exports:{}},Ha={},Fh={exports:{}},Gh={};/**
30
- * @license React
31
- * scheduler.production.js
32
- *
33
- * Copyright (c) Meta Platforms, Inc. and affiliates.
34
- *
35
- * This source code is licensed under the MIT license found in the
36
- * LICENSE file in the root directory of this source tree.
37
- */var vS;function rC(){return vS||(vS=1,(function(t){function e(B,K){var V=B.length;B.push(K);e:for(;0<V;){var ne=V-1>>>1,A=B[ne];if(0<o(A,K))B[ne]=K,B[V]=A,V=ne;else break e}}function n(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var K=B[0],V=B.pop();if(V!==K){B[0]=V;e:for(var ne=0,A=B.length,q=A>>>1;ne<q;){var Z=2*(ne+1)-1,F=B[Z],re=Z+1,le=B[re];if(0>o(F,V))re<A&&0>o(le,F)?(B[ne]=le,B[re]=V,ne=re):(B[ne]=F,B[Z]=V,ne=Z);else if(re<A&&0>o(le,V))B[ne]=le,B[re]=V,ne=re;else break e}}return K}function o(B,K){var V=B.sortIndex-K.sortIndex;return V!==0?V:B.id-K.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;t.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();t.unstable_now=function(){return c.now()-d}}var h=[],p=[],y=1,g=null,v=3,S=!1,x=!1,T=!1,C=!1,M=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function G(B){for(var K=n(p);K!==null;){if(K.callback===null)r(p);else if(K.startTime<=B)r(p),K.sortIndex=K.expirationTime,e(h,K);else break;K=n(p)}}function z(B){if(T=!1,G(B),!x)if(n(h)!==null)x=!0,ee||(ee=!0,Ce());else{var K=n(p);K!==null&&W(z,K.startTime-B)}}var ee=!1,te=-1,X=5,pe=-1;function me(){return C?!0:!(t.unstable_now()-pe<X)}function Se(){if(C=!1,ee){var B=t.unstable_now();pe=B;var K=!0;try{e:{x=!1,T&&(T=!1,O(te),te=-1),S=!0;var V=v;try{t:{for(G(B),g=n(h);g!==null&&!(g.expirationTime>B&&me());){var ne=g.callback;if(typeof ne=="function"){g.callback=null,v=g.priorityLevel;var A=ne(g.expirationTime<=B);if(B=t.unstable_now(),typeof A=="function"){g.callback=A,G(B),K=!0;break t}g===n(h)&&r(h),G(B)}else r(h);g=n(h)}if(g!==null)K=!0;else{var q=n(p);q!==null&&W(z,q.startTime-B),K=!1}}break e}finally{g=null,v=V,S=!1}K=void 0}}finally{K?Ce():ee=!1}}}var Ce;if(typeof _=="function")Ce=function(){_(Se)};else if(typeof MessageChannel<"u"){var ge=new MessageChannel,J=ge.port2;ge.port1.onmessage=Se,Ce=function(){J.postMessage(null)}}else Ce=function(){M(Se,0)};function W(B,K){te=M(function(){B(t.unstable_now())},K)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(B){B.callback=null},t.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<B?Math.floor(1e3/B):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(B){switch(v){case 1:case 2:case 3:var K=3;break;default:K=v}var V=v;v=K;try{return B()}finally{v=V}},t.unstable_requestPaint=function(){C=!0},t.unstable_runWithPriority=function(B,K){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var V=v;v=B;try{return K()}finally{v=V}},t.unstable_scheduleCallback=function(B,K,V){var ne=t.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?ne+V:ne):V=ne,B){case 1:var A=-1;break;case 2:A=250;break;case 5:A=1073741823;break;case 4:A=1e4;break;default:A=5e3}return A=V+A,B={id:y++,callback:K,priorityLevel:B,startTime:V,expirationTime:A,sortIndex:-1},V>ne?(B.sortIndex=V,e(p,B),n(h)===null&&B===n(p)&&(T?(O(te),te=-1):T=!0,W(z,V-ne))):(B.sortIndex=A,e(h,B),x||S||(x=!0,ee||(ee=!0,Ce()))),B},t.unstable_shouldYield=me,t.unstable_wrapCallback=function(B){var K=v;return function(){var V=v;v=K;try{return B.apply(this,arguments)}finally{v=V}}}})(Gh)),Gh}var SS;function sC(){return SS||(SS=1,Fh.exports=rC()),Fh.exports}var Yh={exports:{}},It={};/**
38
- * @license React
39
- * react-dom.production.js
40
- *
41
- * Copyright (c) Meta Platforms, Inc. and affiliates.
42
- *
43
- * This source code is licensed under the MIT license found in the
44
- * LICENSE file in the root directory of this source tree.
45
- */var wS;function oC(){if(wS)return It;wS=1;var t=ly();function e(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 r={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(h,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:y}}var c=t.__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 It.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,It.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(e(299));return l(h,p,null,y)},It.flushSync=function(h){var p=c.T,y=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=p,r.p=y,r.d.f()}},It.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(h,p))},It.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},It.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"?r.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:S}):y==="script"&&r.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},It.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);r.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&&r.d.M(h)},It.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);r.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})}},It.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=d(p.as,p.crossOrigin);r.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 r.d.m(h)},It.requestFormReset=function(h){r.d.r(h)},It.unstable_batchedUpdates=function(h,p){return h(p)},It.useFormState=function(h,p,y){return c.H.useFormState(h,p,y)},It.useFormStatus=function(){return c.H.useHostTransitionStatus()},It.version="19.1.1",It}var xS;function Z1(){if(xS)return Yh.exports;xS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Yh.exports=oC(),Yh.exports}/**
46
- * @license React
47
- * react-dom-client.production.js
48
- *
49
- * Copyright (c) Meta Platforms, Inc. and affiliates.
50
- *
51
- * This source code is licensed under the MIT license found in the
52
- * LICENSE file in the root directory of this source tree.
53
- */var TS;function aC(){if(TS)return Ha;TS=1;var t=sC(),e=ly(),n=Z1();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,a=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(a=s.return),i=s.return;while(i)}return s.tag===3?a:null}function c(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(l(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var a=i,u=s;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(u=f.return,u!==null){a=u;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return d(f),i;if(m===u)return d(f),s;m=m.sibling}throw Error(r(188))}if(a.return!==u.return)a=f,u=m;else{for(var b=!1,w=f.child;w;){if(w===a){b=!0,a=f,u=m;break}if(w===u){b=!0,u=f,a=m;break}w=w.sibling}if(!b){for(w=m.child;w;){if(w===a){b=!0,a=m,u=f;break}if(w===u){b=!0,u=m,a=f;break}w=w.sibling}if(!b)throw Error(r(189))}}if(a.alternate!==u)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?i:s}function p(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=p(i),s!==null)return s;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"),x=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),M=Symbol.for("react.provider"),O=Symbol.for("react.consumer"),_=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),te=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),pe=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),Se=Symbol.iterator;function Ce(i){return i===null||typeof i!="object"?null:(i=Se&&i[Se]||i["@@iterator"],typeof i=="function"?i:null)}var ge=Symbol.for("react.client.reference");function J(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 x:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case z:return"Suspense";case ee:return"SuspenseList";case pe:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case _:return(i.displayName||"Context")+".Provider";case O:return(i._context.displayName||"Context")+".Consumer";case G:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case te:return s=i.displayName||null,s!==null?s:J(i.type)||"Memo";case X:s=i._payload,i=i._init;try{return J(i(s))}catch{}}return null}var W=Array.isArray,B=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},ne=[],A=-1;function q(i){return{current:i}}function Z(i){0>A||(i.current=ne[A],ne[A]=null,A--)}function F(i,s){A++,ne[A]=i.current,i.current=s}var re=q(null),le=q(null),oe=q(null),nt=q(null);function Ve(i,s){switch(F(oe,s),F(le,i),F(re,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?B0(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=B0(s),i=L0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(re),F(re,i)}function Sn(){Z(re),Z(le),Z(oe)}function Yi(i){i.memoizedState!==null&&F(nt,i);var s=re.current,a=L0(s,i.type);s!==a&&(F(le,i),F(re,a))}function bi(i){le.current===i&&(Z(re),Z(le)),nt.current===i&&(Z(nt),za._currentValue=V)}var ve=Object.prototype.hasOwnProperty,ke=t.unstable_scheduleCallback,Te=t.unstable_cancelCallback,We=t.unstable_shouldYield,Tt=t.unstable_requestPaint,we=t.unstable_now,Kn=t.unstable_getCurrentPriorityLevel,Gt=t.unstable_ImmediatePriority,Kt=t.unstable_UserBlockingPriority,wn=t.unstable_NormalPriority,Qn=t.unstable_LowPriority,xn=t.unstable_IdlePriority,Wn=t.log,Vl=t.unstable_setDisableYieldValue,Go=null,an=null;function Xi(i){if(typeof Wn=="function"&&Vl(i),an&&typeof an.setStrictMode=="function")try{an.setStrictMode(Go,i)}catch{}}var ln=Math.clz32?Math.clz32:MO,_O=Math.log,kO=Math.LN2;function MO(i){return i>>>=0,i===0?32:31-(_O(i)/kO|0)|0}var zl=256,Ul=4194304;function Lr(i){var s=i&42;if(s!==0)return s;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 Kl(i,s,a){var u=i.pendingLanes;if(u===0)return 0;var f=0,m=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var w=u&134217727;return w!==0?(u=w&~m,u!==0?f=Lr(u):(b&=w,b!==0?f=Lr(b):a||(a=w&~i,a!==0&&(f=Lr(a))))):(w=u&~m,w!==0?f=Lr(w):b!==0?f=Lr(b):a||(a=u&~i,a!==0&&(f=Lr(a)))),f===0?0:s!==0&&s!==f&&(s&m)===0&&(m=f&-f,a=s&-s,m>=a||m===32&&(a&4194048)!==0)?s:f}function Yo(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function CO(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 vg(){var i=zl;return zl<<=1,(zl&4194048)===0&&(zl=256),i}function Sg(){var i=Ul;return Ul<<=1,(Ul&62914560)===0&&(Ul=4194304),i}function kf(i){for(var s=[],a=0;31>a;a++)s.push(i);return s}function Xo(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function DO(i,s,a,u,f,m){var b=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var w=i.entanglements,E=i.expirationTimes,N=i.hiddenUpdates;for(a=b&~a;0<a;){var U=31-ln(a),I=1<<U;w[U]=0,E[U]=-1;var j=N[U];if(j!==null)for(N[U]=null,U=0;U<j.length;U++){var L=j[U];L!==null&&(L.lane&=-536870913)}a&=~I}u!==0&&wg(i,u,0),m!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=m&~(b&~s))}function wg(i,s,a){i.pendingLanes|=s,i.suspendedLanes&=~s;var u=31-ln(s);i.entangledLanes|=s,i.entanglements[u]=i.entanglements[u]|1073741824|a&4194090}function xg(i,s){var a=i.entangledLanes|=s;for(i=i.entanglements;a;){var u=31-ln(a),f=1<<u;f&s|i[u]&s&&(i[u]|=s),a&=~f}}function Mf(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 Cf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Tg(){var i=K.p;return i!==0?i:(i=window.event,i===void 0?32:nS(i.type))}function NO(i,s){var a=K.p;try{return K.p=i,s()}finally{K.p=a}}var Ji=Math.random().toString(36).slice(2),Pt="__reactFiber$"+Ji,Qt="__reactProps$"+Ji,xs="__reactContainer$"+Ji,Df="__reactEvents$"+Ji,$O="__reactListeners$"+Ji,jO="__reactHandles$"+Ji,Ag="__reactResources$"+Ji,Jo="__reactMarker$"+Ji;function Nf(i){delete i[Pt],delete i[Qt],delete i[Df],delete i[$O],delete i[jO]}function Ts(i){var s=i[Pt];if(s)return s;for(var a=i.parentNode;a;){if(s=a[xs]||a[Pt]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(i=K0(i);i!==null;){if(a=i[Pt])return a;i=K0(i)}return s}i=a,a=i.parentNode}return null}function As(i){if(i=i[Pt]||i[xs]){var s=i.tag;if(s===5||s===6||s===13||s===26||s===27||s===3)return i}return null}function Zo(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Es(i){var s=i[Ag];return s||(s=i[Ag]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function _t(i){i[Jo]=!0}var Eg=new Set,Rg={};function Vr(i,s){Rs(i,s),Rs(i+"Capture",s)}function Rs(i,s){for(Rg[i]=s,i=0;i<s.length;i++)Eg.add(s[i])}var BO=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]*$"),Og={},_g={};function LO(i){return ve.call(_g,i)?!0:ve.call(Og,i)?!1:BO.test(i)?_g[i]=!0:(Og[i]=!0,!1)}function Pl(i,s,a){if(LO(s))if(a===null)i.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var u=s.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+a)}}function ql(i,s,a){if(a===null)i.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+a)}}function vi(i,s,a,u){if(u===null)i.removeAttribute(a);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(s,a,""+u)}}var $f,kg;function Os(i){if($f===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);$f=s&&s[1]||"",kg=-1<a.stack.indexOf(`
54
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
55
- `+$f+i+kg}var jf=!1;function Bf(i,s){if(!i||jf)return"";jf=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(s){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(L){var j=L}Reflect.construct(i,[],I)}else{try{I.call()}catch(L){j=L}i.call(I.prototype)}}else{try{throw Error()}catch(L){j=L}(I=i())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(L){if(L&&j&&typeof L.stack=="string")return[L.stack,j.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=u.DetermineComponentFrameRoot(),b=m[0],w=m[1];if(b&&w){var E=b.split(`
56
- `),N=w.split(`
57
- `);for(f=u=0;u<E.length&&!E[u].includes("DetermineComponentFrameRoot");)u++;for(;f<N.length&&!N[f].includes("DetermineComponentFrameRoot");)f++;if(u===E.length||f===N.length)for(u=E.length-1,f=N.length-1;1<=u&&0<=f&&E[u]!==N[f];)f--;for(;1<=u&&0<=f;u--,f--)if(E[u]!==N[f]){if(u!==1||f!==1)do if(u--,f--,0>f||E[u]!==N[f]){var U=`
58
- `+E[u].replace(" at new "," at ");return i.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",i.displayName)),U}while(1<=u&&0<=f);break}}}finally{jf=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?Os(a):""}function VO(i){switch(i.tag){case 26:case 27:case 5:return Os(i.type);case 16:return Os("Lazy");case 13:return Os("Suspense");case 19:return Os("SuspenseList");case 0:case 15:return Bf(i.type,!1);case 11:return Bf(i.type.render,!1);case 1:return Bf(i.type,!0);case 31:return Os("Activity");default:return""}}function Mg(i){try{var s="";do s+=VO(i),i=i.return;while(i);return s}catch(a){return`
59
- Error generating stack: `+a.message+`
60
- `+a.stack}}function Tn(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Cg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function zO(i){var s=Cg(i)?"checked":"value",a=Object.getOwnPropertyDescriptor(i.constructor.prototype,s),u=""+i[s];if(!i.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,m=a.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return f.call(this)},set:function(b){u=""+b,m.call(this,b)}}),Object.defineProperty(i,s,{enumerable:a.enumerable}),{getValue:function(){return u},setValue:function(b){u=""+b},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Il(i){i._valueTracker||(i._valueTracker=zO(i))}function Dg(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var a=s.getValue(),u="";return i&&(u=Cg(i)?i.checked?"true":"false":i.value),i=u,i!==a?(s.setValue(i),!0):!1}function Hl(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 UO=/[\n"\\]/g;function An(i){return i.replace(UO,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Lf(i,s,a,u,f,m,b,w){i.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?i.type=b:i.removeAttribute("type"),s!=null?b==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Tn(s)):i.value!==""+Tn(s)&&(i.value=""+Tn(s)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),s!=null?Vf(i,b,Tn(s)):a!=null?Vf(i,b,Tn(a)):u!=null&&i.removeAttribute("value"),f==null&&m!=null&&(i.defaultChecked=!!m),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+Tn(w):i.removeAttribute("name")}function Ng(i,s,a,u,f,m,b,w){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(i.type=m),s!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||s!=null))return;a=a!=null?""+Tn(a):"",s=s!=null?""+Tn(s):a,w||s===i.value||(i.value=s),i.defaultValue=s}u=u??f,u=typeof u!="function"&&typeof u!="symbol"&&!!u,i.checked=w?i.checked:!!u,i.defaultChecked=!!u,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b)}function Vf(i,s,a){s==="number"&&Hl(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function _s(i,s,a,u){if(i=i.options,s){s={};for(var f=0;f<a.length;f++)s["$"+a[f]]=!0;for(a=0;a<i.length;a++)f=s.hasOwnProperty("$"+i[a].value),i[a].selected!==f&&(i[a].selected=f),f&&u&&(i[a].defaultSelected=!0)}else{for(a=""+Tn(a),s=null,f=0;f<i.length;f++){if(i[f].value===a){i[f].selected=!0,u&&(i[f].defaultSelected=!0);return}s!==null||i[f].disabled||(s=i[f])}s!==null&&(s.selected=!0)}}function $g(i,s,a){if(s!=null&&(s=""+Tn(s),s!==i.value&&(i.value=s),a==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=a!=null?""+Tn(a):""}function jg(i,s,a,u){if(s==null){if(u!=null){if(a!=null)throw Error(r(92));if(W(u)){if(1<u.length)throw Error(r(93));u=u[0]}a=u}a==null&&(a=""),s=a}a=Tn(s),i.defaultValue=a,u=i.textContent,u===a&&u!==""&&u!==null&&(i.value=u)}function ks(i,s){if(s){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=s;return}}i.textContent=s}var KO=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 Bg(i,s,a){var u=s.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?u?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":u?i.setProperty(s,a):typeof a!="number"||a===0||KO.has(s)?s==="float"?i.cssFloat=a:i[s]=(""+a).trim():i[s]=a+"px"}function Lg(i,s,a){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,a!=null){for(var u in a)!a.hasOwnProperty(u)||s!=null&&s.hasOwnProperty(u)||(u.indexOf("--")===0?i.setProperty(u,""):u==="float"?i.cssFloat="":i[u]="");for(var f in s)u=s[f],s.hasOwnProperty(f)&&a[f]!==u&&Bg(i,f,u)}else for(var m in s)s.hasOwnProperty(m)&&Bg(i,m,s[m])}function zf(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 PO=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"]]),qO=/^[\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 Fl(i){return qO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var Uf=null;function Kf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ms=null,Cs=null;function Vg(i){var s=As(i);if(s&&(i=s.stateNode)){var a=i[Qt]||null;e:switch(i=s.stateNode,s.type){case"input":if(Lf(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),s=a.name,a.type==="radio"&&s!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+An(""+s)+'"][type="radio"]'),s=0;s<a.length;s++){var u=a[s];if(u!==i&&u.form===i.form){var f=u[Qt]||null;if(!f)throw Error(r(90));Lf(u,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(s=0;s<a.length;s++)u=a[s],u.form===i.form&&Dg(u)}break e;case"textarea":$g(i,a.value,a.defaultValue);break e;case"select":s=a.value,s!=null&&_s(i,!!a.multiple,s,!1)}}}var Pf=!1;function zg(i,s,a){if(Pf)return i(s,a);Pf=!0;try{var u=i(s);return u}finally{if(Pf=!1,(Ms!==null||Cs!==null)&&(Cu(),Ms&&(s=Ms,i=Cs,Cs=Ms=null,Vg(s),i)))for(s=0;s<i.length;s++)Vg(i[s])}}function Qo(i,s){var a=i.stateNode;if(a===null)return null;var u=a[Qt]||null;if(u===null)return null;a=u[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(i=i.type,u=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!u;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(r(231,s,typeof a));return a}var Si=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qf=!1;if(Si)try{var Wo={};Object.defineProperty(Wo,"passive",{get:function(){qf=!0}}),window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{qf=!1}var Zi=null,If=null,Gl=null;function Ug(){if(Gl)return Gl;var i,s=If,a=s.length,u,f="value"in Zi?Zi.value:Zi.textContent,m=f.length;for(i=0;i<a&&s[i]===f[i];i++);var b=a-i;for(u=1;u<=b&&s[a-u]===f[m-u];u++);return Gl=f.slice(i,1<u?1-u:void 0)}function Yl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function Xl(){return!0}function Kg(){return!1}function Wt(i){function s(a,u,f,m,b){this._reactName=a,this._targetInst=f,this.type=u,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(a=i[w],this[w]=a?a(m):m[w]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Xl:Kg,this.isPropagationStopped=Kg,this}return y(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Xl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Xl)},persist:function(){},isPersistent:Xl}),s}var zr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jl=Wt(zr),ea=y({},zr,{view:0,detail:0}),IO=Wt(ea),Hf,Ff,ta,Zl=y({},ea,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yf,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!==ta&&(ta&&i.type==="mousemove"?(Hf=i.screenX-ta.screenX,Ff=i.screenY-ta.screenY):Ff=Hf=0,ta=i),Hf)},movementY:function(i){return"movementY"in i?i.movementY:Ff}}),Pg=Wt(Zl),HO=y({},Zl,{dataTransfer:0}),FO=Wt(HO),GO=y({},ea,{relatedTarget:0}),Gf=Wt(GO),YO=y({},zr,{animationName:0,elapsedTime:0,pseudoElement:0}),XO=Wt(YO),JO=y({},zr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),ZO=Wt(JO),QO=y({},zr,{data:0}),qg=Wt(QO),WO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},e_={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"},t_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function n_(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=t_[i])?!!s[i]:!1}function Yf(){return n_}var i_=y({},ea,{key:function(i){if(i.key){var s=WO[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Yl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?e_[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yf,charCode:function(i){return i.type==="keypress"?Yl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Yl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),r_=Wt(i_),s_=y({},Zl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ig=Wt(s_),o_=y({},ea,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yf}),a_=Wt(o_),l_=y({},zr,{propertyName:0,elapsedTime:0,pseudoElement:0}),u_=Wt(l_),c_=y({},Zl,{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}),f_=Wt(c_),d_=y({},zr,{newState:0,oldState:0}),h_=Wt(d_),p_=[9,13,27,32],Xf=Si&&"CompositionEvent"in window,na=null;Si&&"documentMode"in document&&(na=document.documentMode);var m_=Si&&"TextEvent"in window&&!na,Hg=Si&&(!Xf||na&&8<na&&11>=na),Fg=" ",Gg=!1;function Yg(i,s){switch(i){case"keyup":return p_.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ds=!1;function y_(i,s){switch(i){case"compositionend":return Xg(s);case"keypress":return s.which!==32?null:(Gg=!0,Fg);case"textInput":return i=s.data,i===Fg&&Gg?null:i;default:return null}}function g_(i,s){if(Ds)return i==="compositionend"||!Xf&&Yg(i,s)?(i=Ug(),Gl=If=Zi=null,Ds=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return Hg&&s.locale!=="ko"?null:s.data;default:return null}}var b_={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 Jg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!b_[i.type]:s==="textarea"}function Zg(i,s,a,u){Ms?Cs?Cs.push(u):Cs=[u]:Ms=u,s=Lu(s,"onChange"),0<s.length&&(a=new Jl("onChange","change",null,a,u),i.push({event:a,listeners:s}))}var ia=null,ra=null;function v_(i){C0(i,0)}function Ql(i){var s=Zo(i);if(Dg(s))return i}function Qg(i,s){if(i==="change")return s}var Wg=!1;if(Si){var Jf;if(Si){var Zf="oninput"in document;if(!Zf){var eb=document.createElement("div");eb.setAttribute("oninput","return;"),Zf=typeof eb.oninput=="function"}Jf=Zf}else Jf=!1;Wg=Jf&&(!document.documentMode||9<document.documentMode)}function tb(){ia&&(ia.detachEvent("onpropertychange",nb),ra=ia=null)}function nb(i){if(i.propertyName==="value"&&Ql(ra)){var s=[];Zg(s,ra,i,Kf(i)),zg(v_,s)}}function S_(i,s,a){i==="focusin"?(tb(),ia=s,ra=a,ia.attachEvent("onpropertychange",nb)):i==="focusout"&&tb()}function w_(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ql(ra)}function x_(i,s){if(i==="click")return Ql(s)}function T_(i,s){if(i==="input"||i==="change")return Ql(s)}function A_(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var un=typeof Object.is=="function"?Object.is:A_;function sa(i,s){if(un(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var a=Object.keys(i),u=Object.keys(s);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var f=a[u];if(!ve.call(s,f)||!un(i[f],s[f]))return!1}return!0}function ib(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function rb(i,s){var a=ib(i);i=0;for(var u;a;){if(a.nodeType===3){if(u=i+a.textContent.length,i<=s&&u>=s)return{node:a,offset:s-i};i=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ib(a)}}function sb(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?sb(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function ob(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Hl(i.document);s instanceof i.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)i=s.contentWindow;else break;s=Hl(i.document)}return s}function Qf(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var E_=Si&&"documentMode"in document&&11>=document.documentMode,Ns=null,Wf=null,oa=null,ed=!1;function ab(i,s,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;ed||Ns==null||Ns!==Hl(u)||(u=Ns,"selectionStart"in u&&Qf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),oa&&sa(oa,u)||(oa=u,u=Lu(Wf,"onSelect"),0<u.length&&(s=new Jl("onSelect","select",null,s,a),i.push({event:s,listeners:u}),s.target=Ns)))}function Ur(i,s){var a={};return a[i.toLowerCase()]=s.toLowerCase(),a["Webkit"+i]="webkit"+s,a["Moz"+i]="moz"+s,a}var $s={animationend:Ur("Animation","AnimationEnd"),animationiteration:Ur("Animation","AnimationIteration"),animationstart:Ur("Animation","AnimationStart"),transitionrun:Ur("Transition","TransitionRun"),transitionstart:Ur("Transition","TransitionStart"),transitioncancel:Ur("Transition","TransitionCancel"),transitionend:Ur("Transition","TransitionEnd")},td={},lb={};Si&&(lb=document.createElement("div").style,"AnimationEvent"in window||(delete $s.animationend.animation,delete $s.animationiteration.animation,delete $s.animationstart.animation),"TransitionEvent"in window||delete $s.transitionend.transition);function Kr(i){if(td[i])return td[i];if(!$s[i])return i;var s=$s[i],a;for(a in s)if(s.hasOwnProperty(a)&&a in lb)return td[i]=s[a];return i}var ub=Kr("animationend"),cb=Kr("animationiteration"),fb=Kr("animationstart"),R_=Kr("transitionrun"),O_=Kr("transitionstart"),__=Kr("transitioncancel"),db=Kr("transitionend"),hb=new Map,nd="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(" ");nd.push("scrollEnd");function Pn(i,s){hb.set(i,s),Vr(s,[i])}var pb=new WeakMap;function En(i,s){if(typeof i=="object"&&i!==null){var a=pb.get(i);return a!==void 0?a:(s={value:i,source:s,stack:Mg(s)},pb.set(i,s),s)}return{value:i,source:s,stack:Mg(s)}}var Rn=[],js=0,id=0;function Wl(){for(var i=js,s=id=js=0;s<i;){var a=Rn[s];Rn[s++]=null;var u=Rn[s];Rn[s++]=null;var f=Rn[s];Rn[s++]=null;var m=Rn[s];if(Rn[s++]=null,u!==null&&f!==null){var b=u.pending;b===null?f.next=f:(f.next=b.next,b.next=f),u.pending=f}m!==0&&mb(a,f,m)}}function eu(i,s,a,u){Rn[js++]=i,Rn[js++]=s,Rn[js++]=a,Rn[js++]=u,id|=u,i.lanes|=u,i=i.alternate,i!==null&&(i.lanes|=u)}function rd(i,s,a,u){return eu(i,s,a,u),tu(i)}function Bs(i,s){return eu(i,null,null,s),tu(i)}function mb(i,s,a){i.lanes|=a;var u=i.alternate;u!==null&&(u.lanes|=a);for(var f=!1,m=i.return;m!==null;)m.childLanes|=a,u=m.alternate,u!==null&&(u.childLanes|=a),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&&s!==null&&(f=31-ln(a),i=m.hiddenUpdates,u=i[f],u===null?i[f]=[s]:u.push(s),s.lane=a|536870912),m):null}function tu(i){if(50<Ca)throw Ca=0,ch=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ls={};function k_(i,s,a,u){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function cn(i,s,a,u){return new k_(i,s,a,u)}function sd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function wi(i,s){var a=i.alternate;return a===null?(a=cn(i.tag,s,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=s,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,s=i.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function yb(i,s){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,s=a.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function nu(i,s,a,u,f,m){var b=0;if(u=i,typeof i=="function")sd(i)&&(b=1);else if(typeof i=="string")b=Ck(i,a,re.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case pe:return i=cn(31,a,s,f),i.elementType=pe,i.lanes=m,i;case x:return Pr(a.children,f,m,s);case T:b=8,f|=24;break;case C:return i=cn(12,a,s,f|2),i.elementType=C,i.lanes=m,i;case z:return i=cn(13,a,s,f),i.elementType=z,i.lanes=m,i;case ee:return i=cn(19,a,s,f),i.elementType=ee,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case M:case _:b=10;break e;case O:b=9;break e;case G:b=11;break e;case te:b=14;break e;case X:b=16,u=null;break e}b=29,a=Error(r(130,i===null?"null":typeof i,"")),u=null}return s=cn(b,a,s,f),s.elementType=i,s.type=u,s.lanes=m,s}function Pr(i,s,a,u){return i=cn(7,i,u,s),i.lanes=a,i}function od(i,s,a){return i=cn(6,i,null,s),i.lanes=a,i}function ad(i,s,a){return s=cn(4,i.children!==null?i.children:[],i.key,s),s.lanes=a,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Vs=[],zs=0,iu=null,ru=0,On=[],_n=0,qr=null,xi=1,Ti="";function Ir(i,s){Vs[zs++]=ru,Vs[zs++]=iu,iu=i,ru=s}function gb(i,s,a){On[_n++]=xi,On[_n++]=Ti,On[_n++]=qr,qr=i;var u=xi;i=Ti;var f=32-ln(u)-1;u&=~(1<<f),a+=1;var m=32-ln(s)+f;if(30<m){var b=f-f%5;m=(u&(1<<b)-1).toString(32),u>>=b,f-=b,xi=1<<32-ln(s)+f|a<<f|u,Ti=m+i}else xi=1<<m|a<<f|u,Ti=i}function ld(i){i.return!==null&&(Ir(i,1),gb(i,1,0))}function ud(i){for(;i===iu;)iu=Vs[--zs],Vs[zs]=null,ru=Vs[--zs],Vs[zs]=null;for(;i===qr;)qr=On[--_n],On[_n]=null,Ti=On[--_n],On[_n]=null,xi=On[--_n],On[_n]=null}var Yt=null,it=null,$e=!1,Hr=null,ei=!1,cd=Error(r(519));function Fr(i){var s=Error(r(418,""));throw ua(En(s,i)),cd}function bb(i){var s=i.stateNode,a=i.type,u=i.memoizedProps;switch(s[Pt]=i,s[Qt]=u,a){case"dialog":Re("cancel",s),Re("close",s);break;case"iframe":case"object":case"embed":Re("load",s);break;case"video":case"audio":for(a=0;a<Na.length;a++)Re(Na[a],s);break;case"source":Re("error",s);break;case"img":case"image":case"link":Re("error",s),Re("load",s);break;case"details":Re("toggle",s);break;case"input":Re("invalid",s),Ng(s,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0),Il(s);break;case"select":Re("invalid",s);break;case"textarea":Re("invalid",s),jg(s,u.value,u.defaultValue,u.children),Il(s)}a=u.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||s.textContent===""+a||u.suppressHydrationWarning===!0||j0(s.textContent,a)?(u.popover!=null&&(Re("beforetoggle",s),Re("toggle",s)),u.onScroll!=null&&Re("scroll",s),u.onScrollEnd!=null&&Re("scrollend",s),u.onClick!=null&&(s.onclick=Vu),s=!0):s=!1,s||Fr(i)}function vb(i){for(Yt=i.return;Yt;)switch(Yt.tag){case 5:case 13:ei=!1;return;case 27:case 3:ei=!0;return;default:Yt=Yt.return}}function aa(i){if(i!==Yt)return!1;if(!$e)return vb(i),$e=!0,!1;var s=i.tag,a;if((a=s!==3&&s!==27)&&((a=s===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||Rh(i.type,i.memoizedProps)),a=!a),a&&it&&Fr(i),vb(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,s=0;i;){if(i.nodeType===8)if(a=i.data,a==="/$"){if(s===0){it=In(i.nextSibling);break e}s--}else a!=="$"&&a!=="$!"&&a!=="$?"||s++;i=i.nextSibling}it=null}}else s===27?(s=it,hr(i.type)?(i=Mh,Mh=null,it=i):it=s):it=Yt?In(i.stateNode.nextSibling):null;return!0}function la(){it=Yt=null,$e=!1}function Sb(){var i=Hr;return i!==null&&(nn===null?nn=i:nn.push.apply(nn,i),Hr=null),i}function ua(i){Hr===null?Hr=[i]:Hr.push(i)}var fd=q(null),Gr=null,Ai=null;function Qi(i,s,a){F(fd,s._currentValue),s._currentValue=a}function Ei(i){i._currentValue=fd.current,Z(fd)}function dd(i,s,a){for(;i!==null;){var u=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),i===a)break;i=i.return}}function hd(i,s,a,u){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 w=m;m=f;for(var E=0;E<s.length;E++)if(w.context===s[E]){m.lanes|=a,w=m.alternate,w!==null&&(w.lanes|=a),dd(m.return,a,i),u||(b=null);break e}m=w.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(r(341));b.lanes|=a,m=b.alternate,m!==null&&(m.lanes|=a),dd(b,a,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 ca(i,s,a,u){i=null;for(var f=s,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(r(387));if(b=b.memoizedProps,b!==null){var w=f.type;un(f.pendingProps.value,b.value)||(i!==null?i.push(w):i=[w])}}else if(f===nt.current){if(b=f.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(za):i=[za])}f=f.return}i!==null&&hd(s,i,a,u),s.flags|=262144}function su(i){for(i=i.firstContext;i!==null;){if(!un(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Yr(i){Gr=i,Ai=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function qt(i){return wb(Gr,i)}function ou(i,s){return Gr===null&&Yr(i),wb(i,s)}function wb(i,s){var a=s._currentValue;if(s={context:s,memoizedValue:a,next:null},Ai===null){if(i===null)throw Error(r(308));Ai=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ai=Ai.next=s;return a}var M_=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(a,u){i.push(u)}};this.abort=function(){s.aborted=!0,i.forEach(function(a){return a()})}},C_=t.unstable_scheduleCallback,D_=t.unstable_NormalPriority,At={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pd(){return{controller:new M_,data:new Map,refCount:0}}function fa(i){i.refCount--,i.refCount===0&&C_(D_,function(){i.controller.abort()})}var da=null,md=0,Us=0,Ks=null;function N_(i,s){if(da===null){var a=da=[];md=0,Us=gh(),Ks={status:"pending",value:void 0,then:function(u){a.push(u)}}}return md++,s.then(xb,xb),s}function xb(){if(--md===0&&da!==null){Ks!==null&&(Ks.status="fulfilled");var i=da;da=null,Us=0,Ks=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function $_(i,s){var a=[],u={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return i.then(function(){u.status="fulfilled",u.value=s;for(var f=0;f<a.length;f++)(0,a[f])(s)},function(f){for(u.status="rejected",u.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),u}var Tb=B.S;B.S=function(i,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&N_(i,s),Tb!==null&&Tb(i,s)};var Xr=q(null);function yd(){var i=Xr.current;return i!==null?i:Fe.pooledCache}function au(i,s){s===null?F(Xr,Xr.current):F(Xr,s.pool)}function Ab(){var i=yd();return i===null?null:{parent:At._currentValue,pool:i}}var ha=Error(r(460)),Eb=Error(r(474)),lu=Error(r(542)),gd={then:function(){}};function Rb(i){return i=i.status,i==="fulfilled"||i==="rejected"}function uu(){}function Ob(i,s,a){switch(a=i[a],a===void 0?i.push(s):a!==s&&(s.then(uu,uu),s=a),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,kb(i),i;default:if(typeof s.status=="string")s.then(uu,uu);else{if(i=Fe,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(u){if(s.status==="pending"){var f=s;f.status="fulfilled",f.value=u}},function(u){if(s.status==="pending"){var f=s;f.status="rejected",f.reason=u}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,kb(i),i}throw pa=s,ha}}var pa=null;function _b(){if(pa===null)throw Error(r(459));var i=pa;return pa=null,i}function kb(i){if(i===ha||i===lu)throw Error(r(483))}var Wi=!1;function bd(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vd(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function er(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function tr(i,s,a){var u=i.updateQueue;if(u===null)return null;if(u=u.shared,(Be&2)!==0){var f=u.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),u.pending=s,s=tu(i),mb(i,null,a),s}return eu(i,u,s,a),tu(i)}function ma(i,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var u=s.lanes;u&=i.pendingLanes,a|=u,s.lanes=a,xg(i,a)}}function Sd(i,s){var a=i.updateQueue,u=i.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,a=a.next}while(a!==null);m===null?f=m=s:m=m.next=s}else f=m=s;a={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:u.shared,callbacks:u.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=s:i.next=s,a.lastBaseUpdate=s}var wd=!1;function ya(){if(wd){var i=Ks;if(i!==null)throw i}}function ga(i,s,a,u){wd=!1;var f=i.updateQueue;Wi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,w=f.shared.pending;if(w!==null){f.shared.pending=null;var E=w,N=E.next;E.next=null,b===null?m=N:b.next=N,b=E;var U=i.alternate;U!==null&&(U=U.updateQueue,w=U.lastBaseUpdate,w!==b&&(w===null?U.firstBaseUpdate=N:w.next=N,U.lastBaseUpdate=E))}if(m!==null){var I=f.baseState;b=0,U=N=E=null,w=m;do{var j=w.lane&-536870913,L=j!==w.lane;if(L?(Me&j)===j:(u&j)===j){j!==0&&j===Us&&(wd=!0),U!==null&&(U=U.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var de=i,ue=w;j=s;var Ke=a;switch(ue.tag){case 1:if(de=ue.payload,typeof de=="function"){I=de.call(Ke,I,j);break e}I=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=ue.payload,j=typeof de=="function"?de.call(Ke,I,j):de,j==null)break e;I=y({},I,j);break e;case 2:Wi=!0}}j=w.callback,j!==null&&(i.flags|=64,L&&(i.flags|=8192),L=f.callbacks,L===null?f.callbacks=[j]:L.push(j))}else L={lane:j,tag:w.tag,payload:w.payload,callback:w.callback,next:null},U===null?(N=U=L,E=I):U=U.next=L,b|=j;if(w=w.next,w===null){if(w=f.shared.pending,w===null)break;L=w,w=L.next,L.next=null,f.lastBaseUpdate=L,f.shared.pending=null}}while(!0);U===null&&(E=I),f.baseState=E,f.firstBaseUpdate=N,f.lastBaseUpdate=U,m===null&&(f.shared.lanes=0),ur|=b,i.lanes=b,i.memoizedState=I}}function Mb(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Cb(i,s){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)Mb(a[i],s)}var Ps=q(null),cu=q(0);function Db(i,s){i=Di,F(cu,i),F(Ps,s),Di=i|s.baseLanes}function xd(){F(cu,Di),F(Ps,Ps.current)}function Td(){Di=cu.current,Z(Ps),Z(cu)}var nr=0,xe=null,ze=null,mt=null,fu=!1,qs=!1,Jr=!1,du=0,ba=0,Is=null,j_=0;function ct(){throw Error(r(321))}function Ad(i,s){if(s===null)return!1;for(var a=0;a<s.length&&a<i.length;a++)if(!un(i[a],s[a]))return!1;return!0}function Ed(i,s,a,u,f,m){return nr=m,xe=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,B.H=i===null||i.memoizedState===null?mv:yv,Jr=!1,m=a(u,f),Jr=!1,qs&&(m=$b(s,a,u,f)),Nb(i),m}function Nb(i){B.H=bu;var s=ze!==null&&ze.next!==null;if(nr=0,mt=ze=xe=null,fu=!1,ba=0,Is=null,s)throw Error(r(300));i===null||kt||(i=i.dependencies,i!==null&&su(i)&&(kt=!0))}function $b(i,s,a,u){xe=i;var f=0;do{if(qs&&(Is=null),ba=0,qs=!1,25<=f)throw Error(r(301));if(f+=1,mt=ze=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}B.H=P_,m=s(a,u)}while(qs);return m}function B_(){var i=B.H,s=i.useState()[0];return s=typeof s.then=="function"?va(s):s,i=i.useState()[0],(ze!==null?ze.memoizedState:null)!==i&&(xe.flags|=1024),s}function Rd(){var i=du!==0;return du=0,i}function Od(i,s,a){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~a}function _d(i){if(fu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}fu=!1}nr=0,mt=ze=xe=null,qs=!1,ba=du=0,Is=null}function en(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?xe.memoizedState=mt=i:mt=mt.next=i,mt}function yt(){if(ze===null){var i=xe.alternate;i=i!==null?i.memoizedState:null}else i=ze.next;var s=mt===null?xe.memoizedState:mt.next;if(s!==null)mt=s,ze=i;else{if(i===null)throw xe.alternate===null?Error(r(467)):Error(r(310));ze=i,i={memoizedState:ze.memoizedState,baseState:ze.baseState,baseQueue:ze.baseQueue,queue:ze.queue,next:null},mt===null?xe.memoizedState=mt=i:mt=mt.next=i}return mt}function kd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function va(i){var s=ba;return ba+=1,Is===null&&(Is=[]),i=Ob(Is,i,s),s=xe,(mt===null?s.memoizedState:mt.next)===null&&(s=s.alternate,B.H=s===null||s.memoizedState===null?mv:yv),i}function hu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return va(i);if(i.$$typeof===_)return qt(i)}throw Error(r(438,String(i)))}function Md(i){var s=null,a=xe.updateQueue;if(a!==null&&(s=a.memoCache),s==null){var u=xe.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(s={data:u.data.map(function(f){return f.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),a===null&&(a=kd(),xe.updateQueue=a),a.memoCache=s,a=s.data[s.index],a===void 0)for(a=s.data[s.index]=Array(i),u=0;u<i;u++)a[u]=me;return s.index++,a}function Ri(i,s){return typeof s=="function"?s(i):s}function pu(i){var s=yt();return Cd(s,ze,i)}function Cd(i,s,a){var u=i.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=a;var f=i.baseQueue,m=u.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}s.baseQueue=f=m,u.pending=null}if(m=i.baseState,f===null)i.memoizedState=m;else{s=f.next;var w=b=null,E=null,N=s,U=!1;do{var I=N.lane&-536870913;if(I!==N.lane?(Me&I)===I:(nr&I)===I){var j=N.revertLane;if(j===0)E!==null&&(E=E.next={lane:0,revertLane:0,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),I===Us&&(U=!0);else if((nr&j)===j){N=N.next,j===Us&&(U=!0);continue}else I={lane:0,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},E===null?(w=E=I,b=m):E=E.next=I,xe.lanes|=j,ur|=j;I=N.action,Jr&&a(m,I),m=N.hasEagerState?N.eagerState:a(m,I)}else j={lane:I,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},E===null?(w=E=j,b=m):E=E.next=j,xe.lanes|=I,ur|=I;N=N.next}while(N!==null&&N!==s);if(E===null?b=m:E.next=w,!un(m,i.memoizedState)&&(kt=!0,U&&(a=Ks,a!==null)))throw a;i.memoizedState=m,i.baseState=b,i.baseQueue=E,u.lastRenderedState=m}return f===null&&(u.lanes=0),[i.memoizedState,u.dispatch]}function Dd(i){var s=yt(),a=s.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=i;var u=a.dispatch,f=a.pending,m=s.memoizedState;if(f!==null){a.pending=null;var b=f=f.next;do m=i(m,b.action),b=b.next;while(b!==f);un(m,s.memoizedState)||(kt=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),a.lastRenderedState=m}return[m,u]}function jb(i,s,a){var u=xe,f=yt(),m=$e;if(m){if(a===void 0)throw Error(r(407));a=a()}else a=s();var b=!un((ze||f).memoizedState,a);b&&(f.memoizedState=a,kt=!0),f=f.queue;var w=Vb.bind(null,u,f,i);if(Sa(2048,8,w,[i]),f.getSnapshot!==s||b||mt!==null&&mt.memoizedState.tag&1){if(u.flags|=2048,Hs(9,mu(),Lb.bind(null,u,f,a,s),null),Fe===null)throw Error(r(349));m||(nr&124)!==0||Bb(u,s,a)}return a}function Bb(i,s,a){i.flags|=16384,i={getSnapshot:s,value:a},s=xe.updateQueue,s===null?(s=kd(),xe.updateQueue=s,s.stores=[i]):(a=s.stores,a===null?s.stores=[i]:a.push(i))}function Lb(i,s,a,u){s.value=a,s.getSnapshot=u,zb(s)&&Ub(i)}function Vb(i,s,a){return a(function(){zb(s)&&Ub(i)})}function zb(i){var s=i.getSnapshot;i=i.value;try{var a=s();return!un(i,a)}catch{return!0}}function Ub(i){var s=Bs(i,2);s!==null&&mn(s,i,2)}function Nd(i){var s=en();if(typeof i=="function"){var a=i;if(i=a(),Jr){Xi(!0);try{a()}finally{Xi(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:i},s}function Kb(i,s,a,u){return i.baseState=a,Cd(i,ze,typeof u=="function"?u:Ri)}function L_(i,s,a,u,f){if(gu(i))throw Error(r(485));if(i=s.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)}};B.T!==null?a(!0):m.isTransition=!1,u(m),a=s.pending,a===null?(m.next=s.pending=m,Pb(s,m)):(m.next=a.next,s.pending=a.next=m)}}function Pb(i,s){var a=s.action,u=s.payload,f=i.state;if(s.isTransition){var m=B.T,b={};B.T=b;try{var w=a(f,u),E=B.S;E!==null&&E(b,w),qb(i,s,w)}catch(N){$d(i,s,N)}finally{B.T=m}}else try{m=a(f,u),qb(i,s,m)}catch(N){$d(i,s,N)}}function qb(i,s,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(u){Ib(i,s,u)},function(u){return $d(i,s,u)}):Ib(i,s,a)}function Ib(i,s,a){s.status="fulfilled",s.value=a,Hb(s),i.state=a,s=i.pending,s!==null&&(a=s.next,a===s?i.pending=null:(a=a.next,s.next=a,Pb(i,a)))}function $d(i,s,a){var u=i.pending;if(i.pending=null,u!==null){u=u.next;do s.status="rejected",s.reason=a,Hb(s),s=s.next;while(s!==u)}i.action=null}function Hb(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function Fb(i,s){return s}function Gb(i,s){if($e){var a=Fe.formState;if(a!==null){e:{var u=xe;if($e){if(it){t:{for(var f=it,m=ei;f.nodeType!==8;){if(!m){f=null;break t}if(f=In(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){it=In(f.nextSibling),u=f.data==="F!";break e}}Fr(u)}u=!1}u&&(s=a[0])}}return a=en(),a.memoizedState=a.baseState=s,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fb,lastRenderedState:s},a.queue=u,a=dv.bind(null,xe,u),u.dispatch=a,u=Nd(!1),m=zd.bind(null,xe,!1,u.queue),u=en(),f={state:s,dispatch:null,action:i,pending:null},u.queue=f,a=L_.bind(null,xe,f,m,a),f.dispatch=a,u.memoizedState=i,[s,a,!1]}function Yb(i){var s=yt();return Xb(s,ze,i)}function Xb(i,s,a){if(s=Cd(i,s,Fb)[0],i=pu(Ri)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var u=va(s)}catch(b){throw b===ha?lu:b}else u=s;s=yt();var f=s.queue,m=f.dispatch;return a!==s.memoizedState&&(xe.flags|=2048,Hs(9,mu(),V_.bind(null,f,a),null)),[u,m,i]}function V_(i,s){i.action=s}function Jb(i){var s=yt(),a=ze;if(a!==null)return Xb(s,a,i);yt(),s=s.memoizedState,a=yt();var u=a.queue.dispatch;return a.memoizedState=i,[s,u,!1]}function Hs(i,s,a,u){return i={tag:i,create:a,deps:u,inst:s,next:null},s=xe.updateQueue,s===null&&(s=kd(),xe.updateQueue=s),a=s.lastEffect,a===null?s.lastEffect=i.next=i:(u=a.next,a.next=i,i.next=u,s.lastEffect=i),i}function mu(){return{destroy:void 0,resource:void 0}}function Zb(){return yt().memoizedState}function yu(i,s,a,u){var f=en();u=u===void 0?null:u,xe.flags|=i,f.memoizedState=Hs(1|s,mu(),a,u)}function Sa(i,s,a,u){var f=yt();u=u===void 0?null:u;var m=f.memoizedState.inst;ze!==null&&u!==null&&Ad(u,ze.memoizedState.deps)?f.memoizedState=Hs(s,m,a,u):(xe.flags|=i,f.memoizedState=Hs(1|s,m,a,u))}function Qb(i,s){yu(8390656,8,i,s)}function Wb(i,s){Sa(2048,8,i,s)}function ev(i,s){return Sa(4,2,i,s)}function tv(i,s){return Sa(4,4,i,s)}function nv(i,s){if(typeof s=="function"){i=i();var a=s(i);return function(){typeof a=="function"?a():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function iv(i,s,a){a=a!=null?a.concat([i]):null,Sa(4,4,nv.bind(null,s,i),a)}function jd(){}function rv(i,s){var a=yt();s=s===void 0?null:s;var u=a.memoizedState;return s!==null&&Ad(s,u[1])?u[0]:(a.memoizedState=[i,s],i)}function sv(i,s){var a=yt();s=s===void 0?null:s;var u=a.memoizedState;if(s!==null&&Ad(s,u[1]))return u[0];if(u=i(),Jr){Xi(!0);try{i()}finally{Xi(!1)}}return a.memoizedState=[u,s],u}function Bd(i,s,a){return a===void 0||(nr&1073741824)!==0?i.memoizedState=s:(i.memoizedState=a,i=l0(),xe.lanes|=i,ur|=i,a)}function ov(i,s,a,u){return un(a,s)?a:Ps.current!==null?(i=Bd(i,a,u),un(i,s)||(kt=!0),i):(nr&42)===0?(kt=!0,i.memoizedState=a):(i=l0(),xe.lanes|=i,ur|=i,s)}function av(i,s,a,u,f){var m=K.p;K.p=m!==0&&8>m?m:8;var b=B.T,w={};B.T=w,zd(i,!1,s,a);try{var E=f(),N=B.S;if(N!==null&&N(w,E),E!==null&&typeof E=="object"&&typeof E.then=="function"){var U=$_(E,u);wa(i,s,U,pn(i))}else wa(i,s,u,pn(i))}catch(I){wa(i,s,{then:function(){},status:"rejected",reason:I},pn())}finally{K.p=m,B.T=b}}function z_(){}function Ld(i,s,a,u){if(i.tag!==5)throw Error(r(476));var f=lv(i).queue;av(i,f,s,V,a===null?z_:function(){return uv(i),a(u)})}function lv(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:V},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:a},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function uv(i){var s=lv(i).next.queue;wa(i,s,{},pn())}function Vd(){return qt(za)}function cv(){return yt().memoizedState}function fv(){return yt().memoizedState}function U_(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var a=pn();i=er(a);var u=tr(s,i,a);u!==null&&(mn(u,s,a),ma(u,s,a)),s={cache:pd()},i.payload=s;return}s=s.return}}function K_(i,s,a){var u=pn();a={lane:u,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},gu(i)?hv(s,a):(a=rd(i,s,a,u),a!==null&&(mn(a,i,u),pv(a,s,u)))}function dv(i,s,a){var u=pn();wa(i,s,a,u)}function wa(i,s,a,u){var f={lane:u,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(gu(i))hv(s,f);else{var m=i.alternate;if(i.lanes===0&&(m===null||m.lanes===0)&&(m=s.lastRenderedReducer,m!==null))try{var b=s.lastRenderedState,w=m(b,a);if(f.hasEagerState=!0,f.eagerState=w,un(w,b))return eu(i,s,f,0),Fe===null&&Wl(),!1}catch{}finally{}if(a=rd(i,s,f,u),a!==null)return mn(a,i,u),pv(a,s,u),!0}return!1}function zd(i,s,a,u){if(u={lane:2,revertLane:gh(),action:u,hasEagerState:!1,eagerState:null,next:null},gu(i)){if(s)throw Error(r(479))}else s=rd(i,a,u,2),s!==null&&mn(s,i,2)}function gu(i){var s=i.alternate;return i===xe||s!==null&&s===xe}function hv(i,s){qs=fu=!0;var a=i.pending;a===null?s.next=s:(s.next=a.next,a.next=s),i.pending=s}function pv(i,s,a){if((a&4194048)!==0){var u=s.lanes;u&=i.pendingLanes,a|=u,s.lanes=a,xg(i,a)}}var bu={readContext:qt,use:hu,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct},mv={readContext:qt,use:hu,useCallback:function(i,s){return en().memoizedState=[i,s===void 0?null:s],i},useContext:qt,useEffect:Qb,useImperativeHandle:function(i,s,a){a=a!=null?a.concat([i]):null,yu(4194308,4,nv.bind(null,s,i),a)},useLayoutEffect:function(i,s){return yu(4194308,4,i,s)},useInsertionEffect:function(i,s){yu(4,2,i,s)},useMemo:function(i,s){var a=en();s=s===void 0?null:s;var u=i();if(Jr){Xi(!0);try{i()}finally{Xi(!1)}}return a.memoizedState=[u,s],u},useReducer:function(i,s,a){var u=en();if(a!==void 0){var f=a(s);if(Jr){Xi(!0);try{a(s)}finally{Xi(!1)}}}else f=s;return u.memoizedState=u.baseState=f,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:f},u.queue=i,i=i.dispatch=K_.bind(null,xe,i),[u.memoizedState,i]},useRef:function(i){var s=en();return i={current:i},s.memoizedState=i},useState:function(i){i=Nd(i);var s=i.queue,a=dv.bind(null,xe,s);return s.dispatch=a,[i.memoizedState,a]},useDebugValue:jd,useDeferredValue:function(i,s){var a=en();return Bd(a,i,s)},useTransition:function(){var i=Nd(!1);return i=av.bind(null,xe,i.queue,!0,!1),en().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,a){var u=xe,f=en();if($e){if(a===void 0)throw Error(r(407));a=a()}else{if(a=s(),Fe===null)throw Error(r(349));(Me&124)!==0||Bb(u,s,a)}f.memoizedState=a;var m={value:a,getSnapshot:s};return f.queue=m,Qb(Vb.bind(null,u,m,i),[i]),u.flags|=2048,Hs(9,mu(),Lb.bind(null,u,m,a,s),null),a},useId:function(){var i=en(),s=Fe.identifierPrefix;if($e){var a=Ti,u=xi;a=(u&~(1<<32-ln(u)-1)).toString(32)+a,s="«"+s+"R"+a,a=du++,0<a&&(s+="H"+a.toString(32)),s+="»"}else a=j_++,s="«"+s+"r"+a.toString(32)+"»";return i.memoizedState=s},useHostTransitionStatus:Vd,useFormState:Gb,useActionState:Gb,useOptimistic:function(i){var s=en();s.memoizedState=s.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=a,s=zd.bind(null,xe,!0,a),a.dispatch=s,[i,s]},useMemoCache:Md,useCacheRefresh:function(){return en().memoizedState=U_.bind(null,xe)}},yv={readContext:qt,use:hu,useCallback:rv,useContext:qt,useEffect:Wb,useImperativeHandle:iv,useInsertionEffect:ev,useLayoutEffect:tv,useMemo:sv,useReducer:pu,useRef:Zb,useState:function(){return pu(Ri)},useDebugValue:jd,useDeferredValue:function(i,s){var a=yt();return ov(a,ze.memoizedState,i,s)},useTransition:function(){var i=pu(Ri)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:va(i),s]},useSyncExternalStore:jb,useId:cv,useHostTransitionStatus:Vd,useFormState:Yb,useActionState:Yb,useOptimistic:function(i,s){var a=yt();return Kb(a,ze,i,s)},useMemoCache:Md,useCacheRefresh:fv},P_={readContext:qt,use:hu,useCallback:rv,useContext:qt,useEffect:Wb,useImperativeHandle:iv,useInsertionEffect:ev,useLayoutEffect:tv,useMemo:sv,useReducer:Dd,useRef:Zb,useState:function(){return Dd(Ri)},useDebugValue:jd,useDeferredValue:function(i,s){var a=yt();return ze===null?Bd(a,i,s):ov(a,ze.memoizedState,i,s)},useTransition:function(){var i=Dd(Ri)[0],s=yt().memoizedState;return[typeof i=="boolean"?i:va(i),s]},useSyncExternalStore:jb,useId:cv,useHostTransitionStatus:Vd,useFormState:Jb,useActionState:Jb,useOptimistic:function(i,s){var a=yt();return ze!==null?Kb(a,ze,i,s):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:Md,useCacheRefresh:fv},Fs=null,xa=0;function vu(i){var s=xa;return xa+=1,Fs===null&&(Fs=[]),Ob(Fs,i,s)}function Ta(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Su(i,s){throw s.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function gv(i){var s=i._init;return s(i._payload)}function bv(i){function s(k,R){if(i){var D=k.deletions;D===null?(k.deletions=[R],k.flags|=16):D.push(R)}}function a(k,R){if(!i)return null;for(;R!==null;)s(k,R),R=R.sibling;return null}function u(k){for(var R=new Map;k!==null;)k.key!==null?R.set(k.key,k):R.set(k.index,k),k=k.sibling;return R}function f(k,R){return k=wi(k,R),k.index=0,k.sibling=null,k}function m(k,R,D){return k.index=D,i?(D=k.alternate,D!==null?(D=D.index,D<R?(k.flags|=67108866,R):D):(k.flags|=67108866,R)):(k.flags|=1048576,R)}function b(k){return i&&k.alternate===null&&(k.flags|=67108866),k}function w(k,R,D,P){return R===null||R.tag!==6?(R=od(D,k.mode,P),R.return=k,R):(R=f(R,D),R.return=k,R)}function E(k,R,D,P){var ie=D.type;return ie===x?U(k,R,D.props.children,P,D.key):R!==null&&(R.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===X&&gv(ie)===R.type)?(R=f(R,D.props),Ta(R,D),R.return=k,R):(R=nu(D.type,D.key,D.props,null,k.mode,P),Ta(R,D),R.return=k,R)}function N(k,R,D,P){return R===null||R.tag!==4||R.stateNode.containerInfo!==D.containerInfo||R.stateNode.implementation!==D.implementation?(R=ad(D,k.mode,P),R.return=k,R):(R=f(R,D.children||[]),R.return=k,R)}function U(k,R,D,P,ie){return R===null||R.tag!==7?(R=Pr(D,k.mode,P,ie),R.return=k,R):(R=f(R,D),R.return=k,R)}function I(k,R,D){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=od(""+R,k.mode,D),R.return=k,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case v:return D=nu(R.type,R.key,R.props,null,k.mode,D),Ta(D,R),D.return=k,D;case S:return R=ad(R,k.mode,D),R.return=k,R;case X:var P=R._init;return R=P(R._payload),I(k,R,D)}if(W(R)||Ce(R))return R=Pr(R,k.mode,D,null),R.return=k,R;if(typeof R.then=="function")return I(k,vu(R),D);if(R.$$typeof===_)return I(k,ou(k,R),D);Su(k,R)}return null}function j(k,R,D,P){var ie=R!==null?R.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return ie!==null?null:w(k,R,""+D,P);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case v:return D.key===ie?E(k,R,D,P):null;case S:return D.key===ie?N(k,R,D,P):null;case X:return ie=D._init,D=ie(D._payload),j(k,R,D,P)}if(W(D)||Ce(D))return ie!==null?null:U(k,R,D,P,null);if(typeof D.then=="function")return j(k,R,vu(D),P);if(D.$$typeof===_)return j(k,R,ou(k,D),P);Su(k,D)}return null}function L(k,R,D,P,ie){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return k=k.get(D)||null,w(R,k,""+P,ie);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case v:return k=k.get(P.key===null?D:P.key)||null,E(R,k,P,ie);case S:return k=k.get(P.key===null?D:P.key)||null,N(R,k,P,ie);case X:var Ae=P._init;return P=Ae(P._payload),L(k,R,D,P,ie)}if(W(P)||Ce(P))return k=k.get(D)||null,U(R,k,P,ie,null);if(typeof P.then=="function")return L(k,R,D,vu(P),ie);if(P.$$typeof===_)return L(k,R,D,ou(R,P),ie);Su(R,P)}return null}function de(k,R,D,P){for(var ie=null,Ae=null,ae=R,ce=R=0,Ct=null;ae!==null&&ce<D.length;ce++){ae.index>ce?(Ct=ae,ae=null):Ct=ae.sibling;var Ne=j(k,ae,D[ce],P);if(Ne===null){ae===null&&(ae=Ct);break}i&&ae&&Ne.alternate===null&&s(k,ae),R=m(Ne,R,ce),Ae===null?ie=Ne:Ae.sibling=Ne,Ae=Ne,ae=Ct}if(ce===D.length)return a(k,ae),$e&&Ir(k,ce),ie;if(ae===null){for(;ce<D.length;ce++)ae=I(k,D[ce],P),ae!==null&&(R=m(ae,R,ce),Ae===null?ie=ae:Ae.sibling=ae,Ae=ae);return $e&&Ir(k,ce),ie}for(ae=u(ae);ce<D.length;ce++)Ct=L(ae,k,ce,D[ce],P),Ct!==null&&(i&&Ct.alternate!==null&&ae.delete(Ct.key===null?ce:Ct.key),R=m(Ct,R,ce),Ae===null?ie=Ct:Ae.sibling=Ct,Ae=Ct);return i&&ae.forEach(function(br){return s(k,br)}),$e&&Ir(k,ce),ie}function ue(k,R,D,P){if(D==null)throw Error(r(151));for(var ie=null,Ae=null,ae=R,ce=R=0,Ct=null,Ne=D.next();ae!==null&&!Ne.done;ce++,Ne=D.next()){ae.index>ce?(Ct=ae,ae=null):Ct=ae.sibling;var br=j(k,ae,Ne.value,P);if(br===null){ae===null&&(ae=Ct);break}i&&ae&&br.alternate===null&&s(k,ae),R=m(br,R,ce),Ae===null?ie=br:Ae.sibling=br,Ae=br,ae=Ct}if(Ne.done)return a(k,ae),$e&&Ir(k,ce),ie;if(ae===null){for(;!Ne.done;ce++,Ne=D.next())Ne=I(k,Ne.value,P),Ne!==null&&(R=m(Ne,R,ce),Ae===null?ie=Ne:Ae.sibling=Ne,Ae=Ne);return $e&&Ir(k,ce),ie}for(ae=u(ae);!Ne.done;ce++,Ne=D.next())Ne=L(ae,k,ce,Ne.value,P),Ne!==null&&(i&&Ne.alternate!==null&&ae.delete(Ne.key===null?ce:Ne.key),R=m(Ne,R,ce),Ae===null?ie=Ne:Ae.sibling=Ne,Ae=Ne);return i&&ae.forEach(function(qk){return s(k,qk)}),$e&&Ir(k,ce),ie}function Ke(k,R,D,P){if(typeof D=="object"&&D!==null&&D.type===x&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case v:e:{for(var ie=D.key;R!==null;){if(R.key===ie){if(ie=D.type,ie===x){if(R.tag===7){a(k,R.sibling),P=f(R,D.props.children),P.return=k,k=P;break e}}else if(R.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===X&&gv(ie)===R.type){a(k,R.sibling),P=f(R,D.props),Ta(P,D),P.return=k,k=P;break e}a(k,R);break}else s(k,R);R=R.sibling}D.type===x?(P=Pr(D.props.children,k.mode,P,D.key),P.return=k,k=P):(P=nu(D.type,D.key,D.props,null,k.mode,P),Ta(P,D),P.return=k,k=P)}return b(k);case S:e:{for(ie=D.key;R!==null;){if(R.key===ie)if(R.tag===4&&R.stateNode.containerInfo===D.containerInfo&&R.stateNode.implementation===D.implementation){a(k,R.sibling),P=f(R,D.children||[]),P.return=k,k=P;break e}else{a(k,R);break}else s(k,R);R=R.sibling}P=ad(D,k.mode,P),P.return=k,k=P}return b(k);case X:return ie=D._init,D=ie(D._payload),Ke(k,R,D,P)}if(W(D))return de(k,R,D,P);if(Ce(D)){if(ie=Ce(D),typeof ie!="function")throw Error(r(150));return D=ie.call(D),ue(k,R,D,P)}if(typeof D.then=="function")return Ke(k,R,vu(D),P);if(D.$$typeof===_)return Ke(k,R,ou(k,D),P);Su(k,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,R!==null&&R.tag===6?(a(k,R.sibling),P=f(R,D),P.return=k,k=P):(a(k,R),P=od(D,k.mode,P),P.return=k,k=P),b(k)):a(k,R)}return function(k,R,D,P){try{xa=0;var ie=Ke(k,R,D,P);return Fs=null,ie}catch(ae){if(ae===ha||ae===lu)throw ae;var Ae=cn(29,ae,null,k.mode);return Ae.lanes=P,Ae.return=k,Ae}finally{}}}var Gs=bv(!0),vv=bv(!1),kn=q(null),ti=null;function ir(i){var s=i.alternate;F(Et,Et.current&1),F(kn,i),ti===null&&(s===null||Ps.current!==null||s.memoizedState!==null)&&(ti=i)}function Sv(i){if(i.tag===22){if(F(Et,Et.current),F(kn,i),ti===null){var s=i.alternate;s!==null&&s.memoizedState!==null&&(ti=i)}}else rr()}function rr(){F(Et,Et.current),F(kn,kn.current)}function Oi(i){Z(kn),ti===i&&(ti=null),Z(Et)}var Et=q(0);function wu(i){for(var s=i;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||kh(a)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function Ud(i,s,a,u){s=i.memoizedState,a=a(u,s),a=a==null?s:y({},s,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var Kd={enqueueSetState:function(i,s,a){i=i._reactInternals;var u=pn(),f=er(u);f.payload=s,a!=null&&(f.callback=a),s=tr(i,f,u),s!==null&&(mn(s,i,u),ma(s,i,u))},enqueueReplaceState:function(i,s,a){i=i._reactInternals;var u=pn(),f=er(u);f.tag=1,f.payload=s,a!=null&&(f.callback=a),s=tr(i,f,u),s!==null&&(mn(s,i,u),ma(s,i,u))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var a=pn(),u=er(a);u.tag=2,s!=null&&(u.callback=s),s=tr(i,u,a),s!==null&&(mn(s,i,a),ma(s,i,a))}};function wv(i,s,a,u,f,m,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(u,m,b):s.prototype&&s.prototype.isPureReactComponent?!sa(a,u)||!sa(f,m):!0}function xv(i,s,a,u){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,u),s.state!==i&&Kd.enqueueReplaceState(s,s.state,null)}function Zr(i,s){var a=s;if("ref"in s){a={};for(var u in s)u!=="ref"&&(a[u]=s[u])}if(i=i.defaultProps){a===s&&(a=y({},a));for(var f in i)a[f]===void 0&&(a[f]=i[f])}return a}var xu=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function Tv(i){xu(i)}function Av(i){console.error(i)}function Ev(i){xu(i)}function Tu(i,s){try{var a=i.onUncaughtError;a(s.value,{componentStack:s.stack})}catch(u){setTimeout(function(){throw u})}}function Rv(i,s,a){try{var u=i.onCaughtError;u(a.value,{componentStack:a.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Pd(i,s,a){return a=er(a),a.tag=3,a.payload={element:null},a.callback=function(){Tu(i,s)},a}function Ov(i){return i=er(i),i.tag=3,i}function _v(i,s,a,u){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var m=u.value;i.payload=function(){return f(m)},i.callback=function(){Rv(s,a,u)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){Rv(s,a,u),typeof f!="function"&&(cr===null?cr=new Set([this]):cr.add(this));var w=u.stack;this.componentDidCatch(u.value,{componentStack:w!==null?w:""})})}function q_(i,s,a,u,f){if(a.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(s=a.alternate,s!==null&&ca(s,a,f,!0),a=kn.current,a!==null){switch(a.tag){case 13:return ti===null?dh():a.alternate===null&&rt===0&&(rt=3),a.flags&=-257,a.flags|=65536,a.lanes=f,u===gd?a.flags|=16384:(s=a.updateQueue,s===null?a.updateQueue=new Set([u]):s.add(u),ph(i,u,f)),!1;case 22:return a.flags|=65536,u===gd?a.flags|=16384:(s=a.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([u])},a.updateQueue=s):(a=s.retryQueue,a===null?s.retryQueue=new Set([u]):a.add(u)),ph(i,u,f)),!1}throw Error(r(435,a.tag))}return ph(i,u,f),dh(),!1}if($e)return s=kn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=f,u!==cd&&(i=Error(r(422),{cause:u}),ua(En(i,a)))):(u!==cd&&(s=Error(r(423),{cause:u}),ua(En(s,a))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,u=En(u,a),f=Pd(i.stateNode,u,f),Sd(i,f),rt!==4&&(rt=2)),!1;var m=Error(r(520),{cause:u});if(m=En(m,a),Ma===null?Ma=[m]:Ma.push(m),rt!==4&&(rt=2),s===null)return!0;u=En(u,a),a=s;do{switch(a.tag){case 3:return a.flags|=65536,i=f&-f,a.lanes|=i,i=Pd(a.stateNode,u,i),Sd(a,i),!1;case 1:if(s=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(cr===null||!cr.has(m))))return a.flags|=65536,f&=-f,a.lanes|=f,f=Ov(f),_v(f,i,a,u),Sd(a,f),!1}a=a.return}while(a!==null);return!1}var kv=Error(r(461)),kt=!1;function Bt(i,s,a,u){s.child=i===null?vv(s,null,a,u):Gs(s,i.child,a,u)}function Mv(i,s,a,u,f){a=a.render;var m=s.ref;if("ref"in u){var b={};for(var w in u)w!=="ref"&&(b[w]=u[w])}else b=u;return Yr(s),u=Ed(i,s,a,b,m,f),w=Rd(),i!==null&&!kt?(Od(i,s,f),_i(i,s,f)):($e&&w&&ld(s),s.flags|=1,Bt(i,s,u,f),s.child)}function Cv(i,s,a,u,f){if(i===null){var m=a.type;return typeof m=="function"&&!sd(m)&&m.defaultProps===void 0&&a.compare===null?(s.tag=15,s.type=m,Dv(i,s,m,u,f)):(i=nu(a.type,null,u,s,s.mode,f),i.ref=s.ref,i.return=s,s.child=i)}if(m=i.child,!Jd(i,f)){var b=m.memoizedProps;if(a=a.compare,a=a!==null?a:sa,a(b,u)&&i.ref===s.ref)return _i(i,s,f)}return s.flags|=1,i=wi(m,u),i.ref=s.ref,i.return=s,s.child=i}function Dv(i,s,a,u,f){if(i!==null){var m=i.memoizedProps;if(sa(m,u)&&i.ref===s.ref)if(kt=!1,s.pendingProps=u=m,Jd(i,f))(i.flags&131072)!==0&&(kt=!0);else return s.lanes=i.lanes,_i(i,s,f)}return qd(i,s,a,u,f)}function Nv(i,s,a){var u=s.pendingProps,f=u.children,m=i!==null?i.memoizedState:null;if(u.mode==="hidden"){if((s.flags&128)!==0){if(u=m!==null?m.baseLanes|a:a,i!==null){for(f=s.child=i.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;s.childLanes=m&~u}else s.childLanes=0,s.child=null;return $v(i,s,u,a)}if((a&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&au(s,m!==null?m.cachePool:null),m!==null?Db(s,m):xd(),Sv(s);else return s.lanes=s.childLanes=536870912,$v(i,s,m!==null?m.baseLanes|a:a,a)}else m!==null?(au(s,m.cachePool),Db(s,m),rr(),s.memoizedState=null):(i!==null&&au(s,null),xd(),rr());return Bt(i,s,f,a),s.child}function $v(i,s,a,u){var f=yd();return f=f===null?null:{parent:At._currentValue,pool:f},s.memoizedState={baseLanes:a,cachePool:f},i!==null&&au(s,null),xd(),Sv(s),i!==null&&ca(i,s,u,!0),null}function Au(i,s){var a=s.ref;if(a===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(r(284));(i===null||i.ref!==a)&&(s.flags|=4194816)}}function qd(i,s,a,u,f){return Yr(s),a=Ed(i,s,a,u,void 0,f),u=Rd(),i!==null&&!kt?(Od(i,s,f),_i(i,s,f)):($e&&u&&ld(s),s.flags|=1,Bt(i,s,a,f),s.child)}function jv(i,s,a,u,f,m){return Yr(s),s.updateQueue=null,a=$b(s,u,a,f),Nb(i),u=Rd(),i!==null&&!kt?(Od(i,s,m),_i(i,s,m)):($e&&u&&ld(s),s.flags|=1,Bt(i,s,a,m),s.child)}function Bv(i,s,a,u,f){if(Yr(s),s.stateNode===null){var m=Ls,b=a.contextType;typeof b=="object"&&b!==null&&(m=qt(b)),m=new a(u,m),s.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Kd,s.stateNode=m,m._reactInternals=s,m=s.stateNode,m.props=u,m.state=s.memoizedState,m.refs={},bd(s),b=a.contextType,m.context=typeof b=="object"&&b!==null?qt(b):Ls,m.state=s.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(Ud(s,a,b,u),m.state=s.memoizedState),typeof a.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&&Kd.enqueueReplaceState(m,m.state,null),ga(s,u,m,f),ya(),m.state=s.memoizedState),typeof m.componentDidMount=="function"&&(s.flags|=4194308),u=!0}else if(i===null){m=s.stateNode;var w=s.memoizedProps,E=Zr(a,w);m.props=E;var N=m.context,U=a.contextType;b=Ls,typeof U=="object"&&U!==null&&(b=qt(U));var I=a.getDerivedStateFromProps;U=typeof I=="function"||typeof m.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,U||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w||N!==b)&&xv(s,m,u,b),Wi=!1;var j=s.memoizedState;m.state=j,ga(s,u,m,f),ya(),N=s.memoizedState,w||j!==N||Wi?(typeof I=="function"&&(Ud(s,a,I,u),N=s.memoizedState),(E=Wi||wv(s,a,E,u,j,N,b))?(U||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"&&(s.flags|=4194308)):(typeof m.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=N),m.props=u,m.state=N,m.context=b,u=E):(typeof m.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{m=s.stateNode,vd(i,s),b=s.memoizedProps,U=Zr(a,b),m.props=U,I=s.pendingProps,j=m.context,N=a.contextType,E=Ls,typeof N=="object"&&N!==null&&(E=qt(N)),w=a.getDerivedStateFromProps,(N=typeof w=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==I||j!==E)&&xv(s,m,u,E),Wi=!1,j=s.memoizedState,m.state=j,ga(s,u,m,f),ya();var L=s.memoizedState;b!==I||j!==L||Wi||i!==null&&i.dependencies!==null&&su(i.dependencies)?(typeof w=="function"&&(Ud(s,a,w,u),L=s.memoizedState),(U=Wi||wv(s,a,U,u,j,L,E)||i!==null&&i.dependencies!==null&&su(i.dependencies))?(N||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(u,L,E),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(u,L,E)),typeof m.componentDidUpdate=="function"&&(s.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&j===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&j===i.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=L),m.props=u,m.state=L,m.context=E,u=U):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&j===i.memoizedState||(s.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&j===i.memoizedState||(s.flags|=1024),u=!1)}return m=u,Au(i,s),u=(s.flags&128)!==0,m||u?(m=s.stateNode,a=u&&typeof a.getDerivedStateFromError!="function"?null:m.render(),s.flags|=1,i!==null&&u?(s.child=Gs(s,i.child,null,f),s.child=Gs(s,null,a,f)):Bt(i,s,a,f),s.memoizedState=m.state,i=s.child):i=_i(i,s,f),i}function Lv(i,s,a,u){return la(),s.flags|=256,Bt(i,s,a,u),s.child}var Id={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hd(i){return{baseLanes:i,cachePool:Ab()}}function Fd(i,s,a){return i=i!==null?i.childLanes&~a:0,s&&(i|=Mn),i}function Vv(i,s,a){var u=s.pendingProps,f=!1,m=(s.flags&128)!==0,b;if((b=m)||(b=i!==null&&i.memoizedState===null?!1:(Et.current&2)!==0),b&&(f=!0,s.flags&=-129),b=(s.flags&32)!==0,s.flags&=-33,i===null){if($e){if(f?ir(s):rr(),$e){var w=it,E;if(E=w){e:{for(E=w,w=ei;E.nodeType!==8;){if(!w){w=null;break e}if(E=In(E.nextSibling),E===null){w=null;break e}}w=E}w!==null?(s.memoizedState={dehydrated:w,treeContext:qr!==null?{id:xi,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},E=cn(18,null,null,0),E.stateNode=w,E.return=s,s.child=E,Yt=s,it=null,E=!0):E=!1}E||Fr(s)}if(w=s.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return kh(w)?s.lanes=32:s.lanes=536870912,null;Oi(s)}return w=u.children,u=u.fallback,f?(rr(),f=s.mode,w=Eu({mode:"hidden",children:w},f),u=Pr(u,f,a,null),w.return=s,u.return=s,w.sibling=u,s.child=w,f=s.child,f.memoizedState=Hd(a),f.childLanes=Fd(i,b,a),s.memoizedState=Id,u):(ir(s),Gd(s,w))}if(E=i.memoizedState,E!==null&&(w=E.dehydrated,w!==null)){if(m)s.flags&256?(ir(s),s.flags&=-257,s=Yd(i,s,a)):s.memoizedState!==null?(rr(),s.child=i.child,s.flags|=128,s=null):(rr(),f=u.fallback,w=s.mode,u=Eu({mode:"visible",children:u.children},w),f=Pr(f,w,a,null),f.flags|=2,u.return=s,f.return=s,u.sibling=f,s.child=u,Gs(s,i.child,null,a),u=s.child,u.memoizedState=Hd(a),u.childLanes=Fd(i,b,a),s.memoizedState=Id,s=f);else if(ir(s),kh(w)){if(b=w.nextSibling&&w.nextSibling.dataset,b)var N=b.dgst;b=N,u=Error(r(419)),u.stack="",u.digest=b,ua({value:u,source:null,stack:null}),s=Yd(i,s,a)}else if(kt||ca(i,s,a,!1),b=(a&i.childLanes)!==0,kt||b){if(b=Fe,b!==null&&(u=a&-a,u=(u&42)!==0?1:Mf(u),u=(u&(b.suspendedLanes|a))!==0?0:u,u!==0&&u!==E.retryLane))throw E.retryLane=u,Bs(i,u),mn(b,i,u),kv;w.data==="$?"||dh(),s=Yd(i,s,a)}else w.data==="$?"?(s.flags|=192,s.child=i.child,s=null):(i=E.treeContext,it=In(w.nextSibling),Yt=s,$e=!0,Hr=null,ei=!1,i!==null&&(On[_n++]=xi,On[_n++]=Ti,On[_n++]=qr,xi=i.id,Ti=i.overflow,qr=s),s=Gd(s,u.children),s.flags|=4096);return s}return f?(rr(),f=u.fallback,w=s.mode,E=i.child,N=E.sibling,u=wi(E,{mode:"hidden",children:u.children}),u.subtreeFlags=E.subtreeFlags&65011712,N!==null?f=wi(N,f):(f=Pr(f,w,a,null),f.flags|=2),f.return=s,u.return=s,u.sibling=f,s.child=u,u=f,f=s.child,w=i.child.memoizedState,w===null?w=Hd(a):(E=w.cachePool,E!==null?(N=At._currentValue,E=E.parent!==N?{parent:N,pool:N}:E):E=Ab(),w={baseLanes:w.baseLanes|a,cachePool:E}),f.memoizedState=w,f.childLanes=Fd(i,b,a),s.memoizedState=Id,u):(ir(s),a=i.child,i=a.sibling,a=wi(a,{mode:"visible",children:u.children}),a.return=s,a.sibling=null,i!==null&&(b=s.deletions,b===null?(s.deletions=[i],s.flags|=16):b.push(i)),s.child=a,s.memoizedState=null,a)}function Gd(i,s){return s=Eu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Eu(i,s){return i=cn(22,i,null,s),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Yd(i,s,a){return Gs(s,i.child,null,a),i=Gd(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function zv(i,s,a){i.lanes|=s;var u=i.alternate;u!==null&&(u.lanes|=s),dd(i.return,s,a)}function Xd(i,s,a,u,f){var m=i.memoizedState;m===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:f}:(m.isBackwards=s,m.rendering=null,m.renderingStartTime=0,m.last=u,m.tail=a,m.tailMode=f)}function Uv(i,s,a){var u=s.pendingProps,f=u.revealOrder,m=u.tail;if(Bt(i,s,u.children,a),u=Et.current,(u&2)!==0)u=u&1|2,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&zv(i,a,s);else if(i.tag===19)zv(i,a,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}u&=1}switch(F(Et,u),f){case"forwards":for(a=s.child,f=null;a!==null;)i=a.alternate,i!==null&&wu(i)===null&&(f=a),a=a.sibling;a=f,a===null?(f=s.child,s.child=null):(f=a.sibling,a.sibling=null),Xd(s,!1,f,a,m);break;case"backwards":for(a=null,f=s.child,s.child=null;f!==null;){if(i=f.alternate,i!==null&&wu(i)===null){s.child=f;break}i=f.sibling,f.sibling=a,a=f,f=i}Xd(s,!0,a,null,m);break;case"together":Xd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function _i(i,s,a){if(i!==null&&(s.dependencies=i.dependencies),ur|=s.lanes,(a&s.childLanes)===0)if(i!==null){if(ca(i,s,a,!1),(a&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,a=wi(i,i.pendingProps),s.child=a,a.return=s;i.sibling!==null;)i=i.sibling,a=a.sibling=wi(i,i.pendingProps),a.return=s;a.sibling=null}return s.child}function Jd(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&su(i)))}function I_(i,s,a){switch(s.tag){case 3:Ve(s,s.stateNode.containerInfo),Qi(s,At,i.memoizedState.cache),la();break;case 27:case 5:Yi(s);break;case 4:Ve(s,s.stateNode.containerInfo);break;case 10:Qi(s,s.type,s.memoizedProps.value);break;case 13:var u=s.memoizedState;if(u!==null)return u.dehydrated!==null?(ir(s),s.flags|=128,null):(a&s.child.childLanes)!==0?Vv(i,s,a):(ir(s),i=_i(i,s,a),i!==null?i.sibling:null);ir(s);break;case 19:var f=(i.flags&128)!==0;if(u=(a&s.childLanes)!==0,u||(ca(i,s,a,!1),u=(a&s.childLanes)!==0),f){if(u)return Uv(i,s,a);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),F(Et,Et.current),u)break;return null;case 22:case 23:return s.lanes=0,Nv(i,s,a);case 24:Qi(s,At,i.memoizedState.cache)}return _i(i,s,a)}function Kv(i,s,a){if(i!==null)if(i.memoizedProps!==s.pendingProps)kt=!0;else{if(!Jd(i,a)&&(s.flags&128)===0)return kt=!1,I_(i,s,a);kt=(i.flags&131072)!==0}else kt=!1,$e&&(s.flags&1048576)!==0&&gb(s,ru,s.index);switch(s.lanes=0,s.tag){case 16:e:{i=s.pendingProps;var u=s.elementType,f=u._init;if(u=f(u._payload),s.type=u,typeof u=="function")sd(u)?(i=Zr(u,i),s.tag=1,s=Bv(null,s,u,i,a)):(s.tag=0,s=qd(null,s,u,i,a));else{if(u!=null){if(f=u.$$typeof,f===G){s.tag=11,s=Mv(null,s,u,i,a);break e}else if(f===te){s.tag=14,s=Cv(null,s,u,i,a);break e}}throw s=J(u)||u,Error(r(306,s,""))}}return s;case 0:return qd(i,s,s.type,s.pendingProps,a);case 1:return u=s.type,f=Zr(u,s.pendingProps),Bv(i,s,u,f,a);case 3:e:{if(Ve(s,s.stateNode.containerInfo),i===null)throw Error(r(387));u=s.pendingProps;var m=s.memoizedState;f=m.element,vd(i,s),ga(s,u,null,a);var b=s.memoizedState;if(u=b.cache,Qi(s,At,u),u!==m.cache&&hd(s,[At],a,!0),ya(),u=b.element,m.isDehydrated)if(m={element:u,isDehydrated:!1,cache:b.cache},s.updateQueue.baseState=m,s.memoizedState=m,s.flags&256){s=Lv(i,s,u,a);break e}else if(u!==f){f=En(Error(r(424)),s),ua(f),s=Lv(i,s,u,a);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(it=In(i.firstChild),Yt=s,$e=!0,Hr=null,ei=!0,a=vv(s,null,u,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(la(),u===f){s=_i(i,s,a);break e}Bt(i,s,u,a)}s=s.child}return s;case 26:return Au(i,s),i===null?(a=H0(s.type,null,s.pendingProps,null))?s.memoizedState=a:$e||(a=s.type,i=s.pendingProps,u=zu(oe.current).createElement(a),u[Pt]=s,u[Qt]=i,Vt(u,a,i),_t(u),s.stateNode=u):s.memoizedState=H0(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Yi(s),i===null&&$e&&(u=s.stateNode=P0(s.type,s.pendingProps,oe.current),Yt=s,ei=!0,f=it,hr(s.type)?(Mh=f,it=In(u.firstChild)):it=f),Bt(i,s,s.pendingProps.children,a),Au(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&$e&&((f=u=it)&&(u=bk(u,s.type,s.pendingProps,ei),u!==null?(s.stateNode=u,Yt=s,it=In(u.firstChild),ei=!1,f=!0):f=!1),f||Fr(s)),Yi(s),f=s.type,m=s.pendingProps,b=i!==null?i.memoizedProps:null,u=m.children,Rh(f,m)?u=null:b!==null&&Rh(f,b)&&(s.flags|=32),s.memoizedState!==null&&(f=Ed(i,s,B_,null,null,a),za._currentValue=f),Au(i,s),Bt(i,s,u,a),s.child;case 6:return i===null&&$e&&((i=a=it)&&(a=vk(a,s.pendingProps,ei),a!==null?(s.stateNode=a,Yt=s,it=null,i=!0):i=!1),i||Fr(s)),null;case 13:return Vv(i,s,a);case 4:return Ve(s,s.stateNode.containerInfo),u=s.pendingProps,i===null?s.child=Gs(s,null,u,a):Bt(i,s,u,a),s.child;case 11:return Mv(i,s,s.type,s.pendingProps,a);case 7:return Bt(i,s,s.pendingProps,a),s.child;case 8:return Bt(i,s,s.pendingProps.children,a),s.child;case 12:return Bt(i,s,s.pendingProps.children,a),s.child;case 10:return u=s.pendingProps,Qi(s,s.type,u.value),Bt(i,s,u.children,a),s.child;case 9:return f=s.type._context,u=s.pendingProps.children,Yr(s),f=qt(f),u=u(f),s.flags|=1,Bt(i,s,u,a),s.child;case 14:return Cv(i,s,s.type,s.pendingProps,a);case 15:return Dv(i,s,s.type,s.pendingProps,a);case 19:return Uv(i,s,a);case 31:return u=s.pendingProps,a=s.mode,u={mode:u.mode,children:u.children},i===null?(a=Eu(u,a),a.ref=s.ref,s.child=a,a.return=s,s=a):(a=wi(i.child,u),a.ref=s.ref,s.child=a,a.return=s,s=a),s;case 22:return Nv(i,s,a);case 24:return Yr(s),u=qt(At),i===null?(f=yd(),f===null&&(f=Fe,m=pd(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=a),f=m),s.memoizedState={parent:u,cache:f},bd(s),Qi(s,At,f)):((i.lanes&a)!==0&&(vd(i,s),ga(s,null,null,a),ya()),f=i.memoizedState,m=s.memoizedState,f.parent!==u?(f={parent:u,cache:u},s.memoizedState=f,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=f),Qi(s,At,u)):(u=m.cache,Qi(s,At,u),u!==f.cache&&hd(s,[At],a,!0))),Bt(i,s,s.pendingProps.children,a),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function ki(i){i.flags|=4}function Pv(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!J0(s)){if(s=kn.current,s!==null&&((Me&4194048)===Me?ti!==null:(Me&62914560)!==Me&&(Me&536870912)===0||s!==ti))throw pa=gd,Eb;i.flags|=8192}}function Ru(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Sg():536870912,i.lanes|=s,Zs|=s)}function Aa(i,s){if(!$e)switch(i.tailMode){case"hidden":s=i.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:u.sibling=null}}function et(i){var s=i.alternate!==null&&i.alternate.child===i.child,a=0,u=0;if(s)for(var f=i.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags&65011712,u|=f.flags&65011712,f.return=i,f=f.sibling;else for(f=i.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=i,f=f.sibling;return i.subtreeFlags|=u,i.childLanes=a,s}function H_(i,s,a){var u=s.pendingProps;switch(ud(s),s.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(s),null;case 1:return et(s),null;case 3:return a=s.stateNode,u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Ei(At),Sn(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(aa(s)?ki(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Sb())),et(s),null;case 26:return a=s.memoizedState,i===null?(ki(s),a!==null?(et(s),Pv(s,a)):(et(s),s.flags&=-16777217)):a?a!==i.memoizedState?(ki(s),et(s),Pv(s,a)):(et(s),s.flags&=-16777217):(i.memoizedProps!==u&&ki(s),et(s),s.flags&=-16777217),null;case 27:bi(s),a=oe.current;var f=s.type;if(i!==null&&s.stateNode!=null)i.memoizedProps!==u&&ki(s);else{if(!u){if(s.stateNode===null)throw Error(r(166));return et(s),null}i=re.current,aa(s)?bb(s):(i=P0(f,u,a),s.stateNode=i,ki(s))}return et(s),null;case 5:if(bi(s),a=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==u&&ki(s);else{if(!u){if(s.stateNode===null)throw Error(r(166));return et(s),null}if(i=re.current,aa(s))bb(s);else{switch(f=zu(oe.current),i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof u.is=="string"?f.createElement("select",{is:u.is}):f.createElement("select"),u.multiple?i.multiple=!0:u.size&&(i.size=u.size);break;default:i=typeof u.is=="string"?f.createElement(a,{is:u.is}):f.createElement(a)}}i[Pt]=s,i[Qt]=u;e:for(f=s.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===s)break e;for(;f.sibling===null;){if(f.return===null||f.return===s)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}s.stateNode=i;e:switch(Vt(i,a,u),a){case"button":case"input":case"select":case"textarea":i=!!u.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&ki(s)}}return et(s),s.flags&=-16777217,null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==u&&ki(s);else{if(typeof u!="string"&&s.stateNode===null)throw Error(r(166));if(i=oe.current,aa(s)){if(i=s.stateNode,a=s.memoizedProps,u=null,f=Yt,f!==null)switch(f.tag){case 27:case 5:u=f.memoizedProps}i[Pt]=s,i=!!(i.nodeValue===a||u!==null&&u.suppressHydrationWarning===!0||j0(i.nodeValue,a)),i||Fr(s)}else i=zu(i).createTextNode(u),i[Pt]=s,s.stateNode=i}return et(s),null;case 13:if(u=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=aa(s),u!==null&&u.dehydrated!==null){if(i===null){if(!f)throw Error(r(318));if(f=s.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[Pt]=s}else la(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;et(s),f=!1}else f=Sb(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return s.flags&256?(Oi(s),s):(Oi(s),null)}if(Oi(s),(s.flags&128)!==0)return s.lanes=a,s;if(a=u!==null,i=i!==null&&i.memoizedState!==null,a){u=s.child,f=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(f=u.alternate.memoizedState.cachePool.pool);var m=null;u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(m=u.memoizedState.cachePool.pool),m!==f&&(u.flags|=2048)}return a!==i&&a&&(s.child.flags|=8192),Ru(s,s.updateQueue),et(s),null;case 4:return Sn(),i===null&&wh(s.stateNode.containerInfo),et(s),null;case 10:return Ei(s.type),et(s),null;case 19:if(Z(Et),f=s.memoizedState,f===null)return et(s),null;if(u=(s.flags&128)!==0,m=f.rendering,m===null)if(u)Aa(f,!1);else{if(rt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(m=wu(i),m!==null){for(s.flags|=128,Aa(f,!1),i=m.updateQueue,s.updateQueue=i,Ru(s,i),s.subtreeFlags=0,i=a,a=s.child;a!==null;)yb(a,i),a=a.sibling;return F(Et,Et.current&1|2),s.child}i=i.sibling}f.tail!==null&&we()>ku&&(s.flags|=128,u=!0,Aa(f,!1),s.lanes=4194304)}else{if(!u)if(i=wu(m),i!==null){if(s.flags|=128,u=!0,i=i.updateQueue,s.updateQueue=i,Ru(s,i),Aa(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!$e)return et(s),null}else 2*we()-f.renderingStartTime>ku&&a!==536870912&&(s.flags|=128,u=!0,Aa(f,!1),s.lanes=4194304);f.isBackwards?(m.sibling=s.child,s.child=m):(i=f.last,i!==null?i.sibling=m:s.child=m,f.last=m)}return f.tail!==null?(s=f.tail,f.rendering=s,f.tail=s.sibling,f.renderingStartTime=we(),s.sibling=null,i=Et.current,F(Et,u?i&1|2:i&1),s):(et(s),null);case 22:case 23:return Oi(s),Td(),u=s.memoizedState!==null,i!==null?i.memoizedState!==null!==u&&(s.flags|=8192):u&&(s.flags|=8192),u?(a&536870912)!==0&&(s.flags&128)===0&&(et(s),s.subtreeFlags&6&&(s.flags|=8192)):et(s),a=s.updateQueue,a!==null&&Ru(s,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),u=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(u=s.memoizedState.cachePool.pool),u!==a&&(s.flags|=2048),i!==null&&Z(Xr),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),Ei(At),et(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function F_(i,s){switch(ud(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ei(At),Sn(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return bi(s),null;case 13:if(Oi(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));la()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return Z(Et),null;case 4:return Sn(),null;case 10:return Ei(s.type),null;case 22:case 23:return Oi(s),Td(),i!==null&&Z(Xr),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ei(At),null;case 25:return null;default:return null}}function qv(i,s){switch(ud(s),s.tag){case 3:Ei(At),Sn();break;case 26:case 27:case 5:bi(s);break;case 4:Sn();break;case 13:Oi(s);break;case 19:Z(Et);break;case 10:Ei(s.type);break;case 22:case 23:Oi(s),Td(),i!==null&&Z(Xr);break;case 24:Ei(At)}}function Ea(i,s){try{var a=s.updateQueue,u=a!==null?a.lastEffect:null;if(u!==null){var f=u.next;a=f;do{if((a.tag&i)===i){u=void 0;var m=a.create,b=a.inst;u=m(),b.destroy=u}a=a.next}while(a!==f)}}catch(w){qe(s,s.return,w)}}function sr(i,s,a){try{var u=s.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var m=f.next;u=m;do{if((u.tag&i)===i){var b=u.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,f=s;var E=a,N=w;try{N()}catch(U){qe(f,E,U)}}}u=u.next}while(u!==m)}}catch(U){qe(s,s.return,U)}}function Iv(i){var s=i.updateQueue;if(s!==null){var a=i.stateNode;try{Cb(s,a)}catch(u){qe(i,i.return,u)}}}function Hv(i,s,a){a.props=Zr(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(u){qe(i,s,u)}}function Ra(i,s){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var u=i.stateNode;break;case 30:u=i.stateNode;break;default:u=i.stateNode}typeof a=="function"?i.refCleanup=a(u):a.current=u}}catch(f){qe(i,s,f)}}function ni(i,s){var a=i.ref,u=i.refCleanup;if(a!==null)if(typeof u=="function")try{u()}catch(f){qe(i,s,f)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){qe(i,s,f)}else a.current=null}function Fv(i){var s=i.type,a=i.memoizedProps,u=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&u.focus();break e;case"img":a.src?u.src=a.src:a.srcSet&&(u.srcset=a.srcSet)}}catch(f){qe(i,i.return,f)}}function Zd(i,s,a){try{var u=i.stateNode;hk(u,i.type,a,s),u[Qt]=s}catch(f){qe(i,i.return,f)}}function Gv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&hr(i.type)||i.tag===4}function Qd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Gv(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&&hr(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 Wd(i,s,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(i),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=Vu));else if(u!==4&&(u===27&&hr(i.type)&&(a=i.stateNode,s=null),i=i.child,i!==null))for(Wd(i,s,a),i=i.sibling;i!==null;)Wd(i,s,a),i=i.sibling}function Ou(i,s,a){var u=i.tag;if(u===5||u===6)i=i.stateNode,s?a.insertBefore(i,s):a.appendChild(i);else if(u!==4&&(u===27&&hr(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(Ou(i,s,a),i=i.sibling;i!==null;)Ou(i,s,a),i=i.sibling}function Yv(i){var s=i.stateNode,a=i.memoizedProps;try{for(var u=i.type,f=s.attributes;f.length;)s.removeAttributeNode(f[0]);Vt(s,u,a),s[Pt]=i,s[Qt]=a}catch(m){qe(i,i.return,m)}}var Mi=!1,ft=!1,eh=!1,Xv=typeof WeakSet=="function"?WeakSet:Set,Mt=null;function G_(i,s){if(i=i.containerInfo,Ah=Hu,i=ob(i),Qf(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var f=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var b=0,w=-1,E=-1,N=0,U=0,I=i,j=null;t:for(;;){for(var L;I!==a||f!==0&&I.nodeType!==3||(w=b+f),I!==m||u!==0&&I.nodeType!==3||(E=b+u),I.nodeType===3&&(b+=I.nodeValue.length),(L=I.firstChild)!==null;)j=I,I=L;for(;;){if(I===i)break t;if(j===a&&++N===f&&(w=b),j===m&&++U===u&&(E=b),(L=I.nextSibling)!==null)break;I=j,j=I.parentNode}I=L}a=w===-1||E===-1?null:{start:w,end:E}}else a=null}a=a||{start:0,end:0}}else a=null;for(Eh={focusedElem:i,selectionRange:a},Hu=!1,Mt=s;Mt!==null;)if(s=Mt,i=s.child,(s.subtreeFlags&1024)!==0&&i!==null)i.return=s,Mt=i;else for(;Mt!==null;){switch(s=Mt,m=s.alternate,i=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&m!==null){i=void 0,a=s,f=m.memoizedProps,m=m.memoizedState,u=a.stateNode;try{var de=Zr(a.type,f,a.elementType===a.type);i=u.getSnapshotBeforeUpdate(de,m),u.__reactInternalSnapshotBeforeUpdate=i}catch(ue){qe(a,a.return,ue)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,a=i.nodeType,a===9)_h(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":_h(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(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Mt=i;break}Mt=s.return}}function Jv(i,s,a){var u=a.flags;switch(a.tag){case 0:case 11:case 15:or(i,a),u&4&&Ea(5,a);break;case 1:if(or(i,a),u&4)if(i=a.stateNode,s===null)try{i.componentDidMount()}catch(b){qe(a,a.return,b)}else{var f=Zr(a.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(f,s,i.__reactInternalSnapshotBeforeUpdate)}catch(b){qe(a,a.return,b)}}u&64&&Iv(a),u&512&&Ra(a,a.return);break;case 3:if(or(i,a),u&64&&(i=a.updateQueue,i!==null)){if(s=null,a.child!==null)switch(a.child.tag){case 27:case 5:s=a.child.stateNode;break;case 1:s=a.child.stateNode}try{Cb(i,s)}catch(b){qe(a,a.return,b)}}break;case 27:s===null&&u&4&&Yv(a);case 26:case 5:or(i,a),s===null&&u&4&&Fv(a),u&512&&Ra(a,a.return);break;case 12:or(i,a);break;case 13:or(i,a),u&4&&Wv(i,a),u&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=nk.bind(null,a),Sk(i,a))));break;case 22:if(u=a.memoizedState!==null||Mi,!u){s=s!==null&&s.memoizedState!==null||ft,f=Mi;var m=ft;Mi=u,(ft=s)&&!m?ar(i,a,(a.subtreeFlags&8772)!==0):or(i,a),Mi=f,ft=m}break;case 30:break;default:or(i,a)}}function Zv(i){var s=i.alternate;s!==null&&(i.alternate=null,Zv(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Nf(s)),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 Je=null,tn=!1;function Ci(i,s,a){for(a=a.child;a!==null;)Qv(i,s,a),a=a.sibling}function Qv(i,s,a){if(an&&typeof an.onCommitFiberUnmount=="function")try{an.onCommitFiberUnmount(Go,a)}catch{}switch(a.tag){case 26:ft||ni(a,s),Ci(i,s,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ft||ni(a,s);var u=Je,f=tn;hr(a.type)&&(Je=a.stateNode,tn=!1),Ci(i,s,a),ja(a.stateNode),Je=u,tn=f;break;case 5:ft||ni(a,s);case 6:if(u=Je,f=tn,Je=null,Ci(i,s,a),Je=u,tn=f,Je!==null)if(tn)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(a.stateNode)}catch(m){qe(a,s,m)}else try{Je.removeChild(a.stateNode)}catch(m){qe(a,s,m)}break;case 18:Je!==null&&(tn?(i=Je,U0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),qa(i)):U0(Je,a.stateNode));break;case 4:u=Je,f=tn,Je=a.stateNode.containerInfo,tn=!0,Ci(i,s,a),Je=u,tn=f;break;case 0:case 11:case 14:case 15:ft||sr(2,a,s),ft||sr(4,a,s),Ci(i,s,a);break;case 1:ft||(ni(a,s),u=a.stateNode,typeof u.componentWillUnmount=="function"&&Hv(a,s,u)),Ci(i,s,a);break;case 21:Ci(i,s,a);break;case 22:ft=(u=ft)||a.memoizedState!==null,Ci(i,s,a),ft=u;break;default:Ci(i,s,a)}}function Wv(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{qa(i)}catch(a){qe(s,s.return,a)}}function Y_(i){switch(i.tag){case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Xv),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Xv),s;default:throw Error(r(435,i.tag))}}function th(i,s){var a=Y_(i);s.forEach(function(u){var f=ik.bind(null,i,u);a.has(u)||(a.add(u),u.then(f,f))})}function fn(i,s){var a=s.deletions;if(a!==null)for(var u=0;u<a.length;u++){var f=a[u],m=i,b=s,w=b;e:for(;w!==null;){switch(w.tag){case 27:if(hr(w.type)){Je=w.stateNode,tn=!1;break e}break;case 5:Je=w.stateNode,tn=!1;break e;case 3:case 4:Je=w.stateNode.containerInfo,tn=!0;break e}w=w.return}if(Je===null)throw Error(r(160));Qv(m,b,f),Je=null,tn=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)e0(s,i),s=s.sibling}var qn=null;function e0(i,s){var a=i.alternate,u=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:fn(s,i),dn(i),u&4&&(sr(3,i,i.return),Ea(3,i),sr(5,i,i.return));break;case 1:fn(s,i),dn(i),u&512&&(ft||a===null||ni(a,a.return)),u&64&&Mi&&(i=i.updateQueue,i!==null&&(u=i.callbacks,u!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?u:a.concat(u))));break;case 26:var f=qn;if(fn(s,i),dn(i),u&512&&(ft||a===null||ni(a,a.return)),u&4){var m=a!==null?a.memoizedState:null;if(u=i.memoizedState,a===null)if(u===null)if(i.stateNode===null){e:{u=i.type,a=i.memoizedProps,f=f.ownerDocument||f;t:switch(u){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Jo]||m[Pt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(u),f.head.insertBefore(m,f.querySelector("head > title"))),Vt(m,u,a),m[Pt]=i,_t(m),u=m;break e;case"link":var b=Y0("link","href",f).get(u+(a.href||""));if(b){for(var w=0;w<b.length;w++)if(m=b[w],m.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&m.getAttribute("rel")===(a.rel==null?null:a.rel)&&m.getAttribute("title")===(a.title==null?null:a.title)&&m.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(w,1);break t}}m=f.createElement(u),Vt(m,u,a),f.head.appendChild(m);break;case"meta":if(b=Y0("meta","content",f).get(u+(a.content||""))){for(w=0;w<b.length;w++)if(m=b[w],m.getAttribute("content")===(a.content==null?null:""+a.content)&&m.getAttribute("name")===(a.name==null?null:a.name)&&m.getAttribute("property")===(a.property==null?null:a.property)&&m.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&m.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(w,1);break t}}m=f.createElement(u),Vt(m,u,a),f.head.appendChild(m);break;default:throw Error(r(468,u))}m[Pt]=i,_t(m),u=m}i.stateNode=u}else X0(f,i.type,i.stateNode);else i.stateNode=G0(f,u,i.memoizedProps);else m!==u?(m===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):m.count--,u===null?X0(f,i.type,i.stateNode):G0(f,u,i.memoizedProps)):u===null&&i.stateNode!==null&&Zd(i,i.memoizedProps,a.memoizedProps)}break;case 27:fn(s,i),dn(i),u&512&&(ft||a===null||ni(a,a.return)),a!==null&&u&4&&Zd(i,i.memoizedProps,a.memoizedProps);break;case 5:if(fn(s,i),dn(i),u&512&&(ft||a===null||ni(a,a.return)),i.flags&32){f=i.stateNode;try{ks(f,"")}catch(L){qe(i,i.return,L)}}u&4&&i.stateNode!=null&&(f=i.memoizedProps,Zd(i,f,a!==null?a.memoizedProps:f)),u&1024&&(eh=!0);break;case 6:if(fn(s,i),dn(i),u&4){if(i.stateNode===null)throw Error(r(162));u=i.memoizedProps,a=i.stateNode;try{a.nodeValue=u}catch(L){qe(i,i.return,L)}}break;case 3:if(Pu=null,f=qn,qn=Uu(s.containerInfo),fn(s,i),qn=f,dn(i),u&4&&a!==null&&a.memoizedState.isDehydrated)try{qa(s.containerInfo)}catch(L){qe(i,i.return,L)}eh&&(eh=!1,t0(i));break;case 4:u=qn,qn=Uu(i.stateNode.containerInfo),fn(s,i),dn(i),qn=u;break;case 12:fn(s,i),dn(i);break;case 13:fn(s,i),dn(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(ah=we()),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,th(i,u)));break;case 22:f=i.memoizedState!==null;var E=a!==null&&a.memoizedState!==null,N=Mi,U=ft;if(Mi=N||f,ft=U||E,fn(s,i),ft=U,Mi=N,dn(i),u&8192)e:for(s=i.stateNode,s._visibility=f?s._visibility&-2:s._visibility|1,f&&(a===null||E||Mi||ft||Qr(i)),a=null,s=i;;){if(s.tag===5||s.tag===26){if(a===null){E=a=s;try{if(m=E.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{w=E.stateNode;var I=E.memoizedProps.style,j=I!=null&&I.hasOwnProperty("display")?I.display:null;w.style.display=j==null||typeof j=="boolean"?"":(""+j).trim()}}catch(L){qe(E,E.return,L)}}}else if(s.tag===6){if(a===null){E=s;try{E.stateNode.nodeValue=f?"":E.memoizedProps}catch(L){qe(E,E.return,L)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;a===s&&(a=null),s=s.return}a===s&&(a=null),s.sibling.return=s.return,s=s.sibling}u&4&&(u=i.updateQueue,u!==null&&(a=u.retryQueue,a!==null&&(u.retryQueue=null,th(i,a))));break;case 19:fn(s,i),dn(i),u&4&&(u=i.updateQueue,u!==null&&(i.updateQueue=null,th(i,u)));break;case 30:break;case 21:break;default:fn(s,i),dn(i)}}function dn(i){var s=i.flags;if(s&2){try{for(var a,u=i.return;u!==null;){if(Gv(u)){a=u;break}u=u.return}if(a==null)throw Error(r(160));switch(a.tag){case 27:var f=a.stateNode,m=Qd(i);Ou(i,m,f);break;case 5:var b=a.stateNode;a.flags&32&&(ks(b,""),a.flags&=-33);var w=Qd(i);Ou(i,w,b);break;case 3:case 4:var E=a.stateNode.containerInfo,N=Qd(i);Wd(i,N,E);break;default:throw Error(r(161))}}catch(U){qe(i,i.return,U)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function t0(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;t0(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function or(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Jv(i,s.alternate,s),s=s.sibling}function Qr(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:sr(4,s,s.return),Qr(s);break;case 1:ni(s,s.return);var a=s.stateNode;typeof a.componentWillUnmount=="function"&&Hv(s,s.return,a),Qr(s);break;case 27:ja(s.stateNode);case 26:case 5:ni(s,s.return),Qr(s);break;case 22:s.memoizedState===null&&Qr(s);break;case 30:Qr(s);break;default:Qr(s)}i=i.sibling}}function ar(i,s,a){for(a=a&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var u=s.alternate,f=i,m=s,b=m.flags;switch(m.tag){case 0:case 11:case 15:ar(f,m,a),Ea(4,m);break;case 1:if(ar(f,m,a),u=m,f=u.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(N){qe(u,u.return,N)}if(u=m,f=u.updateQueue,f!==null){var w=u.stateNode;try{var E=f.shared.hiddenCallbacks;if(E!==null)for(f.shared.hiddenCallbacks=null,f=0;f<E.length;f++)Mb(E[f],w)}catch(N){qe(u,u.return,N)}}a&&b&64&&Iv(m),Ra(m,m.return);break;case 27:Yv(m);case 26:case 5:ar(f,m,a),a&&u===null&&b&4&&Fv(m),Ra(m,m.return);break;case 12:ar(f,m,a);break;case 13:ar(f,m,a),a&&b&4&&Wv(f,m);break;case 22:m.memoizedState===null&&ar(f,m,a),Ra(m,m.return);break;case 30:break;default:ar(f,m,a)}s=s.sibling}}function nh(i,s){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&fa(a))}function ih(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&fa(i))}function ii(i,s,a,u){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)n0(i,s,a,u),s=s.sibling}function n0(i,s,a,u){var f=s.flags;switch(s.tag){case 0:case 11:case 15:ii(i,s,a,u),f&2048&&Ea(9,s);break;case 1:ii(i,s,a,u);break;case 3:ii(i,s,a,u),f&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&fa(i)));break;case 12:if(f&2048){ii(i,s,a,u),i=s.stateNode;try{var m=s.memoizedProps,b=m.id,w=m.onPostCommit;typeof w=="function"&&w(b,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(E){qe(s,s.return,E)}}else ii(i,s,a,u);break;case 13:ii(i,s,a,u);break;case 23:break;case 22:m=s.stateNode,b=s.alternate,s.memoizedState!==null?m._visibility&2?ii(i,s,a,u):Oa(i,s):m._visibility&2?ii(i,s,a,u):(m._visibility|=2,Ys(i,s,a,u,(s.subtreeFlags&10256)!==0)),f&2048&&nh(b,s);break;case 24:ii(i,s,a,u),f&2048&&ih(s.alternate,s);break;default:ii(i,s,a,u)}}function Ys(i,s,a,u,f){for(f=f&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;){var m=i,b=s,w=a,E=u,N=b.flags;switch(b.tag){case 0:case 11:case 15:Ys(m,b,w,E,f),Ea(8,b);break;case 23:break;case 22:var U=b.stateNode;b.memoizedState!==null?U._visibility&2?Ys(m,b,w,E,f):Oa(m,b):(U._visibility|=2,Ys(m,b,w,E,f)),f&&N&2048&&nh(b.alternate,b);break;case 24:Ys(m,b,w,E,f),f&&N&2048&&ih(b.alternate,b);break;default:Ys(m,b,w,E,f)}s=s.sibling}}function Oa(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var a=i,u=s,f=u.flags;switch(u.tag){case 22:Oa(a,u),f&2048&&nh(u.alternate,u);break;case 24:Oa(a,u),f&2048&&ih(u.alternate,u);break;default:Oa(a,u)}s=s.sibling}}var _a=8192;function Xs(i){if(i.subtreeFlags&_a)for(i=i.child;i!==null;)i0(i),i=i.sibling}function i0(i){switch(i.tag){case 26:Xs(i),i.flags&_a&&i.memoizedState!==null&&Nk(qn,i.memoizedState,i.memoizedProps);break;case 5:Xs(i);break;case 3:case 4:var s=qn;qn=Uu(i.stateNode.containerInfo),Xs(i),qn=s;break;case 22:i.memoizedState===null&&(s=i.alternate,s!==null&&s.memoizedState!==null?(s=_a,_a=16777216,Xs(i),_a=s):Xs(i));break;default:Xs(i)}}function r0(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function ka(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var u=s[a];Mt=u,o0(u,i)}r0(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)s0(i),i=i.sibling}function s0(i){switch(i.tag){case 0:case 11:case 15:ka(i),i.flags&2048&&sr(9,i,i.return);break;case 3:ka(i);break;case 12:ka(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,_u(i)):ka(i);break;default:ka(i)}}function _u(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var u=s[a];Mt=u,o0(u,i)}r0(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:sr(8,s,s.return),_u(s);break;case 22:a=s.stateNode,a._visibility&2&&(a._visibility&=-3,_u(s));break;default:_u(s)}i=i.sibling}}function o0(i,s){for(;Mt!==null;){var a=Mt;switch(a.tag){case 0:case 11:case 15:sr(8,a,s);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var u=a.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:fa(a.memoizedState.cache)}if(u=a.child,u!==null)u.return=a,Mt=u;else e:for(a=i;Mt!==null;){u=Mt;var f=u.sibling,m=u.return;if(Zv(u),u===a){Mt=null;break e}if(f!==null){f.return=m,Mt=f;break e}Mt=m}}}var X_={getCacheForType:function(i){var s=qt(At),a=s.data.get(i);return a===void 0&&(a=i(),s.data.set(i,a)),a}},J_=typeof WeakMap=="function"?WeakMap:Map,Be=0,Fe=null,Ee=null,Me=0,Le=0,hn=null,lr=!1,Js=!1,rh=!1,Di=0,rt=0,ur=0,Wr=0,sh=0,Mn=0,Zs=0,Ma=null,nn=null,oh=!1,ah=0,ku=1/0,Mu=null,cr=null,Lt=0,fr=null,Qs=null,Ws=0,lh=0,uh=null,a0=null,Ca=0,ch=null;function pn(){if((Be&2)!==0&&Me!==0)return Me&-Me;if(B.T!==null){var i=Us;return i!==0?i:gh()}return Tg()}function l0(){Mn===0&&(Mn=(Me&536870912)===0||$e?vg():536870912);var i=kn.current;return i!==null&&(i.flags|=32),Mn}function mn(i,s,a){(i===Fe&&(Le===2||Le===9)||i.cancelPendingCommit!==null)&&(eo(i,0),dr(i,Me,Mn,!1)),Xo(i,a),((Be&2)===0||i!==Fe)&&(i===Fe&&((Be&2)===0&&(Wr|=a),rt===4&&dr(i,Me,Mn,!1)),ri(i))}function u0(i,s,a){if((Be&6)!==0)throw Error(r(327));var u=!a&&(s&124)===0&&(s&i.expiredLanes)===0||Yo(i,s),f=u?W_(i,s):hh(i,s,!0),m=u;do{if(f===0){Js&&!u&&dr(i,s,0,!1);break}else{if(a=i.current.alternate,m&&!Z_(a)){f=hh(i,s,!1),m=!1;continue}if(f===2){if(m=s,i.errorRecoveryDisabledLanes&m)var b=0;else b=i.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){s=b;e:{var w=i;f=Ma;var E=w.current.memoizedState.isDehydrated;if(E&&(eo(w,b).flags|=256),b=hh(w,b,!1),b!==2){if(rh&&!E){w.errorRecoveryDisabledLanes|=m,Wr|=m,f=4;break e}m=nn,nn=f,m!==null&&(nn===null?nn=m:nn.push.apply(nn,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){eo(i,0),dr(i,s,0,!0);break}e:{switch(u=i,m=f,m){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:dr(u,s,Mn,!lr);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(f=ah+300-we(),10<f)){if(dr(u,s,Mn,!lr),Kl(u,0,!0)!==0)break e;u.timeoutHandle=V0(c0.bind(null,u,a,nn,Mu,oh,s,Mn,Wr,Zs,lr,m,2,-0,0),f);break e}c0(u,a,nn,Mu,oh,s,Mn,Wr,Zs,lr,m,0,-0,0)}}break}while(!0);ri(i)}function c0(i,s,a,u,f,m,b,w,E,N,U,I,j,L){if(i.timeoutHandle=-1,I=s.subtreeFlags,(I&8192||(I&16785408)===16785408)&&(Va={stylesheets:null,count:0,unsuspend:Dk},i0(s),I=$k(),I!==null)){i.cancelPendingCommit=I(g0.bind(null,i,s,m,a,u,f,b,w,E,U,1,j,L)),dr(i,m,b,!N);return}g0(i,s,m,a,u,f,b,w,E)}function Z_(i){for(var s=i;;){var a=s.tag;if((a===0||a===11||a===15)&&s.flags&16384&&(a=s.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var u=0;u<a.length;u++){var f=a[u],m=f.getSnapshot;f=f.value;try{if(!un(m(),f))return!1}catch{return!1}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function dr(i,s,a,u){s&=~sh,s&=~Wr,i.suspendedLanes|=s,i.pingedLanes&=~s,u&&(i.warmLanes|=s),u=i.expirationTimes;for(var f=s;0<f;){var m=31-ln(f),b=1<<m;u[m]=-1,f&=~b}a!==0&&wg(i,a,s)}function Cu(){return(Be&6)===0?(Da(0),!1):!0}function fh(){if(Ee!==null){if(Le===0)var i=Ee.return;else i=Ee,Ai=Gr=null,_d(i),Fs=null,xa=0,i=Ee;for(;i!==null;)qv(i.alternate,i),i=i.return;Ee=null}}function eo(i,s){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,mk(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),fh(),Fe=i,Ee=a=wi(i.current,null),Me=s,Le=0,hn=null,lr=!1,Js=Yo(i,s),rh=!1,Zs=Mn=sh=Wr=ur=rt=0,nn=Ma=null,oh=!1,(s&8)!==0&&(s|=s&32);var u=i.entangledLanes;if(u!==0)for(i=i.entanglements,u&=s;0<u;){var f=31-ln(u),m=1<<f;s|=i[f],u&=~m}return Di=s,Wl(),a}function f0(i,s){xe=null,B.H=bu,s===ha||s===lu?(s=_b(),Le=3):s===Eb?(s=_b(),Le=4):Le=s===kv?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,hn=s,Ee===null&&(rt=1,Tu(i,En(s,i.current)))}function d0(){var i=B.H;return B.H=bu,i===null?bu:i}function h0(){var i=B.A;return B.A=X_,i}function dh(){rt=4,lr||(Me&4194048)!==Me&&kn.current!==null||(Js=!0),(ur&134217727)===0&&(Wr&134217727)===0||Fe===null||dr(Fe,Me,Mn,!1)}function hh(i,s,a){var u=Be;Be|=2;var f=d0(),m=h0();(Fe!==i||Me!==s)&&(Mu=null,eo(i,s)),s=!1;var b=rt;e:do try{if(Le!==0&&Ee!==null){var w=Ee,E=hn;switch(Le){case 8:fh(),b=6;break e;case 3:case 2:case 9:case 6:kn.current===null&&(s=!0);var N=Le;if(Le=0,hn=null,to(i,w,E,N),a&&Js){b=0;break e}break;default:N=Le,Le=0,hn=null,to(i,w,E,N)}}Q_(),b=rt;break}catch(U){f0(i,U)}while(!0);return s&&i.shellSuspendCounter++,Ai=Gr=null,Be=u,B.H=f,B.A=m,Ee===null&&(Fe=null,Me=0,Wl()),b}function Q_(){for(;Ee!==null;)p0(Ee)}function W_(i,s){var a=Be;Be|=2;var u=d0(),f=h0();Fe!==i||Me!==s?(Mu=null,ku=we()+500,eo(i,s)):Js=Yo(i,s);e:do try{if(Le!==0&&Ee!==null){s=Ee;var m=hn;t:switch(Le){case 1:Le=0,hn=null,to(i,s,m,1);break;case 2:case 9:if(Rb(m)){Le=0,hn=null,m0(s);break}s=function(){Le!==2&&Le!==9||Fe!==i||(Le=7),ri(i)},m.then(s,s);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:Rb(m)?(Le=0,hn=null,m0(s)):(Le=0,hn=null,to(i,s,m,7));break;case 5:var b=null;switch(Ee.tag){case 26:b=Ee.memoizedState;case 5:case 27:var w=Ee;if(!b||J0(b)){Le=0,hn=null;var E=w.sibling;if(E!==null)Ee=E;else{var N=w.return;N!==null?(Ee=N,Du(N)):Ee=null}break t}}Le=0,hn=null,to(i,s,m,5);break;case 6:Le=0,hn=null,to(i,s,m,6);break;case 8:fh(),rt=6;break e;default:throw Error(r(462))}}ek();break}catch(U){f0(i,U)}while(!0);return Ai=Gr=null,B.H=u,B.A=f,Be=a,Ee!==null?0:(Fe=null,Me=0,Wl(),rt)}function ek(){for(;Ee!==null&&!We();)p0(Ee)}function p0(i){var s=Kv(i.alternate,i,Di);i.memoizedProps=i.pendingProps,s===null?Du(i):Ee=s}function m0(i){var s=i,a=s.alternate;switch(s.tag){case 15:case 0:s=jv(a,s,s.pendingProps,s.type,void 0,Me);break;case 11:s=jv(a,s,s.pendingProps,s.type.render,s.ref,Me);break;case 5:_d(s);default:qv(a,s),s=Ee=yb(s,Di),s=Kv(a,s,Di)}i.memoizedProps=i.pendingProps,s===null?Du(i):Ee=s}function to(i,s,a,u){Ai=Gr=null,_d(s),Fs=null,xa=0;var f=s.return;try{if(q_(i,f,s,a,Me)){rt=1,Tu(i,En(a,i.current)),Ee=null;return}}catch(m){if(f!==null)throw Ee=f,m;rt=1,Tu(i,En(a,i.current)),Ee=null;return}s.flags&32768?($e||u===1?i=!0:Js||(Me&536870912)!==0?i=!1:(lr=i=!0,(u===2||u===9||u===3||u===6)&&(u=kn.current,u!==null&&u.tag===13&&(u.flags|=16384))),y0(s,i)):Du(s)}function Du(i){var s=i;do{if((s.flags&32768)!==0){y0(s,lr);return}i=s.return;var a=H_(s.alternate,s,Di);if(a!==null){Ee=a;return}if(s=s.sibling,s!==null){Ee=s;return}Ee=s=i}while(s!==null);rt===0&&(rt=5)}function y0(i,s){do{var a=F_(i.alternate,i);if(a!==null){a.flags&=32767,Ee=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!s&&(i=i.sibling,i!==null)){Ee=i;return}Ee=i=a}while(i!==null);rt=6,Ee=null}function g0(i,s,a,u,f,m,b,w,E){i.cancelPendingCommit=null;do Nu();while(Lt!==0);if((Be&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(m=s.lanes|s.childLanes,m|=id,DO(i,a,m,b,w,E),i===Fe&&(Ee=Fe=null,Me=0),Qs=s,fr=i,Ws=a,lh=m,uh=f,a0=u,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,rk(wn,function(){return x0(),null})):(i.callbackNode=null,i.callbackPriority=0),u=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||u){u=B.T,B.T=null,f=K.p,K.p=2,b=Be,Be|=4;try{G_(i,s,a)}finally{Be=b,K.p=f,B.T=u}}Lt=1,b0(),v0(),S0()}}function b0(){if(Lt===1){Lt=0;var i=fr,s=Qs,a=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||a){a=B.T,B.T=null;var u=K.p;K.p=2;var f=Be;Be|=4;try{e0(s,i);var m=Eh,b=ob(i.containerInfo),w=m.focusedElem,E=m.selectionRange;if(b!==w&&w&&w.ownerDocument&&sb(w.ownerDocument.documentElement,w)){if(E!==null&&Qf(w)){var N=E.start,U=E.end;if(U===void 0&&(U=N),"selectionStart"in w)w.selectionStart=N,w.selectionEnd=Math.min(U,w.value.length);else{var I=w.ownerDocument||document,j=I&&I.defaultView||window;if(j.getSelection){var L=j.getSelection(),de=w.textContent.length,ue=Math.min(E.start,de),Ke=E.end===void 0?ue:Math.min(E.end,de);!L.extend&&ue>Ke&&(b=Ke,Ke=ue,ue=b);var k=rb(w,ue),R=rb(w,Ke);if(k&&R&&(L.rangeCount!==1||L.anchorNode!==k.node||L.anchorOffset!==k.offset||L.focusNode!==R.node||L.focusOffset!==R.offset)){var D=I.createRange();D.setStart(k.node,k.offset),L.removeAllRanges(),ue>Ke?(L.addRange(D),L.extend(R.node,R.offset)):(D.setEnd(R.node,R.offset),L.addRange(D))}}}}for(I=[],L=w;L=L.parentNode;)L.nodeType===1&&I.push({element:L,left:L.scrollLeft,top:L.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<I.length;w++){var P=I[w];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}Hu=!!Ah,Eh=Ah=null}finally{Be=f,K.p=u,B.T=a}}i.current=s,Lt=2}}function v0(){if(Lt===2){Lt=0;var i=fr,s=Qs,a=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||a){a=B.T,B.T=null;var u=K.p;K.p=2;var f=Be;Be|=4;try{Jv(i,s.alternate,s)}finally{Be=f,K.p=u,B.T=a}}Lt=3}}function S0(){if(Lt===4||Lt===3){Lt=0,Tt();var i=fr,s=Qs,a=Ws,u=a0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Lt=5:(Lt=0,Qs=fr=null,w0(i,i.pendingLanes));var f=i.pendingLanes;if(f===0&&(cr=null),Cf(a),s=s.stateNode,an&&typeof an.onCommitFiberRoot=="function")try{an.onCommitFiberRoot(Go,s,void 0,(s.current.flags&128)===128)}catch{}if(u!==null){s=B.T,f=K.p,K.p=2,B.T=null;try{for(var m=i.onRecoverableError,b=0;b<u.length;b++){var w=u[b];m(w.value,{componentStack:w.stack})}}finally{B.T=s,K.p=f}}(Ws&3)!==0&&Nu(),ri(i),f=i.pendingLanes,(a&4194090)!==0&&(f&42)!==0?i===ch?Ca++:(Ca=0,ch=i):Ca=0,Da(0)}}function w0(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,fa(s)))}function Nu(i){return b0(),v0(),S0(),x0()}function x0(){if(Lt!==5)return!1;var i=fr,s=lh;lh=0;var a=Cf(Ws),u=B.T,f=K.p;try{K.p=32>a?32:a,B.T=null,a=uh,uh=null;var m=fr,b=Ws;if(Lt=0,Qs=fr=null,Ws=0,(Be&6)!==0)throw Error(r(331));var w=Be;if(Be|=4,s0(m.current),n0(m,m.current,b,a),Be=w,Da(0,!1),an&&typeof an.onPostCommitFiberRoot=="function")try{an.onPostCommitFiberRoot(Go,m)}catch{}return!0}finally{K.p=f,B.T=u,w0(i,s)}}function T0(i,s,a){s=En(a,s),s=Pd(i.stateNode,s,2),i=tr(i,s,2),i!==null&&(Xo(i,2),ri(i))}function qe(i,s,a){if(i.tag===3)T0(i,i,a);else for(;s!==null;){if(s.tag===3){T0(s,i,a);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(cr===null||!cr.has(u))){i=En(a,i),a=Ov(2),u=tr(s,a,2),u!==null&&(_v(a,u,s,i),Xo(u,2),ri(u));break}}s=s.return}}function ph(i,s,a){var u=i.pingCache;if(u===null){u=i.pingCache=new J_;var f=new Set;u.set(s,f)}else f=u.get(s),f===void 0&&(f=new Set,u.set(s,f));f.has(a)||(rh=!0,f.add(a),i=tk.bind(null,i,s,a),s.then(i,i))}function tk(i,s,a){var u=i.pingCache;u!==null&&u.delete(s),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,Fe===i&&(Me&a)===a&&(rt===4||rt===3&&(Me&62914560)===Me&&300>we()-ah?(Be&2)===0&&eo(i,0):sh|=a,Zs===Me&&(Zs=0)),ri(i)}function A0(i,s){s===0&&(s=Sg()),i=Bs(i,s),i!==null&&(Xo(i,s),ri(i))}function nk(i){var s=i.memoizedState,a=0;s!==null&&(a=s.retryLane),A0(i,a)}function ik(i,s){var a=0;switch(i.tag){case 13:var u=i.stateNode,f=i.memoizedState;f!==null&&(a=f.retryLane);break;case 19:u=i.stateNode;break;case 22:u=i.stateNode._retryCache;break;default:throw Error(r(314))}u!==null&&u.delete(s),A0(i,a)}function rk(i,s){return ke(i,s)}var $u=null,no=null,mh=!1,ju=!1,yh=!1,es=0;function ri(i){i!==no&&i.next===null&&(no===null?$u=no=i:no=no.next=i),ju=!0,mh||(mh=!0,ok())}function Da(i,s){if(!yh&&ju){yh=!0;do for(var a=!1,u=$u;u!==null;){if(i!==0){var f=u.pendingLanes;if(f===0)var m=0;else{var b=u.suspendedLanes,w=u.pingedLanes;m=(1<<31-ln(42|i)+1)-1,m&=f&~(b&~w),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,_0(u,m))}else m=Me,m=Kl(u,u===Fe?m:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(m&3)===0||Yo(u,m)||(a=!0,_0(u,m));u=u.next}while(a);yh=!1}}function sk(){E0()}function E0(){ju=mh=!1;var i=0;es!==0&&(pk()&&(i=es),es=0);for(var s=we(),a=null,u=$u;u!==null;){var f=u.next,m=R0(u,s);m===0?(u.next=null,a===null?$u=f:a.next=f,f===null&&(no=a)):(a=u,(i!==0||(m&3)!==0)&&(ju=!0)),u=f}Da(i)}function R0(i,s){for(var a=i.suspendedLanes,u=i.pingedLanes,f=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var b=31-ln(m),w=1<<b,E=f[b];E===-1?((w&a)===0||(w&u)!==0)&&(f[b]=CO(w,s)):E<=s&&(i.expiredLanes|=w),m&=~w}if(s=Fe,a=Me,a=Kl(i,i===s?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u=i.callbackNode,a===0||i===s&&(Le===2||Le===9)||i.cancelPendingCommit!==null)return u!==null&&u!==null&&Te(u),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||Yo(i,a)){if(s=a&-a,s===i.callbackPriority)return s;switch(u!==null&&Te(u),Cf(a)){case 2:case 8:a=Kt;break;case 32:a=wn;break;case 268435456:a=xn;break;default:a=wn}return u=O0.bind(null,i),a=ke(a,u),i.callbackPriority=s,i.callbackNode=a,s}return u!==null&&u!==null&&Te(u),i.callbackPriority=2,i.callbackNode=null,2}function O0(i,s){if(Lt!==0&&Lt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(Nu()&&i.callbackNode!==a)return null;var u=Me;return u=Kl(i,i===Fe?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),u===0?null:(u0(i,u,s),R0(i,we()),i.callbackNode!=null&&i.callbackNode===a?O0.bind(null,i):null)}function _0(i,s){if(Nu())return null;u0(i,s,!0)}function ok(){yk(function(){(Be&6)!==0?ke(Gt,sk):E0()})}function gh(){return es===0&&(es=vg()),es}function k0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Fl(""+i)}function M0(i,s){var a=s.ownerDocument.createElement("input");return a.name=s.name,a.value=s.value,i.id&&a.setAttribute("form",i.id),s.parentNode.insertBefore(a,s),i=new FormData(i),a.parentNode.removeChild(a),i}function ak(i,s,a,u,f){if(s==="submit"&&a&&a.stateNode===f){var m=k0((f[Qt]||null).action),b=u.submitter;b&&(s=(s=b[Qt]||null)?k0(s.formAction):b.getAttribute("formAction"),s!==null&&(m=s,b=null));var w=new Jl("action","action",null,u,f);i.push({event:w,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(es!==0){var E=b?M0(f,b):new FormData(f);Ld(a,{pending:!0,data:E,method:f.method,action:m},null,E)}}else typeof m=="function"&&(w.preventDefault(),E=b?M0(f,b):new FormData(f),Ld(a,{pending:!0,data:E,method:f.method,action:m},m,E))},currentTarget:f}]})}}for(var bh=0;bh<nd.length;bh++){var vh=nd[bh],lk=vh.toLowerCase(),uk=vh[0].toUpperCase()+vh.slice(1);Pn(lk,"on"+uk)}Pn(ub,"onAnimationEnd"),Pn(cb,"onAnimationIteration"),Pn(fb,"onAnimationStart"),Pn("dblclick","onDoubleClick"),Pn("focusin","onFocus"),Pn("focusout","onBlur"),Pn(R_,"onTransitionRun"),Pn(O_,"onTransitionStart"),Pn(__,"onTransitionCancel"),Pn(db,"onTransitionEnd"),Rs("onMouseEnter",["mouseout","mouseover"]),Rs("onMouseLeave",["mouseout","mouseover"]),Rs("onPointerEnter",["pointerout","pointerover"]),Rs("onPointerLeave",["pointerout","pointerover"]),Vr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Na="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(" "),ck=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Na));function C0(i,s){s=(s&4)!==0;for(var a=0;a<i.length;a++){var u=i[a],f=u.event;u=u.listeners;e:{var m=void 0;if(s)for(var b=u.length-1;0<=b;b--){var w=u[b],E=w.instance,N=w.currentTarget;if(w=w.listener,E!==m&&f.isPropagationStopped())break e;m=w,f.currentTarget=N;try{m(f)}catch(U){xu(U)}f.currentTarget=null,m=E}else for(b=0;b<u.length;b++){if(w=u[b],E=w.instance,N=w.currentTarget,w=w.listener,E!==m&&f.isPropagationStopped())break e;m=w,f.currentTarget=N;try{m(f)}catch(U){xu(U)}f.currentTarget=null,m=E}}}}function Re(i,s){var a=s[Df];a===void 0&&(a=s[Df]=new Set);var u=i+"__bubble";a.has(u)||(D0(s,i,2,!1),a.add(u))}function Sh(i,s,a){var u=0;s&&(u|=4),D0(a,i,u,s)}var Bu="_reactListening"+Math.random().toString(36).slice(2);function wh(i){if(!i[Bu]){i[Bu]=!0,Eg.forEach(function(a){a!=="selectionchange"&&(ck.has(a)||Sh(a,!1,i),Sh(a,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Bu]||(s[Bu]=!0,Sh("selectionchange",!1,s))}}function D0(i,s,a,u){switch(nS(s)){case 2:var f=Lk;break;case 8:f=Vk;break;default:f=jh}a=f.bind(null,s,a,i),f=void 0,!qf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),u?f!==void 0?i.addEventListener(s,a,{capture:!0,passive:f}):i.addEventListener(s,a,!0):f!==void 0?i.addEventListener(s,a,{passive:f}):i.addEventListener(s,a,!1)}function xh(i,s,a,u,f){var m=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var b=u.tag;if(b===3||b===4){var w=u.stateNode.containerInfo;if(w===f)break;if(b===4)for(b=u.return;b!==null;){var E=b.tag;if((E===3||E===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;w!==null;){if(b=Ts(w),b===null)return;if(E=b.tag,E===5||E===6||E===26||E===27){u=m=b;continue e}w=w.parentNode}}u=u.return}zg(function(){var N=m,U=Kf(a),I=[];e:{var j=hb.get(i);if(j!==void 0){var L=Jl,de=i;switch(i){case"keypress":if(Yl(a)===0)break e;case"keydown":case"keyup":L=r_;break;case"focusin":de="focus",L=Gf;break;case"focusout":de="blur",L=Gf;break;case"beforeblur":case"afterblur":L=Gf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":L=Pg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":L=FO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":L=a_;break;case ub:case cb:case fb:L=XO;break;case db:L=u_;break;case"scroll":case"scrollend":L=IO;break;case"wheel":L=f_;break;case"copy":case"cut":case"paste":L=ZO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":L=Ig;break;case"toggle":case"beforetoggle":L=h_}var ue=(s&4)!==0,Ke=!ue&&(i==="scroll"||i==="scrollend"),k=ue?j!==null?j+"Capture":null:j;ue=[];for(var R=N,D;R!==null;){var P=R;if(D=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||D===null||k===null||(P=Qo(R,k),P!=null&&ue.push($a(R,P,D))),Ke)break;R=R.return}0<ue.length&&(j=new L(j,de,null,a,U),I.push({event:j,listeners:ue}))}}if((s&7)===0){e:{if(j=i==="mouseover"||i==="pointerover",L=i==="mouseout"||i==="pointerout",j&&a!==Uf&&(de=a.relatedTarget||a.fromElement)&&(Ts(de)||de[xs]))break e;if((L||j)&&(j=U.window===U?U:(j=U.ownerDocument)?j.defaultView||j.parentWindow:window,L?(de=a.relatedTarget||a.toElement,L=N,de=de?Ts(de):null,de!==null&&(Ke=l(de),ue=de.tag,de!==Ke||ue!==5&&ue!==27&&ue!==6)&&(de=null)):(L=null,de=N),L!==de)){if(ue=Pg,P="onMouseLeave",k="onMouseEnter",R="mouse",(i==="pointerout"||i==="pointerover")&&(ue=Ig,P="onPointerLeave",k="onPointerEnter",R="pointer"),Ke=L==null?j:Zo(L),D=de==null?j:Zo(de),j=new ue(P,R+"leave",L,a,U),j.target=Ke,j.relatedTarget=D,P=null,Ts(U)===N&&(ue=new ue(k,R+"enter",de,a,U),ue.target=D,ue.relatedTarget=Ke,P=ue),Ke=P,L&&de)t:{for(ue=L,k=de,R=0,D=ue;D;D=io(D))R++;for(D=0,P=k;P;P=io(P))D++;for(;0<R-D;)ue=io(ue),R--;for(;0<D-R;)k=io(k),D--;for(;R--;){if(ue===k||k!==null&&ue===k.alternate)break t;ue=io(ue),k=io(k)}ue=null}else ue=null;L!==null&&N0(I,j,L,ue,!1),de!==null&&Ke!==null&&N0(I,Ke,de,ue,!0)}}e:{if(j=N?Zo(N):window,L=j.nodeName&&j.nodeName.toLowerCase(),L==="select"||L==="input"&&j.type==="file")var ie=Qg;else if(Jg(j))if(Wg)ie=T_;else{ie=w_;var Ae=S_}else L=j.nodeName,!L||L.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?N&&zf(N.elementType)&&(ie=Qg):ie=x_;if(ie&&(ie=ie(i,N))){Zg(I,ie,a,U);break e}Ae&&Ae(i,j,N),i==="focusout"&&N&&j.type==="number"&&N.memoizedProps.value!=null&&Vf(j,"number",j.value)}switch(Ae=N?Zo(N):window,i){case"focusin":(Jg(Ae)||Ae.contentEditable==="true")&&(Ns=Ae,Wf=N,oa=null);break;case"focusout":oa=Wf=Ns=null;break;case"mousedown":ed=!0;break;case"contextmenu":case"mouseup":case"dragend":ed=!1,ab(I,a,U);break;case"selectionchange":if(E_)break;case"keydown":case"keyup":ab(I,a,U)}var ae;if(Xf)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 Ds?Yg(i,a)&&(ce="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(ce="onCompositionStart");ce&&(Hg&&a.locale!=="ko"&&(Ds||ce!=="onCompositionStart"?ce==="onCompositionEnd"&&Ds&&(ae=Ug()):(Zi=U,If="value"in Zi?Zi.value:Zi.textContent,Ds=!0)),Ae=Lu(N,ce),0<Ae.length&&(ce=new qg(ce,i,null,a,U),I.push({event:ce,listeners:Ae}),ae?ce.data=ae:(ae=Xg(a),ae!==null&&(ce.data=ae)))),(ae=m_?y_(i,a):g_(i,a))&&(ce=Lu(N,"onBeforeInput"),0<ce.length&&(Ae=new qg("onBeforeInput","beforeinput",null,a,U),I.push({event:Ae,listeners:ce}),Ae.data=ae)),ak(I,i,N,a,U)}C0(I,s)})}function $a(i,s,a){return{instance:i,listener:s,currentTarget:a}}function Lu(i,s){for(var a=s+"Capture",u=[];i!==null;){var f=i,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=Qo(i,a),f!=null&&u.unshift($a(i,f,m)),f=Qo(i,s),f!=null&&u.push($a(i,f,m))),i.tag===3)return u;i=i.return}return[]}function io(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function N0(i,s,a,u,f){for(var m=s._reactName,b=[];a!==null&&a!==u;){var w=a,E=w.alternate,N=w.stateNode;if(w=w.tag,E!==null&&E===u)break;w!==5&&w!==26&&w!==27||N===null||(E=N,f?(N=Qo(a,m),N!=null&&b.unshift($a(a,N,E))):f||(N=Qo(a,m),N!=null&&b.push($a(a,N,E)))),a=a.return}b.length!==0&&i.push({event:s,listeners:b})}var fk=/\r\n?/g,dk=/\u0000|\uFFFD/g;function $0(i){return(typeof i=="string"?i:""+i).replace(fk,`
61
- `).replace(dk,"")}function j0(i,s){return s=$0(s),$0(i)===s}function Vu(){}function Ue(i,s,a,u,f,m){switch(a){case"children":typeof u=="string"?s==="body"||s==="textarea"&&u===""||ks(i,u):(typeof u=="number"||typeof u=="bigint")&&s!=="body"&&ks(i,""+u);break;case"className":ql(i,"class",u);break;case"tabIndex":ql(i,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ql(i,a,u);break;case"style":Lg(i,u,m);break;case"data":if(s!=="object"){ql(i,"data",u);break}case"src":case"href":if(u===""&&(s!=="a"||a!=="href")){i.removeAttribute(a);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Fl(""+u),i.setAttribute(a,u);break;case"action":case"formAction":if(typeof u=="function"){i.setAttribute(a,"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"&&(a==="formAction"?(s!=="input"&&Ue(i,s,"name",f.name,f,null),Ue(i,s,"formEncType",f.formEncType,f,null),Ue(i,s,"formMethod",f.formMethod,f,null),Ue(i,s,"formTarget",f.formTarget,f,null)):(Ue(i,s,"encType",f.encType,f,null),Ue(i,s,"method",f.method,f,null),Ue(i,s,"target",f.target,f,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){i.removeAttribute(a);break}u=Fl(""+u),i.setAttribute(a,u);break;case"onClick":u!=null&&(i.onclick=Vu);break;case"onScroll":u!=null&&Re("scroll",i);break;case"onScrollEnd":u!=null&&Re("scrollend",i);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(a=u.__html,a!=null){if(f.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"multiple":i.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":i.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){i.removeAttribute("xlink:href");break}a=Fl(""+u),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,""+u):i.removeAttribute(a);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":u&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":u===!0?i.setAttribute(a,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?i.setAttribute(a,u):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?i.setAttribute(a,u):i.removeAttribute(a);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?i.removeAttribute(a):i.setAttribute(a,u);break;case"popover":Re("beforetoggle",i),Re("toggle",i),Pl(i,"popover",u);break;case"xlinkActuate":vi(i,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":vi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":vi(i,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":vi(i,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":vi(i,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":vi(i,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":vi(i,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":vi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":vi(i,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Pl(i,"is",u);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=PO.get(a)||a,Pl(i,a,u))}}function Th(i,s,a,u,f,m){switch(a){case"style":Lg(i,u,m);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(r(61));if(a=u.__html,a!=null){if(f.children!=null)throw Error(r(60));i.innerHTML=a}}break;case"children":typeof u=="string"?ks(i,u):(typeof u=="number"||typeof u=="bigint")&&ks(i,""+u);break;case"onScroll":u!=null&&Re("scroll",i);break;case"onScrollEnd":u!=null&&Re("scrollend",i);break;case"onClick":u!=null&&(i.onclick=Vu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Rg.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),s=a.slice(2,f?a.length-7:void 0),m=i[Qt]||null,m=m!=null?m[a]:null,typeof m=="function"&&i.removeEventListener(s,m,f),typeof u=="function")){typeof m!="function"&&m!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(s,u,f);break e}a in i?i[a]=u:u===!0?i.setAttribute(a,""):Pl(i,a,u)}}}function Vt(i,s,a){switch(s){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 u=!1,f=!1,m;for(m in a)if(a.hasOwnProperty(m)){var b=a[m];if(b!=null)switch(m){case"src":u=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ue(i,s,m,b,a,null)}}f&&Ue(i,s,"srcSet",a.srcSet,a,null),u&&Ue(i,s,"src",a.src,a,null);return;case"input":Re("invalid",i);var w=m=b=f=null,E=null,N=null;for(u in a)if(a.hasOwnProperty(u)){var U=a[u];if(U!=null)switch(u){case"name":f=U;break;case"type":b=U;break;case"checked":E=U;break;case"defaultChecked":N=U;break;case"value":m=U;break;case"defaultValue":w=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,s));break;default:Ue(i,s,u,U,a,null)}}Ng(i,m,w,E,N,b,f,!1),Il(i);return;case"select":Re("invalid",i),u=b=m=null;for(f in a)if(a.hasOwnProperty(f)&&(w=a[f],w!=null))switch(f){case"value":m=w;break;case"defaultValue":b=w;break;case"multiple":u=w;default:Ue(i,s,f,w,a,null)}s=m,a=b,i.multiple=!!u,s!=null?_s(i,!!u,s,!1):a!=null&&_s(i,!!u,a,!0);return;case"textarea":Re("invalid",i),m=f=u=null;for(b in a)if(a.hasOwnProperty(b)&&(w=a[b],w!=null))switch(b){case"value":u=w;break;case"defaultValue":f=w;break;case"children":m=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:Ue(i,s,b,w,a,null)}jg(i,u,f,m),Il(i);return;case"option":for(E in a)if(a.hasOwnProperty(E)&&(u=a[E],u!=null))switch(E){case"selected":i.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:Ue(i,s,E,u,a,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(u=0;u<Na.length;u++)Re(Na[u],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 a)if(a.hasOwnProperty(N)&&(u=a[N],u!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Ue(i,s,N,u,a,null)}return;default:if(zf(s)){for(U in a)a.hasOwnProperty(U)&&(u=a[U],u!==void 0&&Th(i,s,U,u,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(u=a[w],u!=null&&Ue(i,s,w,u,a,null))}function hk(i,s,a,u){switch(s){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,w=null,E=null,N=null,U=null;for(L in a){var I=a[L];if(a.hasOwnProperty(L)&&I!=null)switch(L){case"checked":break;case"value":break;case"defaultValue":E=I;default:u.hasOwnProperty(L)||Ue(i,s,L,null,u,I)}}for(var j in u){var L=u[j];if(I=a[j],u.hasOwnProperty(j)&&(L!=null||I!=null))switch(j){case"type":m=L;break;case"name":f=L;break;case"checked":N=L;break;case"defaultChecked":U=L;break;case"value":b=L;break;case"defaultValue":w=L;break;case"children":case"dangerouslySetInnerHTML":if(L!=null)throw Error(r(137,s));break;default:L!==I&&Ue(i,s,j,L,u,I)}}Lf(i,b,w,E,N,U,m,f);return;case"select":L=b=w=j=null;for(m in a)if(E=a[m],a.hasOwnProperty(m)&&E!=null)switch(m){case"value":break;case"multiple":L=E;default:u.hasOwnProperty(m)||Ue(i,s,m,null,u,E)}for(f in u)if(m=u[f],E=a[f],u.hasOwnProperty(f)&&(m!=null||E!=null))switch(f){case"value":j=m;break;case"defaultValue":w=m;break;case"multiple":b=m;default:m!==E&&Ue(i,s,f,m,u,E)}s=w,a=b,u=L,j!=null?_s(i,!!a,j,!1):!!u!=!!a&&(s!=null?_s(i,!!a,s,!0):_s(i,!!a,a?[]:"",!1));return;case"textarea":L=j=null;for(w in a)if(f=a[w],a.hasOwnProperty(w)&&f!=null&&!u.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ue(i,s,w,null,u,f)}for(b in u)if(f=u[b],m=a[b],u.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":j=f;break;case"defaultValue":L=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==m&&Ue(i,s,b,f,u,m)}$g(i,j,L);return;case"option":for(var de in a)if(j=a[de],a.hasOwnProperty(de)&&j!=null&&!u.hasOwnProperty(de))switch(de){case"selected":i.selected=!1;break;default:Ue(i,s,de,null,u,j)}for(E in u)if(j=u[E],L=a[E],u.hasOwnProperty(E)&&j!==L&&(j!=null||L!=null))switch(E){case"selected":i.selected=j&&typeof j!="function"&&typeof j!="symbol";break;default:Ue(i,s,E,j,u,L)}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 a)j=a[ue],a.hasOwnProperty(ue)&&j!=null&&!u.hasOwnProperty(ue)&&Ue(i,s,ue,null,u,j);for(N in u)if(j=u[N],L=a[N],u.hasOwnProperty(N)&&j!==L&&(j!=null||L!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(r(137,s));break;default:Ue(i,s,N,j,u,L)}return;default:if(zf(s)){for(var Ke in a)j=a[Ke],a.hasOwnProperty(Ke)&&j!==void 0&&!u.hasOwnProperty(Ke)&&Th(i,s,Ke,void 0,u,j);for(U in u)j=u[U],L=a[U],!u.hasOwnProperty(U)||j===L||j===void 0&&L===void 0||Th(i,s,U,j,u,L);return}}for(var k in a)j=a[k],a.hasOwnProperty(k)&&j!=null&&!u.hasOwnProperty(k)&&Ue(i,s,k,null,u,j);for(I in u)j=u[I],L=a[I],!u.hasOwnProperty(I)||j===L||j==null&&L==null||Ue(i,s,I,j,u,L)}var Ah=null,Eh=null;function zu(i){return i.nodeType===9?i:i.ownerDocument}function B0(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 L0(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Rh(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Oh=null;function pk(){var i=window.event;return i&&i.type==="popstate"?i===Oh?!1:(Oh=i,!0):(Oh=null,!1)}var V0=typeof setTimeout=="function"?setTimeout:void 0,mk=typeof clearTimeout=="function"?clearTimeout:void 0,z0=typeof Promise=="function"?Promise:void 0,yk=typeof queueMicrotask=="function"?queueMicrotask:typeof z0<"u"?function(i){return z0.resolve(null).then(i).catch(gk)}:V0;function gk(i){setTimeout(function(){throw i})}function hr(i){return i==="head"}function U0(i,s){var a=s,u=0,f=0;do{var m=a.nextSibling;if(i.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"){if(0<u&&8>u){a=u;var b=i.ownerDocument;if(a&1&&ja(b.documentElement),a&2&&ja(b.body),a&4)for(a=b.head,ja(a),b=a.firstChild;b;){var w=b.nextSibling,E=b.nodeName;b[Jo]||E==="SCRIPT"||E==="STYLE"||E==="LINK"&&b.rel.toLowerCase()==="stylesheet"||a.removeChild(b),b=w}}if(f===0){i.removeChild(m),qa(s);return}f--}else a==="$"||a==="$?"||a==="$!"?f++:u=a.charCodeAt(0)-48;else u=0;a=m}while(a);qa(s)}function _h(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var a=s;switch(s=s.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":_h(a),Nf(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function bk(i,s,a,u){for(;i.nodeType===1;){var f=a;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!u&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(u){if(!i[Jo])switch(s){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(s==="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=In(i.nextSibling),i===null)break}return null}function vk(i,s,a){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=In(i.nextSibling),i===null))return null;return i}function kh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function Sk(i,s){var a=i.ownerDocument;if(i.data!=="$?"||a.readyState==="complete")s();else{var u=function(){s(),a.removeEventListener("DOMContentLoaded",u)};a.addEventListener("DOMContentLoaded",u),i._reactRetry=u}}function In(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="F!"||s==="F")break;if(s==="/$")return null}}return i}var Mh=null;function K0(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"){if(s===0)return i;s--}else a==="/$"&&s++}i=i.previousSibling}return null}function P0(i,s,a){switch(s=zu(a),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function ja(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Nf(i)}var Cn=new Map,q0=new Set;function Uu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ni=K.d;K.d={f:wk,r:xk,D:Tk,C:Ak,L:Ek,m:Rk,X:_k,S:Ok,M:kk};function wk(){var i=Ni.f(),s=Cu();return i||s}function xk(i){var s=As(i);s!==null&&s.tag===5&&s.type==="form"?uv(s):Ni.r(i)}var ro=typeof document>"u"?null:document;function I0(i,s,a){var u=ro;if(u&&typeof s=="string"&&s){var f=An(s);f='link[rel="'+i+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),q0.has(f)||(q0.add(f),i={rel:i,crossOrigin:a,href:s},u.querySelector(f)===null&&(s=u.createElement("link"),Vt(s,"link",i),_t(s),u.head.appendChild(s)))}}function Tk(i){Ni.D(i),I0("dns-prefetch",i,null)}function Ak(i,s){Ni.C(i,s),I0("preconnect",i,s)}function Ek(i,s,a){Ni.L(i,s,a);var u=ro;if(u&&i&&s){var f='link[rel="preload"][as="'+An(s)+'"]';s==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+An(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+An(a.imageSizes)+'"]')):f+='[href="'+An(i)+'"]';var m=f;switch(s){case"style":m=so(i);break;case"script":m=oo(i)}Cn.has(m)||(i=y({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:i,as:s},a),Cn.set(m,i),u.querySelector(f)!==null||s==="style"&&u.querySelector(Ba(m))||s==="script"&&u.querySelector(La(m))||(s=u.createElement("link"),Vt(s,"link",i),_t(s),u.head.appendChild(s)))}}function Rk(i,s){Ni.m(i,s);var a=ro;if(a&&i){var u=s&&typeof s.as=="string"?s.as:"script",f='link[rel="modulepreload"][as="'+An(u)+'"][href="'+An(i)+'"]',m=f;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=oo(i)}if(!Cn.has(m)&&(i=y({rel:"modulepreload",href:i},s),Cn.set(m,i),a.querySelector(f)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(La(m)))return}u=a.createElement("link"),Vt(u,"link",i),_t(u),a.head.appendChild(u)}}}function Ok(i,s,a){Ni.S(i,s,a);var u=ro;if(u&&i){var f=Es(u).hoistableStyles,m=so(i);s=s||"default";var b=f.get(m);if(!b){var w={loading:0,preload:null};if(b=u.querySelector(Ba(m)))w.loading=5;else{i=y({rel:"stylesheet",href:i,"data-precedence":s},a),(a=Cn.get(m))&&Ch(i,a);var E=b=u.createElement("link");_t(E),Vt(E,"link",i),E._p=new Promise(function(N,U){E.onload=N,E.onerror=U}),E.addEventListener("load",function(){w.loading|=1}),E.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Ku(b,s,u)}b={type:"stylesheet",instance:b,count:1,state:w},f.set(m,b)}}}function _k(i,s){Ni.X(i,s);var a=ro;if(a&&i){var u=Es(a).hoistableScripts,f=oo(i),m=u.get(f);m||(m=a.querySelector(La(f)),m||(i=y({src:i,async:!0},s),(s=Cn.get(f))&&Dh(i,s),m=a.createElement("script"),_t(m),Vt(m,"link",i),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(f,m))}}function kk(i,s){Ni.M(i,s);var a=ro;if(a&&i){var u=Es(a).hoistableScripts,f=oo(i),m=u.get(f);m||(m=a.querySelector(La(f)),m||(i=y({src:i,async:!0,type:"module"},s),(s=Cn.get(f))&&Dh(i,s),m=a.createElement("script"),_t(m),Vt(m,"link",i),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},u.set(f,m))}}function H0(i,s,a,u){var f=(f=oe.current)?Uu(f):null;if(!f)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=so(a.href),a=Es(f).hoistableStyles,u=a.get(s),u||(u={type:"style",instance:null,count:0,state:null},a.set(s,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=so(a.href);var m=Es(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(Ba(i)))&&!m._p&&(b.instance=m,b.state.loading=5),Cn.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Cn.set(i,a),m||Mk(f,i,a,b.state))),s&&u===null)throw Error(r(528,""));return b}if(s&&u!==null)throw Error(r(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=oo(a),a=Es(f).hoistableScripts,u=a.get(s),u||(u={type:"script",instance:null,count:0,state:null},a.set(s,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function so(i){return'href="'+An(i)+'"'}function Ba(i){return'link[rel="stylesheet"]['+i+"]"}function F0(i){return y({},i,{"data-precedence":i.precedence,precedence:null})}function Mk(i,s,a,u){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?u.loading=1:(s=i.createElement("link"),u.preload=s,s.addEventListener("load",function(){return u.loading|=1}),s.addEventListener("error",function(){return u.loading|=2}),Vt(s,"link",a),_t(s),i.head.appendChild(s))}function oo(i){return'[src="'+An(i)+'"]'}function La(i){return"script[async]"+i}function G0(i,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var u=i.querySelector('style[data-href~="'+An(a.href)+'"]');if(u)return s.instance=u,_t(u),u;var f=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return u=(i.ownerDocument||i).createElement("style"),_t(u),Vt(u,"style",f),Ku(u,a.precedence,i),s.instance=u;case"stylesheet":f=so(a.href);var m=i.querySelector(Ba(f));if(m)return s.state.loading|=4,s.instance=m,_t(m),m;u=F0(a),(f=Cn.get(f))&&Ch(u,f),m=(i.ownerDocument||i).createElement("link"),_t(m);var b=m;return b._p=new Promise(function(w,E){b.onload=w,b.onerror=E}),Vt(m,"link",u),s.state.loading|=4,Ku(m,a.precedence,i),s.instance=m;case"script":return m=oo(a.src),(f=i.querySelector(La(m)))?(s.instance=f,_t(f),f):(u=a,(f=Cn.get(m))&&(u=y({},a),Dh(u,f)),i=i.ownerDocument||i,f=i.createElement("script"),_t(f),Vt(f,"link",u),i.head.appendChild(f),s.instance=f);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(u=s.instance,s.state.loading|=4,Ku(u,a.precedence,i));return s.instance}function Ku(i,s,a){for(var u=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=u.length?u[u.length-1]:null,m=f,b=0;b<u.length;b++){var w=u[b];if(w.dataset.precedence===s)m=w;else if(m!==f)break}m?m.parentNode.insertBefore(i,m.nextSibling):(s=a.nodeType===9?a.head:a,s.insertBefore(i,s.firstChild))}function Ch(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Dh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Pu=null;function Y0(i,s,a){if(Pu===null){var u=new Map,f=Pu=new Map;f.set(a,u)}else f=Pu,u=f.get(a),u||(u=new Map,f.set(a,u));if(u.has(i))return u;for(u.set(i,null),a=a.getElementsByTagName(i),f=0;f<a.length;f++){var m=a[f];if(!(m[Jo]||m[Pt]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(s)||"";b=i+b;var w=u.get(b);w?w.push(m):u.set(b,[m])}}return u}function X0(i,s,a){i=i.ownerDocument||i,i.head.insertBefore(a,s==="title"?i.querySelector("head > title"):null)}function Ck(i,s,a){if(a===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function J0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Va=null;function Dk(){}function Nk(i,s,a){if(Va===null)throw Error(r(475));var u=Va;if(s.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=so(a.href),m=i.querySelector(Ba(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(u.count++,u=qu.bind(u),i.then(u,u)),s.state.loading|=4,s.instance=m,_t(m);return}m=i.ownerDocument||i,a=F0(a),(f=Cn.get(f))&&Ch(a,f),m=m.createElement("link"),_t(m);var b=m;b._p=new Promise(function(w,E){b.onload=w,b.onerror=E}),Vt(m,"link",a),s.instance=m}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(u.count++,s=qu.bind(u),i.addEventListener("load",s),i.addEventListener("error",s))}}function $k(){if(Va===null)throw Error(r(475));var i=Va;return i.stylesheets&&i.count===0&&Nh(i,i.stylesheets),0<i.count?function(s){var a=setTimeout(function(){if(i.stylesheets&&Nh(i,i.stylesheets),i.unsuspend){var u=i.unsuspend;i.unsuspend=null,u()}},6e4);return i.unsuspend=s,function(){i.unsuspend=null,clearTimeout(a)}}:null}function qu(){if(this.count--,this.count===0){if(this.stylesheets)Nh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Iu=null;function Nh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Iu=new Map,s.forEach(jk,i),Iu=null,qu.call(i))}function jk(i,s){if(!(s.state.loading&4)){var a=Iu.get(i);if(a)var u=a.get(null);else{a=new Map,Iu.set(i,a);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")&&(a.set(b.dataset.precedence,b),u=b)}u&&a.set(null,u)}f=s.instance,b=f.getAttribute("data-precedence"),m=a.get(b)||u,m===u&&a.set(null,f),a.set(b,f),this.count++,u=qu.bind(this),f.addEventListener("load",u),f.addEventListener("error",u),m?m.parentNode.insertBefore(f,m.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(f,i.firstChild)),s.state.loading|=4}}var za={$$typeof:_,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function Bk(i,s,a,u,f,m,b,w){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=kf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kf(0),this.hiddenUpdates=kf(null),this.identifierPrefix=u,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function Z0(i,s,a,u,f,m,b,w,E,N,U,I){return i=new Bk(i,s,a,b,w,E,N,I),s=1,m===!0&&(s|=24),m=cn(3,null,null,s),i.current=m,m.stateNode=i,s=pd(),s.refCount++,i.pooledCache=s,s.refCount++,m.memoizedState={element:u,isDehydrated:a,cache:s},bd(m),i}function Q0(i){return i?(i=Ls,i):Ls}function W0(i,s,a,u,f,m){f=Q0(f),u.context===null?u.context=f:u.pendingContext=f,u=er(s),u.payload={element:a},m=m===void 0?null:m,m!==null&&(u.callback=m),a=tr(i,u,s),a!==null&&(mn(a,i,s),ma(a,i,s))}function eS(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<s?a:s}}function $h(i,s){eS(i,s),(i=i.alternate)&&eS(i,s)}function tS(i){if(i.tag===13){var s=Bs(i,67108864);s!==null&&mn(s,i,67108864),$h(i,67108864)}}var Hu=!0;function Lk(i,s,a,u){var f=B.T;B.T=null;var m=K.p;try{K.p=2,jh(i,s,a,u)}finally{K.p=m,B.T=f}}function Vk(i,s,a,u){var f=B.T;B.T=null;var m=K.p;try{K.p=8,jh(i,s,a,u)}finally{K.p=m,B.T=f}}function jh(i,s,a,u){if(Hu){var f=Bh(u);if(f===null)xh(i,s,u,Fu,a),iS(i,u);else if(Uk(f,i,s,a,u))u.stopPropagation();else if(iS(i,u),s&4&&-1<zk.indexOf(i)){for(;f!==null;){var m=As(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Lr(m.pendingLanes);if(b!==0){var w=m;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var E=1<<31-ln(b);w.entanglements[1]|=E,b&=~E}ri(m),(Be&6)===0&&(ku=we()+500,Da(0))}}break;case 13:w=Bs(m,2),w!==null&&mn(w,m,2),Cu(),$h(m,2)}if(m=Bh(u),m===null&&xh(i,s,u,Fu,a),m===f)break;f=m}f!==null&&u.stopPropagation()}else xh(i,s,u,null,a)}}function Bh(i){return i=Kf(i),Lh(i)}var Fu=null;function Lh(i){if(Fu=null,i=Ts(i),i!==null){var s=l(i);if(s===null)i=null;else{var a=s.tag;if(a===13){if(i=c(s),i!==null)return i;i=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Fu=i,null}function nS(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(Kn()){case Gt:return 2;case Kt:return 8;case wn:case Qn:return 32;case xn:return 268435456;default:return 32}default:return 32}}var Vh=!1,pr=null,mr=null,yr=null,Ua=new Map,Ka=new Map,gr=[],zk="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 iS(i,s){switch(i){case"focusin":case"focusout":pr=null;break;case"dragenter":case"dragleave":mr=null;break;case"mouseover":case"mouseout":yr=null;break;case"pointerover":case"pointerout":Ua.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ka.delete(s.pointerId)}}function Pa(i,s,a,u,f,m){return i===null||i.nativeEvent!==m?(i={blockedOn:s,domEventName:a,eventSystemFlags:u,nativeEvent:m,targetContainers:[f]},s!==null&&(s=As(s),s!==null&&tS(s)),i):(i.eventSystemFlags|=u,s=i.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),i)}function Uk(i,s,a,u,f){switch(s){case"focusin":return pr=Pa(pr,i,s,a,u,f),!0;case"dragenter":return mr=Pa(mr,i,s,a,u,f),!0;case"mouseover":return yr=Pa(yr,i,s,a,u,f),!0;case"pointerover":var m=f.pointerId;return Ua.set(m,Pa(Ua.get(m)||null,i,s,a,u,f)),!0;case"gotpointercapture":return m=f.pointerId,Ka.set(m,Pa(Ka.get(m)||null,i,s,a,u,f)),!0}return!1}function rS(i){var s=Ts(i.target);if(s!==null){var a=l(s);if(a!==null){if(s=a.tag,s===13){if(s=c(a),s!==null){i.blockedOn=s,NO(i.priority,function(){if(a.tag===13){var u=pn();u=Mf(u);var f=Bs(a,u);f!==null&&mn(f,a,u),$h(a,u)}});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Gu(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var a=Bh(i.nativeEvent);if(a===null){a=i.nativeEvent;var u=new a.constructor(a.type,a);Uf=u,a.target.dispatchEvent(u),Uf=null}else return s=As(a),s!==null&&tS(s),i.blockedOn=a,!1;s.shift()}return!0}function sS(i,s,a){Gu(i)&&a.delete(s)}function Kk(){Vh=!1,pr!==null&&Gu(pr)&&(pr=null),mr!==null&&Gu(mr)&&(mr=null),yr!==null&&Gu(yr)&&(yr=null),Ua.forEach(sS),Ka.forEach(sS)}function Yu(i,s){i.blockedOn===s&&(i.blockedOn=null,Vh||(Vh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Kk)))}var Xu=null;function oS(i){Xu!==i&&(Xu=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Xu===i&&(Xu=null);for(var s=0;s<i.length;s+=3){var a=i[s],u=i[s+1],f=i[s+2];if(typeof u!="function"){if(Lh(u||a)===null)continue;break}var m=As(a);m!==null&&(i.splice(s,3),s-=3,Ld(m,{pending:!0,data:f,method:a.method,action:u},u,f))}}))}function qa(i){function s(E){return Yu(E,i)}pr!==null&&Yu(pr,i),mr!==null&&Yu(mr,i),yr!==null&&Yu(yr,i),Ua.forEach(s),Ka.forEach(s);for(var a=0;a<gr.length;a++){var u=gr[a];u.blockedOn===i&&(u.blockedOn=null)}for(;0<gr.length&&(a=gr[0],a.blockedOn===null);)rS(a),a.blockedOn===null&&gr.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(u=0;u<a.length;u+=3){var f=a[u],m=a[u+1],b=f[Qt]||null;if(typeof m=="function")b||oS(a);else if(b){var w=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Qt]||null)w=b.formAction;else if(Lh(f)!==null)continue}else w=b.action;typeof w=="function"?a[u+1]=w:(a.splice(u,3),u-=3),oS(a)}}}function zh(i){this._internalRoot=i}Ju.prototype.render=zh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var a=s.current,u=pn();W0(a,u,i,s,null,null)},Ju.prototype.unmount=zh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;W0(i.current,2,null,i,null,null),Cu(),s[xs]=null}};function Ju(i){this._internalRoot=i}Ju.prototype.unstable_scheduleHydration=function(i){if(i){var s=Tg();i={blockedOn:null,target:i,priority:s};for(var a=0;a<gr.length&&s!==0&&s<gr[a].priority;a++);gr.splice(a,0,i),a===0&&rS(i)}};var aS=e.version;if(aS!=="19.1.1")throw Error(r(527,aS,"19.1.1"));K.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var Pk={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zu.isDisabled&&Zu.supportsFiber)try{Go=Zu.inject(Pk),an=Zu}catch{}}return Ha.createRoot=function(i,s){if(!o(i))throw Error(r(299));var a=!1,u="",f=Tv,m=Av,b=Ev,w=null;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onUncaughtError!==void 0&&(f=s.onUncaughtError),s.onCaughtError!==void 0&&(m=s.onCaughtError),s.onRecoverableError!==void 0&&(b=s.onRecoverableError),s.unstable_transitionCallbacks!==void 0&&(w=s.unstable_transitionCallbacks)),s=Z0(i,1,!1,null,null,a,u,f,m,b,w,null),i[xs]=s.current,wh(i),new zh(s)},Ha.hydrateRoot=function(i,s,a){if(!o(i))throw Error(r(299));var u=!1,f="",m=Tv,b=Av,w=Ev,E=null,N=null;return a!=null&&(a.unstable_strictMode===!0&&(u=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(E=a.unstable_transitionCallbacks),a.formState!==void 0&&(N=a.formState)),s=Z0(i,1,!0,s,a??null,u,f,m,b,w,E,N),s.context=Q0(null),a=s.current,u=pn(),u=Mf(u),f=er(u),f.callback=null,tr(a,f,u),a=u,s.current.lanes=a,Xo(s,a),ri(s),i[xs]=s.current,wh(i),new Ju(s)},Ha.version="19.1.1",Ha}var AS;function lC(){if(AS)return Hh.exports;AS=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Hh.exports=aC(),Hh.exports}var uC=lC();function rf(){return typeof window<"u"}function jr(t){return Q1(t)?(t.nodeName||"").toLowerCase():"#document"}function gn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function pi(t){var e;return(e=(Q1(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Q1(t){return rf()?t instanceof Node||t instanceof gn(t).Node:!1}function ht(t){return rf()?t instanceof Element||t instanceof gn(t).Element:!1}function Ot(t){return rf()?t instanceof HTMLElement||t instanceof gn(t).HTMLElement:!1}function Kp(t){return!rf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof gn(t).ShadowRoot}const cC=new Set(["inline","contents"]);function xl(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=Un(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!cC.has(o)}const fC=new Set(["table","td","th"]);function dC(t){return fC.has(jr(t))}const hC=[":popover-open",":modal"];function sf(t){return hC.some(e=>{try{return t.matches(e)}catch{return!1}})}const pC=["transform","translate","scale","rotate","perspective"],mC=["transform","translate","scale","rotate","perspective","filter"],yC=["paint","layout","strict","content"];function cy(t){const e=of(),n=ht(t)?Un(t):t;return pC.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||mC.some(r=>(n.willChange||"").includes(r))||yC.some(r=>(n.contain||"").includes(r))}function gC(t){let e=Ui(t);for(;Ot(e)&&!Vi(e);){if(cy(e))return e;if(sf(e))return null;e=Ui(e)}return null}function of(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const bC=new Set(["html","body","#document"]);function Vi(t){return bC.has(jr(t))}function Un(t){return gn(t).getComputedStyle(t)}function af(t){return ht(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ui(t){if(jr(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Kp(t)&&t.host||pi(t);return Kp(e)?e.host:e}function W1(t){const e=Ui(t);return Vi(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ot(e)&&xl(e)?e:W1(e)}function Rr(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const o=W1(t),l=o===((r=t.ownerDocument)==null?void 0:r.body),c=gn(o);if(l){const d=Pp(c);return e.concat(c,c.visualViewport||[],xl(o)?o:[],d&&n?Rr(d):[])}return e.concat(o,Rr(o,[],n))}function Pp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const kc=Math.min,us=Math.max,Mc=Math.round,Qu=Math.floor,li=t=>({x:t,y:t}),vC={left:"right",right:"left",bottom:"top",top:"bottom"},SC={start:"end",end:"start"};function ES(t,e,n){return us(t,kc(e,n))}function lf(t,e){return typeof t=="function"?t(e):t}function hs(t){return t.split("-")[0]}function uf(t){return t.split("-")[1]}function eT(t){return t==="x"?"y":"x"}function tT(t){return t==="y"?"height":"width"}const wC=new Set(["top","bottom"]);function Tr(t){return wC.has(hs(t))?"y":"x"}function nT(t){return eT(Tr(t))}function xC(t,e,n){n===void 0&&(n=!1);const r=uf(t),o=nT(t),l=tT(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(c=Cc(c)),[c,Cc(c)]}function TC(t){const e=Cc(t);return[qp(t),e,qp(e)]}function qp(t){return t.replace(/start|end/g,e=>SC[e])}const RS=["left","right"],OS=["right","left"],AC=["top","bottom"],EC=["bottom","top"];function RC(t,e,n){switch(t){case"top":case"bottom":return n?e?OS:RS:e?RS:OS;case"left":case"right":return e?AC:EC;default:return[]}}function OC(t,e,n,r){const o=uf(t);let l=RC(hs(t),n==="start",r);return o&&(l=l.map(c=>c+"-"+o),e&&(l=l.concat(l.map(qp)))),l}function Cc(t){return t.replace(/left|right|bottom|top/g,e=>vC[e])}function _C(t){return{top:0,right:0,bottom:0,left:0,...t}}function kC(t){return typeof t!="number"?_C(t):{top:t,right:t,bottom:t,left:t}}function Dc(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}/*!
62
- * tabbable 6.2.0
63
- * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
64
- */var MC=["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])"],Nc=MC.join(","),iT=typeof Element>"u",Mo=iT?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,$c=!iT&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t?.ownerDocument},jc=function t(e,n){var r;n===void 0&&(n=!0);var o=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),l=o===""||o==="true",c=l||n&&e&&t(e.parentNode);return c},CC=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},rT=function(e,n,r){if(jc(e))return[];var o=Array.prototype.slice.apply(e.querySelectorAll(Nc));return n&&Mo.call(e,Nc)&&o.unshift(e),o=o.filter(r),o},sT=function t(e,n,r){for(var o=[],l=Array.from(e);l.length;){var c=l.shift();if(!jc(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,p=t(h,!0,r);r.flatten?o.push.apply(o,p):o.push({scopeParent:c,candidates:p})}else{var y=Mo.call(c,Nc);y&&r.filter(c)&&(n||!e.includes(c))&&o.push(c);var g=c.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(c),v=!jc(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(g&&v){var S=t(g===!0?c.children:g.children,!0,r);r.flatten?o.push.apply(o,S):o.push({scopeParent:c,candidates:S})}else l.unshift.apply(l,c.children)}}return o},oT=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},aT=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||CC(e))&&!oT(e)?0:e.tabIndex},DC=function(e,n){var r=aT(e);return r<0&&n&&!oT(e)?0:r},NC=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},lT=function(e){return e.tagName==="INPUT"},$C=function(e){return lT(e)&&e.type==="hidden"},jC=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},BC=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},LC=function(e){if(!e.name)return!0;var n=e.form||$c(e),r=function(d){return n.querySelectorAll('input[type="radio"][name="'+d+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=r(window.CSS.escape(e.name));else try{o=r(e.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 l=BC(o,e.form);return!l||l===e},VC=function(e){return lT(e)&&e.type==="radio"},zC=function(e){return VC(e)&&!LC(e)},UC=function(e){var n,r=e&&$c(e),o=(n=r)===null||n===void 0?void 0:n.host,l=!1;if(r&&r!==e){var c,d,h;for(l=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o)||e!=null&&(h=e.ownerDocument)!==null&&h!==void 0&&h.contains(e));!l&&o;){var p,y,g;r=$c(o),o=(p=r)===null||p===void 0?void 0:p.host,l=!!((y=o)!==null&&y!==void 0&&(g=y.ownerDocument)!==null&&g!==void 0&&g.contains(o))}}return l},_S=function(e){var n=e.getBoundingClientRect(),r=n.width,o=n.height;return r===0&&o===0},KC=function(e,n){var r=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(e).visibility==="hidden")return!0;var l=Mo.call(e,"details>summary:first-of-type"),c=l?e.parentElement:e;if(Mo.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof o=="function"){for(var d=e;e;){var h=e.parentElement,p=$c(e);if(h&&!h.shadowRoot&&o(h)===!0)return _S(e);e.assignedSlot?e=e.assignedSlot:!h&&p!==e.ownerDocument?e=p.host:e=h}e=d}if(UC(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return _S(e);return!1},PC=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var o=n.children.item(r);if(o.tagName==="LEGEND")return Mo.call(n,"fieldset[disabled] *")?!0:!o.contains(e)}return!0}n=n.parentElement}return!1},Ip=function(e,n){return!(n.disabled||jc(n)||$C(n)||KC(n,e)||jC(n)||PC(n))},Hp=function(e,n){return!(zC(n)||aT(n)<0||!Ip(e,n))},qC=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},IC=function t(e){var n=[],r=[];return e.forEach(function(o,l){var c=!!o.scopeParent,d=c?o.scopeParent:o,h=DC(d,c),p=c?t(o.candidates):d;h===0?c?n.push.apply(n,p):n.push(d):r.push({documentOrder:l,tabIndex:h,item:o,isScope:c,content:p})}),r.sort(NC).reduce(function(o,l){return l.isScope?o.push.apply(o,l.content):o.push(l.content),o},[]).concat(n)},fy=function(e,n){n=n||{};var r;return n.getShadowRoot?r=sT([e],n.includeContainer,{filter:Hp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:qC}):r=rT(e,n.includeContainer,Hp.bind(null,n)),IC(r)},HC=function(e,n){n=n||{};var r;return n.getShadowRoot?r=sT([e],n.includeContainer,{filter:Ip.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=rT(e,n.includeContainer,Ip.bind(null,n)),r},uT=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return Mo.call(e,Nc)===!1?!1:Hp(n,e)};function FC(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function cT(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(e=>{let{brand:n,version:r}=e;return n+"/"+r}).join(" "):navigator.userAgent}function GC(){return/apple/i.test(navigator.vendor)}function Fp(){const t=/android/i;return t.test(FC())||t.test(cT())}function YC(){return cT().includes("jsdom/")}const kS="data-floating-ui-focusable",XC="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fo(t){let e=t.activeElement;for(;((n=e)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;e=e.shadowRoot.activeElement}return e}function yn(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Kp(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function wr(t){return"composedPath"in t?t.composedPath()[0]:t.target}function Xh(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function JC(t){return t.matches("html,body")}function Xn(t){return t?.ownerDocument||document}function fT(t){return Ot(t)&&t.matches(XC)}function MS(t){return t?t.getAttribute("role")==="combobox"&&fT(t):!1}function Gp(t){return t?t.hasAttribute(kS)?t:t.querySelector("["+kS+"]")||t:null}function So(t,e,n){return n===void 0&&(n=!0),t.filter(o=>{var l;return o.parentId===e&&(!n||((l=o.context)==null?void 0:l.open))}).flatMap(o=>[o,...So(t,o.id,n)])}function CS(t,e){var n;let r=[],o=(n=t.find(l=>l.id===e))==null?void 0:n.parentId;for(;o;){const l=t.find(c=>c.id===o);o=l?.parentId,l&&(r=r.concat(l))}return r}function Jh(t){t.preventDefault(),t.stopPropagation()}function ZC(t){return"nativeEvent"in t}function QC(t){return t.mozInputSource===0&&t.isTrusted?!0:Fp()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function WC(t){return YC()?!1:!Fp()&&t.width===0&&t.height===0||Fp()&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function DS(t,e){return["mouse","pen"].includes(t)}var eD=typeof document<"u",tD=function(){},Li=eD?$.useLayoutEffect:tD;const nD={...F1};function Zh(t){const e=$.useRef(t);return Li(()=>{e.current=t}),e}const iD=nD.useInsertionEffect,rD=iD||(t=>t());function oi(t){const e=$.useRef(()=>{});return rD(()=>{e.current=t}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return e.current==null?void 0:e.current(...r)},[])}const cf=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function dT(t,e){const n=fy(t,cf()),r=n.length;if(r===0)return;const o=fo(Xn(t)),l=n.indexOf(o),c=l===-1?e===1?0:r-1:l+e;return n[c]}function sD(t){return dT(Xn(t).body,1)||t}function oD(t){return dT(Xn(t).body,-1)||t}function NS(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!yn(n,r)}var aD=Z1();function $S(t,e,n){let{reference:r,floating:o}=t;const l=Tr(e),c=nT(e),d=tT(c),h=hs(e),p=l==="y",y=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,v=r[d]/2-o[d]/2;let S;switch(h){case"top":S={x:y,y:r.y-o.height};break;case"bottom":S={x:y,y:r.y+r.height};break;case"right":S={x:r.x+r.width,y:g};break;case"left":S={x:r.x-o.width,y:g};break;default:S={x:r.x,y:r.y}}switch(uf(e)){case"start":S[c]-=v*(n&&p?-1:1);break;case"end":S[c]+=v*(n&&p?-1:1);break}return S}const lD=async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(e));let p=await c.getElementRects({reference:t,floating:e,strategy:o}),{x:y,y:g}=$S(p,r,h),v=r,S={},x=0;for(let T=0;T<d.length;T++){const{name:C,fn:M}=d[T],{x:O,y:_,data:G,reset:z}=await M({x:y,y:g,initialPlacement:r,placement:v,strategy:o,middlewareData:S,rects:p,platform:c,elements:{reference:t,floating:e}});y=O??y,g=_??g,S={...S,[C]:{...S[C],...G}},z&&x<=50&&(x++,typeof z=="object"&&(z.placement&&(v=z.placement),z.rects&&(p=z.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:o}):z.rects),{x:y,y:g}=$S(p,v,h)),T=-1)}return{x:y,y:g,placement:v,strategy:o,middlewareData:S}};async function hT(t,e){var n;e===void 0&&(e={});const{x:r,y:o,platform:l,rects:c,elements:d,strategy:h}=t,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=lf(e,t),x=kC(S),C=d[v?g==="floating"?"reference":"floating":g],M=Dc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:y,strategy:h})),O=g==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,_=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),G=await(l.isElement==null?void 0:l.isElement(_))?await(l.getScale==null?void 0:l.getScale(_))||{x:1,y:1}:{x:1,y:1},z=Dc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:O,offsetParent:_,strategy:h}):O);return{top:(M.top-z.top+x.top)/G.y,bottom:(z.bottom-M.bottom+x.bottom)/G.y,left:(M.left-z.left+x.left)/G.x,right:(z.right-M.right+x.right)/G.x}}const uD=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:l,rects:c,initialPlacement:d,platform:h,elements:p}=e,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:T=!0,...C}=lf(t,e);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const M=hs(o),O=Tr(d),_=hs(d)===d,G=await(h.isRTL==null?void 0:h.isRTL(p.floating)),z=v||(_||!T?[Cc(d)]:TC(d)),ee=x!=="none";!v&&ee&&z.push(...OC(d,T,x,G));const te=[d,...z],X=await hT(e,C),pe=[];let me=((r=l.flip)==null?void 0:r.overflows)||[];if(y&&pe.push(X[M]),g){const J=xC(o,c,G);pe.push(X[J[0]],X[J[1]])}if(me=[...me,{placement:o,overflows:pe}],!pe.every(J=>J<=0)){var Se,Ce;const J=(((Se=l.flip)==null?void 0:Se.index)||0)+1,W=te[J];if(W&&(!(g==="alignment"?O!==Tr(W):!1)||me.every(V=>Tr(V.placement)===O?V.overflows[0]>0:!0)))return{data:{index:J,overflows:me},reset:{placement:W}};let B=(Ce=me.filter(K=>K.overflows[0]<=0).sort((K,V)=>K.overflows[1]-V.overflows[1])[0])==null?void 0:Ce.placement;if(!B)switch(S){case"bestFit":{var ge;const K=(ge=me.filter(V=>{if(ee){const ne=Tr(V.placement);return ne===O||ne==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(ne=>ne>0).reduce((ne,A)=>ne+A,0)]).sort((V,ne)=>V[1]-ne[1])[0])==null?void 0:ge[0];K&&(B=K);break}case"initialPlacement":B=d;break}if(o!==B)return{reset:{placement:B}}}return{}}}},cD=new Set(["left","top"]);async function fD(t,e){const{placement:n,platform:r,elements:o}=t,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=hs(n),d=uf(n),h=Tr(n)==="y",p=cD.has(c)?-1:1,y=l&&h?-1:1,g=lf(e,t);let{mainAxis:v,crossAxis:S,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof x=="number"&&(S=d==="end"?x*-1:x),h?{x:S*y,y:v*p}:{x:v*p,y:S*y}}const dD=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:l,placement:c,middlewareData:d}=e,h=await fD(e,t);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+h.x,y:l+h.y,data:{...h,placement:c}}}}},hD=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:M,y:O}=C;return{x:M,y:O}}},...h}=lf(t,e),p={x:n,y:r},y=await hT(e,h),g=Tr(hs(o)),v=eT(g);let S=p[v],x=p[g];if(l){const C=v==="y"?"top":"left",M=v==="y"?"bottom":"right",O=S+y[C],_=S-y[M];S=ES(O,S,_)}if(c){const C=g==="y"?"top":"left",M=g==="y"?"bottom":"right",O=x+y[C],_=x-y[M];x=ES(O,x,_)}const T=d.fn({...e,[v]:S,[g]:x});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[v]:l,[g]:c}}}}}};function pT(t){const e=Un(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=Ot(t),l=o?t.offsetWidth:n,c=o?t.offsetHeight:r,d=Mc(n)!==l||Mc(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function dy(t){return ht(t)?t:t.contextElement}function wo(t){const e=dy(t);if(!Ot(e))return li(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:l}=pT(e);let c=(l?Mc(n.width):n.width)/r,d=(l?Mc(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const pD=li(0);function mT(t){const e=gn(t);return!of()||!e.visualViewport?pD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function mD(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==gn(t)?!1:e}function ps(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const o=t.getBoundingClientRect(),l=dy(t);let c=li(1);e&&(r?ht(r)&&(c=wo(r)):c=wo(t));const d=mD(l,n,r)?mT(l):li(0);let h=(o.left+d.x)/c.x,p=(o.top+d.y)/c.y,y=o.width/c.x,g=o.height/c.y;if(l){const v=gn(l),S=r&&ht(r)?gn(r):r;let x=v,T=Pp(x);for(;T&&r&&S!==x;){const C=wo(T),M=T.getBoundingClientRect(),O=Un(T),_=M.left+(T.clientLeft+parseFloat(O.paddingLeft))*C.x,G=M.top+(T.clientTop+parseFloat(O.paddingTop))*C.y;h*=C.x,p*=C.y,y*=C.x,g*=C.y,h+=_,p+=G,x=gn(T),T=Pp(x)}}return Dc({width:y,height:g,x:h,y:p})}function ff(t,e){const n=af(t).scrollLeft;return e?e.left+n:ps(pi(t)).left+n}function yT(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-ff(t,n),o=n.top+e.scrollTop;return{x:r,y:o}}function yD(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const l=o==="fixed",c=pi(r),d=e?sf(e.floating):!1;if(r===c||d&&l)return n;let h={scrollLeft:0,scrollTop:0},p=li(1);const y=li(0),g=Ot(r);if((g||!g&&!l)&&((jr(r)!=="body"||xl(c))&&(h=af(r)),Ot(r))){const S=ps(r);p=wo(r),y.x=S.x+r.clientLeft,y.y=S.y+r.clientTop}const v=c&&!g&&!l?yT(c,h):li(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 gD(t){return Array.from(t.getClientRects())}function bD(t){const e=pi(t),n=af(t),r=t.ownerDocument.body,o=us(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),l=us(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+ff(t);const d=-n.scrollTop;return Un(r).direction==="rtl"&&(c+=us(e.clientWidth,r.clientWidth)-o),{width:o,height:l,x:c,y:d}}const jS=25;function vD(t,e){const n=gn(t),r=pi(t),o=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,h=0;if(o){l=o.width,c=o.height;const y=of();(!y||y&&e==="fixed")&&(d=o.offsetLeft,h=o.offsetTop)}const p=ff(r);if(p<=0){const y=r.ownerDocument,g=y.body,v=getComputedStyle(g),S=y.compatMode==="CSS1Compat"&&parseFloat(v.marginLeft)+parseFloat(v.marginRight)||0,x=Math.abs(r.clientWidth-g.clientWidth-S);x<=jS&&(l-=x)}else p<=jS&&(l+=p);return{width:l,height:c,x:d,y:h}}const SD=new Set(["absolute","fixed"]);function wD(t,e){const n=ps(t,!0,e==="fixed"),r=n.top+t.clientTop,o=n.left+t.clientLeft,l=Ot(t)?wo(t):li(1),c=t.clientWidth*l.x,d=t.clientHeight*l.y,h=o*l.x,p=r*l.y;return{width:c,height:d,x:h,y:p}}function BS(t,e,n){let r;if(e==="viewport")r=vD(t,n);else if(e==="document")r=bD(pi(t));else if(ht(e))r=wD(e,n);else{const o=mT(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return Dc(r)}function gT(t,e){const n=Ui(t);return n===e||!ht(n)||Vi(n)?!1:Un(n).position==="fixed"||gT(n,e)}function xD(t,e){const n=e.get(t);if(n)return n;let r=Rr(t,[],!1).filter(d=>ht(d)&&jr(d)!=="body"),o=null;const l=Un(t).position==="fixed";let c=l?Ui(t):t;for(;ht(c)&&!Vi(c);){const d=Un(c),h=cy(c);!h&&d.position==="fixed"&&(o=null),(l?!h&&!o:!h&&d.position==="static"&&!!o&&SD.has(o.position)||xl(c)&&!h&&gT(t,c))?r=r.filter(y=>y!==c):o=d,c=Ui(c)}return e.set(t,r),r}function TD(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const c=[...n==="clippingAncestors"?sf(e)?[]:xD(e,this._c):[].concat(n),r],d=c[0],h=c.reduce((p,y)=>{const g=BS(e,y,o);return p.top=us(g.top,p.top),p.right=kc(g.right,p.right),p.bottom=kc(g.bottom,p.bottom),p.left=us(g.left,p.left),p},BS(e,d,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function AD(t){const{width:e,height:n}=pT(t);return{width:e,height:n}}function ED(t,e,n){const r=Ot(e),o=pi(e),l=n==="fixed",c=ps(t,!0,l,e);let d={scrollLeft:0,scrollTop:0};const h=li(0);function p(){h.x=ff(o)}if(r||!r&&!l)if((jr(e)!=="body"||xl(o))&&(d=af(e)),r){const S=ps(e,!0,l,e);h.x=S.x+e.clientLeft,h.y=S.y+e.clientTop}else o&&p();l&&!r&&o&&p();const y=o&&!r&&!l?yT(o,d):li(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 Qh(t){return Un(t).position==="static"}function LS(t,e){if(!Ot(t)||Un(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return pi(t)===n&&(n=n.ownerDocument.body),n}function bT(t,e){const n=gn(t);if(sf(t))return n;if(!Ot(t)){let o=Ui(t);for(;o&&!Vi(o);){if(ht(o)&&!Qh(o))return o;o=Ui(o)}return n}let r=LS(t,e);for(;r&&dC(r)&&Qh(r);)r=LS(r,e);return r&&Vi(r)&&Qh(r)&&!cy(r)?n:r||gC(t)||n}const RD=async function(t){const e=this.getOffsetParent||bT,n=this.getDimensions,r=await n(t.floating);return{reference:ED(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function OD(t){return Un(t).direction==="rtl"}const _D={convertOffsetParentRelativeRectToViewportRelativeRect:yD,getDocumentElement:pi,getClippingRect:TD,getOffsetParent:bT,getElementRects:RD,getClientRects:gD,getDimensions:AD,getScale:wo,isElement:ht,isRTL:OD};function vT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function kD(t,e){let n=null,r;const o=pi(t);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),l();const p=t.getBoundingClientRect(),{left:y,top:g,width:v,height:S}=p;if(d||e(),!v||!S)return;const x=Qu(g),T=Qu(o.clientWidth-(y+v)),C=Qu(o.clientHeight-(g+S)),M=Qu(y),_={rootMargin:-x+"px "+-T+"px "+-C+"px "+-M+"px",threshold:us(0,kc(1,h))||1};let G=!0;function z(ee){const te=ee[0].intersectionRatio;if(te!==h){if(!G)return c();te?c(!1,te):r=setTimeout(()=>{c(!1,1e-7)},1e3)}te===1&&!vT(p,t.getBoundingClientRect())&&c(),G=!1}try{n=new IntersectionObserver(z,{..._,root:o.ownerDocument})}catch{n=new IntersectionObserver(z,_)}n.observe(t)}return c(!0),l}function MD(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,p=dy(t),y=o||l?[...p?Rr(p):[],...Rr(e)]:[];y.forEach(M=>{o&&M.addEventListener("scroll",n,{passive:!0}),l&&M.addEventListener("resize",n)});const g=p&&d?kD(p,n):null;let v=-1,S=null;c&&(S=new ResizeObserver(M=>{let[O]=M;O&&O.target===p&&S&&(S.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var _;(_=S)==null||_.observe(e)})),n()}),p&&!h&&S.observe(p),S.observe(e));let x,T=h?ps(t):null;h&&C();function C(){const M=ps(t);T&&!vT(T,M)&&n(),T=M,x=requestAnimationFrame(C)}return n(),()=>{var M;y.forEach(O=>{o&&O.removeEventListener("scroll",n),l&&O.removeEventListener("resize",n)}),g?.(),(M=S)==null||M.disconnect(),S=null,h&&cancelAnimationFrame(x)}}const CD=dD,DD=hD,ND=uD,$D=(t,e,n)=>{const r=new Map,o={platform:_D,...n},l={...o.platform,_c:r};return lD(t,e,{...o,platform:l})};var jD=typeof document<"u",BD=function(){},pc=jD?$.useLayoutEffect:BD;function Bc(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Bc(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&t.$$typeof)&&!Bc(t[l],e[l]))return!1}return!0}return t!==t&&e!==e}function ST(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function VS(t,e){const n=ST(t);return Math.round(e*n)/n}function Wh(t){const e=$.useRef(t);return pc(()=>{e.current=t}),e}function LD(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:h,open:p}=t,[y,g]=$.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,S]=$.useState(r);Bc(v,r)||S(r);const[x,T]=$.useState(null),[C,M]=$.useState(null),O=$.useCallback(V=>{V!==ee.current&&(ee.current=V,T(V))},[]),_=$.useCallback(V=>{V!==te.current&&(te.current=V,M(V))},[]),G=l||x,z=c||C,ee=$.useRef(null),te=$.useRef(null),X=$.useRef(y),pe=h!=null,me=Wh(h),Se=Wh(o),Ce=Wh(p),ge=$.useCallback(()=>{if(!ee.current||!te.current)return;const V={placement:e,strategy:n,middleware:v};Se.current&&(V.platform=Se.current),$D(ee.current,te.current,V).then(ne=>{const A={...ne,isPositioned:Ce.current!==!1};J.current&&!Bc(X.current,A)&&(X.current=A,aD.flushSync(()=>{g(A)}))})},[v,e,n,Se,Ce]);pc(()=>{p===!1&&X.current.isPositioned&&(X.current.isPositioned=!1,g(V=>({...V,isPositioned:!1})))},[p]);const J=$.useRef(!1);pc(()=>(J.current=!0,()=>{J.current=!1}),[]),pc(()=>{if(G&&(ee.current=G),z&&(te.current=z),G&&z){if(me.current)return me.current(G,z,ge);ge()}},[G,z,ge,me,pe]);const W=$.useMemo(()=>({reference:ee,floating:te,setReference:O,setFloating:_}),[O,_]),B=$.useMemo(()=>({reference:G,floating:z}),[G,z]),K=$.useMemo(()=>{const V={position:n,left:0,top:0};if(!B.floating)return V;const ne=VS(B.floating,y.x),A=VS(B.floating,y.y);return d?{...V,transform:"translate("+ne+"px, "+A+"px)",...ST(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ne,top:A}},[n,d,B.floating,y.x,y.y]);return $.useMemo(()=>({...y,update:ge,refs:W,elements:B,floatingStyles:K}),[y,ge,W,B,K])}const VD=(t,e)=>({...CD(t),options:[t,e]}),zD=(t,e)=>({...DD(t),options:[t,e]}),UD=(t,e)=>({...ND(t),options:[t,e]}),KD="data-floating-ui-focusable",zS="active",US="selected",PD={...F1};let KS=!1,qD=0;const PS=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+qD++;function ID(){const[t,e]=$.useState(()=>KS?PS():void 0);return Li(()=>{t==null&&e(PS())},[]),$.useEffect(()=>{KS=!0},[]),t}const HD=PD.useId,wT=HD||ID;function FD(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(o=>o(n))},on(e,n){t.has(e)||t.set(e,new Set),t.get(e).add(n)},off(e,n){var r;(r=t.get(e))==null||r.delete(n)}}}const GD=$.createContext(null),YD=$.createContext(null),xT=()=>{var t;return((t=$.useContext(GD))==null?void 0:t.id)||null},hy=()=>$.useContext(YD);function Lc(t){return"data-floating-ui-"+t}function XD(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}let qS=0;function ao(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=e;r&&cancelAnimationFrame(qS);const l=()=>t?.focus({preventScroll:n});o?l():qS=requestAnimationFrame(l)}function JD(t){return t?.ownerDocument||document}const xo={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function IS(t){return t==="inert"?xo.inert:t==="aria-hidden"?xo["aria-hidden"]:xo.none}let Wu=new WeakSet,ec={},ep=0;const ZD=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,TT=t=>t&&(t.host||TT(t.parentNode)),QD=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=TT(n);return t.contains(r)?r:null}).filter(n=>n!=null);function WD(t,e,n,r){const o="data-floating-ui-inert",l=r?"inert":n?"aria-hidden":null,c=QD(e,t),d=new Set,h=new Set(c),p=[];ec[o]||(ec[o]=new WeakMap);const y=ec[o];c.forEach(g),v(e),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,x=>{if(jr(x)!=="script")if(d.has(x))v(x);else{const T=l?x.getAttribute(l):null,C=T!==null&&T!=="false",M=IS(l),O=(M.get(x)||0)+1,_=(y.get(x)||0)+1;M.set(x,O),y.set(x,_),p.push(x),O===1&&C&&Wu.add(x),_===1&&x.setAttribute(o,""),!C&&l&&x.setAttribute(l,l==="inert"?"":"true")}})}return ep++,()=>{p.forEach(S=>{const x=IS(l),C=(x.get(S)||0)-1,M=(y.get(S)||0)-1;x.set(S,C),y.set(S,M),C||(!Wu.has(S)&&l&&S.removeAttribute(l),Wu.delete(S)),M||S.removeAttribute(o)}),ep--,ep||(xo.inert=new WeakMap,xo["aria-hidden"]=new WeakMap,xo.none=new WeakMap,Wu=new WeakSet,ec={})}}function HS(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=JD(t[0]).body;return WD(t.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,e,n)}const py={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},FS=$.forwardRef(function(e,n){const[r,o]=$.useState();Li(()=>{GC()&&o("button")},[]);const l={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Lc("focus-guard")]:"",style:py};return H.jsx("span",{...e,...l})}),eN=$.createContext(null),tN=()=>$.useContext(eN);function GS(t){return $.useMemo(()=>e=>{t.forEach(n=>{n&&(n.current=e)})},t)}const nN=20;let Ar=[];function my(){Ar=Ar.filter(t=>t.isConnected)}function iN(t){my(),t&&jr(t)!=="body"&&(Ar.push(t),Ar.length>nN&&(Ar=Ar.slice(-20)))}function YS(){return my(),Ar[Ar.length-1]}function rN(t){const e=cf();return uT(t,e)?t:fy(t,e)[0]||t}function XS(t,e){var n;if(!e.current.includes("floating")&&!((n=t.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=cf(),l=HC(t,r).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return uT(d,r)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=t.getAttribute("tabindex");e.current.includes("floating")||l.length===0?c!=="0"&&t.setAttribute("tabindex","0"):(c!=="-1"||t.hasAttribute("data-tabindex")&&t.getAttribute("data-tabindex")!=="-1")&&(t.setAttribute("tabindex","-1"),t.setAttribute("data-tabindex","-1"))}const sN=$.forwardRef(function(e,n){return H.jsx("button",{...e,type:"button",ref:n,tabIndex:-1,style:py})});function oN(t){const{context:e,children:n,disabled:r=!1,order:o=["content"],guards:l=!0,initialFocus:c=0,returnFocus:d=!0,restoreFocus:h=!1,modal:p=!0,visuallyHiddenDismiss:y=!1,closeOnFocusOut:g=!0,outsideElementsInert:v=!1,getInsideElements:S=()=>[]}=t,{open:x,onOpenChange:T,events:C,dataRef:M,elements:{domReference:O,floating:_}}=e,G=oi(()=>{var ve;return(ve=M.current.floatingContext)==null?void 0:ve.nodeId}),z=oi(S),ee=typeof c=="number"&&c<0,te=MS(O)&&ee,X=ZD(),pe=X?l:!0,me=!pe||X&&v,Se=Zh(o),Ce=Zh(c),ge=Zh(d),J=hy(),W=tN(),B=$.useRef(null),K=$.useRef(null),V=$.useRef(!1),ne=$.useRef(!1),A=$.useRef(-1),q=$.useRef(-1),Z=W!=null,F=Gp(_),re=oi(function(ve){return ve===void 0&&(ve=F),ve?fy(ve,cf()):[]}),le=oi(ve=>{const ke=re(ve);return Se.current.map(Te=>O&&Te==="reference"?O:F&&Te==="floating"?F:ke).filter(Boolean).flat()});$.useEffect(()=>{if(r||!p)return;function ve(Te){if(Te.key==="Tab"){yn(F,fo(Xn(F)))&&re().length===0&&!te&&Jh(Te);const We=le(),Tt=wr(Te);Se.current[0]==="reference"&&Tt===O&&(Jh(Te),Te.shiftKey?ao(We[We.length-1]):ao(We[1])),Se.current[1]==="floating"&&Tt===F&&Te.shiftKey&&(Jh(Te),ao(We[0]))}}const ke=Xn(F);return ke.addEventListener("keydown",ve),()=>{ke.removeEventListener("keydown",ve)}},[r,O,F,p,Se,te,re,le]),$.useEffect(()=>{if(r||!_)return;function ve(ke){const Te=wr(ke),Tt=re().indexOf(Te);Tt!==-1&&(A.current=Tt)}return _.addEventListener("focusin",ve),()=>{_.removeEventListener("focusin",ve)}},[r,_,re]),$.useEffect(()=>{if(r||!g)return;function ve(){ne.current=!0,setTimeout(()=>{ne.current=!1})}function ke(Tt){const we=Tt.relatedTarget,Kn=Tt.currentTarget,Gt=wr(Tt);queueMicrotask(()=>{const Kt=G(),wn=!(yn(O,we)||yn(_,we)||yn(we,_)||yn(W?.portalNode,we)||we!=null&&we.hasAttribute(Lc("focus-guard"))||J&&(So(J.nodesRef.current,Kt).find(Qn=>{var xn,Wn;return yn((xn=Qn.context)==null?void 0:xn.elements.floating,we)||yn((Wn=Qn.context)==null?void 0:Wn.elements.domReference,we)})||CS(J.nodesRef.current,Kt).find(Qn=>{var xn,Wn,Vl;return[(xn=Qn.context)==null?void 0:xn.elements.floating,Gp((Wn=Qn.context)==null?void 0:Wn.elements.floating)].includes(we)||((Vl=Qn.context)==null?void 0:Vl.elements.domReference)===we})));if(Kn===O&&F&&XS(F,Se),h&&Kn!==O&&!(Gt!=null&&Gt.isConnected)&&fo(Xn(F))===Xn(F).body){Ot(F)&&F.focus();const Qn=A.current,xn=re(),Wn=xn[Qn]||xn[xn.length-1]||F;Ot(Wn)&&Wn.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(te||!p)&&we&&wn&&!ne.current&&we!==YS()&&(V.current=!0,T(!1,Tt,"focus-out"))})}const Te=!!(!J&&W);function We(){XD(q),M.current.insideReactTree=!0,q.current=window.setTimeout(()=>{M.current.insideReactTree=!1})}if(_&&Ot(O))return O.addEventListener("focusout",ke),O.addEventListener("pointerdown",ve),_.addEventListener("focusout",ke),Te&&_.addEventListener("focusout",We,!0),()=>{O.removeEventListener("focusout",ke),O.removeEventListener("pointerdown",ve),_.removeEventListener("focusout",ke),Te&&_.removeEventListener("focusout",We,!0)}},[r,O,_,F,p,J,W,T,g,h,re,te,G,Se,M]);const oe=$.useRef(null),nt=$.useRef(null),Ve=GS([oe,W?.beforeInsideRef]),Sn=GS([nt,W?.afterInsideRef]);$.useEffect(()=>{var ve,ke;if(r||!_)return;const Te=Array.from((W==null||(ve=W.portalNode)==null?void 0:ve.querySelectorAll("["+Lc("portal")+"]"))||[]),Tt=(ke=(J?CS(J.nodesRef.current,G()):[]).find(Gt=>{var Kt;return MS(((Kt=Gt.context)==null?void 0:Kt.elements.domReference)||null)}))==null||(ke=ke.context)==null?void 0:ke.elements.domReference,we=[_,Tt,...Te,...z(),B.current,K.current,oe.current,nt.current,W?.beforeOutsideRef.current,W?.afterOutsideRef.current,Se.current.includes("reference")||te?O:null].filter(Gt=>Gt!=null),Kn=p||te?HS(we,!me,me):HS(we);return()=>{Kn()}},[r,O,_,p,Se,W,te,pe,me,J,G,z]),Li(()=>{if(r||!Ot(F))return;const ve=Xn(F),ke=fo(ve);queueMicrotask(()=>{const Te=le(F),We=Ce.current,Tt=(typeof We=="number"?Te[We]:We.current)||F,we=yn(F,ke);!ee&&!we&&x&&ao(Tt,{preventScroll:Tt===F})})},[r,x,F,ee,le,Ce]),Li(()=>{if(r||!F)return;const ve=Xn(F),ke=fo(ve);iN(ke);function Te(we){let{reason:Kn,event:Gt,nested:Kt}=we;if(["hover","safe-polygon"].includes(Kn)&&Gt.type==="mouseleave"&&(V.current=!0),Kn==="outside-press")if(Kt)V.current=!1;else if(QC(Gt)||WC(Gt))V.current=!1;else{let wn=!1;document.createElement("div").focus({get preventScroll(){return wn=!0,!1}}),wn?V.current=!1:V.current=!0}}C.on("openchange",Te);const We=ve.createElement("span");We.setAttribute("tabindex","-1"),We.setAttribute("aria-hidden","true"),Object.assign(We.style,py),Z&&O&&O.insertAdjacentElement("afterend",We);function Tt(){if(typeof ge.current=="boolean"){const we=O||YS();return we&&we.isConnected?we:We}return ge.current.current||We}return()=>{C.off("openchange",Te);const we=fo(ve),Kn=yn(_,we)||J&&So(J.nodesRef.current,G(),!1).some(Kt=>{var wn;return yn((wn=Kt.context)==null?void 0:wn.elements.floating,we)}),Gt=Tt();queueMicrotask(()=>{const Kt=rN(Gt);ge.current&&!V.current&&Ot(Kt)&&(!(Kt!==we&&we!==ve.body)||Kn)&&Kt.focus({preventScroll:!0}),We.remove()})}},[r,_,F,ge,M,C,J,Z,O,G]),$.useEffect(()=>(queueMicrotask(()=>{V.current=!1}),()=>{queueMicrotask(my)}),[r]),Li(()=>{if(!r&&W)return W.setFocusManagerState({modal:p,closeOnFocusOut:g,open:x,onOpenChange:T,domReference:O}),()=>{W.setFocusManagerState(null)}},[r,W,p,x,T,g,O]),Li(()=>{r||F&&XS(F,Se)},[r,F,Se]);function Yi(ve){return r||!y||!p?null:H.jsx(sN,{ref:ve==="start"?B:K,onClick:ke=>T(!1,ke.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const bi=!r&&pe&&(p?!te:!0)&&(Z||p);return H.jsxs(H.Fragment,{children:[bi&&H.jsx(FS,{"data-type":"inside",ref:Ve,onFocus:ve=>{if(p){const Te=le();ao(o[0]==="reference"?Te[0]:Te[Te.length-1])}else if(W!=null&&W.preserveTabOrder&&W.portalNode)if(V.current=!1,NS(ve,W.portalNode)){const Te=sD(O);Te?.focus()}else{var ke;(ke=W.beforeOutsideRef.current)==null||ke.focus()}}}),!te&&Yi("start"),n,Yi("end"),bi&&H.jsx(FS,{"data-type":"inside",ref:Sn,onFocus:ve=>{if(p)ao(le()[0]);else if(W!=null&&W.preserveTabOrder&&W.portalNode)if(g&&(V.current=!0),NS(ve,W.portalNode)){const Te=oD(O);Te?.focus()}else{var ke;(ke=W.afterOutsideRef.current)==null||ke.focus()}}})]})}function JS(t){return Ot(t.target)&&t.target.tagName==="BUTTON"}function aN(t){return Ot(t.target)&&t.target.tagName==="A"}function ZS(t){return fT(t)}function lN(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:o,elements:{domReference:l}}=t,{enabled:c=!0,event:d="click",toggle:h=!0,ignoreMouse:p=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=e,v=$.useRef(),S=$.useRef(!1),x=$.useMemo(()=>({onPointerDown(T){v.current=T.pointerType},onMouseDown(T){const C=v.current;T.button===0&&d!=="click"&&(DS(C)&&p||(n&&h&&(!(o.current.openEvent&&g)||o.current.openEvent.type==="mousedown")?r(!1,T.nativeEvent,"click"):(T.preventDefault(),r(!0,T.nativeEvent,"click"))))},onClick(T){const C=v.current;if(d==="mousedown"&&v.current){v.current=void 0;return}DS(C)&&p||(n&&h&&(!(o.current.openEvent&&g)||o.current.openEvent.type==="click")?r(!1,T.nativeEvent,"click"):r(!0,T.nativeEvent,"click"))},onKeyDown(T){v.current=void 0,!(T.defaultPrevented||!y||JS(T))&&(T.key===" "&&!ZS(l)&&(T.preventDefault(),S.current=!0),!aN(T)&&T.key==="Enter"&&r(!(n&&h),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!y||JS(T)||ZS(l)||T.key===" "&&S.current&&(S.current=!1,r(!(n&&h),T.nativeEvent,"click"))}}),[o,l,d,p,y,r,n,g,h]);return $.useMemo(()=>c?{reference:x}:{},[c,x])}const uN={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},cN={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},QS=t=>{var e,n;return{escapeKey:typeof t=="boolean"?t:(e=t?.escapeKey)!=null?e:!1,outsidePress:typeof t=="boolean"?t:(n=t?.outsidePress)!=null?n:!0}};function fN(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:o,dataRef:l}=t,{enabled:c=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:x}=e,T=hy(),C=oi(typeof h=="function"?h:()=>!1),M=typeof h=="function"?C:h,O=$.useRef(!1),{escapeKey:_,outsidePress:G}=QS(S),{escapeKey:z,outsidePress:ee}=QS(x),te=$.useRef(!1),X=oi(J=>{var W;if(!n||!c||!d||J.key!=="Escape"||te.current)return;const B=(W=l.current.floatingContext)==null?void 0:W.nodeId,K=T?So(T.nodesRef.current,B):[];if(!_&&(J.stopPropagation(),K.length>0)){let V=!0;if(K.forEach(ne=>{var A;if((A=ne.context)!=null&&A.open&&!ne.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}r(!1,ZC(J)?J.nativeEvent:J,"escape-key")}),pe=oi(J=>{var W;const B=()=>{var K;X(J),(K=wr(J))==null||K.removeEventListener("keydown",B)};(W=wr(J))==null||W.addEventListener("keydown",B)}),me=oi(J=>{var W;const B=l.current.insideReactTree;l.current.insideReactTree=!1;const K=O.current;if(O.current=!1,p==="click"&&K||B||typeof M=="function"&&!M(J))return;const V=wr(J),ne="["+Lc("inert")+"]",A=Xn(o.floating).querySelectorAll(ne);let q=ht(V)?V:null;for(;q&&!Vi(q);){const le=Ui(q);if(Vi(le)||!ht(le))break;q=le}if(A.length&&ht(V)&&!JC(V)&&!yn(V,o.floating)&&Array.from(A).every(le=>!yn(q,le)))return;if(Ot(V)&&ge){const le=Vi(V),oe=Un(V),nt=/auto|scroll/,Ve=le||nt.test(oe.overflowX),Sn=le||nt.test(oe.overflowY),Yi=Ve&&V.clientWidth>0&&V.scrollWidth>V.clientWidth,bi=Sn&&V.clientHeight>0&&V.scrollHeight>V.clientHeight,ve=oe.direction==="rtl",ke=bi&&(ve?J.offsetX<=V.offsetWidth-V.clientWidth:J.offsetX>V.clientWidth),Te=Yi&&J.offsetY>V.clientHeight;if(ke||Te)return}const Z=(W=l.current.floatingContext)==null?void 0:W.nodeId,F=T&&So(T.nodesRef.current,Z).some(le=>{var oe;return Xh(J,(oe=le.context)==null?void 0:oe.elements.floating)});if(Xh(J,o.floating)||Xh(J,o.domReference)||F)return;const re=T?So(T.nodesRef.current,Z):[];if(re.length>0){let le=!0;if(re.forEach(oe=>{var nt;if((nt=oe.context)!=null&&nt.open&&!oe.context.dataRef.current.__outsidePressBubbles){le=!1;return}}),!le)return}r(!1,J,"outside-press")}),Se=oi(J=>{var W;const B=()=>{var K;me(J),(K=wr(J))==null||K.removeEventListener(p,B)};(W=wr(J))==null||W.addEventListener(p,B)});$.useEffect(()=>{if(!n||!c)return;l.current.__escapeKeyBubbles=_,l.current.__outsidePressBubbles=G;let J=-1;function W(A){r(!1,A,"ancestor-scroll")}function B(){window.clearTimeout(J),te.current=!0}function K(){J=window.setTimeout(()=>{te.current=!1},of()?5:0)}const V=Xn(o.floating);d&&(V.addEventListener("keydown",z?pe:X,z),V.addEventListener("compositionstart",B),V.addEventListener("compositionend",K)),M&&V.addEventListener(p,ee?Se:me,ee);let ne=[];return v&&(ht(o.domReference)&&(ne=Rr(o.domReference)),ht(o.floating)&&(ne=ne.concat(Rr(o.floating))),!ht(o.reference)&&o.reference&&o.reference.contextElement&&(ne=ne.concat(Rr(o.reference.contextElement)))),ne=ne.filter(A=>{var q;return A!==((q=V.defaultView)==null?void 0:q.visualViewport)}),ne.forEach(A=>{A.addEventListener("scroll",W,{passive:!0})}),()=>{d&&(V.removeEventListener("keydown",z?pe:X,z),V.removeEventListener("compositionstart",B),V.removeEventListener("compositionend",K)),M&&V.removeEventListener(p,ee?Se:me,ee),ne.forEach(A=>{A.removeEventListener("scroll",W)}),window.clearTimeout(J)}},[l,o,d,M,p,n,r,v,c,_,G,X,z,pe,me,ee,Se]),$.useEffect(()=>{l.current.insideReactTree=!1},[l,M,p]);const Ce=$.useMemo(()=>({onKeyDown:X,...y&&{[uN[g]]:J=>{r(!1,J.nativeEvent,"reference-press")},...g!=="click"&&{onClick(J){r(!1,J.nativeEvent,"reference-press")}}}}),[X,r,y,g]),ge=$.useMemo(()=>({onKeyDown:X,onMouseDown(){O.current=!0},onMouseUp(){O.current=!0},[cN[p]]:()=>{l.current.insideReactTree=!0}}),[X,p,l]);return $.useMemo(()=>c?{reference:Ce,floating:ge}:{},[c,Ce,ge])}function dN(t){const{open:e=!1,onOpenChange:n,elements:r}=t,o=wT(),l=$.useRef({}),[c]=$.useState(()=>FD()),d=xT()!=null,[h,p]=$.useState(r.reference),y=oi((S,x,T)=>{l.current.openEvent=S?x:void 0,c.emit("openchange",{open:S,event:x,reason:T,nested:d}),n?.(S,x,T)}),g=$.useMemo(()=>({setPositionReference:p}),[]),v=$.useMemo(()=>({reference:h||r.reference||null,floating:r.floating||null,domReference:r.reference}),[h,r.reference,r.floating]);return $.useMemo(()=>({dataRef:l,open:e,onOpenChange:y,elements:v,events:c,floatingId:o,refs:g}),[e,y,v,c,o,g])}function hN(t){t===void 0&&(t={});const{nodeId:e}=t,n=dN({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,o=r.elements,[l,c]=$.useState(null),[d,h]=$.useState(null),y=o?.domReference||l,g=$.useRef(null),v=hy();Li(()=>{y&&(g.current=y)},[y]);const S=LD({...t,elements:{...o,...d&&{reference:d}}}),x=$.useCallback(_=>{const G=ht(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),getClientRects:()=>_.getClientRects(),contextElement:_}:_;h(G),S.refs.setReference(G)},[S.refs]),T=$.useCallback(_=>{(ht(_)||_===null)&&(g.current=_,c(_)),(ht(S.refs.reference.current)||S.refs.reference.current===null||_!==null&&!ht(_))&&S.refs.setReference(_)},[S.refs]),C=$.useMemo(()=>({...S.refs,setReference:T,setPositionReference:x,domReference:g}),[S.refs,T,x]),M=$.useMemo(()=>({...S.elements,domReference:y}),[S.elements,y]),O=$.useMemo(()=>({...S,...r,refs:C,elements:M,nodeId:e}),[S,C,M,e,r]);return Li(()=>{r.dataRef.current.floatingContext=O;const _=v?.nodesRef.current.find(G=>G.id===e);_&&(_.context=O)}),$.useMemo(()=>({...S,context:O,refs:C,elements:M}),[S,C,M,O])}function tp(t,e,n){const r=new Map,o=n==="item";let l=t;if(o&&t){const{[zS]:c,[US]:d,...h}=t;l=h}return{...n==="floating"&&{tabIndex:-1,[KD]:""},...l,...e.map(c=>{const d=c?c[n]:null;return typeof d=="function"?t?d(t):null:d}).concat(t).reduce((c,d)=>(d&&Object.entries(d).forEach(h=>{let[p,y]=h;if(!(o&&[zS,US].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof y=="function"){var g;(g=r.get(p))==null||g.push(y),c[p]=function(){for(var v,S=arguments.length,x=new Array(S),T=0;T<S;T++)x[T]=arguments[T];return(v=r.get(p))==null?void 0:v.map(C=>C(...x)).find(C=>C!==void 0)}}}else c[p]=y}),c),{})}}function pN(t){t===void 0&&(t=[]);const e=t.map(d=>d?.reference),n=t.map(d=>d?.floating),r=t.map(d=>d?.item),o=$.useCallback(d=>tp(d,t,"reference"),e),l=$.useCallback(d=>tp(d,t,"floating"),n),c=$.useCallback(d=>tp(d,t,"item"),r);return $.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c}),[o,l,c])}const mN=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function yN(t,e){var n,r;e===void 0&&(e={});const{open:o,elements:l,floatingId:c}=t,{enabled:d=!0,role:h="dialog"}=e,p=wT(),y=((n=l.domReference)==null?void 0:n.id)||p,g=$.useMemo(()=>{var O;return((O=Gp(l.floating))==null?void 0:O.id)||c},[l.floating,c]),v=(r=mN.get(h))!=null?r:h,x=xT()!=null,T=$.useMemo(()=>v==="tooltip"||h==="label"?{["aria-"+(h==="label"?"labelledby":"describedby")]:o?g:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":v==="alertdialog"?"dialog":v,"aria-controls":o?g:void 0,...v==="listbox"&&{role:"combobox"},...v==="menu"&&{id:y},...v==="menu"&&x&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,x,o,y,h]),C=$.useMemo(()=>{const O={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?O:{...O,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),M=$.useCallback(O=>{let{active:_,selected:G}=O;const z={role:"option",..._&&{id:g+"-fui-option"}};switch(h){case"select":case"combobox":return{...z,"aria-selected":G}}return{}},[g,h]);return $.useMemo(()=>d?{reference:T,floating:C,item:M}:{},[d,T,C,M])}const Tl=t=>Array.isArray(t)?t:[t],gN=(t,e)=>{const n=[[],[]];for(const r of t)e(r)?n[0].push(r):n[1].push(r);return n},AT=Array,is=(t,e)=>t.includes(e),bN=(t,e=0)=>[...new Array(t)].map((n,r)=>r+e),Ie=(t,e,n)=>t===void 0?e===void 0?[]:Array.isArray(e)?e:[e]:(Array.isArray(e)?t.push(...e):t.push(e),t),os=(t,e)=>e==null?t??[]:t==null?Tl(e):t.concat(e),vN=(...t)=>t.reduce(os,[]),cs=(t,e,n)=>{if(t===void 0)return Array.isArray(e)?e:[e];const r=n?.isEqual??((o,l)=>o===l);for(const o of Tl(e))t.some(l=>r(l,o))||t.push(o);return t},SN=(t,e)=>t.reduce((n,r)=>{const o=r[e];return n[o]=Ie(n[o],r),n},{}),Co=(t,e,n)=>t.length===e.length&&t.every(n?.isEqual?(r,o)=>n.isEqual(r,e[o]):(r,o)=>r===e[o]),vs=(t,e)=>Jn(t)===e,Jn=t=>{const e=typeof t;return e==="object"?t===null?"null":"object":e==="function"?"object":e},Ki={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},wN={...Ki,function:"a function"};class xN extends Error{}const xt=t=>Do(t,xN),Do=(t,e=Error)=>{throw new e(t)};class TN extends Error{name="ParseError"}const Y=t=>Do(t,TN),ET=t=>` ${t}`,He=(t,e)=>{const n={},r=Array.isArray(t);let o=!1;for(const[l,c]of Object.entries(t).entries()){const d=r?e(l,c[1]):e(...c,l);o||=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 o?Object.values(n):n},RT=Object.entries,mi=(t,e)=>t in e,yy=(t,e)=>e in t;class AN{constructor(e){Object.assign(this,e)}}const EN=class{};class OT extends EN{}const RN=(t,e)=>{const n={},r={};let o;for(o in t)o in e?n[o]=t[o]:r[o]=t[o];return[n,r]},ON=(t,e)=>RN(t,e)[1],Al=t=>Object.keys(t).length===0,Vc=t=>[...Object.entries(t),...Object.getOwnPropertySymbols(t).map(e=>[e,t[e]])],_N=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),kN=t=>{const e=Object.keys(t).sort(),n={};for(let r=0;r<e.length;r++)n[e[r]]=t[e[r]];return n},Bi=ET("represents an uninitialized value"),MN=t=>Object.values(t).filter(e=>typeof e=="number"?!0:typeof t[e]!="number"),_T={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},kT=globalThis.File??Blob,MT={ArrayBuffer,Blob,File:kT,FormData,Headers,Request,Response,URL},CN={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},No={..._T,...MT,...CN,String,Number,Boolean},gy=t=>{let e=Object.getPrototypeOf(t);for(;e?.constructor&&(!mi(e.constructor.name,No)||!(t instanceof No[e.constructor.name]));)e=Object.getPrototypeOf(e);const n=e?.constructor?.name;if(!(n===void 0||n==="Object"))return n},Yp=t=>typeof t=="object"&&t!==null?gy(t)??"object":Jn(t),Ft=Array.isArray,DN={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"},NN={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"},$N={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"},jN={...DN,...NN,...$N},by=t=>{const e=Object(t).name??null;return e&&mi(e,No)&&No[e]===t?e:null},WS=(t,e)=>{let n=t.prototype;for(;n!==null;){if(n===e.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},BN=t=>CT(t,new Map),CT=(t,e)=>{if(typeof t!="object"||t===null)return t;if(e?.has(t))return e.get(t);const n=by(t.constructor);if(n==="Date")return new Date(t.getTime());if(n&&n!=="Array")return t;const r=Array.isArray(t)?t.slice():Object.create(Object.getPrototypeOf(t)),o=Object.getOwnPropertyDescriptors(t);if(e){e.set(t,r);for(const l in o){const c=o[l];"get"in c||"set"in c||(c.value=CT(c.value,e))}}return Object.defineProperties(r,o),r},LN=t=>{let e=Bi;return()=>e===Bi?e=t():e},df=t=>typeof t=="function"&&t.length===0,VN=class extends Function{constructor(...t){const e=t.slice(0,-1),n=t.at(-1);try{super(...e,n)}catch(r){return xt(`Encountered an unexpected error while compiling your definition:
65
- Message: ${r}
66
- Source: (${t.slice(0,-1)}) => {
67
- ${t.at(-1)}
68
- }`)}}};class Uo{constructor(e,...[n]){return Object.assign(Object.setPrototypeOf(e.bind(n?.bind??this),this.constructor.prototype),n?.attach)}}const zN=LN(()=>{try{return new Function("return false")()}catch{return!0}});class yi{constructor(){}}var UN={};const KN=()=>{try{return((new Error().stack?.split(`
69
- `)[2]?.trim()||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1]||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}},PN=UN??{},qN={fileName:KN,env:PN},IN=t=>t[0].toUpperCase()+t.slice(1),DT=t=>new RegExp(HN(t),typeof t=="string"?"":t.flags),HN=t=>`^(?:${typeof t=="string"?t:t.source})$`,xr={negativeLookahead:t=>`(?!${t})`,nonCapturingGroup:t=>`(?:${t})`},Xp="\\",hf={" ":1,"\n":1," ":1},FN=/^-0\.?0*$/.source,NT=/[1-9]\d*/.source,GN=/\.\d+/.source,YN=/\.\d*[1-9]/.source,$T=t=>DT(xr.negativeLookahead(FN)+xr.nonCapturingGroup("-?"+xr.nonCapturingGroup(xr.nonCapturingGroup("0|"+NT)+xr.nonCapturingGroup(t.decimalPattern)+"?")+(t.allowDecimalOnly?"|"+t.decimalPattern:"")+"?")),ew=$T({decimalPattern:YN,allowDecimalOnly:!1}),XN=ew.test.bind(ew),Jp=$T({decimalPattern:GN,allowDecimalOnly:!0});Jp.test.bind(Jp);const JN=/^-?\d*\.?\d*$/,ZN=t=>t.length!==0&&JN.test(t),zc=DT(xr.negativeLookahead("^-0$")+"-?"+xr.nonCapturingGroup(xr.nonCapturingGroup("0|"+NT))),QN=zc.test.bind(zc),Zp=/^-?\d+$/,WN=Zp.test.bind(Zp),jT={number:"a number",bigint:"a bigint",integer:"an integer"},BT=(t,e)=>`'${t}' was parsed as ${jT[e]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,e2=(t,e)=>e==="number"?XN(t):QN(t),t2=(t,e)=>e==="number"?Number(t):Number.parseInt(t),n2=(t,e)=>e==="number"?ZN(t):WN(t),i2=(t,e)=>vy(t,"number",e),r2=(t,e)=>vy(t,"number",{...e,strict:!0}),s2=(t,e)=>vy(t,"integer",e),vy=(t,e,n)=>{const r=t2(t,e);return!Number.isNaN(r)&&n2(t,e)?n?.strict?e2(t,e)?r:Y(BT(t,e)):r:n?.errorOnFail?Y(n?.errorOnFail===!0?`Failed to parse ${jT[e]} from '${t}'`:n?.errorOnFail):void 0},o2=t=>{if(t[t.length-1]!=="n")return;const e=t.slice(0,-1);let n;try{n=BigInt(e)}catch{return}if(zc.test(e))return n;if(Zp.test(e))return Y(BT(t,"bigint"))},a2="0.49.0",l2={version:a2,filename:qN.fileName(),FileConstructor:kT},El=l2,tw=new Map,np=Object.create(null),Qp=t=>{const e=tw.get(t);if(e)return e;let n=u2(t);return np[n]?n=`${n}${np[n]++}`:np[n]=1,El[n]=t,tw.set(t,n),n},fl=t=>/^[$A-Z_a-z][\w$]*$/.test(t),u2=t=>{switch(typeof t){case"object":{if(t===null)break;const e=gy(t)??"object";return e[0].toLowerCase()+e.slice(1)}case"function":return fl(t.name)?t.name:"fn";case"symbol":return t.description&&fl(t.description)?t.description:"symbol"}return xt(`Unexpected attempt to register serializable value of type ${Jn(t)}`)},Sy=t=>typeof t=="string"?JSON.stringify(t):typeof t=="bigint"?`${t}n`:`${t}`,c2=(t,e={})=>Wa(t,{onUndefined:"$ark.undefined",onBigInt:n=>`$ark.bigint-${n}`,...e},[]),Pe=(t,e)=>{switch(Jn(t)){case"object":const n=t,r=n.constructor.name;return r==="Object"||r==="Array"?e?.quoteKeys===!1?Uc(n,e?.indent??0,""):JSON.stringify(Wa(n,$o,[]),null,e?.indent):Uc(n,e?.indent??0,"");case"symbol":return $o.onSymbol(t);default:return Sy(t)}},Uc=(t,e,n)=>{if(typeof t=="function")return $o.onFunction(t);if(typeof t!="object"||t===null)return Sy(t);const r=n+" ".repeat(e);if(Array.isArray(t)){if(t.length===0)return"[]";const l=t.map(c=>Uc(c,e,r)).join(`,
70
- `+r);return e?`[
71
- ${r}${l}
72
- ${n}]`:`[${l}]`}const o=t.constructor.name;if(o==="Object"){const l=Vc(t).map(([c,d])=>{const h=typeof c=="symbol"?$o.onSymbol(c):fl(c)?c:JSON.stringify(c),p=Uc(d,e,r);return`${r}${h}: ${p}`});return l.length===0?"{}":e?`{
73
- ${l.join(`,
74
- `)}
75
- ${n}}`:`{${l.join(", ")}}`}return t instanceof Date?Rl(t):"expression"in t&&typeof t.expression=="string"?t.expression:o},$o={onCycle:()=>"(cycle)",onSymbol:t=>`Symbol(${Qp(t)})`,onFunction:t=>`Function(${Qp(t)})`},Wa=(t,e,n)=>{switch(Jn(t)){case"object":{const r=t;if("toJSON"in r&&typeof r.toJSON=="function")return r.toJSON();if(typeof r=="function")return $o.onFunction(r);if(n.includes(r))return"(cycle)";const o=[...n,r];if(Array.isArray(r))return r.map(c=>Wa(c,e,o));if(r instanceof Date)return r.toDateString();const l={};for(const c in r)l[c]=Wa(r[c],e,o);for(const c of Object.getOwnPropertySymbols(r))l[e.onSymbol?.(c)??c.toString()]=Wa(r[c],e,o);return l}case"symbol":return $o.onSymbol(t);case"bigint":return e.onBigInt?.(t)??`${t}n`;case"undefined":return e.onUndefined??"undefined";case"string":return t.replaceAll("\\","\\\\");default:return t}},Rl=t=>{const e=t.getFullYear(),n=t.getMonth(),r=t.getDate(),o=t.getHours(),l=t.getMinutes(),c=t.getSeconds(),d=t.getMilliseconds();if(n===0&&r===1&&o===0&&l===0&&c===0&&d===0)return`${e}`;const h=`${f2[n]} ${r}, ${e}`;if(o===0&&l===0&&c===0&&d===0)return h;let p=t.toLocaleTimeString();const y=p.endsWith(" AM")||p.endsWith(" PM")?p.slice(-3):"";return y&&(p=p.slice(0,-y.length)),d?p+=`.${h2(d,3)}`:d2.test(p)&&(p=p.slice(0,-3)),`${p+y}, ${h}`},f2=["January","February","March","April","May","June","July","August","September","October","November","December"],d2=/:\d\d:00$/,h2=(t,e)=>String(t).padStart(e,"0"),LT=(t,e,...[n])=>{const r=n?.stringifySymbol??Pe;let o=t;switch(typeof e){case"string":o=fl(e)?t===""?e:`${t}.${e}`:`${t}[${JSON.stringify(e)}]`;break;case"number":o=`${t}[${e}]`;break;case"symbol":o=`${t}[${r(e)}]`;break;default:n?.stringifyNonKey?o=`${t}[${n.stringifyNonKey(e)}]`:Y(`${Pe(e)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return o},Ol=(t,...e)=>t.reduce((n,r)=>LT(n,r,...e),"");class VT extends AT{cache={};constructor(...e){super(),this.push(...e)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let e=0;e<this.length;e++)this.cache.json.push(typeof this[e]=="symbol"?Pe(this[e]):this[e]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=Ol(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let e="";const n=[e];for(const r of this)e=LT(e,r),n.push(e);return this.cache.stringifyAncestors=n}}class p2{chars;i;def;constructor(e){this.def=e,this.chars=[...e],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(e){let n="";for(;this.lookahead;){if(e(this,n))if(n[n.length-1]===Xp)n=n.slice(0,-1);else break;n+=this.shift()}return n}shiftUntilLookahead(e){return typeof e=="string"?this.shiftUntil(n=>n.lookahead===e):this.shiftUntil(n=>n.lookahead in e)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in hf))}jumpToIndex(e){this.i=e<0?this.length+e:e}jumpForward(e){this.i+=e}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(e,n){return this.chars.slice(e,n).join("")}lookaheadIs(e){return this.lookahead===e}lookaheadIsIn(e){return this.lookahead in e}}let Wp="$ark",m2=2;for(;Wp in globalThis;)Wp=`$ark${m2++}`;const zT=Wp;globalThis[zT]=El;const Q=El,y2=t=>`${zT}.${t}`,Zt=t=>y2(Qp(t));class UT extends OT{argNames;body="";constructor(...e){super(),this.argNames=e;for(const n of e){if(n in this)throw new Error(`Arg name '${n}' would overwrite an existing property on FunctionBody`);this[n]=n}}indentation=0;indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(e,n=!1){return KT(e,n)}index(e,n=!1){return PT(`${e}`,n)}line(e){return this.body+=`${" ".repeat(this.indentation)}${e}
76
- `,this}const(e,n){return this.line(`const ${e} = ${n}`),this}let(e,n){return this.line(`let ${e} = ${n}`)}set(e,n){return this.line(`${e} = ${n}`)}if(e,n){return this.block(`if (${e})`,n)}elseIf(e,n){return this.block(`else if (${e})`,n)}else(e){return this.block("else",e)}for(e,n,r=0){return this.block(`for (let i = ${r}; ${e}; i++)`,n)}forIn(e,n){return this.block(`for (const k in ${e})`,n)}block(e,n,r=""){return this.line(`${e} {`),this.indent(),n(this),this.dedent(),this.line(`}${r}`)}return(e=""){return this.line(`return ${e}`)}write(e="anonymous",n=0){return`${e}(${this.argNames.join(", ")}) { ${n?this.body.split(`
77
- `).map(r=>" ".repeat(n)+`${r}`).join(`
78
- `):this.body} }`}compile(){return new VN(...this.argNames,this.body)}}const _l=t=>vs(t,"object")||typeof t=="symbol"?Zt(t):Sy(t),KT=(t,e=!1)=>typeof t=="string"&&fl(t)?`${e?"?":""}.${t}`:PT(g2(t),e),g2=t=>typeof t=="symbol"?Zt(t):JSON.stringify(t),PT=(t,e=!1)=>`${e?"?.":""}[${t}]`;class ip extends UT{traversalKind;optimistic;constructor(e){super("data","ctx"),this.traversalKind=e.kind,this.optimistic=e.optimistic===!0}invoke(e,n){const r=n?.arg??this.data,o=typeof e=="string"?!0:this.requiresContextFor(e),l=typeof e=="string"?e:e.id;return o?`${this.referenceToId(l,n)}(${r}, ${this.ctx})`:`${this.referenceToId(l,n)}(${r})`}referenceToId(e,n){const r=n?.kind??this.traversalKind,o=`this.${e}${r}`;return n?.bind?`${o}.bind(${n?.bind})`:o}requiresContextFor(e){return this.traversalKind==="Apply"||e.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(e,n,r){const o=this.requiresContextFor(r);return o&&this.line(`${this.ctx}.path.push(${e})`),this.check(r,{arg:n}),o&&this.line(`${this.ctx}.path.pop()`),this}check(e,n){return this.traversalKind==="Allows"?this.if(`!${this.invoke(e,n)}`,()=>this.return(!1)):this.line(this.invoke(e,n))}}const qT=t=>He(t,(e,n)=>[e,Ft(n)?[...n]:n]),Pi=ET("arkKind"),fe=(t,e)=>t?.[Pi]===e,Xt=t=>fe(t,"root")||fe(t,"constraint"),b2=["unit","proto","domain"],pf=["required","optional","index","sequence"],IT=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],wy=[...IT,...pf,"structure","predicate"],mf=["alias","union","morph","unit","intersection","proto","domain"],v2=[...mf,...wy],HT=He(wy,(t,e)=>[e,1]),S2=He([...pf,"undeclared"],(t,e)=>[e,1]),FT=He(v2,(t,e)=>[e,t]),mc=t=>typeof t=="string"&&t in FT,Kc=t=>FT[t],xy=t=>mf.slice(Kc(t)+1);[...xy("union")];[...xy("morph")];const ms=t=>typeof t=="string"||typeof t=="boolean"||t===null?t:typeof t=="number"?Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t:_l(t),yf=t=>{let e="{ ";for(const[n,r]of Object.entries(t))e+=`${n}: ${_l(r)}, `;return e+" }"},ut=t=>{const e=t;return e.hasAssociatedError&&(e.defaults.expected??=n=>"description"in n?n.description:e.defaults.description(n),e.defaults.actual??=n=>Pe(n),e.defaults.problem??=n=>`must be ${n.expected}${n.actual?` (was ${n.actual})`:""}`,e.defaults.message??=n=>{if(n.path.length===0)return n.problem;const r=`${n.propString} ${n.problem}`;return r[0]==="["?`value at ${r}`:r}),e};class w2 extends Error{name="ToJsonSchemaError";code;context;constructor(e,n){super(Pe(n,{quoteKeys:!1,indent:4})),this.code=e,this.context=n}hasCode(e){return this.code===e}}const x2={dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:t=>Rt.throw("arrayObject",t),arrayPostfix:t=>Rt.throw("arrayPostfix",t),defaultValue:t=>Rt.throw("defaultValue",t),domain:t=>Rt.throw("domain",t),morph:t=>Rt.throw("morph",t),patternIntersection:t=>Rt.throw("patternIntersection",t),predicate:t=>Rt.throw("predicate",t),proto:t=>Rt.throw("proto",t),symbolKey:t=>Rt.throw("symbolKey",t),unit:t=>Rt.throw("unit",t),date:t=>Rt.throw("date",t)}},Rt={Error:w2,throw:(...t)=>{throw new Rt.Error(...t)},throwInternalOperandError:(t,e)=>xt(`Unexpected JSON Schema input for ${t}: ${Pe(e)}`),defaultConfig:x2};Q.config??={};const em=(t,e)=>{if(!e)return t;const n={...t};let r;for(r in e){const o={...t.keywords};if(r==="keywords"){for(const l in e[r]){const c=e.keywords[l];c!==void 0&&(o[l]=typeof c=="string"?{description:c}:c)}n.keywords=o}else r==="toJsonSchema"?n[r]=GT(t.toJsonSchema,e.toJsonSchema):mc(r)?n[r]={...t[r],...e[r]}:n[r]=e[r]}return n},GT=((t,e)=>{if(!t)return e??{};if(!e)return t;const n={...t};let r;for(r in e)r==="fallback"?n.fallback=T2(t.fallback,e.fallback):n[r]=e[r];return n}),T2=(t,e)=>{t=nw(t),e=nw(e);const n={};let r;for(r in Rt.defaultConfig.fallback)n[r]=e[r]??e.default??t[r]??t.default??Rt.defaultConfig.fallback[r];return n},nw=t=>typeof t=="function"?{default:t}:t??{};class jo extends OT{[Pi]="error";path;data;nodeConfig;input;ctx;constructor({prefixPath:e,relativePath:n,...r},o){super(),this.input=r,this.ctx=o,_N(this,r);const l=o.data;r.code==="union"&&(r.errors=r.errors.flatMap(d=>{const h=d.hasCode("union")?d.errors:[d];return!e&&!n?h:h.map(p=>p.transform(y=>({...y,path:vN(e,y.path,n)})))})),this.nodeConfig=o.config[this.code];const c=[...r.path??o.path];n&&c.push(...n),e&&c.unshift(...e),this.path=new VT(...c),this.data="data"in r?r.data:l}transform(e){return new jo(e({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(e){return this.code===e}get propString(){return Ol(this.path)}get expected(){if(this.input.expected)return this.input.expected;const e=this.meta?.expected??this.nodeConfig.expected;return typeof e=="function"?e(this.input):e}get actual(){if(this.input.actual)return this.input.actual;const e=this.meta?.actual??this.nodeConfig.actual;return typeof e=="function"?e(this.data):e}get problem(){if(this.input.problem)return this.input.problem;const e=this.meta?.problem??this.nodeConfig.problem;return typeof e=="function"?e(this):e}get message(){if(this.input.message)return this.input.message;const e=this.meta?.message??this.nodeConfig.message;return typeof e=="function"?e(this):e}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}}class kr extends AT{[Pi]="errors";ctx;constructor(e){super(),this.ctx=e}byPath=Object.create(null);get flatByPath(){return He(this.byPath,(e,n)=>[e,n.flat])}get flatProblemsByPath(){return He(this.byPath,(e,n)=>[e,n.flat.map(r=>r.problem)])}byAncestorPath=Object.create(null);count=0;mutable=this;throw(){throw this.toTraversalError()}toTraversalError(){return new A2(this)}add(e){this.includes(e)||this._add(e)}transform(e){const n=new kr(this.ctx);for(const r of this)n.add(e(r));return n}merge(e){for(const n of e)this.includes(n)||this._add(new jo({...n,path:[...this.ctx.path,...n.path]},this.ctx))}affectsPath(e){return this.length===0?!1:e.stringifyAncestors().some(n=>n in this.byPath)||e.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(e=>e.toJSON())]}toString(){return this.join(`
79
- `)}_add(e){const n=this.byPath[e.propString];if(n){if(n.hasCode("union")&&n.errors.length===0)return;const r=e.hasCode("union")&&e.errors.length===0?e:new jo({code:"intersection",errors:n.hasCode("intersection")?[...n.errors,e]:[n,e]},this.ctx),o=this.indexOf(n);this.mutable[o===-1?this.length:o]=r,this.byPath[e.propString]=r,this.addAncestorPaths(e)}else this.byPath[e.propString]=e,this.addAncestorPaths(e),this.mutable.push(e);this.count++}addAncestorPaths(e){for(const n of e.path.stringifyAncestors())this.byAncestorPath[n]=Ie(this.byAncestorPath[n],e)}}class A2 extends Error{name="TraversalError";constructor(e){e.length===1?super(e.summary):super(`
80
- `+e.map(n=>` • ${E2(n)}`).join(`
81
- `)),Object.defineProperty(this,"arkErrors",{value:e,enumerable:!1})}}const E2=t=>t.toString().split(`
82
- `).join(`
83
- `);class po{path=[];errors=new kr(this);root;config;queuedMorphs=[];branches=[];seen={};constructor(e,n){this.root=e,this.config=n}get data(){let e=this.root;for(const n of this.path)e=e?.[n];return e}get propString(){return Ol(this.path)}reject(e){return this.error(e),!1}mustBe(e){return this.error(e),!1}error(e){const n=typeof e=="object"?e.code?e:{...e,code:"predicate"}:{code:"predicate",expected:e};return this.errorFromContext(n)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches.at(-1)}queueMorphs(e){const n={path:new VT(...this.path),morphs:e};this.currentBranch?this.currentBranch.queuedMorphs.push(n):this.queuedMorphs.push(n)}finalize(e){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()?e?e(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(e){return this.errorFromContext(e)}errorFromContext(e){const n=new jo(e,this);return this.currentBranch?this.currentBranch.error=n:this.errors.add(n),n}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const e=this.queuedMorphs;this.queuedMorphs=[];for(const{path:n,morphs:r}of e)this.errors.affectsPath(n)||this.applyMorphsAtPath(n,r)}}applyMorphsAtPath(e,n){const r=e.at(-1);let o;if(r!==void 0){o=this.root;for(let l=0;l<e.length-1;l++)o=o[e[l]]}for(const l of n){this.path=[...e];const c=Xt(l),d=l(o===void 0?this.root:o[r],this);if(d instanceof jo){this.errors.add(d);break}if(d instanceof kr){c||this.errors.merge(d);break}o===void 0?this.root=d:o[r]=d,this.applyQueuedMorphs()}}}const qi=(t,e,n)=>{if(!n)return e();n.path.push(t);const r=e();return n.path.pop(),r};class YT extends Uo{attachments;$;onFail;includesTransform;includesContextualPredicate;isCyclic;allowsRequiresContext;rootApplyStrategy;contextFreeMorph;rootApply;referencesById;shallowReferences;flatRefs;flatMorphs;allows;get shallowMorphs(){return[]}constructor(e,n){super((o,l,c=this.onFail)=>l?(this.traverseApply(o,l),l.hasError()?l.errors:l.data):this.rootApply(o,c),{attach:e}),this.attachments=e,this.$=n,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((o,l)=>k2(o,l.shallowReferences),[this]);const r=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let o=0;o<this.children.length;o++){if(this.includesTransform||=this.children[o].includesTransform,this.includesContextualPredicate||=this.children[o].includesContextualPredicate,this.isCyclic||=this.children[o].isCyclic,!r){const l=this.children[o].flatRefs;for(let c=0;c<l.length;c++){const d=l[c];if(!this.flatRefs.some(h=>XT(h,d))){this.flatRefs.push(d);for(const h of d.node.branches)(h.hasKind("morph")||h.hasKind("intersection")&&h.structure?.structuralMorph!==void 0)&&this.flatMorphs.push({path:d.path,propString:d.propString,node:h})}}}Object.assign(this.referencesById,this.children[o].referencesById)}this.flatRefs.sort((o,l)=>o.path.length>l.path.length?1:o.path.length<l.path.length?-1:o.propString>l.propString?1:o.propString<l.propString||o.node.expression<l.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(o=>o.length===1||o.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(o=>o.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?o=>this.traverseAllows(o,new po(o,this.$.resolvedConfig)):o=>this.traverseAllows(o)}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(n,r)=>{if(this.allows(n))return n;const o=new po(n,this.$.resolvedConfig);return this.traverseApply(n,o),o.finalize(r)};case"contextual":return(n,r)=>{const o=new po(n,this.$.resolvedConfig);return this.traverseApply(n,o),o.finalize(r)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const e=this.$.resolvedConfig.clone;return(n,r)=>{if(this.allows(n))return this.contextFreeMorph(e&&(typeof n=="object"&&n!==null||typeof n=="function")?e(n):n);const o=new po(n,this.$.resolvedConfig);return this.traverseApply(n,o),o.finalize(r)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,xt(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}compiledMeta=_2(this.metaJson);cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get description(){return this.cacheGetter("description",this.meta?.description??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}precedence=Kc(this.kind);precompilation;assert=(e,n)=>this(e,n,r=>r.throw());traverse(e,n){return this(e,n,null)}get in(){return this.cacheGetter("in",this.getIo("in"))}get out(){return this.cacheGetter("out",this.getIo("out"))}getIo(e){if(!this.includesTransform)return this;const n={};for(const[r,o]of this.innerEntries){const l=this.impl.keys[r];if(l.reduceIo)l.reduceIo(e,n,o);else if(l.child){const c=o;n[r]=Ft(c)?c.map(d=>d[e]):c[e]}else n[r]=o}return this.$.node(this.kind,n)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(e){const n=Xt(e)?e:this.$.parseDefinition(e);return this.innerHash===n.innerHash}ifEquals(e){return this.equals(e)?this:void 0}hasKind(e){return this.kind===e}assertHasKind(e){return this.kind!==e&&Do(`${this.kind} node was not of asserted kind ${e}`),this}hasKindIn(...e){return e.includes(this.kind)}assertHasKindIn(...e){return is(e,this.kind)||Do(`${this.kind} node was not one of asserted kinds ${e}`),this}isBasis(){return is(b2,this.kind)}isConstraint(){return is(wy,this.kind)}isStructural(){return is(pf,this.kind)}isRefinement(){return is(IT,this.kind)}isRoot(){return is(mf,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(e){return this.hasKind("unit")&&this.allows(e)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(e){const n=Xa.normalize(e);return this._select(n)}_select(e){let n=Xa.applyBoundary[e.boundary??"references"](this);return e.kind&&(n=n.filter(r=>r.kind===e.kind)),e.where&&(n=n.filter(e.where)),Xa.applyMethod[e.method??"filter"](n,this,e)}transform(e,n){return this._transform(e,this._createTransformContext(n))}_createTransformContext(e){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:e?.prereduced??!1},undeclaredKeyHandling:void 0,...e}}_transform(e,n){const r=n.bindScope??this.$;if(n.seen[this.id])return this.$.lazilyResolve(n.seen[this.id]);if(n.shouldTransform?.(this,n)===!1)return this;let o;n.seen[this.id]=()=>o,this.hasKind("structure")&&this.undeclared!==n.undeclaredKeyHandling&&(n={...n,undeclaredKeyHandling:this.undeclared});const l=He(this.inner,(y,g)=>{if(!this.impl.keys[y].child)return[y,g];const v=g;if(!Ft(v)){const x=v._transform(e,n);return x?[y,x]:[]}if(v.length===0)return[y,g];const S=v.flatMap(x=>x._transform(e,n)??[]);return S.length?[y,S]:[]});delete n.seen[this.id];const c=Object.assign(l,{meta:this.meta}),d=n.selected&&!n.selected.includes(this)?c:e(this.kind,c,n);if(d===null)return null;if(Xt(d))return o=d;const h=Object.keys(d);return(h.length===0||h.length===1&&h[0]==="meta")&&!Al(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in d)?n.undeclaredKeyHandling?{...d,value:Q.intrinsic.unknown}:null:(this.kind==="morph"&&(d.in??=Q.intrinsic.unknown),o=r.node(this.kind,d,n.parseOptions))}configureReferences(e,n="references"){const r=Xa.normalize(n),o=typeof e=="string"?(h,p)=>({...p,meta:{...p.meta,description:e}}):typeof e=="function"?(h,p)=>({...p,meta:e(p.meta)}):(h,p)=>({...p,meta:{...p.meta,...e}});if(r.boundary==="self")return this.$.node(this.kind,o(this.kind,{...this.inner,meta:this.meta}));const l=this._select(r),c=l&&Tl(l),d=r.boundary==="child"?(h,p)=>p.root.children.includes(h):r.boundary==="shallow"?h=>h.kind!=="structure":()=>!0;return this.$.finalize(this.transform(o,{shouldTransform:d,selected:c}))}}const Xa={applyBoundary:{self:t=>[t],child:t=>[...t.children],shallow:t=>[...t.shallowReferences],references:t=>[...t.references]},applyMethod:{filter:t=>t,assertFilter:(t,e,n)=>(t.length===0&&Do(iw(e,n)),t),find:t=>t[0],assertFind:(t,e,n)=>(t.length===0&&Do(iw(e,n)),t[0])},normalize:t=>typeof t=="function"?{boundary:"references",method:"filter",where:t}:typeof t=="string"?mi(t,Xa.applyBoundary)?{method:"filter",boundary:t}:{boundary:"references",method:"filter",kind:t}:{boundary:"references",method:"filter",...t}},iw=(t,e)=>`${t} had no references matching ${Pe(e)}.`,R2=t=>Ol(t,{stringifyNonKey:e=>e.expression}),O2=/"(\$ark\.[^"]+)"/g,_2=t=>JSON.stringify(t).replaceAll(O2,"$1"),Er=(t,e)=>({path:t,node:e,propString:R2(t)}),XT=(t,e)=>t.propString===e.propString&&t.node.equals(e.node),rw=(t,e)=>cs(t,e,{isEqual:XT}),k2=(t,e)=>cs(t,e,{isEqual:(n,r)=>n.equals(r)});class se extends Array{static init(e,n,r,o){return new se({kind:e,l:n,r,path:o?.path??[],optional:o?.optional??!1})}add(e,n,r,o){return this.push({kind:e,l:n,r,path:o?.path??[],optional:o?.optional??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:e,l:n,r}=this[0],o=Ol(e);return JT(`Intersection${o&&` at ${o}`} of ${sw(n,r)}`)}return`The following intersections result in unsatisfiable types:
84
- • ${this.map(({path:e,l:n,r})=>`${e}: ${sw(n,r)}`).join(`
85
- • `)}`}throw(){return Y(this.describeReasons())}invert(){const e=this.map(n=>({...n,l:n.r,r:n.l}));return e instanceof se?e:new se(...e)}withPrefixKey(e,n){return this.map(r=>({...r,path:[e,...r.path],optional:r.optional||n==="optional"}))}toNeverIfDisjoint(){return Q.intrinsic.never}}const sw=(t,e)=>`${tm(t)} and ${tm(e)}`,tm=t=>Xt(t)?t.expression:Ft(t)?t.map(tm).join(" | ")||"never":String(t),JT=t=>`${t} results in an unsatisfiable type`,lo={},Ii=(t,e,n)=>Nt(t,e,{$:n,invert:!1,pipe:!1}),nm=(t,e,n)=>Nt(t,e,{$:n,invert:!1,pipe:!0}),Nt=((t,e,n)=>{const r=n.pipe?"|>":"&",o=`${t.hash}${r}${e.hash}`;if(lo[o]!==void 0)return lo[o];if(!n.pipe){const d=`${e.hash}${r}${t.hash}`;if(lo[d]!==void 0){const h=lo[d],p=h instanceof se?h.invert():h;return lo[o]=p,p}}const l=!n.pipe||!t.includesTransform&&!e.includesTransform;if(l&&t.equals(e))return t;let c=l?im(t,e,n):t.hasKindIn(...mf)?M2(t,e,n):im(t,e,n);return Xt(c)&&(t.equals(c)?c=t:e.equals(c)&&(c=e)),lo[o]=c,c}),im=(t,e,n)=>{const r=t.precedence<e.precedence?t.kind:e.kind,o=t.impl.intersections[e.kind]??e.impl.intersections[t.kind];if(o===void 0)return null;if(r===t.kind)return o(t,e,n);{let l=o(e,t,{...n,invert:!n.invert});return l instanceof se&&(l=l.invert()),l}},M2=(t,e,n)=>t.includesTransform||e.includesTransform?n.invert?ow(e,t,n):ow(t,e,n):im(t,e,n),ow=(t,e,n)=>t.distribute(r=>C2(r,e,n),r=>{const o=r.filter(Xt);if(o.length===0)return se.init("union",t.branches,e.branches);if(o.length<t.branches.length||!t.branches.every((c,d)=>c.in.equals(o[d].in)))return n.$.parseSchema(o);if(o.length===1)return o[0];const l={branches:o};return n.$.parseSchema(l)}),C2=(t,e,n)=>{if(t.hasKind("morph")){const o=[...t.morphs];if(t.lastMorphIfNode){const l=Nt(t.lastMorphIfNode,e,n);if(l instanceof se)return l;o[o.length-1]=l}else o.push(e);return n.$.node("morph",{morphs:o,in:t.inner.in})}if(e.hasKind("morph")){const o=Nt(t,e.in,n);return o instanceof se?o:n.$.node("morph",{morphs:[e],in:o})}return n.$.node("morph",{morphs:[e],in:t})};class Ko extends YT{constructor(e,n){super(e,n),Object.defineProperty(this,Pi,{value:"constraint",enumerable:!1})}impliedSiblings;intersect(e){return Ii(this,e,this.$)}}class gf extends Ko{traverseApply=(e,n)=>{this.traverseAllows(e,n)||n.errorFromNodeContext(this.errorContext)};compile(e){e.traversalKind==="Allows"?e.return(this.compiledCondition):e.if(this.compiledNegation,()=>e.line(`${e.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return yf(this.errorContext)}}const rn=t=>(e,n)=>{if(Ft(e)){if(e.length===0)return;const o=e.map(l=>n.$.node(t,l));return t==="predicate"?o:o.sort((l,c)=>l.hash<c.hash?-1:1)}const r=n.$.node(t,e);return r.hasOpenIntersection()?[r]:r},Pc=t=>{const e=t.r.shift();if(!e){let r=t.l.length===0&&t.kind==="structure"?Q.intrinsic.unknown.internal:t.ctx.$.node(t.kind,Object.assign(t.baseInner,D2(t.l)),{prereduced:!0});for(const o of t.roots){if(r instanceof se)return r;r=Nt(o,r,t.ctx)}return r}let n=!1;for(let r=0;r<t.l.length;r++){const o=Nt(t.l[r],e,t.ctx);if(o!==null){if(o instanceof se)return o;if(n){if(!t.l.includes(o))return xt(`Unexpectedly encountered multiple distinct intersection results for refinement ${o}`)}else{if(o.isRoot())return t.roots.push(o),t.l.splice(r),Pc(t);t.l[r]=o,n=!0}}}if(n||t.l.push(e),t.kind==="intersection"&&e.impliedSiblings)for(const r of e.impliedSiblings)cs(t.r,r);return Pc(t)},qc=t=>Object.entries(t).flatMap(([n,r])=>n in HT?r:[]).sort((n,r)=>n.precedence<r.precedence?-1:n.precedence>r.precedence?1:n.kind==="predicate"&&r.kind==="predicate"?0:n.hash<r.hash?-1:1),D2=t=>{const e={};for(const n of t)if(n.hasOpenIntersection())e[n.kind]=Ie(e[n.kind],n);else{if(e[n.kind])return xt(`Unexpected intersection of closed refinements of kind ${n.kind}`);e[n.kind]=n}return e},N2=(...t)=>Y($2(...t)),$2=(t,e,n)=>{const r=n.hasKind("morph")?"a morph":n.isUnknown()?"unknown":n.exclude(e).defaultShortDescription;return`${IN(t)} operand must be ${e.description} (was ${r})`},j2=(t,e,n)=>new Ic(t,e,n,n,null);class ZT extends Uo{}class Ic extends Uo{[Pi]="generic";paramDefs;bodyDef;$;arg$;baseInstantiation;hkt;description;constructor(e,n,r,o,l){super((...c)=>{const d=He(this.names,(h,p)=>{const y=this.arg$.parse(c[h]);return y.extends(this.constraints[h])||Y(B2(p,this.constraints[h].expression,y.expression)),[p,y]});if(this.defIsLazy()){const h=this.bodyDef(d);return this.$.parse(h)}return this.$.parse(n,{args:d})}),this.paramDefs=e,this.bodyDef=n,this.$=r,this.arg$=o,this.hkt=l,this.description=l?new l().description??`a generic type for ${l.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof ZT}cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get json(){return this.cacheGetter("json",{params:this.params.map(e=>e[1].isUnknown()?e[0]:[e[0],e[1].json]),body:c2(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(e=>typeof e=="string"?[e,Q.intrinsic.unknown]:[e[0],this.$.parse(e[1])]))}get names(){return this.cacheGetter("names",this.params.map(e=>e[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(e=>e[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const B2=(t,e,n)=>`${t} must be assignable to ${e} (was ${n})`,L2=ut({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:t=>typeof t=="function"?{predicate:t}:t,defaults:{description:t=>`valid according to ${t.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class V2 extends Ko{serializedPredicate=Zt(this.predicate);compiledCondition=`${this.serializedPredicate}(data, ctx)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=null;expression=this.serializedPredicate;traverseAllows=this.predicate;errorContext={code:"predicate",description:this.description,meta:this.meta};compiledErrorContext=yf(this.errorContext);traverseApply=(e,n)=>{!this.predicate(e,n.external)&&!n.hasError()&&n.errorFromNodeContext(this.errorContext)};compile(e){if(e.traversalKind==="Allows"){e.return(this.compiledCondition);return}e.if(`${this.compiledNegation} && !ctx.hasError()`,()=>e.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(e,n){return n.fallback.predicate({code:"predicate",base:e,predicate:this.predicate})}}const QT={implementation:L2,Node:V2},z2=ut({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:t=>Number.isInteger(t)?t:Y(K2(t))}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>t.rule===1?"an integer":t.rule===2?"even":`a multiple of ${t.rule}`},intersections:{divisor:(t,e,n)=>n.$.node("divisor",{rule:Math.abs(t.rule*e.rule/P2(t.rule,e.rule))})},obviatesBasisDescription:!0});class U2 extends gf{traverseAllows=e=>e%this.rule===0;compiledCondition=`data % ${this.rule} === 0`;compiledNegation=`data % ${this.rule} !== 0`;impliedBasis=Q.intrinsic.number.internal;expression=`% ${this.rule}`;reduceJsonSchema(e){return e.type="integer",this.rule===1||(e.multipleOf=this.rule),e}}const WT={implementation:z2,Node:U2},K2=t=>`divisor must be an integer (was ${t})`,P2=(t,e)=>{let n,r=t,o=e;for(;o!==0;)n=o,o=r%o,r=n;return r};class Po extends gf{boundOperandKind=F2[this.kind];compiledActual=this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()";comparator=G2(this.kind,this.exclusive);numericLimit=this.rule.valueOf();expression=`${this.comparator} ${this.rule}`;compiledCondition=`${this.compiledActual} ${this.comparator} ${this.numericLimit}`;compiledNegation=`${this.compiledActual} ${q2[this.comparator]} ${this.numericLimit}`;stringLimit=this.boundOperandKind==="date"?Y2(this.numericLimit):`${this.numericLimit}`;limitKind=this.comparator[0]==="<"?"upper":"lower";isStricterThan(e){return(this.limitKind==="upper"?this.numericLimit<e.numericLimit:this.numericLimit>e.numericLimit)||this.numericLimit===e.numericLimit&&this.exclusive===!0&&!e.exclusive}overlapsRange(e){return!(this.isStricterThan(e)||this.numericLimit===e.numericLimit&&(this.exclusive||e.exclusive))}overlapIsUnit(e){return this.numericLimit===e.numericLimit&&!this.exclusive&&!e.exclusive}}const q2={"<":">=","<=":">",">":"<=",">=":"<"},I2={min:"max",minLength:"maxLength",after:"before"},eA={parse:t=>t||void 0},tA=t=>e=>{if(typeof e=="number")return{rule:e};const{exclusive:n,...r}=e;return n?{...r,rule:t==="minLength"?r.rule+1:r.rule-1}:r},nA=t=>e=>{if(typeof e=="number"||typeof e=="string"||e instanceof Date)return{rule:e};const{exclusive:n,...r}=e;if(!n)return r;const o=typeof r.rule=="number"?r.rule:typeof r.rule=="string"?new Date(r.rule).valueOf():r.rule.valueOf();return n?{...r,rule:t==="after"?o+1:o-1}:r},iA=t=>typeof t=="string"||typeof t=="number"?new Date(t):t,H2=(t,e)=>`${t} bound must be a positive integer (was ${e})`,Ty=t=>e=>((!Number.isInteger(e)||e<0)&&Y(H2(t,e)),e),F2={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},G2=(t,e)=>`${mi(t,I2)?">":"<"}${e?"":"="}`,Y2=t=>typeof t=="string"?t:new Date(t).toLocaleString(),X2=t=>`Bounded expression ${t} must be exactly one of number, string, Array, or Date`,J2=ut({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:iA,serialize:t=>t.toISOString()}},normalize:nA("after"),defaults:{description:t=>`${t.collapsibleLimitString} or later`,actual:Rl},intersections:{after:(t,e)=>t.isStricterThan(e)?t:e}});class Z2 extends Po{impliedBasis=Q.intrinsic.Date.internal;collapsibleLimitString=Rl(this.rule);traverseAllows=e=>e>=this.rule;reduceJsonSchema(e,n){return n.fallback.date({code:"date",base:e,after:this.rule})}}const rA={implementation:J2,Node:Z2},Q2=ut({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:iA,serialize:t=>t.toISOString()}},normalize:nA("before"),defaults:{description:t=>`${t.collapsibleLimitString} or earlier`,actual:Rl},intersections:{before:(t,e)=>t.isStricterThan(e)?t:e,after:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("unit",{unit:t.rule}):null:se.init("range",t,e)}});class W2 extends Po{collapsibleLimitString=Rl(this.rule);traverseAllows=e=>e<=this.rule;impliedBasis=Q.intrinsic.Date.internal;reduceJsonSchema(e,n){return n.fallback.date({code:"date",base:e,before:this.rule})}}const sA={implementation:Q2,Node:W2},e$=ut({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:Ty("exactLength")}},normalize:t=>typeof t=="number"?{rule:t}:t,hasAssociatedError:!0,defaults:{description:t=>`exactly length ${t.rule}`,actual:t=>`${t.length}`},intersections:{exactLength:(t,e,n)=>se.init("unit",n.$.node("unit",{unit:t.rule}),n.$.node("unit",{unit:e.rule}),{path:["length"]}),minLength:(t,e)=>t.rule>=e.rule?t:se.init("range",t,e),maxLength:(t,e)=>t.rule<=e.rule?t:se.init("range",t,e)}});class t$ extends gf{traverseAllows=e=>e.length===this.rule;compiledCondition=`data.length === ${this.rule}`;compiledNegation=`data.length !== ${this.rule}`;impliedBasis=Q.intrinsic.lengthBoundable.internal;expression=`== ${this.rule}`;reduceJsonSchema(e){switch(e.type){case"string":return e.minLength=this.rule,e.maxLength=this.rule,e;case"array":return e.minItems=this.rule,e.maxItems=this.rule,e;default:return Rt.throwInternalOperandError("exactLength",e)}}}const oA={implementation:e$,Node:t$},n$=ut({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:eA},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"negative":"non-positive":`${t.exclusive?"less than":"at most"} ${t.rule}`},intersections:{max:(t,e)=>t.isStricterThan(e)?t:e,min:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("unit",{unit:t.rule}):null:se.init("range",t,e)},obviatesBasisDescription:!0});class i$ extends Po{impliedBasis=Q.intrinsic.number.internal;traverseAllows=this.exclusive?e=>e<this.rule:e=>e<=this.rule;reduceJsonSchema(e){return this.exclusive?e.exclusiveMaximum=this.rule:e.maximum=this.rule,e}}const aA={implementation:n$,Node:i$},r$=ut({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Ty("maxLength")}},reduce:(t,e)=>t.rule===0?e.node("exactLength",t):void 0,normalize:tA("maxLength"),defaults:{description:t=>`at most length ${t.rule}`,actual:t=>`${t.length}`},intersections:{maxLength:(t,e)=>t.isStricterThan(e)?t:e,minLength:(t,e,n)=>t.overlapsRange(e)?t.overlapIsUnit(e)?n.$.node("exactLength",{rule:t.rule}):null:se.init("range",t,e)}});class s$ extends Po{impliedBasis=Q.intrinsic.lengthBoundable.internal;traverseAllows=e=>e.length<=this.rule;reduceJsonSchema(e){switch(e.type){case"string":return e.maxLength=this.rule,e;case"array":return e.maxItems=this.rule,e;default:return Rt.throwInternalOperandError("maxLength",e)}}}const lA={implementation:r$,Node:s$},o$=ut({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:eA},normalize:t=>typeof t=="number"?{rule:t}:t,defaults:{description:t=>t.rule===0?t.exclusive?"positive":"non-negative":`${t.exclusive?"more than":"at least"} ${t.rule}`},intersections:{min:(t,e)=>t.isStricterThan(e)?t:e},obviatesBasisDescription:!0});class a$ extends Po{impliedBasis=Q.intrinsic.number.internal;traverseAllows=this.exclusive?e=>e>this.rule:e=>e>=this.rule;reduceJsonSchema(e){return this.exclusive?e.exclusiveMinimum=this.rule:e.minimum=this.rule,e}}const uA={implementation:o$,Node:a$},l$=ut({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:Ty("minLength")}},reduce:t=>t.rule===0?Q.intrinsic.unknown:void 0,normalize:tA("minLength"),defaults:{description:t=>t.rule===1?"non-empty":`at least length ${t.rule}`,actual:t=>t.length===0?"":`${t.length}`},intersections:{minLength:(t,e)=>t.isStricterThan(e)?t:e}});class u$ extends Po{impliedBasis=Q.intrinsic.lengthBoundable.internal;traverseAllows=e=>e.length>=this.rule;reduceJsonSchema(e){switch(e.type){case"string":return e.minLength=this.rule,e;case"array":return e.minItems=this.rule,e;default:return Rt.throwInternalOperandError("minLength",e)}}}const cA={implementation:l$,Node:u$},c$={min:uA.implementation,max:aA.implementation,minLength:cA.implementation,maxLength:lA.implementation,exactLength:oA.implementation,after:rA.implementation,before:sA.implementation},f$={min:uA.Node,max:aA.Node,minLength:cA.Node,maxLength:lA.Node,exactLength:oA.Node,after:rA.Node,before:sA.Node},d$=ut({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:t=>typeof t=="string"?{rule:t}:t instanceof RegExp?t.flags?{rule:t.source,flags:t.flags}:{rule:t.source}:t,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:t=>`matched by ${t.rule}`},intersections:{pattern:()=>null}});class h$ extends gf{instance=new RegExp(this.rule,this.flags);expression=`${this.instance}`;traverseAllows=this.instance.test.bind(this.instance);compiledCondition=`${this.expression}.test(data)`;compiledNegation=`!${this.compiledCondition}`;impliedBasis=Q.intrinsic.string.internal;reduceJsonSchema(e,n){return e.pattern?n.fallback.patternIntersection({code:"patternIntersection",base:e,pattern:this.rule}):(e.pattern=this.rule,e)}}const fA={implementation:d$,Node:h$},yc=(t,e)=>{const n=p$(t);return e&&!e.includes(n)?Y(`Root of kind ${n} should be one of ${e}`):n},p$=t=>{if(fe(t,"root"))return t.kind;if(typeof t=="string")return t[0]==="$"?"alias":t in Ki?"domain":"proto";if(typeof t=="function")return"proto";if(typeof t!="object"||t===null)return Y(aw(t));if("morphs"in t)return"morph";if("branches"in t||Ft(t))return"union";if("unit"in t)return"unit";if("reference"in t)return"alias";const e=Object.keys(t);return e.length===0||e.some(n=>n in HT)?"intersection":"proto"in t?"proto":"domain"in t?"domain":Y(aw(t))},aw=t=>`${Pe(t)} is not a valid type schema`,lw={},m$=t=>Ft(t)?t.map(e=>e.collapsibleJson):t.collapsibleJson,jn={};Q.nodesByRegisteredId=jn;const dA=t=>(lw[t]??=0,`${t}${++lw[t]}`),hA=t=>{const e=bf[t.kind],n=e.applyConfig?.(t.def,t.$.resolvedConfig)??t.def,r={},{meta:o,...l}=n,c=o===void 0?{}:typeof o=="string"?{description:o}:o,d=RT(l).sort(([p],[y])=>mc(p)?mc(y)?Kc(p)-Kc(y):1:mc(y)||p<y?-1:1).filter(([p,y])=>{if(p.startsWith("meta.")){const g=p.slice(5);return c[g]=y,!1}return!0});for(const p of d){const y=p[0],g=e.keys[y];if(!g)return Y(`Key ${y} is not valid on ${t.kind} schema`);const v=g.parse?g.parse(p[1],t):p[1];v!==Bi&&(v!==void 0||g.preserveUndefined)&&(r[y]=v)}if(e.reduce&&!t.prereduced){const p=e.reduce(r,t.$);if(p)return p instanceof se?p.throw():g$(p,c)}return Ay({id:t.id,kind:t.kind,inner:r,meta:c,$:t.$})},Ay=({id:t,kind:e,inner:n,meta:r,$:o,ignoreCache:l})=>{const c=bf[e],d=RT(n),h=[];let p={};for(const[M,O]of d){const _=c.keys[M],G=_.serialize??(_.child?m$:ms);if(p[M]=G(O),_.child===!0){const z=O;Ft(z)?h.push(...z):h.push(z)}else typeof _.child=="function"&&h.push(..._.child(O))}c.finalizeInnerJson&&(p=c.finalizeInnerJson(p));let y={...p},g={};Al(r)||(g=He(r,(M,O)=>[M,M==="examples"?O:ms(O)]),y.meta=tc(g,"description",!0)),p=tc(p,c.collapsibleKey,!1);const v=JSON.stringify({kind:e,...p});y=tc(y,c.collapsibleKey,!1);const S=tc(y,c.collapsibleKey,!0),x=JSON.stringify({kind:e,...y});if(o.nodesByHash[x]&&!l)return o.nodesByHash[x];const T={id:t,kind:e,impl:c,inner:n,innerEntries:d,innerJson:p,innerHash:v,meta:r,metaJson:g,json:y,hash:x,collapsibleJson:S,children:h};if(e!=="intersection")for(const M in n)M!=="in"&&M!=="out"&&(T[M]=n[M]);const C=new Tj[e](T,o);return o.nodesByHash[x]=C},y$=(t,e)=>t.id===e?t:(Xt(jn[e])&&xt(`Unexpected attempt to overwrite node id ${e}`),Ay({id:e,kind:t.kind,inner:t.inner,meta:t.meta,$:t.$,ignoreCache:!0})),g$=(t,e,n)=>Ay({id:dA(e.alias??t.kind),kind:t.kind,inner:t.inner,meta:e,$:t.$}),tc=(t,e,n)=>{const r=Object.keys(t);if(r.length===1&&r[0]===e){const o=t[e];if(n||vs(o,"object")&&(Object.keys(o).length===1||Array.isArray(o)))return o}return t},rm=(t,e,n)=>{if(t.key!==e.key)return null;const r=t.key;let o=Nt(t.value,e.value,n);const l=t.required||e.required?"required":"optional";if(o instanceof se)if(l==="optional")o=Q.intrinsic.never.internal;else return o.withPrefixKey(t.key,t.required&&e.required?"required":"optional");if(l==="required")return n.$.node("required",{key:r,value:o});const c=t.hasDefault()?e.hasDefault()?t.default===e.default?t.default:Y(mA(t.default,e.default)):t.default:e.hasDefault()?e.default:Bi;return n.$.node("optional",{key:r,value:o,default:c})};class pA extends Ko{required=this.kind==="required";optional=this.kind==="optional";impliedBasis=Q.intrinsic.object.internal;serializedKey=_l(this.key);compiledKey=typeof this.key=="string"?this.key:this.serializedKey;flatRefs=Ie(this.value.flatRefs.map(e=>Er([this.key,...e.path],e.node)),Er([this.key],this.value));_transform(e,n){n.path.push(this.key);const r=super._transform(e,n);return n.path.pop(),r}hasDefault(){return"default"in this.inner}traverseAllows=(e,n)=>this.key in e?qi(this.key,()=>this.value.traverseAllows(e[this.key],n),n):this.optional;traverseApply=(e,n)=>{this.key in e?qi(this.key,()=>this.value.traverseApply(e[this.key],n),n):this.hasKind("required")&&n.errorFromNodeContext(this.errorContext)};compile(e){e.if(`${this.serializedKey} in data`,()=>e.traverseKey(this.serializedKey,`data${e.prop(this.key)}`,this.value)),this.hasKind("required")&&e.else(()=>e.traversalKind==="Apply"?e.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):e.return(!1)),e.traversalKind==="Allows"&&e.return(!0)}}const mA=(t,e)=>`Invalid intersection of default values ${Pe(t)} & ${Pe(e)}`,b$=ut({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)},default:{preserveUndefined:!0}},normalize:t=>t,reduce:(t,e)=>{if(e.resolvedConfig.exactOptionalPropertyTypes===!1&&!t.value.allows(void 0))return e.node("optional",{...t,value:t.value.or(ye.undefined)},{prereduced:!0})},defaults:{description:t=>`${t.compiledKey}?: ${t.value.description}`},intersections:{optional:rm}});class v$ extends pA{constructor(...e){super(...e),"default"in this.inner&&Ry(this.value,this.inner.default,this.key)}get outProp(){if(!this.hasDefault())return this;const{default:e,...n}=this.inner;return this.cacheGetter("outProp",this.$.node("required",n,{prereduced:!0}))}expression=this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${Pe(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`;defaultValueMorph=w$(this);defaultValueMorphRef=this.defaultValueMorph&&Zt(this.defaultValueMorph)}const Ey={implementation:b$,Node:v$},S$={},w$=t=>{if(!t.hasDefault())return;const e=`{${t.compiledKey}: ${t.value.id} = ${ms(t.default)}}`;return S$[e]??=yA(t.key,t.value,t.default)},yA=(t,e,n)=>{if(typeof n=="function")return e.includesTransform?(o,l)=>(qi(t,()=>e(o[t]=n(),l),l),o):o=>(o[t]=n(),o);const r=e.includesTransform?e.assert(n):n;return vs(r,"object")?(o,l)=>(qi(t,()=>e(o[t]=n,l),l),o):o=>(o[t]=r,o)},Ry=(t,e,n)=>{const r=df(e);vs(e,"object")&&!r&&Y(x$(n));const o=t.in(r?e():e);if(o instanceof kr){n===null&&Y(`Default ${o.summary}`);const l=o.transform(c=>c.transform(d=>({...d,prefixPath:[n]})));Y(`Default for ${l.summary}`)}return e},x$=t=>`Non-primitive default ${t===null?"":typeof t=="number"?`for value at [${t}] `:`for ${_l(t)} `}must be specified as a function like () => ({my: 'object'})`;class kl extends YT{constructor(e,n){super(e,n),Object.defineProperty(this,Pi,{value:"root",enumerable:!1})}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:e=>{const n=this(e);return n instanceof kr?n:{value:n}},toJSONSchema:e=>e.target&&e.target!=="draft-2020-12"?Y(`JSONSchema target '${e.target}' is not supported (must be "draft-2020-12")`):e.io==="input"?this.in.toJsonSchema():this.out.toJsonSchema()}}as(){return this}brand(e){return e===""?Y(T$):this}readonly(){return this}branches=this.hasKind("union")?this.inner.branches:[this];distribute(e,n){const r=this.branches.map(e);return n?.(r)??r}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(e={}){const n=GT(this.$.resolvedConfig.toJsonSchema,e);n.useRefs||=this.isCyclic;const r=typeof n.dialect=="string"?{$schema:n.dialect}:{};return Object.assign(r,this.toJsonSchemaRecurse(n)),n.useRefs&&(r.$defs=He(this.references,(o,l)=>l.isRoot()&&!l.alwaysExpandJsonSchema?[l.id,l.toResolvedJsonSchema(n)]:[])),r}toJsonSchemaRecurse(e){return e.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(e)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(e){const n=this.innerToJsonSchema(e);return Object.assign(n,this.metaJson)}intersect(e){const n=this.$.parseDefinition(e),r=this.rawIntersect(n);return r instanceof se?r:this.$.finalize(r)}rawIntersect(e){return Ii(this,e,this.$)}toNeverIfDisjoint(){return this}and(e){const n=this.intersect(e);return n instanceof se?n.throw():n}rawAnd(e){const n=this.rawIntersect(e);return n instanceof se?n.throw():n}or(e){const n=this.$.parseDefinition(e);return this.$.finalize(this.rawOr(n))}rawOr(e){const n=[...this.branches,...e.branches];return this.$.node("union",n)}map(e){return this.$.schema(this.applyStructuralOperation("map",[e]))}pick(...e){return this.$.schema(this.applyStructuralOperation("pick",e))}omit(...e){return this.$.schema(this.applyStructuralOperation("omit",e))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}_keyof;keyof(){if(this._keyof)return this._keyof;const e=this.applyStructuralOperation("keyof",[]).reduce((n,r)=>n.intersect(r).toNeverIfDisjoint(),Q.intrinsic.unknown.internal);return e.branches.length===0&&Y(JT(`keyof ${this.expression}`)),this._keyof=this.$.finalize(e)}get props(){return this.branches.length!==1?Y(A$(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(e){const n=this.$.parseDefinition(e);return this.$.schema(n.distribute(r=>this.applyStructuralOperation("merge",[uw(r)??Y(cw("merge",r.expression))])))}applyStructuralOperation(e,n){return this.distribute(r=>{if(r.equals(Q.intrinsic.object)&&e!=="merge")return r;const o=uw(r);if(o||Y(cw(e,r.expression)),e==="keyof")return o.keyof();if(e==="get")return o.get(...n);if(e==="props")return o.props;const l=e==="required"?"require":e==="partial"?"optionalize":e;return this.$.node("intersection",{...r.inner,structure:o[l](...n)})})}get(...e){return e[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",e))}extract(e){const n=this.$.parseDefinition(e);return this.$.schema(this.branches.filter(r=>r.extends(n)))}exclude(e){const n=this.$.parseDefinition(e);return this.$.schema(this.branches.filter(r=>!r.extends(n)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(e){return!(this.intersect(e)instanceof se)}extends(e){const n=this.intersect(e);return!(n instanceof se)&&this.equals(n)}ifExtends(e){return this.extends(e)?this:void 0}subsumes(e){return this.$.parseDefinition(e).extends(this)}configure(e,n="shallow"){return this.configureReferences(e,n)}describe(e,n="shallow"){return this.configure({description:e},n)}optional(){return[this,"?"]}default(e){return Ry(this,e,null),[this,"=",e]}from(e){return this.assert(e)}_pipe(...e){const n=e.reduce((r,o)=>r.rawPipeOnce(o),this);return this.$.finalize(n)}tryPipe(...e){const n=e.reduce((r,o)=>r.rawPipeOnce(fe(o,"root")?o:((l,c)=>{try{return o(l,c)}catch(d){return c.error({code:"predicate",predicate:o,actual:`aborted due to error:
86
- ${d}
87
- `})}})),this);return this.$.finalize(n)}pipe=Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)});to(e){return this.$.finalize(this.toNode(this.$.parseDefinition(e)))}toNode(e){const n=nm(this,e,this.$);return n instanceof se?n.throw():n}rawPipeOnce(e){return fe(e,"root")?this.toNode(e):this.distribute(n=>n.hasKind("morph")?this.$.node("morph",{in:n.inner.in,morphs:[...n.morphs,e]}):this.$.node("morph",{in:n,morphs:[e]}),this.$.parseSchema)}narrow(e){return this.constrainOut("predicate",e)}constrain(e,n){return this._constrain("root",e,n)}constrainIn(e,n){return this._constrain("in",e,n)}constrainOut(e,n){return this._constrain("out",e,n)}_constrain(e,n,r){const o=this.$.node(n,r);if(o.isRoot())return o.isUnknown()?this:xt(`Unexpected constraint node ${o}`);const l=e==="root"?this:this[e];if(l.hasKind("morph")||o.impliedBasis&&!l.extends(o.impliedBasis))return N2(n,o.impliedBasis,this);const c=this.$.node("intersection",{[o.kind]:o}),d=e==="out"?nm(this,c,this.$):Ii(this,c,this.$);return d instanceof se&&d.throw(),this.$.finalize(d)}onUndeclaredKey(e){const n=typeof e=="string"?e:e.rule,r=typeof e=="string"?!1:e.deep;return this.$.finalize(this.transform((o,l)=>o==="structure"?n==="ignore"?ON(l,{undeclared:1}):{...l,undeclared:n}:l,r?void 0:{shouldTransform:o=>!is(pf,o.kind)}))}hasEqualMorphs(e){return!this.includesTransform&&!e.includesTransform?!0:!(!Co(this.shallowMorphs,e.shallowMorphs)||!Co(this.flatMorphs,e.flatMorphs,{isEqual:(n,r)=>n.propString===r.propString&&(n.node.hasKind("morph")&&r.node.hasKind("morph")?n.node.hasEqualMorphs(r.node):n.node.hasKind("intersection")&&r.node.hasKind("intersection")?n.node.structure?.structuralMorphRef===r.node.structure?.structuralMorphRef:!1)}))}onDeepUndeclaredKey(e){return this.onUndeclaredKey({rule:e,deep:!0})}filter(e){return this.constrainIn("predicate",e)}divisibleBy(e){return this.constrain("divisor",e)}matching(e){return this.constrain("pattern",e)}atLeast(e){return this.constrain("min",e)}atMost(e){return this.constrain("max",e)}moreThan(e){return this.constrain("min",uo(e))}lessThan(e){return this.constrain("max",uo(e))}atLeastLength(e){return this.constrain("minLength",e)}atMostLength(e){return this.constrain("maxLength",e)}moreThanLength(e){return this.constrain("minLength",uo(e))}lessThanLength(e){return this.constrain("maxLength",uo(e))}exactlyLength(e){return this.constrain("exactLength",e)}atOrAfter(e){return this.constrain("after",e)}atOrBefore(e){return this.constrain("before",e)}laterThan(e){return this.constrain("after",uo(e))}earlierThan(e){return this.constrain("before",uo(e))}}const T$="Expected a non-empty brand name after #",uo=t=>typeof t=="object"&&!(t instanceof Date)?{...t,exclusive:!0}:{rule:t,exclusive:!0},nc=(t,e)=>fe(e,"root")?fe(t,"root")?t.extends(e):e.allows(t):fe(t,"root")?t.hasUnit(e):e===t,uw=t=>t.hasKind("morph")?null:t.hasKind("intersection")?t.inner.structure??(t.basis?.domain==="object"?t.$.bindReference(Q.intrinsic.emptyStructure):null):t.isBasis()&&t.domain==="object"?t.$.bindReference(Q.intrinsic.emptyStructure):null,A$=t=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
88
- ${t}`,cw=(t,e)=>`${t} operand must be an object (was ${e})`,Ml=(t,e)=>He(xy(t),(n,r)=>[r,e]),E$=t=>typeof t=="string"?{reference:t}:t,fw=t=>t instanceof se?Q.intrinsic.never.internal:t,R$=ut({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:t=>t.startsWith("$")?t:`$ark.${t}`},resolve:{}},normalize:E$,defaults:{description:t=>t.reference},intersections:{alias:(t,e,n)=>n.$.lazilyResolve(()=>fw(Nt(t.resolution,e.resolution,n)),`${t.reference}${n.pipe?"=>":"&"}${e.reference}`),...Ml("alias",(t,e,n)=>e.isUnknown()?t:e.isNever()?e:e.isBasis()&&!e.overlaps(Q.intrinsic.object)?se.init("assignability",Q.intrinsic.object,e):n.$.lazilyResolve(()=>fw(Nt(t.resolution,e,n)),`${t.reference}${n.pipe?"=>":"&"}${e.id}`))}});class O$ extends kl{expression=this.reference;structure=void 0;get resolution(){const e=this._resolve();return jn[this.id]=e}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));const e=this.reference;let n=jn[e];const r=[];for(;fe(n,"context");){if(r.includes(n.id))return Y(_$(n.id,r));r.push(n.id),n=jn[n.id]}return fe(n,"root")?n:xt(`Unexpected resolution for reference ${this.reference}
89
- Seen: [${r.join("->")}]
90
- Resolution: ${Pe(n)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const e=this.reference.slice(1),n=this.$.resolutions[e];return typeof n=="string"?n:fe(n,"root")?n.id:xt(`Unexpected resolution for reference ${this.reference}: ${Pe(n)}`)}get defaultShortDescription(){return Ki.object}innerToJsonSchema(e){return this.resolution.toJsonSchemaRecurse(e)}traverseAllows=(e,n)=>{const r=n.seen[this.reference];return r?.includes(e)?!0:(n.seen[this.reference]=Ie(r,e),this.resolution.traverseAllows(e,n))};traverseApply=(e,n)=>{const r=n.seen[this.reference];r?.includes(e)||(n.seen[this.reference]=Ie(r,e),this.resolution.traverseApply(e,n))};compile(e){const n=this.resolutionId;e.if(`ctx.seen.${n} && ctx.seen.${n}.includes(data)`,()=>e.return(!0)),e.if(`!ctx.seen.${n}`,()=>e.line(`ctx.seen.${n} = []`)),e.line(`ctx.seen.${n}.push(data)`),e.return(e.invoke(n))}}const _$=(t,e)=>`Alias '${t}' has a shallow resolution cycle: ${[...e,t].join("->")}`,Oy={implementation:R$,Node:O$};class _y extends kl{traverseApply=(e,n)=>{this.traverseAllows(e,n)||n.errorFromNodeContext(this.errorContext)};get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return yf(this.errorContext)}compile(e){e.traversalKind==="Allows"?e.return(this.compiledCondition):e.if(this.compiledNegation,()=>e.line(`${e.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}}const k$=ut({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:t=>typeof t=="string"?{domain:t}:yy(t,"numberAllowsNaN")&&t.domain!=="number"?Y(ky.writeBadAllowNanMessage(t.domain)):t,applyConfig:(t,e)=>t.numberAllowsNaN===void 0&&t.domain==="number"&&e.numberAllowsNaN?{...t,numberAllowsNaN:!0}:t,defaults:{description:t=>Ki[t.domain],actual:t=>Number.isNaN(t)?"NaN":Ki[Jn(t)]},intersections:{domain:(t,e)=>t.domain==="number"&&e.domain==="number"?t.numberAllowsNaN?e:t:se.init("domain",t,e)}});class M$ extends _y{requiresNaNCheck=this.domain==="number"&&!this.numberAllowsNaN;traverseAllows=this.requiresNaNCheck?e=>typeof e=="number"&&!Number.isNaN(e):e=>Jn(e)===this.domain;compiledCondition=this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`;compiledNegation=this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`;expression=this.numberAllowsNaN?"number | NaN":this.domain;get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return Ki[this.domain]}innerToJsonSchema(e){return this.domain==="bigint"||this.domain==="symbol"?e.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}}const ky={implementation:k$,Node:M$,writeBadAllowNanMessage:t=>`numberAllowsNaN may only be specified with domain "number" (was ${t})`},C$=ut({kind:"intersection",hasAssociatedError:!0,normalize:t=>{if(Xt(t))return t;const{structure:e,...n}=t,r=!!e,o=e??{},l=He(n,(c,d)=>mi(c,S2)?(r&&Y(`Flattened structure key ${c} cannot be specified alongside a root 'structure' key.`),o[c]=d,[]):[c,d]);return(fe(o,"constraint")||!Al(o))&&(l.structure=o),l},finalizeInnerJson:({structure:t,...e})=>vs(t,"object")?{...t,...e}:e,keys:{domain:{child:!0,parse:(t,e)=>e.$.node("domain",t)},proto:{child:!0,parse:(t,e)=>e.$.node("proto",t)},structure:{child:!0,parse:(t,e)=>e.$.node("structure",t),serialize:t=>{if(!t.sequence?.minLength)return t.collapsibleJson;const{sequence:e,...n}=t.collapsibleJson,{minVariadicLength:r,...o}=e,l=o.variadic&&Object.keys(o).length===1?o.variadic:o;return{...n,sequence:l}}},divisor:{child:!0,parse:rn("divisor")},max:{child:!0,parse:rn("max")},min:{child:!0,parse:rn("min")},maxLength:{child:!0,parse:rn("maxLength")},minLength:{child:!0,parse:rn("minLength")},exactLength:{child:!0,parse:rn("exactLength")},before:{child:!0,parse:rn("before")},after:{child:!0,parse:rn("after")},pattern:{child:!0,parse:rn("pattern")},predicate:{child:!0,parse:rn("predicate")}},reduce:(t,e)=>dw({},t,{$:e,invert:!1,pipe:!1}),defaults:{description:t=>{if(t.children.length===0)return"unknown";if(t.structure)return t.structure.description;const e=[];if(t.basis&&!t.refinements.some(n=>n.impl.obviatesBasisDescription)&&e.push(t.basis.description),t.refinements.length){const n=t.refinements.toSorted((r,o)=>r.kind==="min"&&o.kind==="max"?-1:0).map(r=>r.description);e.push(...n)}return t.inner.predicate&&e.push(...t.inner.predicate.map(n=>n.description)),e.join(" and ")},expected:t=>` ◦ ${t.errors.map(e=>e.expected).join(`
91
- ◦ `)}`,problem:t=>`(${t.actual}) must be...
92
- ${t.expected}`},intersections:{intersection:(t,e,n)=>dw(t.inner,e.inner,n),...Ml("intersection",(t,e,n)=>{if(t.children.length===0)return e;const{domain:r,proto:o,...l}=t.inner,c=o??r,d=c?Nt(c,e,n):e;return d instanceof se?d:t?.basis?.equals(d)?t:t.$.node("intersection",{...l,[d.kind]:d},{prereduced:!0})})}});class D$ extends kl{basis=this.inner.domain??this.inner.proto??null;refinements=this.children.filter(e=>e.isRefinement());structure=this.inner.structure;expression=N$(this);get shallowMorphs(){return this.inner.structure?.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){return this.basis?.defaultShortDescription??"present"}innerToJsonSchema(e){return this.children.reduce((n,r)=>r.isBasis()?r.toJsonSchemaRecurse(e):r.reduceJsonSchema(n,e),{})}traverseAllows=(e,n)=>this.children.every(r=>r.traverseAllows(e,n));traverseApply=(e,n)=>{const r=n.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(e,n),n.currentErrorCount>r))){if(this.refinements.length){for(let o=0;o<this.refinements.length-1;o++)if(this.refinements[o].traverseApply(e,n),n.failFast&&n.currentErrorCount>r)return;if(this.refinements.at(-1).traverseApply(e,n),n.currentErrorCount>r)return}if(!(this.structure&&(this.structure.traverseApply(e,n),n.currentErrorCount>r))&&this.inner.predicate){for(let o=0;o<this.inner.predicate.length-1;o++)if(this.inner.predicate[o].traverseApply(e,n),n.failFast&&n.currentErrorCount>r)return;this.inner.predicate.at(-1).traverseApply(e,n)}}};compile(e){if(e.traversalKind==="Allows"){for(const n of this.children)e.check(n);e.return(!0);return}if(e.initializeErrorCount(),this.basis&&(e.check(this.basis),this.children.length>1&&e.returnIfFail()),this.refinements.length){for(let n=0;n<this.refinements.length-1;n++)e.check(this.refinements[n]),e.returnIfFailFast();e.check(this.refinements.at(-1)),(this.structure||this.inner.predicate)&&e.returnIfFail()}if(this.structure&&(e.check(this.structure),this.inner.predicate&&e.returnIfFail()),this.inner.predicate){for(let n=0;n<this.inner.predicate.length-1;n++)e.check(this.inner.predicate[n]),e.returnIfFail();e.check(this.inner.predicate.at(-1))}}}const gA={implementation:C$,Node:D$},N$=t=>{let e=t.structure?.expression||`${t.basis&&!t.refinements.some(n=>n.impl.obviatesBasisExpression)?t.basis.nestableExpression+" ":""}${t.refinements.map(n=>n.expression).join(" & ")}`||"unknown";return e==="Array == 0"&&(e="[]"),e},dw=(t,e,n)=>{const r={},o=t.proto??t.domain,l=e.proto??e.domain,c=o?l?Nt(o,l,n):o:l;return c instanceof se?c:(c&&(r[c.kind]=c),Pc({kind:"intersection",baseInner:r,l:qc(t),r:qc(e),roots:[],ctx:n}))},$$=ut({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(t,e)=>e.$.parseSchema(t)},morphs:{parse:Tl,serialize:t=>t.map(e=>fe(e,"root")?e.json:Zt(e))},declaredIn:{child:!1,serialize:t=>t.json},declaredOut:{child:!1,serialize:t=>t.json}},normalize:t=>t,defaults:{description:t=>`a morph from ${t.in.description} to ${t.out?.description??"unknown"}`},intersections:{morph:(t,e,n)=>{if(!t.hasEqualMorphs(e))return Y(B$(t.expression,e.expression));const r=Nt(t.in,e.in,n);if(r instanceof se)return r;const o={morphs:t.morphs};if(t.declaredIn||e.declaredIn){const l=Nt(t.in,e.in,n);if(l instanceof se)return l.throw();o.declaredIn=l}if(t.declaredOut||e.declaredOut){const l=Nt(t.out,e.out,n);if(l instanceof se)return l.throw();o.declaredOut=l}return r.distribute(l=>n.$.node("morph",{...o,in:l}),n.$.parseSchema)},...Ml("morph",(t,e,n)=>{const r=t.inner.in?Nt(t.inner.in,e,n):e;return r instanceof se?r:r.equals(t.inner.in)?t:n.$.node("morph",{...t.inner,in:r})})}});class j$ extends kl{serializedMorphs=this.morphs.map(Zt);compiledMorphs=`[${this.serializedMorphs}]`;lastMorph=this.inner.morphs.at(-1);lastMorphIfNode=fe(this.lastMorph,"root")?this.lastMorph:void 0;introspectableIn=this.inner.in;introspectableOut=this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.out:void 0;get shallowMorphs(){return Array.isArray(this.inner.in?.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get in(){return this.declaredIn??this.inner.in?.in??Q.intrinsic.unknown.internal}get out(){return this.declaredOut??this.introspectableOut??Q.intrinsic.unknown.internal}declareIn(e){return this.$.node("morph",{...this.inner,declaredIn:e})}declareOut(e){return this.$.node("morph",{...this.inner,declaredOut:e})}expression=`(In: ${this.in.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.out.expression}>`;get defaultShortDescription(){return this.in.meta.description??this.in.defaultShortDescription}innerToJsonSchema(e){return e.fallback.morph({code:"morph",base:this.in.toJsonSchemaRecurse(e),out:this.introspectableOut?.toJsonSchemaRecurse(e)??null})}compile(e){if(e.traversalKind==="Allows"){if(!this.introspectableIn)return;e.return(e.invoke(this.introspectableIn));return}this.introspectableIn&&e.line(e.invoke(this.introspectableIn)),e.line(`ctx.queueMorphs(${this.compiledMorphs})`)}traverseAllows=(e,n)=>!this.introspectableIn||this.introspectableIn.traverseAllows(e,n);traverseApply=(e,n)=>{this.introspectableIn&&this.introspectableIn.traverseApply(e,n),n.queueMorphs(this.morphs)};hasEqualMorphs(e){return Co(this.morphs,e.morphs,{isEqual:(n,r)=>n===r||fe(n,"root")&&fe(r,"root")&&n.equals(r)})}}const bA={implementation:$$,Node:j$},B$=(t,e)=>`The intersection of distinct morphs at a single path is indeterminate:
93
- Left: ${t}
94
- Right: ${e}`,L$=ut({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:t=>by(t)??ms(t)},dateAllowsInvalid:{}},normalize:t=>{const e=typeof t=="string"?{proto:No[t]}:typeof t=="function"?Xt(t)?t:{proto:t}:typeof t.proto=="string"?{...t,proto:No[t.proto]}:t;return typeof e.proto!="function"&&Y(Hc.writeInvalidSchemaMessage(e.proto)),yy(e,"dateAllowsInvalid")&&e.proto!==Date&&Y(Hc.writeBadInvalidDateMessage(e.proto)),e},applyConfig:(t,e)=>t.dateAllowsInvalid===void 0&&t.proto===Date&&e.dateAllowsInvalid?{...t,dateAllowsInvalid:!0}:t,defaults:{description:t=>t.builtinName?jN[t.builtinName]:`an instance of ${t.proto.name}`,actual:t=>t instanceof Date&&t.toString()==="Invalid Date"?"an invalid Date":Yp(t)},intersections:{proto:(t,e)=>t.proto===Date&&e.proto===Date?t.dateAllowsInvalid?e:t:WS(t.proto,e.proto)?t:WS(e.proto,t.proto)?e:se.init("proto",t,e),domain:(t,e)=>e.domain==="object"?t:se.init("domain",Q.intrinsic.object.internal,e)}});class V$ extends _y{builtinName=by(this.proto);serializedConstructor=this.json.proto;requiresInvalidDateCheck=this.proto===Date&&!this.dateAllowsInvalid;traverseAllows=this.requiresInvalidDateCheck?e=>e instanceof Date&&e.toString()!=="Invalid Date":e=>e instanceof this.proto;compiledCondition=`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`;compiledNegation=`!(${this.compiledCondition})`;innerToJsonSchema(e){switch(this.builtinName){case"Array":return{type:"array"};case"Date":return e.fallback.date?.({code:"date",base:{}})??e.fallback.proto({code:"proto",base:{},proto:this.proto});default:return e.fallback.proto({code:"proto",base:{},proto:this.proto})}}expression=this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name;get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}domain="object";get defaultShortDescription(){return this.description}}const Hc={implementation:L$,Node:V$,writeBadInvalidDateMessage:t=>`dateAllowsInvalid may only be specified with constructor Date (was ${t.name})`,writeInvalidSchemaMessage:t=>`instanceOf operand must be a function (was ${Jn(t)})`},z$=ut({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(t,e)=>{const n=[];for(const r of t){const o=fe(r,"root")?r.branches:e.$.parseSchema(r).branches;for(const l of o)if(l.hasKind("morph")){const c=n.findIndex(d=>d.hasKind("morph")&&d.hasEqualMorphs(l));if(c===-1)n.push(l);else{const d=n[c];n[c]=e.$.node("morph",{...d.inner,in:d.in.rawOr(l.in)})}}else n.push(l)}return e.def.ordered||n.sort((r,o)=>r.hash<o.hash?-1:1),n}}},normalize:t=>Ft(t)?{branches:t}:t,reduce:(t,e)=>{const n=J$(t);if(n.length===1)return n[0];if(n.length!==t.branches.length)return e.node("union",{...t,branches:n},{prereduced:!0})},defaults:{description:t=>t.distribute(e=>e.description,To),expected:t=>{const e=SN(t.errors,"propString"),n=Object.entries(e).map(([r,o])=>{const l=[];for(const h of o)cs(l,h.expected);const c=To(l),d=o.every(h=>h.actual===o[0].actual)?o[0].actual:Pe(o[0].data);return`${r&&`${r} `}must be ${c}${d&&` (was ${d})`}`});return To(n)},problem:t=>t.expected,message:t=>t.problem},intersections:{union:(t,e,n)=>{if(t.isNever!==e.isNever)return se.init("presence",t,e);let r;return t.ordered?(e.ordered&&Y(Q$(t.expression,e.expression)),r=rp(e.branches,t.branches,n),r instanceof se&&r.invert()):r=rp(t.branches,e.branches,n),r instanceof se?r:n.$.parseSchema(t.ordered||e.ordered?{branches:r,ordered:!0}:{branches:r})},...Ml("union",(t,e,n)=>{const r=rp(t.branches,[e],n);return r instanceof se?r:r.length===1?r[0]:n.$.parseSchema(t.ordered?{branches:r,ordered:!0}:{branches:r})})}});class U$ extends kl{isBoolean=this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0);get branchGroups(){const e=[];let n=-1;for(const r of this.branches){if(r.hasKind("unit")&&r.domain==="boolean"){n===-1?(n=e.length,e.push(r)):e[n]=Q.intrinsic.boolean;continue}e.push(r)}return e}unitBranches=this.branches.filter(e=>e.in.hasKind("unit"));discriminant=this.discriminate();discriminantJson=this.discriminant?G$(this.discriminant):null;expression=this.distribute(e=>e.nestableExpression,X$);createBranchedOptimisticRootApply(){return(e,n)=>{const r=this.traverseOptimistic(e);if(r!==Bi)return r;const o=new po(e,this.$.resolvedConfig);return this.traverseApply(e,o),o.finalize(n)}}get shallowMorphs(){return this.branches.reduce((e,n)=>cs(e,n.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(e=>e.defaultShortDescription,To)}innerToJsonSchema(e){if(this.branchGroups.length===1&&this.branchGroups[0].equals(Q.intrinsic.boolean))return{type:"boolean"};const n=this.branchGroups.map(r=>r.toJsonSchemaRecurse(e));return n.every(r=>Object.keys(r).length===1&&yy(r,"const"))?{enum:n.map(r=>r.const)}:{anyOf:n}}traverseAllows=(e,n)=>this.branches.some(r=>r.traverseAllows(e,n));traverseApply=(e,n)=>{const r=[];for(let o=0;o<this.branches.length;o++){if(n.pushBranch(),this.branches[o].traverseApply(e,n),!n.hasError())return this.branches[o].includesTransform?n.queuedMorphs.push(...n.popBranch().queuedMorphs):n.popBranch();r.push(n.popBranch().error)}n.errorFromNodeContext({code:"union",errors:r,meta:this.meta})};traverseOptimistic=e=>{for(let n=0;n<this.branches.length;n++){const r=this.branches[n];if(r.traverseAllows(e))return r.contextFreeMorph?r.contextFreeMorph(e):e}return Bi};compile(e){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(e);let n=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(n=`typeof ${n} === "object" ? ${n} === null ? "null" : "object" : typeof ${n} === "function" ? "object" : typeof ${n}`);const r=this.discriminant.cases,o=Object.keys(r),{optimistic:l}=e;if(e.optimistic=!1,e.block(`switch(${n})`,()=>{for(const y in r){const g=r[y],v=y==="default"?y:`case ${y}`;e.line(`${v}: return ${g===!0?l?e.data:g:l?`${e.invoke(g)} ? ${g.contextFreeMorph?`${Zt(g.contextFreeMorph)}(${e.data})`:e.data} : "${Bi}"`:e.invoke(g)}`)}return e}),e.traversalKind==="Allows"){e.return(l?`"${Bi}"`:!1);return}const c=To(this.discriminant.kind==="domain"?o.map(y=>{const g=y.slice(1,-1);return g==="function"?Ki.object:Ki[g]}):o),d=this.discriminant.path.map(y=>typeof y=="symbol"?Zt(y):JSON.stringify(y)),h=JSON.stringify(c),p=this.discriminant.kind==="domain"?`${H$}[${n}]`:`${F$}(${n})`;e.line(`ctx.errorFromNodeContext({
95
- code: "predicate",
96
- expected: ${h},
97
- actual: ${p},
98
- relativePath: [${d}],
99
- meta: ${this.compiledMeta}
100
- })`)}compileIndiscriminable(e){if(e.traversalKind==="Apply"){e.const("errors","[]");for(const n of this.branches)e.line("ctx.pushBranch()").line(e.invoke(n)).if("!ctx.hasError()",()=>e.return(n.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");e.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:n}=e;e.optimistic=!1;for(const r of this.branches)e.if(`${e.invoke(r)}`,()=>e.return(n?r.contextFreeMorph?`${Zt(r.contextFreeMorph)}(${e.data})`:e.data:!0));e.return(n?`"${Bi}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const l=He(this.unitBranches,(c,d)=>[`${d.in.serializedValue}`,d.hasKind("morph")?d:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:l}}const e=[];for(let l=0;l<this.branches.length-1;l++){const c=this.branches[l];for(let d=l+1;d<this.branches.length;d++){const h=this.branches[d],p=Ii(c.in,h.in,c.$);if(p instanceof se)for(const y of p){if(!y.kind||y.optional)continue;let g,v;if(y.kind==="domain"){const x=y.l,T=y.r;g=`"${typeof x=="string"?x:x.domain}"`,v=`"${typeof T=="string"?T:T.domain}"`}else if(y.kind==="unit")g=y.l.serializedValue,v=y.r.serializedValue;else continue;const S=e.find(x=>Co(x.path,y.path)&&x.kind===y.kind);S?(S.cases[g]?S.cases[g].branchIndices=cs(S.cases[g].branchIndices,l):S.cases[g]??={branchIndices:[l],condition:y.l},S.cases[v]?S.cases[v].branchIndices=cs(S.cases[v].branchIndices,d):S.cases[v]??={branchIndices:[d],condition:y.r}):e.push({kind:y.kind,cases:{[g]:{branchIndices:[l],condition:y.l},[v]:{branchIndices:[d],condition:y.r}},path:y.path})}}}const n=this.ordered?q$(e,this.branches):e;if(!n.length)return null;const r=K$(n,this),o={};for(const l in r.best.cases){const c=P$(r,l);if(c===null){o[l]=!0;continue}if(c.length===this.branches.length)return null;this.ordered&&c.sort((p,y)=>p.originalIndex-y.originalIndex);const d=c.map(p=>p.branch),h=d.length===1?d[0]:this.$.node("union",this.ordered?{branches:d,ordered:!0}:d);Object.assign(this.referencesById,h.referencesById),o[l]=h}if(r.defaultEntries.length){const l=r.defaultEntries.map(c=>c.branch);o.default=this.$.node("union",this.ordered?{branches:l,ordered:!0}:l,{prereduced:!0}),Object.assign(this.referencesById,o.default.referencesById)}return Object.assign(r.location,{cases:o})}}const K$=(t,e)=>{const n=t.sort((l,c)=>Object.keys(c.cases).length-Object.keys(l.cases).length)[0],r={kind:n.kind,path:n.path,optionallyChainedPropString:vA(n.path)},o=e.branches.map((l,c)=>({originalIndex:c,branch:l}));return{best:n,location:r,defaultEntries:o,node:e}},P$=(t,e)=>{const n=t.best.cases[e],r=I$(n.condition,t.location.path,t.node.$);let o=[];const l=[];for(let c=0;c<t.defaultEntries.length;c++){const d=t.defaultEntries[c];if(n.branchIndices.includes(d.originalIndex)){const h=hw(t.node.branches[d.originalIndex],t.location);h===null?o=null:o?.push({originalIndex:d.originalIndex,branch:h})}else if(d.branch.hasKind("alias")&&r.hasKind("domain")&&r.domain==="object")o?.push(d);else{if(d.branch.in.overlaps(r)){const h=hw(d.branch,t.location);o?.push({originalIndex:d.originalIndex,branch:h})}l.push(d)}}return t.defaultEntries=l,o},q$=(t,e)=>t.filter(r=>{const o=Object.values(r.cases).map(l=>l.branchIndices);for(let l=0;l<o.length-1;l++){const c=o[l];for(let d=l+1;d<o.length;d++){const h=o[d];for(const p of c)for(const y of h)if(p>y&&e[p].overlaps(e[y]))return!1}}return!0}),I$=(t,e,n)=>{let r=t==="undefined"?n.node("unit",{unit:void 0}):t==="null"?n.node("unit",{unit:null}):t==="boolean"?n.units([!0,!1]):t;for(let o=e.length-1;o>=0;o--){const l=e[o];r=n.node("intersection",typeof l=="number"?{proto:"Array",sequence:[...bN(l).map(c=>({})),r]}:{domain:"object",required:[{key:l,value:r}]})}return r},vA=t=>t.reduce((e,n)=>e+KT(n,!0),"data"),H$=Zt(wN),F$=Zt(Pe),SA={implementation:z$,Node:U$},G$=t=>({kind:t.kind,path:t.path.map(e=>typeof e=="string"?e:_l(e)),cases:He(t.cases,(e,n)=>[e,n===!0?n:n.hasKind("union")&&n.discriminantJson?n.discriminantJson:n.json])}),Y$={delimiter:" | ",finalDelimiter:" | "},X$=t=>To(t,Y$),To=(t,e)=>{const n=e?.delimiter??", ",r=e?.finalDelimiter??" or ";if(t.length===0)return"never";if(t.length===1)return t[0];if(t.length===2&&t[0]==="false"&&t[1]==="true"||t[0]==="true"&&t[1]==="false")return"boolean";const o={},l=t.filter(d=>o[d]?!1:o[d]=!0),c=l.pop();return`${l.join(n)}${l.length?r:""}${c}`},rp=(t,e,n)=>{const r=e.map(()=>[]);for(let l=0;l<t.length;l++){let c={};for(let d=0;d<e.length;d++){if(r[d]===null)continue;if(t[l].equals(e[d])){r[d]=null,c={};break}const h=Nt(t[l],e[d],n);if(!(h instanceof se)){if(h.equals(t[l])){r[d].push(t[l]),c={};break}h.equals(e[d])?r[d]=null:c[d]=h}}for(const d in c)r[d][l]=c[d]}const o=r.flatMap((l,c)=>l?.flatMap(d=>d.branches)??e[c]);return o.length===0?se.init("union",t,e):o},J$=({branches:t,ordered:e})=>{if(t.length<2)return t;const n=t.map(()=>!0);for(let r=0;r<t.length;r++)for(let o=r+1;o<t.length&&n[r]&&n[o];o++){if(t[r].equals(t[o])){n[o]=!1;continue}const l=Ii(t[r].in,t[o].in,t[0].$);l instanceof se||(e||Z$(t[r],t[o]),l.equals(t[r].in)?n[r]=!!e:l.equals(t[o].in)&&(n[o]=!1))}return t.filter((r,o)=>n[o])},Z$=(t,e)=>{!t.includesTransform&&!e.includesTransform||(Co(t.shallowMorphs,e.shallowMorphs)||Y(pw(t.expression,e.expression)),Co(t.flatMorphs,e.flatMorphs,{isEqual:(n,r)=>n.propString===r.propString&&(n.node.hasKind("morph")&&r.node.hasKind("morph")?n.node.hasEqualMorphs(r.node):n.node.hasKind("intersection")&&r.node.hasKind("intersection")?n.node.structure?.structuralMorphRef===r.node.structure?.structuralMorphRef:!1)})||Y(pw(t.expression,e.expression)))},hw=(t,e)=>t.transform((n,r)=>n==="domain"||n==="unit"?null:r,{shouldTransform:(n,r)=>{const o=vA(r.path);return e.optionallyChainedPropString.startsWith(o)?n.hasKind("domain")&&n.domain==="object"||(n.hasKind("domain")||e.kind==="unit")&&o===e.optionallyChainedPropString?!0:n.children.length!==0&&n.kind!=="index":!1}}),pw=(t,e)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
101
- Left: ${t}
102
- Right: ${e}`,Q$=(t,e)=>`The intersection of two ordered unions is indeterminate:
103
- Left: ${t}
104
- Right: ${e}`,W$=ut({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:t=>t instanceof Date?t.toISOString():ms(t)}},normalize:t=>t,defaults:{description:t=>Pe(t.unit),problem:({expected:t,actual:e})=>`${t===e?`must be reference equal to ${t} (serialized to the same value)`:`must be ${t} (was ${e})`}`},intersections:{unit:(t,e)=>se.init("unit",t,e),...Ml("unit",(t,e)=>{if(e.allows(t.unit))return t;const n=e.hasKind("intersection")?e.basis:e;if(n){const r=n.hasKind("domain")?n:Q.intrinsic.object;if(t.domain!==r.domain){const o=t.domain==="undefined"||t.domain==="null"||t.domain==="boolean"?t.domain:Q.intrinsic[t.domain];return se.init("domain",o,r)}}return se.init("assignability",t,e.hasKind("intersection")?e.children.find(r=>!r.allows(t.unit)):e)})}});class ej extends _y{compiledValue=this.json.unit;serializedValue=typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`;compiledCondition=mw(this.unit,this.serializedValue);compiledNegation=mw(this.unit,this.serializedValue,"negated");expression=Pe(this.unit);domain=Jn(this.unit);get defaultShortDescription(){return this.domain==="object"?Ki.object:this.description}innerToJsonSchema(e){return this.unit===null?{type:"null"}:Q.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:e.fallback.unit({code:"unit",base:{},unit:this.unit})}traverseAllows=this.unit instanceof Date?e=>e instanceof Date&&e.toISOString()===this.compiledValue:Number.isNaN(this.unit)?e=>Number.isNaN(e):e=>e===this.unit}const wA={implementation:W$,Node:ej},mw=(t,e,n)=>{if(t instanceof Date){const r=`data instanceof Date && data.toISOString() === ${e}`;return n?`!(${r})`:r}return Number.isNaN(t)?`${n?"!":""}Number.isNaN(data)`:`data ${n?"!":"="}== ${e}`},tj=ut({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(t,e)=>{const n=e.$.parseSchema(t);if(!n.extends(Q.intrinsic.key))return Y(rj(n.expression));const r=n.branches.filter(o=>o.hasKind("unit"));return r.length?Y(ij(r.map(o=>Pe(o.unit)))):n}},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`[${t.signature.expression}]: ${t.value.description}`},intersections:{index:(t,e,n)=>{if(t.signature.equals(e.signature)){const r=Nt(t.value,e.value,n),o=r instanceof se?Q.intrinsic.never.internal:r;return n.$.node("index",{signature:t.signature,value:o})}return t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:null}}});class nj extends Ko{impliedBasis=Q.intrinsic.object.internal;expression=`[${this.signature.expression}]: ${this.value.expression}`;flatRefs=Ie(this.value.flatRefs.map(e=>Er([this.signature,...e.path],e.node)),Er([this.signature],this.value));traverseAllows=(e,n)=>Vc(e).every(r=>this.signature.traverseAllows(r[0],n)?qi(r[0],()=>this.value.traverseAllows(r[1],n),n):!0);traverseApply=(e,n)=>{for(const r of Vc(e))this.signature.traverseAllows(r[0],n)&&qi(r[0],()=>this.value.traverseApply(r[1],n),n)};_transform(e,n){n.path.push(this.signature);const r=super._transform(e,n);return n.path.pop(),r}compile(){}}const xA={implementation:tj,Node:nj},ij=t=>`Index keys ${t.join(", ")} should be specified as named props.`,rj=t=>`Indexed key definition '${t}' must be a string or symbol`,sj=ut({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(t,e)=>e.$.parseSchema(t)}},normalize:t=>t,defaults:{description:t=>`${t.compiledKey}: ${t.value.description}`,expected:t=>t.missingValueDescription,actual:()=>"missing"},intersections:{required:rm,optional:rm}});class oj extends pA{expression=`${this.compiledKey}: ${this.value.expression}`;errorContext=Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta});compiledErrorContext=yf(this.errorContext)}const TA={implementation:sj,Node:oj},aj=ut({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}},optionals:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}},defaultables:{child:t=>t.map(e=>e[0]),parse:(t,e)=>{if(t.length!==0)return t.map(n=>{const r=e.$.parseSchema(n[0]);return Ry(r,n[1],null),[r,n[1]]})},serialize:t=>t.map(e=>[e[0].collapsibleJson,ms(e[1])])},variadic:{child:!0,parse:(t,e)=>e.$.parseSchema(t,e)},minVariadicLength:{parse:t=>t===0?void 0:t},postfix:{child:!0,parse:(t,e)=>{if(t.length!==0)return t.map(n=>e.$.parseSchema(n))}}},normalize:t=>{if(typeof t=="string")return{variadic:t};if("variadic"in t||"prefix"in t||"defaultables"in t||"optionals"in t||"postfix"in t||"minVariadicLength"in t){if(t.postfix?.length){if(!t.variadic)return Y(dj);if(t.optionals?.length||t.defaultables?.length)return Y(EA)}return t.minVariadicLength&&!t.variadic?Y("minVariadicLength may not be specified without a variadic element"):t}return{variadic:t}},reduce:(t,e)=>{let n=t.minVariadicLength??0;const r=t.prefix?.slice()??[],o=t.defaultables?.slice()??[],l=t.optionals?.slice()??[],c=t.postfix?.slice()??[];if(t.variadic){for(;l.at(-1)?.equals(t.variadic);)l.pop();if(l.length===0&&o.length===0)for(;r.at(-1)?.equals(t.variadic);)r.pop(),n++;for(;c[0]?.equals(t.variadic);)c.shift(),n++}else l.length===0&&o.length===0&&r.push(...c.splice(0));if(n!==t.minVariadicLength||t.prefix&&t.prefix.length!==r.length)return e.node("sequence",{...t,prefix:r,defaultables:o,optionals:l,postfix:c,minVariadicLength:n},{prereduced:!0})},defaults:{description:t=>t.isVariadicOnly?`${t.variadic.nestableExpression}[]`:`[${t.tuple.map(n=>n.kind==="defaultables"?`${n.node.nestableExpression} = ${Pe(n.default)}`:n.kind==="optionals"?`${n.node.nestableExpression}?`:n.kind==="variadic"?`...${n.node.nestableExpression}[]`:n.node.expression).join(", ")}]`},intersections:{sequence:(t,e,n)=>{const r=Ja({l:t.tuple,r:e.tuple,disjoint:new se,result:[],fixedVariants:[],ctx:n}),o=r.disjoint.length===0?[r,...r.fixedVariants]:r.fixedVariants;return o.length===0?r.disjoint:o.length===1?n.$.node("sequence",yw(o[0].result)):n.$.node("union",o.map(l=>({proto:Array,sequence:yw(l.result)})))}}});class lj extends Ko{impliedBasis=Q.intrinsic.Array.internal;tuple=fj(this.inner);prefixLength=this.prefix?.length??0;defaultablesLength=this.defaultables?.length??0;optionalsLength=this.optionals?.length??0;postfixLength=this.postfix?.length??0;defaultablesAndOptionals=[];prevariadic=this.tuple.filter(e=>e.kind==="defaultables"||e.kind==="optionals"?(this.defaultablesAndOptionals.push(e.node),!0):e.kind==="prefix");variadicOrPostfix=os(this.variadic&&[this.variadic],this.postfix);flatRefs=this.addFlatRefs();addFlatRefs(){return rw(this.flatRefs,this.prevariadic.flatMap((e,n)=>Ie(e.node.flatRefs.map(r=>Er([`${n}`,...r.path],r.node)),Er([`${n}`],e.node)))),rw(this.flatRefs,this.variadicOrPostfix.flatMap(e=>Ie(e.flatRefs.map(n=>Er([Q.intrinsic.nonNegativeIntegerString.internal,...n.path],n.node)),Er([Q.intrinsic.nonNegativeIntegerString.internal],e)))),this.flatRefs}isVariadicOnly=this.prevariadic.length+this.postfixLength===0;minVariadicLength=this.inner.minVariadicLength??0;minLength=this.prefixLength+this.minVariadicLength+this.postfixLength;minLengthNode=this.minLength===0?null:this.$.node("minLength",this.minLength);maxLength=this.variadic?null:this.tuple.length;maxLengthNode=this.maxLength===null?null:this.$.node("maxLength",this.maxLength);impliedSiblings=this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[];defaultValueMorphs=cj(this);defaultValueMorphsReference=this.defaultValueMorphs.length?Zt(this.defaultValueMorphs):void 0;elementAtIndex(e,n){if(n<this.prevariadic.length)return this.tuple[n];const r=e.length-this.postfixLength;return n>=r?{kind:"postfix",node:this.postfix[n-r]}:{kind:"variadic",node:this.variadic??xt(`Unexpected attempt to access index ${n} on ${this}`)}}traverseAllows=(e,n)=>{for(let r=0;r<e.length;r++)if(!this.elementAtIndex(e,r).node.traverseAllows(e[r],n))return!1;return!0};traverseApply=(e,n)=>{let r=0;for(;r<e.length;r++)qi(r,()=>this.elementAtIndex(e,r).node.traverseApply(e[r],n),n)};get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(e){if(this.prefix)for(const[n,r]of this.prefix.entries())e.traverseKey(`${n}`,`data[${n}]`,r);for(const[n,r]of this.defaultablesAndOptionals.entries()){const o=`${n+this.prefixLength}`;e.if(`${o} >= ${e.data}.length`,()=>e.traversalKind==="Allows"?e.return(!0):e.return()),e.traverseKey(o,`data[${o}]`,r)}if(this.variadic&&(this.postfix&&e.const("firstPostfixIndex",`${e.data}.length${this.postfix?`- ${this.postfix.length}`:""}`),e.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>e.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[n,r]of this.postfix.entries()){const o=`firstPostfixIndex + ${n}`;e.traverseKey(o,`data[${o}]`,r)}e.traversalKind==="Allows"&&e.return(!0)}_transform(e,n){n.path.push(Q.intrinsic.nonNegativeIntegerString.internal);const r=super._transform(e,n);return n.path.pop(),r}expression=this.description;reduceJsonSchema(e,n){if(this.prevariadic.length&&(e.prefixItems=this.prevariadic.map(r=>{const o=r.node.toJsonSchemaRecurse(n);if(r.kind==="defaultables"){const l=typeof r.default=="function"?r.default():r.default;o.default=Q.intrinsic.jsonData.allows(l)?l:n.fallback.defaultValue({code:"defaultValue",base:o,value:l})}return o})),this.minLength&&(e.minItems=this.minLength),this.variadic){const r=Object.assign(e,{items:this.variadic.toJsonSchemaRecurse(n)});if(this.maxLength&&(r.maxItems=this.maxLength),this.postfix){const o=this.postfix.map(l=>l.toJsonSchemaRecurse(n));e=n.fallback.arrayPostfix({code:"arrayPostfix",base:r,elements:o})}}else e.items=!1,delete e.maxItems;return e}}const uj={},cj=t=>{if(!t.defaultables)return[];const e=[];let n="[";const r=t.prefixLength+t.defaultablesLength-1;for(let o=t.prefixLength;o<=r;o++){const[l,c]=t.defaultables[o-t.prefixLength];e.push(yA(o,l,c)),n+=`${o}: ${l.id} = ${ms(c)}, `}return n+="]",uj[n]??=e},AA={implementation:aj,Node:lj},fj=t=>{const e=[];if(t.prefix)for(const n of t.prefix)e.push({kind:"prefix",node:n});if(t.defaultables)for(const[n,r]of t.defaultables)e.push({kind:"defaultables",node:n,default:r});if(t.optionals)for(const n of t.optionals)e.push({kind:"optionals",node:n});if(t.variadic&&e.push({kind:"variadic",node:t.variadic}),t.postfix)for(const n of t.postfix)e.push({kind:"postfix",node:n});return e},yw=t=>t.reduce((e,n)=>(n.kind==="variadic"?e.variadic=n.node:n.kind==="defaultables"?e.defaultables=Ie(e.defaultables,[[n.node,n.default]]):e[n.kind]=Ie(e[n.kind],n.node),e),{}),EA="A postfix required element cannot follow an optional or defaultable element",dj="A postfix element requires a variadic element",Ja=t=>{const[e,...n]=t.l,[r,...o]=t.r;if(!e||!r)return t;const l=n.at(-1)?.kind==="postfix",c=o.at(-1)?.kind==="postfix",d=e.kind==="prefix"||r.kind==="prefix"?"prefix":e.kind==="postfix"||r.kind==="postfix"?"postfix":e.kind==="variadic"&&r.kind==="variadic"?"variadic":l||c?"prefix":e.kind==="defaultables"||r.kind==="defaultables"?"defaultables":"optionals";if(e.kind==="prefix"&&r.kind==="variadic"&&c){const g=Ja({...t,fixedVariants:[],r:o.map(v=>({...v,kind:"prefix"}))});g.disjoint.length===0&&t.fixedVariants.push(g)}else if(r.kind==="prefix"&&e.kind==="variadic"&&l){const g=Ja({...t,fixedVariants:[],l:n.map(v=>({...v,kind:"prefix"}))});g.disjoint.length===0&&t.fixedVariants.push(g)}const h=Nt(e.node,r.node,t.ctx);if(h instanceof se)if(d==="prefix"||d==="postfix")t.disjoint.push(...h.withPrefixKey(d==="prefix"?t.result.length:`-${n.length+1}`,"required")),t.result=[...t.result,{kind:d,node:Q.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?t:Ja({...t,fixedVariants:[],l:n.map(g=>({...g,kind:"prefix"})),r:n.map(g=>({...g,kind:"prefix"}))});else d==="defaultables"?(e.kind==="defaultables"&&r.kind==="defaultables"&&e.default!==r.default&&Y(mA(e.default,r.default)),t.result=[...t.result,{kind:d,node:h,default:e.kind==="defaultables"?e.default:r.kind==="defaultables"?r.default:xt(`Unexpected defaultable intersection from ${e.kind} and ${r.kind} elements.`)}]):t.result=[...t.result,{kind:d,node:h}];const p=t.l.length,y=t.r.length;return(e.kind!=="variadic"||p>=y&&(r.kind==="variadic"||y===1))&&(t.l=n),(r.kind!=="variadic"||y>=p&&(e.kind==="variadic"||p===1))&&(t.r=o),Ja(t)},RA=t=>e=>{if(e.props.length||e.index){const n=e.index?.map(o=>o[t])??[];for(const o of e.props)n.push(o[t]);e.undeclared&&n.push(`+ (undeclared): ${e.undeclared}`);const r=`{ ${n.join(", ")} }`;return e.sequence?`${r} & ${e.sequence.description}`:r}return e.sequence?.description??"{}"},hj=RA("description"),pj=RA("expression"),gw=(t,e,n)=>{const r=t.required?"required":"optional";if(!e.signature.allows(t.key))return null;const o=Ii(t.value,e.value,n);return o instanceof se?r==="optional"?n.node("optional",{key:t.key,value:Q.intrinsic.never.internal}):o.withPrefixKey(t.key,t.kind):null},mj=ut({kind:"structure",hasAssociatedError:!1,normalize:t=>t,applyConfig:(t,e)=>!t.undeclared&&e.onUndeclaredKey!=="ignore"?{...t,undeclared:e.onUndeclaredKey}:t,keys:{required:{child:!0,parse:rn("required"),reduceIo:(t,e,n)=>{e.required=Ie(e.required,n.map(r=>r[t]))}},optional:{child:!0,parse:rn("optional"),reduceIo:(t,e,n)=>{if(t==="in"){e.optional=n.map(r=>r.in);return}for(const r of n)e[r.outProp.kind]=Ie(e[r.outProp.kind],r.outProp.out)}},index:{child:!0,parse:rn("index")},sequence:{child:!0,parse:rn("sequence")},undeclared:{parse:t=>t==="ignore"?void 0:t,reduceIo:(t,e,n)=>{n==="delete"&&(t==="in"?delete e.undeclared:e.undeclared="reject")}}},defaults:{description:hj},intersections:{structure:(t,e,n)=>{const r={...t.inner},o={...e.inner},l=new se;if(t.undeclared){const h=t.keyof();for(const p of e.requiredKeys)h.allows(p)||l.add("presence",Q.intrinsic.never.internal,e.propsByKey[p].value,{path:[p]});o.optional&&(o.optional=o.optional.filter(p=>h.allows(p.key))),o.index&&(o.index=o.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=Ii(h,p.signature,n.$);if(y instanceof se)return[];const g=sm(y,p.value,n.$);return g.required&&(o.required=os(o.required,g.required)),g.optional&&(o.optional=os(o.optional,g.optional)),g.index??[]}))}if(e.undeclared){const h=e.keyof();for(const p of t.requiredKeys)h.allows(p)||l.add("presence",t.propsByKey[p].value,Q.intrinsic.never.internal,{path:[p]});r.optional&&(r.optional=r.optional.filter(p=>h.allows(p.key))),r.index&&(r.index=r.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=Ii(h,p.signature,n.$);if(y instanceof se)return[];const g=sm(y,p.value,n.$);return g.required&&(r.required=os(r.required,g.required)),g.optional&&(r.optional=os(r.optional,g.optional)),g.index??[]}))}const c={};(t.undeclared||e.undeclared)&&(c.undeclared=t.undeclared==="reject"||e.undeclared==="reject"?"reject":"delete");const d=Pc({kind:"structure",baseInner:c,l:qc(r),r:qc(o),roots:[],ctx:n});return d instanceof se&&l.push(...d),l.length?l:d}},reduce:(t,e)=>{if(t.index){if(!(t.required||t.optional))return;let n=!1;const r=t.required??[],o=t.optional??[],l=[...o];for(const c of t.index){for(const d of r){const h=gw(d,c,e);if(h instanceof se)return h}for(const[d,h]of o.entries()){const p=gw(h,c,e);if(p instanceof se)return p;p!==null&&(l[d]=p,n=!0)}}if(n)return e.node("structure",{...t,optional:l},{prereduced:!0})}}});class yj extends Ko{impliedBasis=Q.intrinsic.object.internal;impliedSiblings=this.children.flatMap(e=>e.impliedSiblings??[]);props=os(this.required,this.optional);propsByKey=He(this.props,(e,n)=>[n.key,n]);propsByKeyReference=Zt(this.propsByKey);expression=pj(this);requiredKeys=this.required?.map(e=>e.key)??[];optionalKeys=this.optional?.map(e=>e.key)??[];literalKeys=[...this.requiredKeys,...this.optionalKeys];_keyof;keyof(){if(this._keyof)return this._keyof;let e=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:n}of this.index)e=e.concat(n.branches);return this._keyof=this.$.node("union",e)}map(e){return this.$.node("structure",this.props.flatMap(e).reduce((n,r)=>{const o=this.propsByKey[r.key];if(Xt(r))return r.kind!=="required"&&r.kind!=="optional"?Y(`Map result must have kind "required" or "optional" (was ${r.kind})`):(n[r.kind]=Ie(n[r.kind],r),n);const l=r.kind??o?.kind??"required",c=He(r,(d,h)=>d in Ey.implementation.keys?[d,h]:[]);return n[l]=Ie(n[l],this.$.node(l,c)),n},{}))}assertHasKeys(e){const n=e.filter(r=>!nc(r,this.keyof()));if(n.length)return Y(bw(this.expression,n))}get(e,...n){let r,o=!1;const l=Sj(e);if((typeof l=="string"||typeof l=="symbol")&&this.propsByKey[l]&&(r=this.propsByKey[l].value,o=this.propsByKey[l].required),this.index)for(const d of this.index)nc(l,d.signature)&&(r=r?.and(d.value)??d.value);if(this.sequence&&nc(l,Q.intrinsic.nonNegativeIntegerString))if(fe(l,"root"))this.sequence.variadic&&(r=r?.and(this.sequence.element)??this.sequence.element);else{const d=Number.parseInt(l);if(d<this.sequence.prevariadic.length){const h=this.sequence.prevariadic[d].node;r=r?.and(h)??h,o||=d<this.sequence.prefixLength}else if(this.sequence.variadic){const h=this.$.node("union",this.sequence.variadicOrPostfix);r=r?.and(h)??h}}if(!r)return this.sequence?.variadic&&fe(l,"root")&&l.extends(Q.intrinsic.number)?Y(wj(l.expression,this.sequence.expression)):Y(bw(this.expression,[l]));const c=r.get(...n);return o?c:c.or(Q.intrinsic.undefined)}pick(...e){return this.assertHasKeys(e),this.$.node("structure",this.filterKeys("pick",e))}omit(...e){return this.assertHasKeys(e),this.$.node("structure",this.filterKeys("omit",e))}optionalize(){const{required:e,...n}=this.inner;return this.$.node("structure",{...n,optional:this.props.map(r=>r.hasKind("required")?this.$.node("optional",r.inner):r)})}require(){const{optional:e,...n}=this.inner;return this.$.node("structure",{...n,required:this.props.map(r=>r.hasKind("optional")?{key:r.key,value:r.value}:r)})}merge(e){const n=this.filterKeys("omit",[e.keyof()]);return e.required&&(n.required=Ie(n.required,e.required)),e.optional&&(n.optional=Ie(n.optional,e.optional)),e.index&&(n.index=Ie(n.index,e.index)),e.sequence&&(n.sequence=e.sequence),e.undeclared?n.undeclared=e.undeclared:delete n.undeclared,this.$.node("structure",n)}filterKeys(e,n){const r=qT(this.inner),o=l=>{const c=n.some(d=>nc(l,d));return e==="pick"?c:!c};return r.required&&(r.required=r.required.filter(l=>o(l.key))),r.optional&&(r.optional=r.optional.filter(l=>o(l.key))),r.index&&(r.index=r.index.filter(l=>o(l.signature))),r}traverseAllows=(e,n)=>this._traverse("Allows",e,n);traverseApply=(e,n)=>this._traverse("Apply",e,n);_traverse=(e,n,r)=>{const o=r?.currentErrorCount??0;for(let l=0;l<this.props.length;l++)if(e==="Allows"){if(!this.props[l].traverseAllows(n,r))return!1}else if(this.props[l].traverseApply(n,r),r.failFast&&r.currentErrorCount>o)return!1;if(this.sequence){if(e==="Allows"){if(!this.sequence.traverseAllows(n,r))return!1}else if(this.sequence.traverseApply(n,r),r.failFast&&r.currentErrorCount>o)return!1}if(this.index||this.undeclared==="reject"){const l=Object.keys(n);l.push(...Object.getOwnPropertySymbols(n));for(let c=0;c<l.length;c++){const d=l[c];if(this.index){for(const h of this.index)if(h.signature.traverseAllows(d,r)){if(e==="Allows"){if(!qi(d,()=>h.value.traverseAllows(n[d],r),r))return!1}else if(qi(d,()=>h.value.traverseApply(n[d],r),r),r.failFast&&r.currentErrorCount>o)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(d)&&(e==="Allows"||(r.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[d],meta:this.meta}),r.failFast)))return!1}}return this.structuralMorph&&r&&!r.hasError()&&r.queueMorphs([this.structuralMorph]),!0};get defaultable(){return this.cacheGetter("defaultable",this.optional?.filter(e=>e.hasDefault())??[])}declaresKey=e=>e in this.propsByKey||this.index?.some(n=>n.signature.allows(e))||this.sequence!==void 0&&Q.intrinsic.nonNegativeIntegerString.allows(e);_compileDeclaresKey(e){const n=[];if(this.props.length&&n.push(`k in ${this.propsByKeyReference}`),this.index)for(const r of this.index)n.push(e.invoke(r.signature,{kind:"Allows",arg:"k"}));return this.sequence&&n.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),n.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",bj(this))}structuralMorphRef=this.structuralMorph&&Zt(this.structuralMorph);compile(e){e.traversalKind==="Apply"&&e.initializeErrorCount();for(const n of this.props)e.check(n),e.traversalKind==="Apply"&&e.returnIfFailFast();if(this.sequence&&(e.check(this.sequence),e.traversalKind==="Apply"&&e.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(e.const("keys","Object.keys(data)"),e.line("keys.push(...Object.getOwnPropertySymbols(data))"),e.for("i < keys.length",()=>this.compileExhaustiveEntry(e))),e.traversalKind==="Allows")return e.return(!0);this.structuralMorphRef&&e.if("ctx && !ctx.hasError()",()=>(e.line("ctx.queueMorphs(["),vj(e,this),e.line("])")))}compileExhaustiveEntry(e){if(e.const("k","keys[i]"),this.index)for(const n of this.index)e.if(`${e.invoke(n.signature,{arg:"k",kind:"Allows"})}`,()=>e.traverseKey("k","data[k]",n.value));return this.undeclared==="reject"&&e.if(`!(${this._compileDeclaresKey(e)})`,()=>e.traversalKind==="Allows"?e.return(!1):e.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>e.return())),e}reduceJsonSchema(e,n){switch(e.type){case"object":return this.reduceObjectJsonSchema(e,n);case"array":const r=this.sequence?.reduceJsonSchema(e,n)??e;return this.props.length||this.index?n.fallback.arrayObject({code:"arrayObject",base:r,object:this.reduceObjectJsonSchema({type:"object"},n)}):r;default:return Rt.throwInternalOperandError("structure",e)}}reduceObjectJsonSchema(e,n){if(this.props.length){e.properties={};for(const r of this.props){const o=r.value.toJsonSchemaRecurse(n);if(typeof r.key=="symbol"){n.fallback.symbolKey({code:"symbolKey",base:e,key:r.key,value:o,optional:r.optional});continue}if(r.hasDefault()){const l=typeof r.default=="function"?r.default():r.default;o.default=Q.intrinsic.jsonData.allows(l)?l:n.fallback.defaultValue({code:"defaultValue",base:o,value:l})}e.properties[r.key]=o}this.requiredKeys.length&&e.properties&&(e.required=this.requiredKeys.filter(r=>typeof r=="string"&&r in e.properties))}if(this.index)for(const r of this.index){const o=r.value.toJsonSchemaRecurse(n);if(r.signature.equals(Q.intrinsic.string)){e.additionalProperties=o;continue}for(const l of r.signature.branches){if(!l.extends(Q.intrinsic.string)){e=n.fallback.symbolKey({code:"symbolKey",base:e,key:null,value:o,optional:!1});continue}let c={type:"string"};if(l.hasKind("morph")&&(c=n.fallback.morph({code:"morph",base:l.in.toJsonSchemaRecurse(n),out:l.out.toJsonSchemaRecurse(n)})),!l.hasKind("intersection"))return xt(`Unexpected index branch kind ${l.kind}.`);const{pattern:d}=l.inner;if(d){const h=Object.assign(c,{pattern:d[0].rule});for(let p=1;p<d.length;p++)c=n.fallback.patternIntersection({code:"patternIntersection",base:h,pattern:d[p].rule});e.patternProperties??={},e.patternProperties[h.pattern]=o}}}return this.undeclared&&!e.additionalProperties&&(e.additionalProperties=!1),e}}const sp={},gj=t=>{let e="";for(let n=0;n<t.defaultable.length;n++)e+=t.defaultable[n].defaultValueMorphRef;if(t.sequence?.defaultValueMorphsReference&&(e+=t.sequence?.defaultValueMorphsReference),t.undeclared==="delete"){if(e+="delete !(",t.required)for(const n of t.required)e+=n.compiledKey+" | ";if(t.optional)for(const n of t.optional)e+=n.compiledKey+" | ";if(t.index)for(const n of t.index)e+=n.signature.id+" | ";if(t.sequence)if(t.sequence.maxLength===null)e+=ye.nonNegativeIntegerString.id;else for(let n=0;n<t.sequence.tuple.length;n++)e+=n+" | ";e+=")"}return e},bj=t=>{const e=gj(t);if(!e)return;if(sp[e])return sp[e];const n=(r,o)=>{for(let l=0;l<t.defaultable.length;l++)t.defaultable[l].key in r||t.defaultable[l].defaultValueMorph(r,o);if(t.sequence?.defaultables)for(let l=r.length-t.sequence.prefixLength;l<t.sequence.defaultables.length;l++)t.sequence.defaultValueMorphs[l](r,o);if(t.undeclared==="delete")for(const l in r)t.declaresKey(l)||delete r[l];return r};return sp[e]=n},vj=(t,e)=>{const r=`(data${e.defaultable.some(o=>o.defaultValueMorph.length===2)||e.sequence?.defaultValueMorphs.some(o=>o.length===2)?", ctx":""})`;return t.block(`${r} => `,o=>{for(let l=0;l<e.defaultable.length;l++){const{serializedKey:c,defaultValueMorphRef:d}=e.defaultable[l];o.if(`!(${c} in data)`,h=>h.line(`${d}${r}`))}return e.sequence?.defaultables&&o.for(`i < ${e.sequence.defaultables.length}`,l=>l.set("data[i]",5),`data.length - ${e.sequence.prefixLength}`),e.undeclared==="delete"&&o.forIn("data",l=>l.if(`!(${e._compileDeclaresKey(l)})`,c=>c.line("delete data[k]"))),o.return("data")})},OA={implementation:mj,Node:yj},Sj=t=>(fe(t,"root")&&t.hasKind("unit")&&(t=t.unit),typeof t=="number"&&(t=`${t}`),t),wj=(t,e)=>`${t} is not allowed as an array index on ${e}. Use the 'nonNegativeIntegerString' keyword instead.`,sm=(t,e,n)=>{const[r,o]=gN(t.branches,c=>c.hasKind("unit"));if(!r.length)return{index:n.node("index",{signature:t,value:e})};const l={};for(const c of r){const d=n.node("required",{key:c.unit,value:e});l[d.kind]=Ie(l[d.kind],d)}return o.length&&(l.index=n.node("index",{signature:o,value:e})),l},xj=t=>fe(t,"root")?t.expression:Pe(t),bw=(t,e)=>`Key${e.length===1?"":"s"} ${e.map(xj).join(", ")} ${e.length===1?"does":"do"} not exist on ${t}`,bf={...c$,alias:Oy.implementation,domain:ky.implementation,unit:wA.implementation,proto:Hc.implementation,union:SA.implementation,morph:bA.implementation,intersection:gA.implementation,divisor:WT.implementation,pattern:fA.implementation,predicate:QT.implementation,required:TA.implementation,optional:Ey.implementation,index:xA.implementation,sequence:AA.implementation,structure:OA.implementation};Q.defaultConfig=kN(Object.assign(He(bf,(t,e)=>[t,e.defaults]),{jitless:zN(),clone:BN,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:Rt.defaultConfig}));Q.resolvedConfig=em(Q.defaultConfig,Q.config);const Tj={...f$,alias:Oy.Node,domain:ky.Node,unit:wA.Node,proto:Hc.Node,union:SA.Node,morph:bA.Node,intersection:gA.Node,divisor:WT.Node,pattern:fA.Node,predicate:QT.Node,required:TA.Node,optional:Ey.Node,index:xA.Node,sequence:AA.Node,structure:OA.Node};class om extends AN{get[Pi](){return"module"}}const _A=(t,e)=>new om(He(t,(n,r)=>[n,fe(r,"module")?_A(r,e):e.bindReference(r)])),Aj=t=>Ft(t)?t:"branches"in t&&Ft(t.branches)?t.branches:void 0,Ej=(t,e)=>Y(`Node of kind ${e} is not valid as a ${t} definition`),vw=t=>`#${t} duplicates public alias ${t}`,op={};Q.ambient??={};let Sw;const kA="function $",Rj=t=>MA(t,CA(t)),MA=(t,e)=>{const n=e.write(kA,4),r=e.compile()();for(const o of t)o.precompilation||(o.traverseAllows=r[`${o.id}Allows`].bind(r),o.isRoot()&&!o.allowsRequiresContext&&(o.allows=o.traverseAllows),o.traverseApply=r[`${o.id}Apply`].bind(r),r[`${o.id}Optimistic`]&&(o.traverseOptimistic=r[`${o.id}Optimistic`].bind(r)),o.precompilation=n)},CA=t=>new UT().return(t.reduce((e,n)=>{const r=new ip({kind:"Allows"}).indent();n.compile(r);const o=r.write(`${n.id}Allows`),l=new ip({kind:"Apply"}).indent();n.compile(l);const c=l.write(`${n.id}Apply`),d=`${e}${o},
105
- ${c},
106
- `;if(!n.hasKind("union"))return d;const h=new ip({kind:"Allows",optimistic:!0}).indent();n.compile(h);const p=h.write(`${n.id}Optimistic`);return`${d}${p},
107
- `},`{
108
- `)+"}");class DA{config;resolvedConfig;name;get[Pi](){return"scope"}referencesById={};references=[];resolutions={};exportedNames=[];aliases={};resolved=!1;nodesByHash={};intrinsic;constructor(e,n){this.config=em(Q.config,n),this.resolvedConfig=em(Q.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(op).length}`,this.name in op&&Y(`A Scope already named ${this.name} already exists`),op[this.name]=this;const r=Object.entries(e).map(o=>this.preparseOwnAliasEntry(...o));for(const[o,l]of r){let c=o;if(o[0]==="#"?(c=o.slice(1),c in this.aliases&&Y(vw(c)),this.aliases[c]=l):(c in this.aliases&&Y(vw(o)),this.aliases[c]=l,this.exportedNames.push(c)),!fe(l,"module")&&!fe(l,"generic")&&!df(l)){const d=this.preparseOwnDefinitionFormat(l,{alias:c});this.resolutions[c]=fe(d,"root")?this.bindReference(d):this.createParseContext(d).id}}Sw??=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0}),this.nodesByHash[Sw.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=Q.intrinsic?He(Q.intrinsic,(o,l)=>o.startsWith("json")?[]:[o,this.bindReference(l)]):{}}cacheGetter(e,n){return Object.defineProperty(this,e,{value:n}),n}get internal(){return this}_json;get json(){return this._json||this.export(),this._json}defineSchema(e){return e}generic=(...e)=>{const n=this;return(r,o)=>new Ic(e,o?new ZT(r):r,n,n,o??null)};units=(e,n)=>{const r=[];for(const l of e)r.includes(l)||r.push(l);const o=r.map(l=>this.node("unit",{unit:l},n));return this.node("union",o,{...n,prereduced:!0})};lazyResolutions=[];lazilyResolve(e,n){const r=this.node("alias",{reference:n??"synthetic",resolve:e},{prereduced:!0});return this.resolved||this.lazyResolutions.push(r),r}schema=(e,n)=>this.finalize(this.parseSchema(e,n));parseSchema=(e,n)=>this.node(yc(e),e,n);preparseNode(e,n,r){let o=typeof e=="string"?e:yc(n,e);if(Xt(n)&&n.kind===o)return n;if(o==="alias"&&!r?.prereduced){const{reference:d}=Oy.implementation.normalize(n,this);if(d.startsWith("$")){const h=this.resolveRoot(d.slice(1));n=h,o=h.kind}}else if(o==="union"&&vs(n,"object")){const d=Aj(n);d?.length===1&&(n=d[0],o=yc(n))}if(Xt(n)&&n.kind===o)return n;const c=bf[o].normalize?.(n,this)??n;return Xt(c)?c.kind===o?c:Ej(o,c.kind):{...r,$:this,kind:o,def:c,prefix:r.alias??o}}bindReference(e){let n;return Xt(e)?n=e.$===this?e:new e.constructor(e.attachments,this):n=e.$===this?e:new Ic(e.params,e.bodyDef,e.$,this,e.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(e){return this.maybeResolveRoot(e)??Y(BA(e))}maybeResolveRoot(e){const n=this.maybeResolve(e);if(!fe(n,"generic"))return n}maybeResolveSubalias(e){return am(this.aliases,e)??am(this.ambient,e)}get ambient(){return Q.ambient}maybeResolve(e){const n=this.resolutions[e];if(n){if(typeof n!="string")return this.bindReference(n);const o=jn[n];if(fe(o,"root"))return this.resolutions[e]=o;if(fe(o,"context")){if(o.phase==="resolving")return this.node("alias",{reference:`$${e}`},{prereduced:!0});if(o.phase==="resolved")return xt(`Unexpected resolved context for was uncached by its scope: ${Pe(o)}`);o.phase="resolving";const l=this.bindReference(this.parseOwnDefinitionFormat(o.def,o));return o.phase="resolved",jn[l.id]=l,jn[o.id]=l,this.resolutions[e]=l}return xt(`Unexpected nodesById entry for ${n}: ${Pe(o)}`)}let r=this.aliases[e]??this.ambient?.[e];return r?(r=this.normalizeRootScopeValue(r),fe(r,"generic")?this.resolutions[e]=this.bindReference(r):fe(r,"module")?(r.root||Y(LA(e)),this.resolutions[e]=this.bindReference(r.root)):this.resolutions[e]=this.parse(r,{alias:e})):this.maybeResolveSubalias(e)}createParseContext(e){const n=e.id??dA(e.prefix);return jn[n]=Object.assign(e,{[Pi]:"context",$:this,id:n,phase:"unresolved"})}traversal(e){return new po(e,this.resolvedConfig)}import(...e){return new om(He(this.export(...e),(n,r)=>[`#${n}`,r]))}precompilation;_exportedResolutions;_exports;export(...e){if(!this._exports){this._exports={};for(const r of this.exportedNames){const o=this.aliases[r];this._exports[r]=fe(o,"module")?_A(o,this):ww(this.maybeResolve(r))}for(const r of this.lazyResolutions)r.resolution;if(this._exportedResolutions=jA(this,this._exports),this._json=$A(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const r=CA(this.references);this.precompilation=r.write(kA,4),MA(this.references,r)}this.resolved=!0}const n=e.length?e:this.exportedNames;return new om(He(n,(r,o)=>[o,this._exports[o]]))}resolve(e){return this.export()[e]}node=(e,n,r={})=>{const o=this.preparseNode(e,n,r);if(Xt(o))return this.bindReference(o);const l=this.createParseContext(o),c=hA(l),d=this.bindReference(c);return jn[l.id]=d};parse=(e,n={})=>this.finalize(this.parseDefinition(e,n));parseDefinition(e,n={}){if(fe(e,"root"))return this.bindReference(e);const r=this.preparseOwnDefinitionFormat(e,n);if(fe(r,"root"))return this.bindReference(r);const o=this.createParseContext(r);jn[o.id]=o;let l=this.bindReference(this.parseOwnDefinitionFormat(e,o));return l.isCyclic&&(l=y$(l,o.id)),jn[o.id]=l,l}finalize(e){return ww(e),!e.precompilation&&!this.resolvedConfig.jitless&&Rj(e.references),e}}class NA extends DA{parseOwnDefinitionFormat(e,n){return hA(n)}preparseOwnDefinitionFormat(e,n){return this.preparseNode(yc(e),e,n)}preparseOwnAliasEntry(e,n){return[e,n]}normalizeRootScopeValue(e){return e}}const ww=t=>{const e=t.references.filter(n=>n.hasKind("alias"));for(const n of e){Object.assign(n.referencesById,n.resolution.referencesById);for(const r of t.references)n.id in r.referencesById&&Object.assign(r.referencesById,n.referencesById)}return t},$A=t=>He(t,(e,n)=>[e,fe(n,"root")||fe(n,"generic")?n.json:fe(n,"module")?$A(n):xt(`Unexpected resolution ${Pe(n)}`)]),am=(t,e)=>{const n=e.indexOf(".");if(n===-1)return;const r=e.slice(0,n),o=t[r];if(o===void 0)return;if(!fe(o,"module"))return Y(Oj(r));const l=e.slice(n+1),c=o[l];if(c===void 0)return am(o,l);if(fe(c,"root")||fe(c,"generic"))return c;if(fe(c,"module"))return c.root??Y(LA(e));xt(`Unexpected resolution for alias '${e}': ${Pe(c)}`)},My=(t,e)=>new NA(t,e),Cl=new NA({}),jA=(t,e)=>{const n={};for(const r in e){const o=e[r];if(fe(o,"module")){const l=jA(t,o),c=He(l,(d,h)=>[`${r}.${d}`,h]);Object.assign(n,c)}else fe(o,"root")||fe(o,"generic")?n[r]=o:xt(`Unexpected scope resolution ${Pe(o)}`)}return n},BA=t=>`'${t}' is unresolvable`,Oj=t=>`'${t}' must reference a module to be accessed using dot syntax`,LA=t=>`Reference to submodule '${t}' must specify an alias`;Cl.export();const Ge=Cl.schema,Cy=Cl.node;Cl.defineSchema;const Gi=Cl.generic,VA="^(?:0|[1-9]\\d*)$",_j=new RegExp(VA);Zt(_j);const zA=My({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();Q.intrinsic={...zA};const UA=My({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:VA}},{prereducedAliases:!0}).export();Object.assign(Q.intrinsic,UA);const kj=My({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),ye={...zA,...UA,...kj,emptyStructure:Cy("structure",{},{prereduced:!0})};Q.intrinsic={...ye};const Mj=t=>typeof t=="string"&&t[0]==="d"&&(t[1]==="'"||t[1]==='"')&&t.at(-1)===t[1],xw=t=>t.toString()!=="Invalid Date",Cj=t=>t.slice(2,-1),KA=t=>`'${t}' could not be parsed by the Date constructor`,Dj=(t,e)=>Nj(t,e),Nj=(t,e)=>{const n=new Date(t);if(xw(n))return n;const r=i2(t);if(r!==void 0){const o=new Date(r);if(xw(o))return o}return e?Y(e===!0?KA(t):e):void 0},Tw=(t,e)=>{const n=t.scanner.shiftUntil(jj[qA[e]]);if(t.scanner.lookahead==="")return t.error(Lj(n,e));if(t.scanner.shift(),e==="/"){try{new RegExp(n)}catch(r){Y(String(r))}t.root=t.ctx.$.node("intersection",{domain:"string",pattern:n},{prereduced:!0})}else if(mi(e,PA))t.root=t.ctx.$.node("unit",{unit:n});else{const r=Dj(n,KA(n));t.root=t.ctx.$.node("unit",{meta:n,unit:r})}},PA={"'":1,'"':1},$j={"/":1,"'":1,'"':1},qA={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},jj={"'":t=>t.lookahead==="'",'"':t=>t.lookahead==='"',"/":t=>t.lookahead==="/"},Bj={'"':"double-quote","'":"single-quote","/":"forward slash"},Lj=(t,e)=>`${e}${t} requires a closing ${Bj[qA[e]]}`,Vj=t=>`Private type references should not include '#'. Use '${t}' instead.`,IA="Optional definitions like 'string?' are only valid as properties in an object or tuple",HA="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",zj={">":!0,">=":!0},Uj={"<":!0,"<=":!0},Fc={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},Kj=t=>`Unmatched )${t===""?"":` before ${t}`}`,FA=t=>`Missing ${t}`,Pj=(t,e)=>`Left bounds are only valid when paired with right bounds (try ...${e}${t})`,GA=t=>`Left-bounded expressions must specify their limits using < or <= (was ${t})`,qj=(t,e,n,r)=>`An expression may have at most one left bound (parsed ${t}${Fc[e]}, ${n}${Fc[r]})`,Ij=(t,e,n)=>YA(t,e,n,[]),YA=(t,e,n,r)=>{const o=n.parseUntilFinalizer();return r.push(o.root),o.finalizer===">"?r.length!==e.params.length?n.error(XA(t,e.names,r.map(l=>l.expression))):r:o.finalizer===","?YA(t,e,n,r):o.error(FA(">"))},XA=(t,e,n)=>`${t}<${e.join(", ")}> requires exactly ${e.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,Aw=t=>{const e=t.scanner.shiftUntilNextTerminator();e==="keyof"?t.addPrefix("keyof"):t.root=Fj(t,e)},Hj=(t,e,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(XA(t,e.names,[]));const o=Ij(t,e,n);return e(...o)},Fj=(t,e)=>Gj(t,e)??Yj(t,e)??t.error(e===""?t.scanner.lookahead==="#"?Vj(t.shiftedByOne().scanner.shiftUntilNextTerminator()):JA(t):BA(e)),Gj=(t,e)=>{if(t.ctx.args?.[e]){const r=t.ctx.args[e];return typeof r!="string"?r:t.ctx.$.node("alias",{reference:r},{prereduced:!0})}const n=t.ctx.$.maybeResolve(e);if(fe(n,"root"))return n;if(n!==void 0)return fe(n,"generic")?Hj(e,n,t):Y(`Unexpected resolution ${Pe(n)}`)},Yj=(t,e)=>{const n=r2(e);if(n!==void 0)return t.ctx.$.node("unit",{unit:n});const r=o2(e);if(r!==void 0)return t.ctx.$.node("unit",{unit:r})},JA=t=>{const e=t.previousOperator();return e?ZA(e,t.scanner.unscanned):Xj(t.scanner.unscanned)},ZA=(t,e="")=>`Token '${t}' requires a right operand${e?` before '${e}'`:""}`,Xj=t=>`Expected an expression${t?` before '${t}'`:""}`,QA=t=>t.scanner.lookahead===""?t.error(JA(t)):t.scanner.lookahead==="("?t.shiftedByOne().reduceGroupOpen():t.scanner.lookaheadIsIn($j)?Tw(t,t.scanner.shift()):t.scanner.lookaheadIsIn(hf)?QA(t.shiftedByOne()):t.scanner.lookahead==="d"&&t.scanner.nextLookahead in PA?Tw(t,`${t.scanner.shift()}${t.scanner.shift()}`):Aw(t);class Bo extends p2{shiftUntilNextTerminator(){return this.shiftUntilNonWhitespace(),this.shiftUntil(()=>this.lookahead in Bo.terminatingChars)}static terminatingChars={"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...hf};static finalizingLookaheads={">":1,",":1,"":1,"=":1,"?":1};static lookaheadIsFinalizing=(e,n)=>e===">"?n[0]==="="?n[1]==="=":n.trimStart()===""||mi(n.trimStart()[0],Bo.terminatingChars):e==="="?n[0]!=="=":e===","||e==="?"}const Jj=(t,e)=>{const n=Qj(t,e);if(t.root.hasKind("unit")){if(typeof t.root.unit=="number"){t.reduceLeftBound(t.root.unit,n),t.unsetRoot();return}if(t.root.unit instanceof Date){const r=`d'${t.root.description??t.root.unit.toISOString()}'`;t.unsetRoot(),t.reduceLeftBound(r,n);return}}return eB(t,n)},Zj={"<":1,">":1,"=":1},Qj=(t,e)=>t.scanner.lookaheadIs("=")?`${e}${t.scanner.shift()}`:e,Ew=(t,e,n,r)=>n.extends(Q.intrinsic.number)?typeof e!="number"?Y(lm(t,e,r)):t==="=="?["min","max"]:t[0]===">"?["min"]:["max"]:n.extends(Q.intrinsic.lengthBoundable)?typeof e!="number"?Y(lm(t,e,r)):t==="=="?["exactLength"]:t[0]===">"?["minLength"]:["maxLength"]:n.extends(Q.intrinsic.Date)?t==="=="?["after","before"]:t[0]===">"?["after"]:["before"]:Y(X2(n.expression)),Wj=t=>({rule:Mj(t.limit)?Cj(t.limit):t.limit,exclusive:t.comparator.length===1}),eB=(t,e)=>{const n=t.unsetRoot(),r=t.scanner.location;t.parseOperand();const o=t.unsetRoot(),l=t.scanner.sliceChars(r,t.scanner.location);if(t.root=n,!o.hasKind("unit")||typeof o.unit!="number"&&!(o.unit instanceof Date))return t.error(lm(e,l,"right"));const c=o.unit,d=e.length===1,h=Ew(e,typeof c=="number"?c:l,n,"right");for(const y of h)t.constrainRoot(y,e==="=="?{rule:c}:{rule:c,exclusive:d});if(!t.branches.leftBound)return;if(!mi(e,Uj))return t.error(GA(e));const p=Ew(t.branches.leftBound.comparator,t.branches.leftBound.limit,n,"left");t.constrainRoot(p[0],Wj(t.branches.leftBound)),t.branches.leftBound=null},lm=(t,e,n)=>`Comparator ${n==="left"?Fc[t]:t} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${e})`,tB=t=>{t.scanner.shiftUntilNonWhitespace();const e=t.scanner.shiftUntilNextTerminator();t.root=t.root.brand(e)},nB=t=>{const e=t.scanner.shiftUntilNextTerminator(),n=s2(e,{errorOnFail:Rw(e)});n===0&&t.error(Rw(0)),t.root=t.root.constrain("divisor",n)},Rw=t=>`% operator must be followed by a non-zero integer literal (was ${t})`,WA=t=>{const e=t.scanner.shift();return e===""?t.finalize(""):e==="["?t.scanner.shift()==="]"?t.setRoot(t.root.array()):t.error(iB):e==="|"?t.scanner.lookahead===">"?t.shiftedByOne().pushRootToBranch("|>"):t.pushRootToBranch(e):e==="&"?t.pushRootToBranch(e):e===")"?t.finalizeGroup():Bo.lookaheadIsFinalizing(e,t.scanner.unscanned)?t.finalize(e):mi(e,Zj)?Jj(t,e):e==="%"?nB(t):e==="#"?tB(t):e in hf?WA(t):t.error(Dy(e))},Dy=(t,e="")=>`'${t}' is not allowed here${e&&` (should be ${e})`}`,iB="Missing expected ']'",rB=t=>{const e=t.unsetRoot();t.parseOperand();const n=t.unsetRoot();if(!n.hasKind("unit"))return t.error(sB(n.expression));const r=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[e,"=",r]},sB=t=>`Default value '${t}' must a literal value`,Ow=(t,e)=>{const n=e.$.maybeResolveRoot(t);if(n)return n;if(t.endsWith("[]")){const l=e.$.maybeResolveRoot(t.slice(0,-2));if(l)return l.array()}const r=new vf(new Bo(t),e),o=oB(r);return r.finalizer===">"&&Y(Dy(">")),o},oB=t=>{t.parseOperand();let e=Ny(t).root;return e?(t.finalizer==="="?e=rB(t):t.finalizer==="?"&&(e=[e,"?"]),t.scanner.shiftUntilNonWhitespace(),t.scanner.lookahead&&Y(Dy(t.scanner.lookahead)),e):xt(`Root was unexpectedly unset after parsing string '${t.scanner.scanned}'`)},Ny=t=>{for(;t.finalizer===void 0;)aB(t);return t},aB=t=>t.hasRoot()?t.parseOperator():t.parseOperand();class vf{root;branches={prefixes:[],leftBound:null,intersection:null,union:null,pipe:null};finalizer;groups=[];scanner;ctx;constructor(e,n){this.scanner=e,this.ctx=n}error(e){return Y(e)}hasRoot(){return this.root!==void 0}setRoot(e){this.root=e}unsetRoot(){const e=this.root;return this.root=void 0,e}constrainRoot(...e){this.root=this.root.constrain(e[0],e[1])}finalize(e){if(this.groups.length)return this.error(FA(")"));this.finalizeBranches(),this.finalizer=e}reduceLeftBound(e,n){const r=Fc[n];if(!mi(r,zj))return this.error(GA(n));if(this.branches.leftBound)return this.error(qj(this.branches.leftBound.limit,this.branches.leftBound.comparator,e,r));this.branches.leftBound={comparator:r,limit:e}}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 e=this.groups.pop();if(!e)return this.error(Kj(this.scanner.unscanned));this.branches=e}addPrefix(e){this.branches.prefixes.push(e)}applyPrefixes(){for(;this.branches.prefixes.length;){const e=this.branches.prefixes.pop();this.root=e==="keyof"?this.root.keyof():xt(`Unexpected prefix '${e}'`)}}pushRootToBranch(e){this.assertRangeUnset(),this.applyPrefixes();const n=this.root;this.root=void 0,this.branches.intersection=this.branches.intersection?.rawAnd(n)??n,e!=="&"&&(this.branches.union=this.branches.union?.rawOr(this.branches.intersection)??this.branches.intersection,this.branches.intersection=null,e!=="|"&&(this.branches.pipe=this.branches.pipe?.rawPipeOnce(this.branches.union)??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return Ny(new vf(this.scanner,this.ctx))}parseOperator(){return WA(this)}parseOperand(){return QA(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(Pj(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(){return this.branches.leftBound?.comparator??this.branches.prefixes.at(-1)??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const lB="An empty string is not a valid generic parameter name",um=(t,e,n)=>{t.shiftUntilNonWhitespace();const r=t.shiftUntilNextTerminator();return r===""?t.lookahead===""&&e.length?e:Y(lB):(t.shiftUntilNonWhitespace(),uB(t,r,e,n))},_w="extends ",uB=(t,e,n,r)=>{if(t.shiftUntilNonWhitespace(),t.unscanned.startsWith(_w))t.jumpForward(_w.length);else return t.lookahead===","&&t.shift(),n.push(e),um(t,n,r);const o=Ny(new vf(t,r));return n.push([e,o.root]),um(t,n,r)};class cB extends Uo{$;constructor(e){super((...n)=>new ic(e)(...n),{bind:e}),this.$=e}in(e){return new ic(this.$,e===void 0?void 0:this.$.parse(e))}at(e,n){return new ic(this.$).at(e,n)}case(e,n){return new ic(this.$).case(e,n)}}class ic extends Uo{$;in;key;branches=[];constructor(e,n){super(r=>this.caseEntries(Object.entries(r).map(([o,l])=>o==="default"?[o,l]:[this.$.parse(o),l]))),this.$=e,this.in=n}at(e,n){return this.key&&Y(dB),this.branches.length&&Y(fB),this.key=e,n?this.match(n):this}case(e,n){return this.caseEntry(this.$.parse(e),n)}caseEntry(e,n){const o=(this.key?this.$.parse({[this.key]:e}):e).pipe(n);return this.branches.push(o),this}match(e){return this(e)}strings(e){return this.caseEntries(Object.entries(e).map(([n,r])=>n==="default"?[n,r]:[this.$.node("unit",{unit:n}),r]))}caseEntries(e){for(let n=0;n<e.length;n++){const[r,o]=e[n];if(r==="default")return n!==e.length-1&&Y("default may only be specified as the last key of a switch definition"),this.default(o);if(typeof o!="function")return Y(`Value for case "${r}" must be a function (was ${Jn(o)})`);this.caseEntry(r,o)}return this}default(e){typeof e=="function"&&this.case(ye.unknown,e);const n={branches:this.branches,ordered:!0};(e==="never"||e==="assert")&&(n.meta={onFail:kw});const r=this.$.node("union",n);if(!this.in)return this.$.finalize(r);let o=this.in.pipe(r);return(e==="never"||e==="assert")&&(o=o.configureReferences({onFail:kw},"self")),this.$.finalize(o)}}const kw=t=>t.throw(),fB="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",dB="At most one key matcher may be specified per expression",eE=(t,e)=>{if(Ft(t)){if(t[1]==="=")return[e.$.parseOwnDefinitionFormat(t[0],e),"=",t[2]];if(t[1]==="?")return[e.$.parseOwnDefinitionFormat(t[0],e),"?"]}return aE(t,e)},hB="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",pB="Only required keys may specify default values, e.g. { value: 'number = 0' }",mB=(t,e)=>{let n;const r={},o=Vc(t);for(const[c,d]of o){const h=bB(c);if(h.kind==="spread"){if(!Al(r))return Y(gB);const S=e.$.parseOwnDefinitionFormat(d,e);if(S.equals(ye.object))continue;if(!S.hasKind("intersection")||!S.basis?.equals(ye.object))return Y(vB(S.expression));n=S.structure;continue}if(h.kind==="undeclared"){d!=="reject"&&d!=="delete"&&d!=="ignore"&&Y(yB(d)),r.undeclared=d;continue}const p=eE(d,e),y=h;if(h.kind==="required"){Ft(p)?ap(r,"optional",p[1]==="="?{key:h.normalized,value:p[0],default:p[2]}:{key:h.normalized,value:p[0]},e):ap(r,"required",{key:h.normalized,value:p},e);continue}if(Ft(p)&&(p[1]==="?"&&Y(hB),p[1]==="="&&Y(pB)),h.kind==="optional"){ap(r,"optional",{key:h.normalized,value:p},e);continue}const g=e.$.parseOwnDefinitionFormat(y.normalized,e),v=sm(g,p,e.$);v.index&&(r.index=Ie(r.index,v.index)),v.required&&(r.required=Ie(r.required,v.required))}const l=e.$.node("structure",r);return e.$.parseSchema({domain:"object",structure:n?.merge(l)??l})},ap=(t,e,n,r)=>{t[e]=Ie(t[e],r.$.node(e,n))},yB=t=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${Pe(t)})`,gB="Spread operator may only be used as the first key in an object",bB=t=>typeof t=="symbol"?{kind:"required",normalized:t}:t.at(-1)==="?"?t.at(-2)===Xp?{kind:"required",normalized:`${t.slice(0,-2)}?`}:{kind:"optional",normalized:t.slice(0,-1)}:t[0]==="["&&t.at(-1)==="]"?{kind:"index",normalized:t.slice(1,-1)}:t[0]===Xp&&t[1]==="["&&t.at(-1)==="]"?{kind:"required",normalized:t.slice(1)}:t==="..."?{kind:"spread"}:t==="+"?{kind:"undeclared"}:{kind:"required",normalized:t==="\\..."?"...":t==="\\+"?"+":t},vB=t=>`Spread operand must resolve to an object literal type (was ${t})`,SB=(t,e)=>MB(t)?rE[t[0]](t,e):_B(t)?iE[t[1]](t,e):null,wB=(t,e)=>e.$.parseOwnDefinitionFormat(t[1],e).keyof(),lp=(t,e)=>{if(t[2]===void 0)return Y(ZA(t[1],""));const n=e.$.parseOwnDefinitionFormat(t[0],e),r=e.$.parseOwnDefinitionFormat(t[2],e);if(t[1]==="|")return e.$.node("union",{branches:[n,r]});const o=t[1]==="&"?Ii(n,r,e.$):nm(n,r,e.$);return o instanceof se?o.throw():o},xB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).array(),TB=(t,e)=>typeof t[2]!="function"?Y(tE("=>",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).pipe(t[2]),tE=(t,e)=>`${t===":"?"Narrow":"Morph"} expression requires a function following '${t}' (was ${typeof e})`,AB=(t,e)=>typeof t[2]!="function"?Y(tE(":",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).constrain("predicate",t[2]),EB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).configureReferences(t[2],"shallow"),nE=t=>t,RB=nE({"[]":xB,"?":()=>Y(IA)}),OB=nE({"|":lp,"&":lp,":":AB,"=>":TB,"|>":lp,"@":EB,"=":()=>Y(HA)}),iE={...RB,...OB},_B=t=>iE[t[1]]!==void 0,kB=t=>t,rE=kB({keyof:wB,instanceof:(t,e)=>{if(typeof t[1]!="function")return Y(Mw(Yp(t[1])));const n=t.slice(1).map(r=>typeof r=="function"?e.$.node("proto",{proto:r}):Y(Mw(Yp(r))));return n.length===1?n[0]:e.$.node("union",{branches:n})},"===":(t,e)=>e.$.units(t.slice(1))}),MB=t=>rE[t[0]]!==void 0,Mw=t=>`Expected a constructor following 'instanceof' operator (was ${t})`,CB=(t,e)=>{let n=[{}],r=0;for(;r<t.length;){let o=!1;t[r]==="..."&&r<t.length-1&&(o=!0,r++);const l=eE(t[r],e),[c,d,h]=Ft(l)?l:[l];if(r++,o){if(!c.extends(Q.intrinsic.Array))return Y($B(c.expression));n=n.flatMap(p=>c.distribute(y=>NB(qT(p),y)))}else n=n.map(p=>d==="?"?sE(p,c):d==="="?DB(p,c,h):cm(p,c))}return e.$.parseSchema(n.map(o=>Al(o)?{proto:Array,exactLength:0}:{proto:Array,sequence:o}))},cm=(t,e)=>t.defaultables||t.optionals?Y(t.variadic?EA:jB):(t.variadic?t.postfix=Ie(t.postfix,e):t.prefix=Ie(t.prefix,e),t),sE=(t,e)=>t.variadic?Y(oE):(t.optionals=Ie(t.optionals,e),t),DB=(t,e,n)=>t.variadic?Y(oE):t.optionals?Y(BB):(t.defaultables=Ie(t.defaultables,[[e,n]]),t),Cw=(t,e)=>(t.postfix&&Y(Dw),t.variadic?t.variadic.equals(e)||Y(Dw):t.variadic=e.internal,t),NB=(t,e)=>{const n=e.select({method:"find",kind:"sequence"});if(!n)return Cw(t,Q.intrinsic.unknown);if(n.prefix)for(const r of n.prefix)cm(t,r);if(n.optionals)for(const r of n.optionals)sE(t,r);if(n.variadic&&Cw(t,n.variadic),n.postfix)for(const r of n.postfix)cm(t,r);return t},$B=t=>`Spread element must be an array (was ${t})`,Dw="A tuple may have at most one variadic element",jB="A required element may not follow an optional element",oE="An optional element may not follow a variadic element",BB="A defaultable element may not follow an optional element without a default",LB={},aE=(t,e)=>{if(typeof t=="string"){if(e.args&&Object.keys(e.args).some(r=>t.includes(r)))return Ow(t,e);const n=LB[e.$.name]??={};return n[t]??=Ow(t,e)}return vs(t,"object")?VB(t,e):Y(fm(Jn(t)))},VB=(t,e)=>{const n=gy(t);switch(n){case void 0:return fe(t,"root")?t:mB(t,e);case"Array":return zB(t,e);case"RegExp":return e.$.node("intersection",{domain:"string",pattern:t},{prereduced:!0});case"Function":{const r=df(t)?t():t;return fe(r,"root")?r:Y(fm("Function"))}default:return Y(fm(n??Pe(t)))}},zB=(t,e)=>SB(t,e)??CB(t,e),fm=t=>`Type definitions must be strings or objects (was ${t})`;class UB extends Uo{constructor(e){const n=Object.assign({errors:kr,hkt:yi,$:e,raw:e.parse,module:e.constructor.module,scope:e.constructor.scope,define:e.define,match:e.match,generic:e.generic,schema:e.schema,keywords:e.ambient,unit:e.unit,enumerated:e.enumerated,instanceOf:e.instanceOf,valueOf:e.valueOf,or:e.or,and:e.and,merge:e.merge,pipe:e.pipe},e.ambientAttachments);super((...r)=>{if(r.length===1)return e.parse(r[0]);if(r.length===2&&typeof r[0]=="string"&&r[0][0]==="<"&&r[0].at(-1)===">"){const o=r[0].slice(1,-1),l=e.parseGenericParams(o,{});return new Ic(l,r[1],e,e,null)}return e.parse(r)},{bind:e,attach:n})}}const dl=Q;class Sf extends DA{get ambientAttachments(){if(dl.typeAttachments)return this.cacheGetter("ambientAttachments",He(dl.typeAttachments,(e,n)=>[e,this.bindReference(n)]))}preparseOwnAliasEntry(e,n){const r=e.indexOf("<");if(r===-1){if(fe(n,"module")||fe(n,"generic"))return[e,n];const c=this.name==="ark"?e:e==="root"?this.name:`${this.name}.${e}`,d=this.resolvedConfig.keywords?.[c];return d&&(n=[n,"@",d]),[e,n]}e.at(-1)!==">"&&Y("'>' must be the last character of a generic declaration in a scope");const o=e.slice(0,r),l=e.slice(r+1,-1);return[o,()=>{const c=this.parseGenericParams(l,{alias:o});return j2(c,n,this)}]}parseGenericParams(e,n){return um(new Bo(e),[],this.createParseContext({...n,def:e,prefix:"generic"}))}normalizeRootScopeValue(e){return df(e)&&!fe(e,"generic")?e():e}preparseOwnDefinitionFormat(e,n){return{...n,def:e,prefix:n.alias??"type"}}parseOwnDefinitionFormat(e,n){!(n.alias&&n.alias in this.aliases)&&!n.args&&(n.args={this:n.id});const o=aE(e,n);if(Ft(o)){if(o[1]==="=")return Y(HA);if(o[1]==="?")return Y(IA)}return o}unit=e=>this.units([e]);valueOf=e=>this.units(MN(e));enumerated=(...e)=>this.units(e);instanceOf=e=>this.node("proto",{proto:e},{prereduced:!0});or=(...e)=>this.schema(e.map(n=>this.parse(n)));and=(...e)=>e.reduce((n,r)=>n.and(this.parse(r)),this.intrinsic.unknown);merge=(...e)=>e.reduce((n,r)=>n.merge(this.parse(r)),this.intrinsic.object);pipe=(...e)=>this.intrinsic.unknown.pipe(...e);match=new cB(this);declare=()=>({type:this.type});define(e){return e}type=new UB(this);static scope=((e,n={})=>new Sf(e,n));static module=((e,n={})=>this.scope(e,n).export())}const KB=Object.assign(Sf.scope,{define:t=>t}),je=Sf;class PB extends yi{description='merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'}const qB=Gi(["base",ye.object],["props",ye.object])(t=>t.base.merge(t.props),PB),IB=je.module({Key:ye.key,Merge:qB});class HB extends yi{}const FB=Gi("element")(t=>{const e=t.element.exclude(ye.Array),n=e.array();return e.rawOr(n).pipe(Tl).distribute(r=>r.assertHasKind("morph").declareOut(n),Ge)},HB),GB=je.module({root:ye.Array,readonly:"root",index:ye.nonNegativeIntegerString,liftFrom:FB},{name:"Array"}),dm=Ge(["string",El.FileConstructor]),YB=dm.rawOr(dm.array()),Nw=Ge({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:YB}}),XB=je.module({root:["instanceof",FormData],value:dm,parsed:Nw,parse:Ge({in:FormData,morphs:t=>{const e={};for(const[n,r]of t)if(n in e){const o=e[n];typeof o=="string"||o instanceof El.FileConstructor?e[n]=[o,r]:o.push(r)}else e[n]=r;return e},declaredOut:Nw})},{name:"FormData"}),JB=je.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"}),ZB={Boolean:1,Number:1,String:1},QB=je.module({...He({..._T,...MT},(t,e)=>t in ZB?[]:[t,["instanceof",e]]),Array:GB,TypedArray:JB,FormData:XB}),WB=Ge({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"}),e3=Ge({domain:"number",divisor:1}),lE=je.module({root:ye.number,integer:e3,epoch:WB,safe:Ge({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"}),Xe=(t,e,n)=>{const r={domain:"string",pattern:{rule:t.source,flags:t.flags,meta:e}};return n&&(r.meta={format:n}),Cy("intersection",r)},$w=Xe(zc,"a well-formed integer string"),uE=je.module({root:$w,parse:Ge({in:$w,morphs:(t,e)=>{const n=Number.parseInt(t);return Number.isSafeInteger(n)?n:e.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:ye.integer})},{name:"string.integer"}),t3=Xe(/^[\dA-Fa-f]+$/,"hex characters only"),n3=je.module({root:Xe(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:Xe(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),jw=Xe(/^[A-Z].*$/,"capitalized"),i3=je.module({root:Ge({in:"string",morphs:t=>t.charAt(0).toUpperCase()+t.slice(1),declaredOut:jw}),preformatted:jw},{name:"string.capitalize"}),r3=t=>{const e=t.replaceAll(/[ -]+/g,"");let n=0,r,o,l=!1;for(let c=e.length-1;c>=0;c--)r=e.substring(c,c+1),o=Number.parseInt(r,10),l?(o*=2,n+=o>=10?o%10+1:o):n+=o,l=!l;return!!(n%10===0&&e)},s3=/^(?: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}))$/,o3=Ge({domain:"string",pattern:{meta:"a credit card number",rule:s3.source},predicate:{meta:"a credit card number",predicate:r3}}),a3=/^([+-]?\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)?)?)?)?$/,l3=t=>!Number.isNaN(new Date(t).valueOf()),Bw=Ge({domain:"string",predicate:{meta:"a parsable date",predicate:l3}}).assertHasKind("intersection"),Lw=uE.root.internal.narrow((t,e)=>{const n=Number.parseInt(t),r=lE.epoch(n);return r instanceof kr?(e.errors.merge(r),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),u3=je.module({root:Lw,parse:Ge({in:Lw,morphs:t=>new Date(t),declaredOut:ye.Date})},{name:"string.date.epoch"}),Vw=Xe(a3,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),c3=je.module({root:Vw,parse:Ge({in:Vw,morphs:t=>new Date(t),declaredOut:ye.Date})},{name:"string.date.iso"}),f3=je.module({root:Bw,parse:Ge({declaredIn:Bw,in:"string",morphs:(t,e)=>{const n=new Date(t);return Number.isNaN(n.valueOf())?e.error("a parsable date"):n},declaredOut:ye.Date}),iso:c3,epoch:u3},{name:"string.date"}),d3=Xe(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),zw="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",vr=`(${zw}[.]){3}${zw}`,h3=new RegExp(`^${vr}$`),gt="(?:[0-9a-fA-F]{1,4})",p3=new RegExp(`^((?:${gt}:){7}(?:${gt}|:)|(?:${gt}:){6}(?:${vr}|:${gt}|:)|(?:${gt}:){5}(?::${vr}|(:${gt}){1,2}|:)|(?:${gt}:){4}(?:(:${gt}){0,1}:${vr}|(:${gt}){1,3}|:)|(?:${gt}:){3}(?:(:${gt}){0,2}:${vr}|(:${gt}){1,4}|:)|(?:${gt}:){2}(?:(:${gt}){0,3}:${vr}|(:${gt}){1,5}|:)|(?:${gt}:){1}(?:(:${gt}){0,4}:${vr}|(:${gt}){1,6}|:)|(?::((?::${gt}){0,5}:${vr}|(?::${gt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),m3=je.module({root:["v4 | v6","@","an IP address"],v4:Xe(h3,"an IPv4 address","ipv4"),v6:Xe(p3,"an IPv6 address","ipv6")},{name:"string.ip"}),Ao="a JSON string",cE=t=>{if(!(t instanceof SyntaxError))throw t;return`must be ${Ao} (${t})`},y3=Ge({meta:Ao,domain:"string",predicate:{meta:Ao,predicate:(t,e)=>{try{return JSON.parse(t),!0}catch(n){return e.reject({code:"predicate",expected:Ao,problem:cE(n)})}}}}),g3=(t,e)=>{if(t.length===0)return e.error({code:"predicate",expected:Ao,actual:"empty"});try{return JSON.parse(t)}catch(n){return e.error({code:"predicate",expected:Ao,problem:cE(n)})}},b3=je.module({root:y3,parse:Ge({meta:"safe JSON string parser",in:"string",morphs:g3,declaredOut:ye.jsonObject})},{name:"string.json"}),Uw=Xe(/^[a-z]*$/,"only lowercase letters"),v3=je.module({root:Ge({in:"string",morphs:t=>t.toLowerCase(),declaredOut:Uw}),preformatted:Uw},{name:"string.lower"}),fE=["NFC","NFD","NFKC","NFKD"],Dl=He(fE,(t,e)=>[e,Ge({domain:"string",predicate:n=>n.normalize(e)===n,meta:`${e}-normalized unicode`})]),wf=He(fE,(t,e)=>[e,Ge({in:"string",morphs:n=>n.normalize(e),declaredOut:Dl[e]})]),S3=je.module({root:wf.NFC,preformatted:Dl.NFC},{name:"string.normalize.NFC"}),w3=je.module({root:wf.NFD,preformatted:Dl.NFD},{name:"string.normalize.NFD"}),x3=je.module({root:wf.NFKC,preformatted:Dl.NFKC},{name:"string.normalize.NFKC"}),T3=je.module({root:wf.NFKD,preformatted:Dl.NFKD},{name:"string.normalize.NFKD"}),A3=je.module({root:"NFC",NFC:S3,NFD:w3,NFKC:x3,NFKD:T3},{name:"string.normalize"}),Kw=Xe(Jp,"a well-formed numeric string"),E3=je.module({root:Kw,parse:Ge({in:Kw,morphs:t=>Number.parseFloat(t),declaredOut:ye.number})},{name:"string.numeric"}),Pw="a regex pattern",R3=Ge({domain:"string",predicate:{meta:Pw,predicate:(t,e)=>{try{return new RegExp(t),!0}catch(n){return e.reject({code:"predicate",expected:Pw,problem:String(n)})}}},meta:{format:"regex"}}),O3=/^(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-]+)*))?$/,_3=Xe(O3,"a semantic version (see https://semver.org/)"),qw=Xe(/^\S.*\S$|^\S?$/,"trimmed"),k3=je.module({root:Ge({in:"string",morphs:t=>t.trim(),declaredOut:qw}),preformatted:qw},{name:"string.trim"}),Iw=Xe(/^[A-Z]*$/,"only uppercase letters"),M3=je.module({root:Ge({in:"string",morphs:t=>t.toUpperCase(),declaredOut:Iw}),preformatted:Iw},{name:"string.upper"}),C3=t=>{if(URL.canParse)return URL.canParse(t);try{return new URL(t),!0}catch{return!1}},Hw=Ge({domain:"string",predicate:{meta:"a URL string",predicate:C3},meta:{format:"uri"}}),D3=je.module({root:Hw,parse:Ge({declaredIn:Hw,in:"string",morphs:(t,e)=>{try{return new URL(t)}catch{return e.error("a URL string")}},declaredOut:Ge(URL)})},{name:"string.url"}),N3=je.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:Xe(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:Xe(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:Xe(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:Xe(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:Xe(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:Xe(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:Xe(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:Xe(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),$3=je.module({root:ye.string,alpha:Xe(/^[A-Za-z]*$/,"only letters"),alphanumeric:Xe(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:t3,base64:n3,capitalize:i3,creditCard:o3,date:f3,digits:Xe(/^\d*$/,"only digits 0-9"),email:d3,integer:uE,ip:m3,json:b3,lower:v3,normalize:A3,numeric:E3,regex:R3,semver:_3,trim:k3,upper:M3,url:D3,uuid:N3},{name:"string"}),j3=je.module({bigint:ye.bigint,boolean:ye.boolean,false:ye.false,never:ye.never,null:ye.null,number:ye.number,object:ye.object,string:ye.string,symbol:ye.symbol,true:ye.true,unknown:ye.unknown,undefined:ye.undefined}),B3=je.module({root:ye.unknown,any:ye.unknown},{name:"unknown"}),L3=je.module({root:ye.jsonObject,stringify:Cy("morph",{in:ye.jsonObject,morphs:t=>JSON.stringify(t),declaredOut:ye.string})},{name:"object.json"}),V3=je.module({root:ye.object,json:L3},{name:"object"});class z3 extends yi{description='instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'}const U3=Gi(["K",ye.key],"V")(t=>({domain:"object",index:{signature:t.K,value:t.V}}),z3);class K3 extends yi{description='pick a set of properties from an object like `Pick(User, "name | age")`'}const P3=Gi(["T",ye.object],["K",ye.key])(t=>t.T.pick(t.K),K3);class q3 extends yi{description='omit a set of properties from an object like `Omit(User, "age")`'}const I3=Gi(["T",ye.object],["K",ye.key])(t=>t.T.omit(t.K),q3);class H3 extends yi{description="make all named properties of an object optional like `Partial(User)`"}const F3=Gi(["T",ye.object])(t=>t.T.partial(),H3);class G3 extends yi{description="make all named properties of an object required like `Required(User)`"}const Y3=Gi(["T",ye.object])(t=>t.T.required(),G3);class X3 extends yi{description='exclude branches of a union like `Exclude("boolean", "true")`'}const J3=Gi("T","U")(t=>t.T.exclude(t.U),X3);class Z3 extends yi{description='extract branches of a union like `Extract("0 | false | 1", "number")`'}const Q3=Gi("T","U")(t=>t.T.extract(t.U),Z3),W3=je.module({Exclude:J3,Extract:Q3,Omit:I3,Partial:F3,Pick:P3,Record:U3,Required:Y3}),Ss=KB({...j3,...W3,...QB,...IB,string:$3,number:lE,object:V3,unknown:B3},{prereducedAliases:!0,name:"ark"}),Dt=Ss.export();Object.assign(dl.ambient,Dt);dl.typeAttachments={string:Dt.string.root,number:Dt.number.root,bigint:Dt.bigint,boolean:Dt.boolean,symbol:Dt.symbol,undefined:Dt.undefined,null:Dt.null,object:Dt.object.root,unknown:Dt.unknown.root,false:Dt.false,true:Dt.true,never:Dt.never,arrayIndex:Dt.Array.index,Key:Dt.Key,Record:Dt.Record,Array:Dt.Array.root,Date:Dt.Date};const St=Object.assign(Ss.type,dl.typeAttachments);Ss.match;Ss.generic;Ss.schema;Ss.define;Ss.declare;const dE={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 eL(t){return Number.parseInt(t,10)}const tL=St(dE),nL=tL.keyof().pipe(t=>eL(t));St([nL,"string"]);function iL(t){return H.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...t,children:[H.jsx("title",{children:"Tempest Games Logo"}),H.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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}}),H.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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}}),H.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 hE(t){return H.jsx("a",{...t})}const rL={class:"_class_1riwg_1"},up=["⠋","⠙","⠸","⠴","⠦","⠇"];function sL({input:t}){const e=$.useRef(null),[n,r]=$.useState(typeof t=="string"?t:null);return $.useEffect(()=>{let o=!0,l;if(typeof t=="string")r(t);else{let c=0;l=setInterval(()=>{e.current&&(e.current.textContent=up[c],c=(c+1)%up.length)},100),t.then(d=>{o&&(clearInterval(l),r(d))})}return()=>{o=!1,l&&clearInterval(l)}},[t]),H.jsx("span",{ref:e,children:n??up[0]})}var oL=Object.create,pE=Object.defineProperty,aL=Object.getOwnPropertyDescriptor,mE=Object.getOwnPropertyNames,lL=Object.getPrototypeOf,uL=Object.prototype.hasOwnProperty,gi=(t,e)=>function(){return e||(0,t[mE(t)[0]])((e={exports:{}}).exports,e),e.exports},cL=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=mE(e),l=0,c=o.length,d;l<c;l++)d=o[l],!uL.call(t,d)&&d!==n&&pE(t,d,{get:(h=>e[h]).bind(null,d),enumerable:!(r=aL(e,d))||r.enumerable});return t},pt=(t,e,n)=>(n=t!=null?oL(lL(t)):{},cL(e||!t||!t.__esModule?pE(n,"default",{value:t,enumerable:!0}):n,t)),yE=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(r){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),fL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=yE().default;function r(o,l){if(n(o)!="object"||!o)return o;var c=o[Symbol.toPrimitive];if(c!==void 0){var d=c.call(o,l||"default");if(n(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),dL=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=yE().default,r=fL();function o(l){var c=r(l,"string");return n(c)=="symbol"?c:c+""}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}}),ws=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=dL();function r(o,l,c){return(l=n(l))in o?Object.defineProperty(o,l,{value:c,enumerable:!0,configurable:!0,writable:!0}):o[l]=c,o}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),Zn=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ws();function r(l,c){var d=Object.keys(l);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(l);c&&(h=h.filter(function(p){return Object.getOwnPropertyDescriptor(l,p).enumerable})),d.push.apply(d,h)}return d}function o(l){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?r(Object(d),!0).forEach(function(h){n(l,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(d)):r(Object(d)).forEach(function(h){Object.defineProperty(l,h,Object.getOwnPropertyDescriptor(d,h))})}return l}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}});function xf(t){const e={subscribe(n){let r=null,o=!1,l=!1,c=!1;function d(){if(r===null){c=!0;return}l||(l=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=t({next(h){var p;o||(p=n.next)===null||p===void 0||p.call(n,h)},error(h){var p;o||(o=!0,(p=n.error)===null||p===void 0||p.call(n,h),d())},complete(){var h;o||(o=!0,(h=n.complete)===null||h===void 0||h.call(n),d())}}),c&&d(),{unsubscribe:d}},pipe(...n){return n.reduce(hL,e)}};return e}function hL(t,e){return e(t)}function pL(t){const e=new AbortController;return new Promise((r,o)=>{let l=!1;function c(){l||(l=!0,d.unsubscribe())}e.signal.addEventListener("abort",()=>{o(e.signal.reason)});const d=t.subscribe({next(h){l=!0,r(h),c()},error(h){o(h)},complete(){e.abort(),c()}})})}function mL(t){return e=>{let n=0,r=null;const o=[];function l(){r||(r=e.subscribe({next(d){for(const p of o){var h;(h=p.next)===null||h===void 0||h.call(p,d)}},error(d){for(const p of o){var h;(h=p.error)===null||h===void 0||h.call(p,d)}},complete(){for(const h of o){var d;(d=h.complete)===null||d===void 0||d.call(h)}}}))}function c(){if(n===0&&r){const d=r;r=null,d.unsubscribe()}}return xf(d=>(n++,o.push(d),l(),{unsubscribe(){n--,c();const h=o.findIndex(p=>p===d);h>-1&&o.splice(h,1)}}))}}function yL(t){let e=t;const n=[],r=c=>{e!==void 0&&c.next(e),n.push(c)},o=c=>{n.splice(n.indexOf(c),1)},l=xf(c=>(r(c),()=>{o(c)}));return l.next=c=>{if(e!==c){e=c;for(const d of n)d.next(c)}},l.get=()=>e,l}function gL(t){return xf(e=>{function n(o=0,l=t.op){const c=t.links[o];if(!c)throw new Error("No more links to execute - did you forget to add an ending link?");return c({op:l,next(h){return n(o+1,h)}})}return n().subscribe(e)})}function hl(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}var bL=Object.create,gE=Object.defineProperty,vL=Object.getOwnPropertyDescriptor,bE=Object.getOwnPropertyNames,SL=Object.getPrototypeOf,wL=Object.prototype.hasOwnProperty,Nl=(t,e)=>function(){return e||(0,t[bE(t)[0]])((e={exports:{}}).exports,e),e.exports},xL=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var o=bE(e),l=0,c=o.length,d;l<c;l++)d=o[l],!wL.call(t,d)&&d!==n&&gE(t,d,{get:(h=>e[h]).bind(null,d),enumerable:!(r=vL(e,d))||r.enumerable});return t},Tf=(t,e,n)=>(n=t!=null?bL(SL(t)):{},xL(gE(n,"default",{value:t,enumerable:!0}),t));const vE=()=>{},Fw=t=>{Object.freeze&&Object.freeze(t)};function SE(t,e,n){var r;const o=e.join(".");return(r=n[o])!==null&&r!==void 0||(n[o]=new Proxy(vE,{get(l,c){if(!(typeof c!="string"||c==="then"))return SE(t,[...e,c],n)},apply(l,c,d){const h=e[e.length-1];let p={args:d,path:e};return h==="call"?p={args:d.length>=2?[d[1]]:[],path:e.slice(0,-1)}:h==="apply"&&(p={args:d.length>=2?d[1]:[],path:e.slice(0,-1)}),Fw(p.args),Fw(p.path),t(p)}})),n[o]}const TL=t=>SE(t,[],Object.create(null)),AL=t=>new Proxy(vE,{get(e,n){if(n!=="then")return t(n)}});var wE=Nl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(r){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),EL=Nl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=wE().default;function r(o,l){if(n(o)!="object"||!o)return o;var c=o[Symbol.toPrimitive];if(c!==void 0){var d=c.call(o,l||"default");if(n(d)!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(o)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),RL=Nl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=wE().default,r=EL();function o(l){var c=r(l,"string");return n(c)=="symbol"?c:c+""}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}}),xE=Nl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=RL();function r(o,l,c){return(l=n(l))in o?Object.defineProperty(o,l,{value:c,enumerable:!0,configurable:!0,writable:!0}):o[l]=c,o}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),$y=Nl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=xE();function r(l,c){var d=Object.keys(l);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(l);c&&(h=h.filter(function(p){return Object.getOwnPropertyDescriptor(l,p).enumerable})),d.push.apply(d,h)}return d}function o(l){for(var c=1;c<arguments.length;c++){var d=arguments[c]!=null?arguments[c]:{};c%2?r(Object(d),!0).forEach(function(h){n(l,h,d[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(d)):r(Object(d)).forEach(function(h){Object.defineProperty(l,h,Object.getOwnPropertyDescriptor(d,h))})}return l}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}});Tf($y());Tf(xE());var rc=Tf($y());function OL(t,e){if("error"in t){const r=e.deserialize(t.error);return{ok:!1,error:(0,rc.default)((0,rc.default)({},t),{},{error:r})}}return{ok:!0,result:(0,rc.default)((0,rc.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var cp=class extends Error{constructor(){super("Unable to transform response from server")}};function _L(t,e){let n;try{n=OL(t,e)}catch{throw new cp}if(!n.ok&&(!hl(n.error.error)||typeof n.error.error.code!="number"))throw new cp;if(n.ok&&!hl(n.result))throw new cp;return n}Tf($y());var sc=pt(ws(),1),co=pt(Zn(),1);function kL(t){return t instanceof pl}function ML(t){return hl(t)&&hl(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function CL(t,e){return typeof t=="string"?t:hl(t)&&typeof t.message=="string"?t.message:e}var pl=class gc extends Error{constructor(e,n){var r,o;const l=n?.cause;super(e,{cause:l}),(0,sc.default)(this,"cause",void 0),(0,sc.default)(this,"shape",void 0),(0,sc.default)(this,"data",void 0),(0,sc.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=l,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(o=n.result)===null||o===void 0?void 0:o.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,gc.prototype)}static from(e,n={}){const r=e;return kL(r)?(n.meta&&(r.meta=(0,co.default)((0,co.default)({},r.meta),n.meta)),r):ML(r)?new gc(r.error.message,(0,co.default)((0,co.default)({},n),{},{result:r})):new gc(CL(r,"Unknown error"),(0,co.default)((0,co.default)({},n),{},{cause:r}))}};function DL(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const Gw=t=>typeof t=="function";function NL(t){if(t)return t;if(typeof window<"u"&&Gw(window.fetch))return window.fetch;if(typeof globalThis<"u"&&Gw(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var el=pt(Zn());function $L(t){return{url:t.url.toString(),fetch:t.fetch,transformer:DL(t.transformer),methodOverride:t.methodOverride}}function jL(t){const e={};for(let n=0;n<t.length;n++){const r=t[n];e[n]=r}return e}const BL={query:"GET",mutation:"POST",subscription:"PATCH"};function TE(t){return"input"in t?t.transformer.input.serialize(t.input):jL(t.inputs.map(e=>t.transformer.input.serialize(e)))}const AE=t=>{const e=t.url.split("?");let r=e[0].replace(/\/$/,"")+"/"+t.path;const o=[];if(e[1]&&o.push(e[1]),"inputs"in t&&o.push("batch=1"),t.type==="query"||t.type==="subscription"){const l=TE(t);l!==void 0&&t.methodOverride!=="POST"&&o.push(`input=${encodeURIComponent(JSON.stringify(l))}`)}return o.length&&(r+="?"+o.join("&")),r},LL=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=TE(t);return e!==void 0?JSON.stringify(e):void 0},VL=t=>PL((0,el.default)((0,el.default)({},t),{},{contentTypeHeader:"application/json",getUrl:AE,getBody:LL}));var zL=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const UL=t=>{var e;if(t?.aborted)throw(e=t.throwIfAborted)===null||e===void 0||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new zL};async function KL(t){var e;UL(t.signal);const n=t.getUrl(t),r=t.getBody(t),o=(e=t.methodOverride)!==null&&e!==void 0?e:BL[t.type],l=await(async()=>{const d=await t.headers();return Symbol.iterator in d?Object.fromEntries(d):d})(),c=(0,el.default)((0,el.default)((0,el.default)({},t.contentTypeHeader&&o!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{"trpc-accept":t.trpcAcceptHeader}:void 0),l);return NL(t.fetch)(n,{method:o,signal:t.signal,body:r,headers:c})}async function PL(t){const e={},n=await KL(t);e.response=n;const r=await n.json();return e.responseJSON=r,{json:r,meta:e}}pt(Zn(),1);const Yw=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function Xw(t){let e=null,n=null;const r=()=>{clearTimeout(n),n=null,e=null};function o(d){const h=[[]];let p=0;for(;;){const v=d[p];if(!v)break;const S=h[h.length-1];if(v.aborted){var y;(y=v.reject)===null||y===void 0||y.call(v,new Error("Aborted")),p++;continue}if(t.validate(S.concat(v).map(T=>T.key))){S.push(v),p++;continue}if(S.length===0){var g;(g=v.reject)===null||g===void 0||g.call(v,new Error("Input is too big for a single dispatch")),p++;continue}h.push([])}return h}function l(){const d=o(e);r();for(const h of d){if(!h.length)continue;const p={items:h};for(const g of h)g.batch=p;t.fetch(p.items.map(g=>g.key)).then(async g=>{await Promise.all(g.map(async(S,x)=>{const T=p.items[x];try{var C;const O=await Promise.resolve(S);(C=T.resolve)===null||C===void 0||C.call(T,O)}catch(O){var M;(M=T.reject)===null||M===void 0||M.call(T,O)}T.batch=null,T.reject=null,T.resolve=null}));for(const S of p.items){var v;(v=S.reject)===null||v===void 0||v.call(S,new Error("Missing result")),S.batch=null}}).catch(g=>{for(const S of p.items){var v;(v=S.reject)===null||v===void 0||v.call(S,g),S.batch=null}})}}function c(d){var h;const p={aborted:!1,key:d,batch:null,resolve:Yw,reject:Yw},y=new Promise((g,v)=>{var S;p.reject=v,p.resolve=g,(S=e)!==null&&S!==void 0||(e=[]),e.push(p)});return(h=n)!==null&&h!==void 0||(n=setTimeout(l)),y}return{load:c}}function qL(...t){const e=new AbortController,n=t.length;let r=0;const o=()=>{++r===n&&e.abort()};for(const l of t)l?.aborted?o():l?.addEventListener("abort",o,{once:!0});return e.signal}var oc=pt(Zn(),1);function IL(t){var e,n;const r=$L(t),o=(e=t.maxURLLength)!==null&&e!==void 0?e:1/0,l=(n=t.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const c=y=>({validate(g){if(o===1/0&&l===1/0)return!0;if(g.length>l)return!1;const v=g.map(T=>T.path).join(","),S=g.map(T=>T.input);return AE((0,oc.default)((0,oc.default)({},r),{},{type:y,path:v,inputs:S,signal:null})).length<=o},async fetch(g){const v=g.map(O=>O.path).join(","),S=g.map(O=>O.input),x=qL(...g.map(O=>O.signal)),T=await VL((0,oc.default)((0,oc.default)({},r),{},{path:v,inputs:S,type:y,headers(){return t.headers?typeof t.headers=="function"?t.headers({opList:g}):t.headers:{}},signal:x}));return(Array.isArray(T.json)?T.json:g.map(()=>T.json)).map(O=>({meta:T.meta,json:O}))}}),d=Xw(c("query")),h=Xw(c("mutation")),p={query:d,mutation:h};return({op:y})=>xf(g=>{/* istanbul ignore if -- @preserve */if(y.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const S=p[y.type].load(y);let x;return S.then(T=>{x=T;const C=_L(T.json,r.transformer.output);if(!C.ok){g.error(pl.from(C.error,{meta:T.meta}));return}g.next({context:T.meta,result:C.result}),g.complete()}).catch(T=>{g.error(pl.from(T,{meta:x?.meta}))}),()=>{}})}}pt(Zn(),1);const EE=(t,...e)=>typeof t=="function"?t(...e):t;pt(ws(),1);function HL(){let t,e;return{promise:new Promise((r,o)=>{t=r,e=o}),resolve:t,reject:e}}async function FL(t){const e=await EE(t.url);if(!t.connectionParams)return e;const r=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+r}async function GL(t){const e={method:"connectionParams",data:await EE(t)};return JSON.stringify(e)}pt(ws(),1);var rs=pt(ws(),1);function YL(t){const{promise:e,resolve:n,reject:r}=HL();return t.addEventListener("open",()=>{t.removeEventListener("error",r),n()}),t.addEventListener("error",r),e}function XL(t,{intervalMs:e,pongTimeoutMs:n}){let r,o;function l(){r=setTimeout(()=>{t.send("PING"),o=setTimeout(()=>{t.close()},n)},e)}function c(){clearTimeout(r),l()}function d(){clearTimeout(o),c()}t.addEventListener("open",l),t.addEventListener("message",({data:h})=>{clearTimeout(r),l(),h==="PONG"&&d()}),t.addEventListener("close",()=>{clearTimeout(r),clearTimeout(o)})}var JL=class hm{constructor(e){var n;if((0,rs.default)(this,"id",++hm.connectCount),(0,rs.default)(this,"WebSocketPonyfill",void 0),(0,rs.default)(this,"urlOptions",void 0),(0,rs.default)(this,"keepAliveOpts",void 0),(0,rs.default)(this,"wsObservable",yL(null)),(0,rs.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n: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=e.urlOptions,this.keepAliveOpts=e.keepAlive}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}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(){var e=this;if(e.openPromise)return e.openPromise;e.id=++hm.connectCount;const n=FL(e.urlOptions).then(r=>new e.WebSocketPonyfill(r));e.openPromise=n.then(async r=>{e.ws=r,r.addEventListener("message",function({data:o}){o==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&XL(r,e.keepAliveOpts),r.addEventListener("close",()=>{e.ws===r&&(e.ws=null)}),await YL(r),e.urlOptions.connectionParams&&r.send(await GL(e.urlOptions.connectionParams))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,rs.default)(JL,"connectCount",0);pt(ws(),1);pt(Zn(),1);var fp=pt(ws(),1),Jw=pt(Zn(),1),ZL=class{constructor(t){(0,fp.default)(this,"links",void 0),(0,fp.default)(this,"runtime",void 0),(0,fp.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return gL({links:this.links,op:(0,Jw.default)((0,Jw.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(mL())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await pL(n)).result.data}catch(n){throw pl.from(n)}}query(t,e,n){return this.requestAsPromise({type:"query",path:t,input:e,context:n?.context,signal:n?.signal})}mutation(t,e,n){return this.requestAsPromise({type:"mutation",path:t,input:e,context:n?.context,signal:n?.signal})}subscription(t,e,n){return this.$request({type:"subscription",path:t,input:e,context:n.context,signal:n.signal}).subscribe({next(o){switch(o.result.type){case"state":{var l;(l=n.onConnectionStateChange)===null||l===void 0||l.call(n,o.result);break}case"started":{var c;(c=n.onStarted)===null||c===void 0||c.call(n,{context:o.context});break}case"stopped":{var d;(d=n.onStopped)===null||d===void 0||d.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,o.result.data);break}}},error(o){var l;(l=n.onError)===null||l===void 0||l.call(n,o)},complete(){var o;(o=n.onComplete)===null||o===void 0||o.call(n)}})}};const QL=Symbol.for("trpc_untypedClient"),WL={query:"query",mutate:"mutation",subscribe:"subscription"},eV=t=>WL[t];function tV(t){const e=TL(({path:n,args:r})=>{const o=[...n],l=eV(o.pop()),c=o.join(".");return t[l](c,...r)});return AL(n=>n===QL?t:e[n])}function nV(t){const e=new ZL(t);return tV(e)}pt(Zn(),1);pt(Zn(),1);var iV=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(o){var l,c,d,h=2;for(typeof Symbol<"u"&&(c=Symbol.asyncIterator,d=Symbol.iterator);h--;){if(c&&(l=o[c])!=null)return l.call(o);if(d&&(l=o[d])!=null)return new r(l.call(o));c="@@asyncIterator",d="@@iterator"}throw new TypeError("Object is not async iterable")}function r(o){function l(c){if(Object(c)!==c)return Promise.reject(new TypeError(c+" is not an object."));var d=c.done;return Promise.resolve(c.value).then(function(h){return{value:h,done:d}})}return r=function(d){this.s=d,this.n=d.next},r.prototype={s:null,n:null,next:function(){return l(this.n.apply(this.s,arguments))},return:function(d){var h=this.s.return;return h===void 0?Promise.resolve({value:d,done:!0}):l(h.apply(this.s,arguments))},throw:function(d){var h=this.s.return;return h===void 0?Promise.reject(d):l(h.apply(this.s,arguments))}},new r(o)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});pt(iV(),1);pt(Zn(),1);var rV=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){function n(){var r=typeof SuppressedError=="function"?SuppressedError:function(d,h){var p=Error();return p.name="SuppressedError",p.error=d,p.suppressed=h,p},o={},l=[];function c(d,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(d)var p=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(p===void 0&&(p=h[Symbol.dispose||Symbol.for("Symbol.dispose")],d))var y=p;if(typeof p!="function")throw new TypeError("Object is not disposable.");y&&(p=function(){try{y.call(h)}catch(v){return Promise.reject(v)}}),l.push({v:h,d:p,a:d})}else d&&l.push({d:h,a:d});return h}return{e:o,u:c.bind(null,!1),a:c.bind(null,!0),d:function(){var h,p=this.e,y=0;function g(){for(;h=l.pop();)try{if(!h.a&&y===1)return y=0,l.push(h),Promise.resolve().then(g);if(h.d){var S=h.d.call(h.v);if(h.a)return y|=2,Promise.resolve(S).then(g,v)}else y|=1}catch(x){return v(x)}if(y===1)return p!==o?Promise.reject(p):Promise.resolve();if(p!==o)throw p}function v(S){return p=p!==o?new r(S,p):S,g()}return g()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),RE=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(r,o){this.v=r,this.k=o}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),sV=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=RE();function r(o){return new n(o,0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),oV=gi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=RE();function r(l){return function(){return new o(l.apply(this,arguments))}}function o(l){var c,d;function h(y,g){try{var v=l[y](g),S=v.value,x=S instanceof n;Promise.resolve(x?S.v:S).then(function(T){if(x){var C=y==="return"?"return":"next";if(!S.k||T.done)return h(C,T);T=l[C](T).value}p(v.done?"return":"normal",T)},function(T){h("throw",T)})}catch(T){p("throw",T)}}function p(y,g){switch(y){case"return":c.resolve({value:g,done:!0});break;case"throw":c.reject(g);break;default:c.resolve({value:g,done:!1})}(c=c.next)?h(c.key,c.arg):d=null}this._invoke=function(y,g){return new Promise(function(v,S){var x={key:y,arg:g,resolve:v,reject:S,next:null};d?d=d.next=x:(c=d=x,h(y,g))})},typeof l.return!="function"&&(this.return=void 0)}o.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},o.prototype.next=function(l){return this._invoke("next",l)},o.prototype.throw=function(l){return this._invoke("throw",l)},o.prototype.return=function(l){return this._invoke("return",l)},e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}});pt(rV(),1);pt(sV(),1);pt(oV(),1);pt(Zn(),1);var aV={};function OE(t,e){if(t instanceof Promise)throw new Error(e)}function lV(t,e){const n={},r=[];for(const o in t){const l=t[o]["~standard"].validate(e[o]);if(OE(l,`Validation must be synchronous, but ${o} returned a Promise.`),l.issues){r.push(...l.issues.map(c=>({...c,message:c.message,path:[o,...c.path??[]]})));continue}n[o]=l.value}return r.length?{issues:r}:{value:n}}function uV(t){const e=t.runtimeEnvStrict??t.runtimeEnv??aV;if(t.emptyStringAsUndefined??!1)for(const[O,_]of Object.entries(e))_===""&&delete e[O];if(!!t.skipValidation)return e;const o=typeof t.client=="object"?t.client:{},l=typeof t.server=="object"?t.server:{},c=typeof t.shared=="object"?t.shared:{},d=t.isServer??(typeof window>"u"||"Deno"in window),h=d?{...l,...c,...o}:{...o,...c},p=t.createFinalSchema?.(h,d)["~standard"].validate(e)??lV(h,e);OE(p,"Validation must be synchronous");const y=t.onValidationError??(O=>{throw console.error("❌ Invalid environment variables:",O),new Error("Invalid environment variables")}),g=t.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(p.issues)return y(p.issues);const v=O=>t.clientPrefix?!O.startsWith(t.clientPrefix)&&!(O in c):!0,S=O=>d||!v(O),x=O=>O==="__esModule"||O==="$$typeof",T=(t.extends??[]).reduce((O,_)=>Object.assign(O,_),{}),C=Object.assign(T,p.value);return new Proxy(C,{get(O,_){if(typeof _=="string"&&!x(_))return S(_)?Reflect.get(O,_):g(_)}})}const cV={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},fV="__vite_start_time"in globalThis,dV=typeof window<"u",$i=St("string"),Zw=St('"true" | "false" | undefined'),_E=uV({isServer:!fV&&!dV,server:{CI:St("string | undefined").pipe(Boolean),POSTGRES_USER:$i,POSTGRES_PASSWORD:$i,POSTGRES_DATABASE:$i,POSTGRES_HOST:$i,POSTGRES_PORT:$i.pipe(t=>Number.parseInt(t,10)),BACKEND_PORT:$i.pipe(t=>Number.parseInt(t,10)),RUN_WORKERS_FROM_SOURCE:Zw.pipe(t=>t==="true"),FRONTEND_PORT:$i.pipe(t=>Number.parseInt(t,10)),FRONTEND_ORIGINS:$i.pipe.try(t=>JSON.parse(t),St("string[]")),API_KEY_OPENAI:St("string | undefined"),API_KEY_RESEND:St("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:$i,VITE_DEV_FRONTEND_HOST:St("string | undefined"),VITE_DEV_HTTPS:Zw.pipe(t=>t==="true")},runtimeEnv:cV,emptyStringAsUndefined:!0}),sn=nV({links:[IL({url:_E.VITE_BACKEND_ORIGIN,fetch(t,e){return e?(Object.assign(e,{credentials:"include"}),fetch(t,e)):fetch(t)}})]}),hV=lt({key:"appVersionQuery",default:sn.version.query});lt({key:"lastKnownVersion",default:null,effects:[Y1(localStorage,JSON,"lastKnownVersion")]});const pV=hi({key:"appVersion",get:async({get:t})=>{const e=t(hV),{version:n}=await e;return n}});function dp(t){return["optional",t]}function mV(t,e){let n=[t];for(const r of e){if(typeof r!="string")return!1;n=n.flatMap(o=>{if(o===null)return[];const l=[],c=o[1],d=c[r];d!==void 0&&l.push(d);const h=Object.keys(c).find(p=>p.startsWith("$"));if(h){const p=c[h];p&&l.push(p)}return l})}for(const r of n)if(r===null||r[0]==="optional")return!0;return!1}const fi=Object.create(null);fi.open="0";fi.close="1";fi.ping="2";fi.pong="3";fi.message="4";fi.upgrade="5";fi.noop="6";const bc=Object.create(null);Object.keys(fi).forEach(t=>{bc[fi[t]]=t});const pm={type:"error",data:"parser error"},kE=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",ME=typeof ArrayBuffer=="function",CE=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,jy=({type:t,data:e},n,r)=>kE&&e instanceof Blob?n?r(e):Qw(e,r):ME&&(e instanceof ArrayBuffer||CE(e))?n?r(e):Qw(new Blob([e]),r):r(fi[t]+(e||"")),Qw=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function Ww(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let hp;function yV(t,e){if(kE&&t.data instanceof Blob)return t.data.arrayBuffer().then(Ww).then(e);if(ME&&(t.data instanceof ArrayBuffer||CE(t.data)))return e(Ww(t.data));jy(t,!1,n=>{hp||(hp=new TextEncoder),e(hp.encode(n))})}const ex="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Za=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<ex.length;t++)Za[ex.charCodeAt(t)]=t;const gV=t=>{let e=t.length*.75,n=t.length,r,o=0,l,c,d,h;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const p=new ArrayBuffer(e),y=new Uint8Array(p);for(r=0;r<n;r+=4)l=Za[t.charCodeAt(r)],c=Za[t.charCodeAt(r+1)],d=Za[t.charCodeAt(r+2)],h=Za[t.charCodeAt(r+3)],y[o++]=l<<2|c>>4,y[o++]=(c&15)<<4|d>>2,y[o++]=(d&3)<<6|h&63;return p},bV=typeof ArrayBuffer=="function",By=(t,e)=>{if(typeof t!="string")return{type:"message",data:DE(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:vV(t.substring(1),e)}:bc[n]?t.length>1?{type:bc[n],data:t.substring(1)}:{type:bc[n]}:pm},vV=(t,e)=>{if(bV){const n=gV(t);return DE(n,e)}else return{base64:!0,data:t}},DE=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},NE="",SV=(t,e)=>{const n=t.length,r=new Array(n);let o=0;t.forEach((l,c)=>{jy(l,!1,d=>{r[c]=d,++o===n&&e(r.join(NE))})})},wV=(t,e)=>{const n=t.split(NE),r=[];for(let o=0;o<n.length;o++){const l=By(n[o],e);if(r.push(l),l.type==="error")break}return r};function xV(){return new TransformStream({transform(t,e){yV(t,n=>{const r=n.length;let o;if(r<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,r);else if(r<65536){o=new Uint8Array(3);const l=new DataView(o.buffer);l.setUint8(0,126),l.setUint16(1,r)}else{o=new Uint8Array(9);const l=new DataView(o.buffer);l.setUint8(0,127),l.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(o[0]|=128),e.enqueue(o),e.enqueue(n)})}})}let pp;function ac(t){return t.reduce((e,n)=>e+n.length,0)}function lc(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let o=0;o<e;o++)n[o]=t[0][r++],r===t[0].length&&(t.shift(),r=0);return t.length&&r<t[0].length&&(t[0]=t[0].slice(r)),n}function TV(t,e){pp||(pp=new TextDecoder);const n=[];let r=0,o=-1,l=!1;return new TransformStream({transform(c,d){for(n.push(c);;){if(r===0){if(ac(n)<1)break;const h=lc(n,1);l=(h[0]&128)===128,o=h[0]&127,o<126?r=3:o===126?r=1:r=2}else if(r===1){if(ac(n)<2)break;const h=lc(n,2);o=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),r=3}else if(r===2){if(ac(n)<8)break;const h=lc(n,8),p=new DataView(h.buffer,h.byteOffset,h.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(pm);break}o=y*Math.pow(2,32)+p.getUint32(4),r=3}else{if(ac(n)<o)break;const h=lc(n,o);d.enqueue(By(l?h:pp.decode(h),e)),r=0}if(o===0||o>t){d.enqueue(pm);break}}}})}const $E=4;function wt(t){if(t)return AV(t)}function AV(t){for(var e in wt.prototype)t[e]=wt.prototype[e];return t}wt.prototype.on=wt.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};wt.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};wt.prototype.off=wt.prototype.removeListener=wt.prototype.removeAllListeners=wt.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,o=0;o<n.length;o++)if(r=n[o],r===e||r.fn===e){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+t],this};wt.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,o=n.length;r<o;++r)n[r].apply(this,e)}return this};wt.prototype.emitReserved=wt.prototype.emit;wt.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};wt.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Af=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Bn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),EV="arraybuffer";function jE(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const RV=Bn.setTimeout,OV=Bn.clearTimeout;function Ef(t,e){e.useNativeTimers?(t.setTimeoutFn=RV.bind(Bn),t.clearTimeoutFn=OV.bind(Bn)):(t.setTimeoutFn=Bn.setTimeout.bind(Bn),t.clearTimeoutFn=Bn.clearTimeout.bind(Bn))}const _V=1.33;function kV(t){return typeof t=="string"?MV(t):Math.ceil((t.byteLength||t.size)*_V)}function MV(t){let e=0,n=0;for(let r=0,o=t.length;r<o;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}function BE(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function CV(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function DV(t){let e={},n=t.split("&");for(let r=0,o=n.length;r<o;r++){let l=n[r].split("=");e[decodeURIComponent(l[0])]=decodeURIComponent(l[1])}return e}class NV extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class Ly extends wt{constructor(e){super(),this.writable=!1,Ef(this,e),this.opts=e,this.query=e.query,this.socket=e.socket,this.supportsBinary=!e.forceBase64}onError(e,n,r){return super.emitReserved("error",new NV(e,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=By(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}pause(e){}createUri(e,n={}){return e+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const e=this.opts.hostname;return e.indexOf(":")===-1?e:"["+e+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(e){const n=CV(e);return n.length?"?"+n:""}}class $V extends Ly{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};wV(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,SV(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const e=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=BE()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let LE=!1;try{LE=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const jV=LE;function BV(){}class LV extends $V{constructor(e){if(super(e),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&e.hostname!==location.hostname||r!==e.port}}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(o,l)=>{this.onError("xhr post error",o,l)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}let Eo=class vc extends wt{constructor(e,n,r){super(),this.createRequest=e,Ef(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var e;const n=jE(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&r.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(e=this._opts.cookieJar)===null||e===void 0||e.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var o;r.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=vc.requestsCount++,vc.requests[this._index]=this)}_onError(e){this.emitReserved("error",e,this._xhr),this._cleanup(!0)}_cleanup(e){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=BV,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete vc.requests[this._index],this._xhr=null}}_onLoad(){const e=this._xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Eo.requestsCount=0;Eo.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",tx);else if(typeof addEventListener=="function"){const t="onpagehide"in Bn?"pagehide":"unload";addEventListener(t,tx,!1)}}function tx(){for(let t in Eo.requests)Eo.requests.hasOwnProperty(t)&&Eo.requests[t].abort()}const VV=(function(){const t=VE({xdomain:!1});return t&&t.responseType!==null})();class zV extends LV{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=VV&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new Eo(VE,this.uri(),e)}}function VE(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||jV))return new XMLHttpRequest}catch{}if(!e)try{return new Bn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const zE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class UV extends Ly{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=zE?{}:jE(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(e,n,r)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],o=n===e.length-1;jy(r,this.supportsBinary,l=>{try{this.doWrite(r,l)}catch{}o&&Af(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const e=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=BE()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const mp=Bn.WebSocket||Bn.MozWebSocket;class KV extends UV{createSocket(e,n,r){return zE?new mp(e,n,r):n?new mp(e,n):new mp(e)}doWrite(e,n){this.ws.send(n)}}class PV extends Ly{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(e){return this.emitReserved("error",e)}this._transport.closed.then(()=>{this.onClose()}).catch(e=>{this.onError("webtransport error",e)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(e=>{const n=TV(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=e.readable.pipeThrough(n).getReader(),o=xV();o.readable.pipeTo(e.writable),this._writer=o.writable.getWriter();const l=()=>{r.read().then(({done:d,value:h})=>{d||(this.onPacket(h),l())}).catch(d=>{})};l();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],o=n===e.length-1;this._writer.write(r).then(()=>{o&&Af(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const qV={websocket:KV,webtransport:PV,polling:zV},IV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,HV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function mm(t){if(t.length>8e3)throw"URI too long";const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let o=IV.exec(t||""),l={},c=14;for(;c--;)l[HV[c]]=o[c]||"";return n!=-1&&r!=-1&&(l.source=e,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,":"),l.authority=l.authority.replace("[","").replace("]","").replace(/;/g,":"),l.ipv6uri=!0),l.pathNames=FV(l,l.path),l.queryKey=GV(l,l.query),l}function FV(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.slice(0,1)=="/"||e.length===0)&&r.splice(0,1),e.slice(-1)=="/"&&r.splice(r.length-1,1),r}function GV(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,o,l){o&&(n[o]=l)}),n}const ym=typeof addEventListener=="function"&&typeof removeEventListener=="function",Sc=[];ym&&addEventListener("offline",()=>{Sc.forEach(t=>t())},!1);class Or extends wt{constructor(e,n){if(super(),this.binaryType=EV,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,e&&typeof e=="object"&&(n=e,e=null),e){const r=mm(e);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=mm(n.host).host);Ef(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(r=>{const o=r.prototype.name;this.transports.push(o),this._transportsByName[o]=r}),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=DV(this.opts.query)),ym&&(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"})},Sc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=$E,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[e]);return new this._transportsByName[e](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const e=this.opts.rememberUpgrade&&Or.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(e);n.open(),this.setTransport(n)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.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",Or.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.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=e.data,this._onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this._pingInterval=e.pingInterval,this._pingTimeout=e.pingTimeout,this._maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const e=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+e,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},e),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 e=this._getWritablePackets();this.transport.send(e),this._prevBufferLen=e.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const o=this.writeBuffer[r].data;if(o&&(n+=kV(o)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const e=Date.now()>this._pingTimeoutTime;return e&&(this._pingTimeoutTime=0,Af(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),e}write(e,n,r){return this._sendPacket("message",e,n,r),this}send(e,n,r){return this._sendPacket("message",e,n,r),this}_sendPacket(e,n,r,o){if(typeof n=="function"&&(o=n,n=void 0),typeof r=="function"&&(o=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const l={type:e,data:n,options:r};this.emitReserved("packetCreate",l),this.writeBuffer.push(l),o&&this.once("flush",o),this.flush()}close(){const e=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{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?r():e()}):this.upgrading?r():e()),this}_onError(e){if(Or.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",e),this._onClose("transport error",e)}_onClose(e,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(),ym&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Sc.indexOf(this._offlineEventListener);r!==-1&&Sc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}Or.protocol=$E;class YV extends Or{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let e=0;e<this._upgrades.length;e++)this._probe(this._upgrades[e])}_probe(e){let n=this.createTransport(e),r=!1;Or.priorWebsocketSuccess=!1;const o=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!r)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Or.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||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 l(){r||(r=!0,y(),n.close(),n=null)}const c=g=>{const v=new Error("probe error: "+g);v.transport=n.name,l(),this.emitReserved("upgradeError",v)};function d(){c("transport closed")}function h(){c("socket closed")}function p(g){n&&g.name!==n.name&&l()}const y=()=>{n.removeListener("open",o),n.removeListener("error",c),n.removeListener("close",d),this.off("close",h),this.off("upgrading",p)};n.once("open",o),n.once("error",c),n.once("close",d),this.once("close",h),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&e!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(e){this._upgrades=this._filterUpgrades(e.upgrades),super.onHandshake(e)}_filterUpgrades(e){const n=[];for(let r=0;r<e.length;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}let XV=class extends YV{constructor(e,n={}){const r=typeof e=="object"?e:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(o=>qV[o]).filter(o=>!!o)),super(e,r)}};function JV(t,e="",n){let r=t;n=n||typeof location<"u"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n<"u"?t=n.protocol+"//"+t:t="https://"+t),r=mm(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const l=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+l+":"+r.port+e,r.href=r.protocol+"://"+l+(n&&n.port===r.port?"":":"+r.port),r}const ZV=typeof ArrayBuffer=="function",QV=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,UE=Object.prototype.toString,WV=typeof Blob=="function"||typeof Blob<"u"&&UE.call(Blob)==="[object BlobConstructor]",e4=typeof File=="function"||typeof File<"u"&&UE.call(File)==="[object FileConstructor]";function Vy(t){return ZV&&(t instanceof ArrayBuffer||QV(t))||WV&&t instanceof Blob||e4&&t instanceof File}function wc(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(wc(t[n]))return!0;return!1}if(Vy(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return wc(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&wc(t[n]))return!0;return!1}function t4(t){const e=[],n=t.data,r=t;return r.data=gm(n,e),r.attachments=e.length,{packet:r,buffers:e}}function gm(t,e){if(!t)return t;if(Vy(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=gm(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=gm(t[r],e));return n}return t}function n4(t,e){return t.data=bm(t.data,e),delete t.attachments,t}function bm(t,e){if(!t)return t;if(t&&t._placeholder===!0){if(typeof t.num=="number"&&t.num>=0&&t.num<e.length)return e[t.num];throw new Error("illegal attachments")}else if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=bm(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=bm(t[n],e));return t}const i4=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],r4=5;var _e;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(_e||(_e={}));class s4{constructor(e){this.replacer=e}encode(e){return(e.type===_e.EVENT||e.type===_e.ACK)&&wc(e)?this.encodeAsBinary({type:e.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===_e.BINARY_EVENT||e.type===_e.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=t4(e),r=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(r),o}}function nx(t){return Object.prototype.toString.call(t)==="[object Object]"}class zy extends wt{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(e);const r=n.type===_e.BINARY_EVENT;r||n.type===_e.BINARY_ACK?(n.type=r?_e.EVENT:_e.ACK,this.reconstructor=new o4(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Vy(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),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: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(_e[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===_e.BINARY_EVENT||r.type===_e.BINARY_ACK){const l=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const c=e.substring(l,n);if(c!=Number(c)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(c)}if(e.charAt(n+1)==="/"){const l=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(l,n)}else r.nsp="/";const o=e.charAt(n+1);if(o!==""&&Number(o)==o){const l=n+1;for(;++n;){const c=e.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===e.length)break}r.id=Number(e.substring(l,n+1))}if(e.charAt(++n)){const l=this.tryParse(e.substr(n));if(zy.isPayloadValid(r.type,l))r.data=l;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case _e.CONNECT:return nx(n);case _e.DISCONNECT:return n===void 0;case _e.CONNECT_ERROR:return typeof n=="string"||nx(n);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&i4.indexOf(n[0])===-1);case _e.ACK:case _e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class o4{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=n4(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const a4=Object.freeze(Object.defineProperty({__proto__:null,Decoder:zy,Encoder:s4,get PacketType(){return _e},protocol:r4},Symbol.toStringTag,{value:"Module"}));function Gn(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const l4=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class KE extends wt{constructor(e,n,r){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=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[Gn(e,"open",this.onopen.bind(this)),Gn(e,"packet",this.onpacket.bind(this)),Gn(e,"error",this.onerror.bind(this)),Gn(e,"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(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){var r,o,l;if(l4.hasOwnProperty(e))throw new Error('"'+e.toString()+'" is a reserved event name');if(n.unshift(e),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:_e.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=(o=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||o===void 0?void 0:o.writable,h=this.connected&&!(!((l=this.io.engine)===null||l===void 0)&&l._hasPingExpired());return this.flags.volatile&&!d||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(e,n){var r;const o=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(o===void 0){this.acks[e]=n;return}const l=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===e&&this.sendBuffer.splice(d,1);n.call(this,new Error("operation has timed out"))},o),c=(...d)=>{this.io.clearTimeoutFn(l),n.apply(this,d)};c.withError=!0,this.acks[e]=c}emitWithAck(e,...n){return new Promise((r,o)=>{const l=(c,d)=>c?o(c):r(d);l.withError=!0,n.push(l),this.emit(e,...n)})}_addToQueue(e){let n;typeof e[e.length-1]=="function"&&(n=e.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:e,flags:Object.assign({fromQueue:!0},this.flags)};e.push((o,...l)=>r!==this._queue[0]?void 0:(o!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...l)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(e=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!e||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this._sendConnectPacket(e)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(e){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},e):e})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(e=>{if(!this.sendBuffer.some(r=>String(r.id)===e)){const r=this.acks[e];delete this.acks[e],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case _e.CONNECT:e.data&&e.data.sid?this.onconnect(e.data.sid,e.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 _e.EVENT:case _e.BINARY_EVENT:this.onevent(e);break;case _e.ACK:case _e.BINARY_ACK:this.onack(e);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e),this._pid&&e.length&&typeof e[e.length-1]=="string"&&(this._lastOffset=e[e.length-1])}ack(e){const n=this;let r=!1;return function(...o){r||(r=!0,n.packet({type:_e.ACK,id:e,data:o}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(delete this.acks[e.id],n.withError&&e.data.unshift(null),n.apply(this,e.data))}onconnect(e,n){this.id=e,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function qo(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}qo.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};qo.prototype.reset=function(){this.attempts=0};qo.prototype.setMin=function(t){this.ms=t};qo.prototype.setMax=function(t){this.max=t};qo.prototype.setJitter=function(t){this.jitter=t};class vm extends wt{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Ef(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((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new qo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const o=n.parser||a4;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,e||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new XV(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const o=Gn(n,"open",function(){r.onopen(),e&&e()}),l=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),e?e(d):this.maybeReconnectOnOpen()},c=Gn(n,"error",l);if(this._timeout!==!1){const d=this._timeout,h=this.setTimeoutFn(()=>{o(),l(new Error("timeout")),n.close()},d);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(o),this.subs.push(c),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(Gn(e,"ping",this.onping.bind(this)),Gn(e,"data",this.ondata.bind(this)),Gn(e,"error",this.onerror.bind(this)),Gn(e,"close",this.onclose.bind(this)),Gn(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){try{this.decoder.add(e)}catch(n){this.onclose("parse error",n)}}ondecoded(e){Af(()=>{this.emitReserved("packet",e)},this.setTimeoutFn)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r?this._autoConnect&&!r.active&&r.connect():(r=new KE(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(e,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=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 r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(o=>{o?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",o)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const Fa={};function xc(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=JV(t,e.path||"/socket.io"),r=n.source,o=n.id,l=n.path,c=Fa[o]&&l in Fa[o].nsps,d=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let h;return d?h=new vm(r,e):(Fa[o]||(Fa[o]=new vm(r,e)),h=Fa[o]),n.query&&!e.query&&(e.query=n.queryKey),h.socket(n.path,e)}Object.assign(xc,{Manager:vm,Socket:KE,io:xc,connect:xc});const u4=["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"],c4=3,f4=15,d4=/^[a-zA-Z0-9_-]+$/,h4=St(d4).pipe(St(`string > ${c4} & string < ${f4}`)).brand("username"),ix=20,rx={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function p4(t){let e="";for(const n of t)n in rx?e+=rx[n]:e+=n;return e}function m4(t){const e=t.toLocaleLowerCase(),n=p4(e);for(const r of u4)if(n.includes(r)||e.includes(r))return!0;return!1}function y4(t){const e=new Set(t).size;return t.length*Math.log2(e)}function g4(t){let e=0;return m4(t)&&(e-=100),e+=y4(t)*.5,Math.max(e,0)}const b4=St("string").narrow((t,e)=>{const n=g4(t);return n>=ix?!0:e.mustBe(`Of complexity ${ix} or more. Was ${n.toFixed(2)}.`)}).brand("password");St({"+":"delete",email:"string",password:"string"});const v4=St("string").brand("email");St({"+":"delete",username:"string",password:"string",email:"string"});const S4=St({email:"string",userId:"string",username:"string",password:"boolean",verification:"'unverified' | 'verified'"}),di=xc(_E.VITE_BACKEND_ORIGIN,{auth:t=>{const e=Ze(ot);e&&t(e)},withCredentials:!0,autoConnect:!1});di.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),De(ot,null)}).on("usernameChanged",t=>{De(ot,e=>e===null?null:{...e,username:t})});const ot=lt({key:"auth",default:function(){const e=localStorage.getItem("auth");if(e)try{const n=Nr(e),r=S4(n);return r instanceof St.errors?(console.error("failed to parse auth data",r),null):(r.verification==="verified"&&(console.log("connecting..."),di.connect()),r)}catch(n){return console.error("failed to parse auth data",n),null}return null},effects:[function({onSet:e}){e(({newValue:n})=>{console.log("setting auth",n),n?(console.log("setting auth",n),De(Ro,n.username),localStorage.setItem("auth",$t(n)),n.verification==="verified"?(console.log("connecting..."),di.connect()):ys("/verify")):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]}),Ro=lt({key:"username",default:Ze(ot)?.username??""}),yp=lt({key:"usernameDebounce",default:!0}),w4=lt({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:t})=>{tM(Ro,()=>{Ze(yp)&&(t(Ze(Ro)),De(yp,!1),setTimeout(()=>{De(yp,!0),t(Ze(Ro))},2e3))})}]}),x4=hi({key:"isUsernameTakenQuery",get:({get:t})=>{const e=t(w4);if(!e)return!1;const n=Ze(ot);return e===n?.username?!1:sn.isUsernameTaken.query({username:e})}}),PE=hi({key:"usernameIssues",get:({get:t})=>{const e=t(Ro),n=h4(e);return n instanceof St.errors?n:null}}),ai=lt({key:"password0",default:""}),qE=hi({key:"password0Issues",get:({get:t})=>{const e=t(ai),n=b4(e);return n instanceof St.errors?n:null}}),Lo=lt({key:"email",default:""}),IE=hi({key:"emailIssues",get:({get:t})=>{const e=t(Lo),n=v4(e);return n instanceof St.errors?n:null}});hi({key:"signupReady",get:({get:t})=>{const e=t(PE),n=t(qE),r=t(IE);return!(e??n??r)}});const zi=lt({key:"oneTimeCode",default:""}),Sm=lt({key:"oneTimeCodeNewEmail",default:""}),si=lt({key:"authTarget",default:null}),HE=dp({verify:dp({$token:null}),game:dp({clicker:null}),account:null,admin:null});function T4(t){return mV(HE,t)}const A4=[[]];function E4(t){return A4.some(e=>e.join("/")===t.join("/"))}function ys(t){history.pushState(null,"",t),De(FE,t)}const FE=lt({key:"pathName",default:window.location.pathname,effects:[({onSet:t,setSelf:e})=>{const n=o=>{history.replaceState(null,"",o),e(o)},r=o=>{switch(o){case"/":{const l=Ze(ot);switch(console.log("/","auth",l),l?.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{Ze(ot)?.verification==="verified"&&n("/game");break}case"/game":case"/game/clicker":{Ze(ot)?.verification==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const l=Ze(ot);if(!l){n("/");break}l.verification==="unverified"&&n("/verify");break}}};r(window.location.pathname),t(({newValue:o})=>{r(o)})},({setSelf:t})=>{document.addEventListener("click",e=>{const n=e.target.closest("a");if(n&&n instanceof HTMLAnchorElement){const r=n.getAttribute("href");r?.startsWith("/")&&(e.preventDefault(),history.pushState(null,"",r),t(r))}}),window.addEventListener("popstate",()=>{t(window.location.pathname)})}]}),R4=hi({key:"route",get:({get:t})=>{const n=t(FE).split("/").slice(1).filter(Boolean);return T4(n)?E4(n)||t(ot)?n:401:404}}),sx=lt({key:"buttonBlockActive",default:!1}),Nn=lt({key:"editing",default:[],effects:[({onSet:t})=>{t(({newValue:e})=>{switch(e[0]){case"email":{Ze(GE)?.focus();break}case"new-password":{Ze(YE)?.focus();break}case"username":{Ze(XE)?.focus();break}}})}]}),GE=lt({key:"emailInputElement",default:null}),YE=lt({key:"password0InputElement",default:null}),XE=lt({key:"usernameInputElement",default:null});function O4(t){const e=$.useRef(null);return $.useEffect(()=>{De(t,e.current)},[t]),e}const _4=hi({key:"otcLoginFieldLabel",get:({get:t})=>{const e=t(ot);return e?`Code sent to ${e.email}`:""}}),k4=hi({key:"otcVerifyFieldLabel",get:({get:t})=>{const e=t(Lo);return e?`Code sent to ${e}`:""}});function gp({label:t,inputToken:e,issuesToken:n,inputElementToken:r,initialState:o,onSubmit:l,onOpen:c,onCancel:d,extraIssues:h}){const p=vt(e),y=Yn(e),g=vt(zi),v=Yn(zi),S=vt(Sm),x=Yn(Sm),T=vt(ai),C=Yn(ai),M=vt(sx),O=Yn(sx),_=vt(Nn),G=Yn(Nn),z=vt(n),ee=vt(_4),te=vt(k4),X=O4(r),pe=_[0]===t,me=_.at(-1),[Se,...Ce]=_;return H.jsxs("form",{onSubmit:async ge=>{if(ge.preventDefault(),M){O(!1);return}console.log(`submitted! changing ${t} to`,p);const J=await l(p);Error.isError(J)&&console.error(J)},children:[pe?H.jsx("button",{type:"button",onClick:async()=>{await d?.(),G([])},children:"x"}):null,H.jsxs("main",{children:[H.jsxs("label",{htmlFor:t,children:[z||h?H.jsxs("aside",{children:[h,z?.map(ge=>H.jsx("span",{children:ge.message},ge.path.join(".")))]}):null,H.jsx("span",{children:t==="new-password"?"Password":ns(t)}),H.jsx("input",{id:t,type:t==="new-password"?"password":"text",ref:X,value:p,onChange:ge=>{y(ge.target.value)},autoComplete:t,autoCapitalize:"none",disabled:me!==t})]}),pe?Ce.map(ge=>H.jsxs("label",{htmlFor:`${t}-${ge}`,children:[H.jsx("span",{children:(()=>{switch(ge){case"otcLogin":return ee;case"otcVerify":return te;case"passwordLogin":return"Password"}})()}),H.jsx("input",{id:`${t}-otc`,type:"text",ref:X,value:(()=>{switch(ge){case"otcLogin":return g;case"otcVerify":return t==="email"?S:g;case"passwordLogin":return T}})(),onChange:J=>{switch(ge){case"otcLogin":v(J.target.value);break;case"otcVerify":if(t==="email"){x(J.target.value);break}v(J.target.value);break;case"passwordLogin":C(J.target.value)}},autoComplete:t.includes("otc")?"one-time-code":t.includes("password")?"password":"",autoCapitalize:"none",disabled:ge!==me})]},`${t}-${ge}`)):null]}),_[0]===t?H.jsx("button",{type:"submit",children:"->"}):H.jsx("button",{type:"button",onMouseDown:async()=>{O(!0),await c?.(),G(o)},onMouseUp:()=>{O(!1)},children:"/"})]})}function M4(){const t=vt(ot),e=vt(x4);return $.useEffect(()=>{t&&De(Lo,t.email),t?.password&&De(ai,"••••••••••••")},[]),t?H.jsxs("article",{"data-css":"editor",children:[H.jsx(gp,{label:"username",inputToken:Ro,issuesToken:PE,inputElementToken:XE,initialState:["username"],onSubmit:async n=>(await new Promise(r=>{di.once("usernameChanged",r),di.emit("changeUsername",n)}),De(Nn,[]),n),extraIssues:e?H.jsx("span",{children:"This username is taken."}):null}),H.jsx(gp,{label:"email",inputToken:Lo,issuesToken:IE,inputElementToken:GE,initialState:["email"],onSubmit:async n=>{const r=Ze(Nn);if(r[0]!=="email")return new Error("field not email");switch(r.length){case 1:{const{userKey:o,nextStep:l}=await sn.offerNewEmail.mutate({emailOffered:n});switch(console.log({authTarget:o,nextStep:l}),l){case"otc_login":{De(si,o),De(Nn,["email","otcLogin"]);break}case"password_login":{De(si,o),De(Nn,["email","passwordLogin"]);break}case"otc_verify":{De(si,o),De(zi,"not needed"),De(Nn,["email","otcLogin","otcVerify"]);break}}return o}case 2:switch(console.log("case 2"),r[1]){case"otcLogin":{console.log("case 2.1");const o=Ze(si);if(!o)return new Error("No auth target");const l=Ze(zi),c=await sn.verifyAccountAction.mutate({oneTimeCode:l,userKey:o});return De(ot,c),De(Nn,["email","otcLogin","otcVerify"]),o}case"passwordLogin":return new Error("not implemented")}break;case 3:{const o=Ze(si);if(!o)return new Error("No auth target");const l=Ze(Sm),c=await sn.verifyAccountAction.mutate({oneTimeCode:l,userKey:o});return De(ot,c),De(Nn,[]),c.email}}}}),H.jsx(gp,{label:"new-password",inputToken:ai,issuesToken:qE,inputElementToken:YE,initialState:t.password?["new-password","otcVerify"]:["new-password"],onSubmit:async n=>{const r=Ze(Nn);if(r[0]!=="new-password")return new Error("field not new-password");switch(r.length){case 1:return await sn.setPassword.mutate({password:n}),De(ai,"••••••••••••"),De(ot,o=>o&&{...o,password:!0}),De(Nn,[]),"done";case 2:{const o=Ze(si);return o?(await sn.verifyAccountAction.mutate({oneTimeCode:Ze(zi),userKey:o}),De(ot,l=>l&&{...l,password:!1}),De(ai,""),De(Nn,["new-password"]),"done"):new Error("No userKey")}}},onCancel:()=>{t.password&&De(ai,"••••••••••••")},onOpen:async()=>{if(t.password){const n=Ze(si);if(!n)return new Error("No userKey");await sn.startPasswordReset.mutate({userKey:n})}}})]}):H.jsx("p",{children:"You must be logged in to verify your account."})}function C4(){return H.jsx("article",{children:H.jsx("h1",{children:"admin"})})}const Uy=lt({key:"count",default:0}),JE=nM({key:"incrementTX",do:({set:t})=>{t(Uy,e=>e+1)}}),D4=YM({key:"countContinuity",config:t=>t.add(Uy).add(JE)});function N4({route:[,t]}){return H.jsx("article",{children:t?H.jsx(j4,{gameId:t}):H.jsx($4,{})})}function $4(){return H.jsx("nav",{children:H.jsx(hE,{href:"/game/clicker",children:"Clicker"})})}rM(HE[1].game[1]);function j4({gameId:t}){console.log(t);const e=vt(Uy),n=iM(JE);return iC(D4),H.jsxs("article",{children:[H.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",e]}),H.jsx("p",{children:"Let's see how high we can count!"})]})}const ZE=$.createContext({});function B4(t){const e=$.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ky=typeof window<"u",L4=Ky?$.useLayoutEffect:$.useEffect,Py=$.createContext(null);function qy(t,e){t.indexOf(e)===-1&&t.push(e)}function Iy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Hi=(t,e,n)=>n>e?e:n<t?t:n;let Hy=()=>{};const Fi={},QE=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function WE(t){return typeof t=="object"&&t!==null}const eR=t=>/^0[^.\s]+$/u.test(t);function Fy(t){let e;return()=>(e===void 0&&(e=t()),e)}const zn=t=>t,V4=(t,e)=>n=>e(t(n)),$l=(...t)=>t.reduce(V4),ml=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Gy{constructor(){this.subscriptions=[]}add(e){return qy(this.subscriptions,e),()=>Iy(this.subscriptions,e)}notify(e,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](e,n,r);else for(let l=0;l<o;l++){const c=this.subscriptions[l];c&&c(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ui=t=>t*1e3,Vn=t=>t/1e3;function tR(t,e){return e?t*(1e3/e):0}const nR=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,z4=1e-7,U4=12;function K4(t,e,n,r,o){let l,c,d=0;do c=e+(n-e)/2,l=nR(c,r,o)-t,l>0?n=c:e=c;while(Math.abs(l)>z4&&++d<U4);return c}function jl(t,e,n,r){if(t===e&&n===r)return zn;const o=l=>K4(l,0,1,t,n);return l=>l===0||l===1?l:nR(o(l),e,r)}const iR=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,rR=t=>e=>1-t(1-e),sR=jl(.33,1.53,.69,.99),Yy=rR(sR),oR=iR(Yy),aR=t=>(t*=2)<1?.5*Yy(t):.5*(2-Math.pow(2,-10*(t-1))),Xy=t=>1-Math.sin(Math.acos(t)),lR=rR(Xy),uR=iR(Xy),P4=jl(.42,0,1,1),q4=jl(0,0,.58,1),cR=jl(.42,0,.58,1),I4=t=>Array.isArray(t)&&typeof t[0]!="number",fR=t=>Array.isArray(t)&&typeof t[0]=="number",H4={linear:zn,easeIn:P4,easeInOut:cR,easeOut:q4,circIn:Xy,circInOut:uR,circOut:lR,backIn:Yy,backInOut:oR,backOut:sR,anticipate:aR},F4=t=>typeof t=="string",ox=t=>{if(fR(t)){Hy(t.length===4);const[e,n,r,o]=t;return jl(e,n,r,o)}else if(F4(t))return H4[t];return t},uc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function G4(t,e){let n=new Set,r=new Set,o=!1,l=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1};function h(y){c.has(y)&&(p.schedule(y),t()),y(d)}const p={schedule:(y,g=!1,v=!1)=>{const x=v&&o?n:r;return g&&c.add(y),x.has(y)||x.add(y),y},cancel:y=>{r.delete(y),c.delete(y)},process:y=>{if(d=y,o){l=!0;return}o=!0,[n,r]=[r,n],n.forEach(h),n.clear(),o=!1,l&&(l=!1,p.process(y))}};return p}const Y4=40;function dR(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},l=()=>n=!0,c=uc.reduce((_,G)=>(_[G]=G4(l),_),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:y,update:g,preRender:v,render:S,postRender:x}=c,T=()=>{const _=Fi.useManualTiming?o.timestamp:performance.now();n=!1,Fi.useManualTiming||(o.delta=r?1e3/60:Math.max(Math.min(_-o.timestamp,Y4),1)),o.timestamp=_,o.isProcessing=!0,d.process(o),h.process(o),p.process(o),y.process(o),g.process(o),v.process(o),S.process(o),x.process(o),o.isProcessing=!1,n&&e&&(r=!1,t(T))},C=()=>{n=!0,r=!0,o.isProcessing||t(T)};return{schedule:uc.reduce((_,G)=>{const z=c[G];return _[G]=(ee,te=!1,X=!1)=>(n||C(),z.schedule(ee,te,X)),_},{}),cancel:_=>{for(let G=0;G<uc.length;G++)c[uc[G]].cancel(_)},state:o,steps:c}}const{schedule:Qe,cancel:Mr,state:zt,steps:bp}=dR(typeof requestAnimationFrame<"u"?requestAnimationFrame:zn,!0);let Tc;function X4(){Tc=void 0}const on={now:()=>(Tc===void 0&&on.set(zt.isProcessing||Fi.useManualTiming?zt.timestamp:performance.now()),Tc),set:t=>{Tc=t,queueMicrotask(X4)}},hR=t=>e=>typeof e=="string"&&e.startsWith(t),Jy=hR("--"),J4=hR("var(--"),Zy=t=>J4(t)?Z4.test(t.split("/*")[0].trim()):!1,Z4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Io={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},yl={...Io,transform:t=>Hi(0,1,t)},cc={...Io,default:1},tl=t=>Math.round(t*1e5)/1e5,Qy=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Q4(t){return t==null}const W4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Wy=(t,e)=>n=>!!(typeof n=="string"&&W4.test(n)&&n.startsWith(t)||e&&!Q4(n)&&Object.prototype.hasOwnProperty.call(n,e)),pR=(t,e,n)=>r=>{if(typeof r!="string")return r;const[o,l,c,d]=r.match(Qy);return{[t]:parseFloat(o),[e]:parseFloat(l),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},ez=t=>Hi(0,255,t),vp={...Io,transform:t=>Math.round(ez(t))},as={test:Wy("rgb","red"),parse:pR("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+vp.transform(t)+", "+vp.transform(e)+", "+vp.transform(n)+", "+tl(yl.transform(r))+")"};function tz(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const wm={test:Wy("#"),parse:tz,transform:as.transform},Bl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Sr=Bl("deg"),ci=Bl("%"),he=Bl("px"),nz=Bl("vh"),iz=Bl("vw"),ax={...ci,parse:t=>ci.parse(t)/100,transform:t=>ci.transform(t*100)},mo={test:Wy("hsl","hue"),parse:pR("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+ci.transform(tl(e))+", "+ci.transform(tl(n))+", "+tl(yl.transform(r))+")"},bt={test:t=>as.test(t)||wm.test(t)||mo.test(t),parse:t=>as.test(t)?as.parse(t):mo.test(t)?mo.parse(t):wm.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?as.transform(t):mo.transform(t),getAnimatableNone:t=>{const e=bt.parse(t);return e.alpha=0,bt.transform(e)}},rz=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sz(t){return isNaN(t)&&typeof t=="string"&&(t.match(Qy)?.length||0)+(t.match(rz)?.length||0)>0}const mR="number",yR="color",oz="var",az="var(",lx="${}",lz=/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 gl(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},o=[];let l=0;const d=e.replace(lz,h=>(bt.test(h)?(r.color.push(l),o.push(yR),n.push(bt.parse(h))):h.startsWith(az)?(r.var.push(l),o.push(oz),n.push(h)):(r.number.push(l),o.push(mR),n.push(parseFloat(h))),++l,lx)).split(lx);return{values:n,split:d,indexes:r,types:o}}function gR(t){return gl(t).values}function bR(t){const{split:e,types:n}=gl(t),r=e.length;return o=>{let l="";for(let c=0;c<r;c++)if(l+=e[c],o[c]!==void 0){const d=n[c];d===mR?l+=tl(o[c]):d===yR?l+=bt.transform(o[c]):l+=o[c]}return l}}const uz=t=>typeof t=="number"?0:bt.test(t)?bt.getAnimatableNone(t):t;function cz(t){const e=gR(t);return bR(t)(e.map(uz))}const Cr={test:sz,parse:gR,createTransformer:bR,getAnimatableNone:cz};function Sp(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function fz({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let o=0,l=0,c=0;if(!e)o=l=c=n;else{const d=n<.5?n*(1+e):n+e-n*e,h=2*n-d;o=Sp(h,d,t+1/3),l=Sp(h,d,t),c=Sp(h,d,t-1/3)}return{red:Math.round(o*255),green:Math.round(l*255),blue:Math.round(c*255),alpha:r}}function Gc(t,e){return n=>n>0?e:t}const tt=(t,e,n)=>t+(e-t)*n,wp=(t,e,n)=>{const r=t*t,o=n*(e*e-r)+r;return o<0?0:Math.sqrt(o)},dz=[wm,as,mo],hz=t=>dz.find(e=>e.test(t));function ux(t){const e=hz(t);if(!e)return!1;let n=e.parse(t);return e===mo&&(n=fz(n)),n}const cx=(t,e)=>{const n=ux(t),r=ux(e);if(!n||!r)return Gc(t,e);const o={...n};return l=>(o.red=wp(n.red,r.red,l),o.green=wp(n.green,r.green,l),o.blue=wp(n.blue,r.blue,l),o.alpha=tt(n.alpha,r.alpha,l),as.transform(o))},xm=new Set(["none","hidden"]);function pz(t,e){return xm.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function mz(t,e){return n=>tt(t,e,n)}function eg(t){return typeof t=="number"?mz:typeof t=="string"?Zy(t)?Gc:bt.test(t)?cx:bz:Array.isArray(t)?vR:typeof t=="object"?bt.test(t)?cx:yz:Gc}function vR(t,e){const n=[...t],r=n.length,o=t.map((l,c)=>eg(l)(l,e[c]));return l=>{for(let c=0;c<r;c++)n[c]=o[c](l);return n}}function yz(t,e){const n={...t,...e},r={};for(const o in n)t[o]!==void 0&&e[o]!==void 0&&(r[o]=eg(t[o])(t[o],e[o]));return o=>{for(const l in r)n[l]=r[l](o);return n}}function gz(t,e){const n=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const l=e.types[o],c=t.indexes[l][r[l]],d=t.values[c]??0;n[o]=d,r[l]++}return n}const bz=(t,e)=>{const n=Cr.createTransformer(e),r=gl(t),o=gl(e);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?xm.has(t)&&!o.values.length||xm.has(e)&&!r.values.length?pz(t,e):$l(vR(gz(r,o),o.values),n):Gc(t,e)};function SR(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?tt(t,e,n):eg(t)(t,e)}const vz=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Qe.update(e,n),stop:()=>Mr(e),now:()=>zt.isProcessing?zt.timestamp:on.now()}},wR=(t,e,n=10)=>{let r="";const o=Math.max(Math.round(e/n),2);for(let l=0;l<o;l++)r+=Math.round(t(l/(o-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},Yc=2e4;function tg(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<Yc;)e+=n,r=t.next(e);return e>=Yc?1/0:e}function Sz(t,e=100,n){const r=n({...t,keyframes:[0,e]}),o=Math.min(tg(r),Yc);return{type:"keyframes",ease:l=>r.next(o*l).value/e,duration:Vn(o)}}const wz=5;function xR(t,e,n){const r=Math.max(e-wz,0);return tR(n-t(r),e-r)}const st={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},xp=.001;function xz({duration:t=st.duration,bounce:e=st.bounce,velocity:n=st.velocity,mass:r=st.mass}){let o,l,c=1-e;c=Hi(st.minDamping,st.maxDamping,c),t=Hi(st.minDuration,st.maxDuration,Vn(t)),c<1?(o=p=>{const y=p*c,g=y*t,v=y-n,S=Tm(p,c),x=Math.exp(-g);return xp-v/S*x},l=p=>{const g=p*c*t,v=g*n+n,S=Math.pow(c,2)*Math.pow(p,2)*t,x=Math.exp(-g),T=Tm(Math.pow(p,2),c);return(-o(p)+xp>0?-1:1)*((v-S)*x)/T}):(o=p=>{const y=Math.exp(-p*t),g=(p-n)*t+1;return-xp+y*g},l=p=>{const y=Math.exp(-p*t),g=(n-p)*(t*t);return y*g});const d=5/t,h=Az(o,l,d);if(t=ui(t),isNaN(h))return{stiffness:st.stiffness,damping:st.damping,duration:t};{const p=Math.pow(h,2)*r;return{stiffness:p,damping:c*2*Math.sqrt(r*p),duration:t}}}const Tz=12;function Az(t,e,n){let r=n;for(let o=1;o<Tz;o++)r=r-t(r)/e(r);return r}function Tm(t,e){return t*Math.sqrt(1-e*e)}const Ez=["duration","bounce"],Rz=["stiffness","damping","mass"];function fx(t,e){return e.some(n=>t[n]!==void 0)}function Oz(t){let e={velocity:st.velocity,stiffness:st.stiffness,damping:st.damping,mass:st.mass,isResolvedFromDuration:!1,...t};if(!fx(t,Rz)&&fx(t,Ez))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,l=2*Hi(.05,1,1-(t.bounce||0))*Math.sqrt(o);e={...e,mass:st.mass,stiffness:o,damping:l}}else{const n=xz(t);e={...e,...n,mass:st.mass},e.isResolvedFromDuration=!0}return e}function Xc(t=st.visualDuration,e=st.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:o}=n;const l=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],d={done:!1,value:l},{stiffness:h,damping:p,mass:y,duration:g,velocity:v,isResolvedFromDuration:S}=Oz({...n,velocity:-Vn(n.velocity||0)}),x=v||0,T=p/(2*Math.sqrt(h*y)),C=c-l,M=Vn(Math.sqrt(h/y)),O=Math.abs(C)<5;r||(r=O?st.restSpeed.granular:st.restSpeed.default),o||(o=O?st.restDelta.granular:st.restDelta.default);let _;if(T<1){const z=Tm(M,T);_=ee=>{const te=Math.exp(-T*M*ee);return c-te*((x+T*M*C)/z*Math.sin(z*ee)+C*Math.cos(z*ee))}}else if(T===1)_=z=>c-Math.exp(-M*z)*(C+(x+M*C)*z);else{const z=M*Math.sqrt(T*T-1);_=ee=>{const te=Math.exp(-T*M*ee),X=Math.min(z*ee,300);return c-te*((x+T*M*C)*Math.sinh(X)+z*C*Math.cosh(X))/z}}const G={calculatedDuration:S&&g||null,next:z=>{const ee=_(z);if(S)d.done=z>=g;else{let te=z===0?x:0;T<1&&(te=z===0?ui(x):xR(_,z,ee));const X=Math.abs(te)<=r,pe=Math.abs(c-ee)<=o;d.done=X&&pe}return d.value=d.done?c:ee,d},toString:()=>{const z=Math.min(tg(G),Yc),ee=wR(te=>G.next(z*te).value,z,30);return z+"ms "+ee},toTransition:()=>{}};return G}Xc.applyToOptions=t=>{const e=Sz(t,100,Xc);return t.ease=e.ease,t.duration=ui(e.duration),t.type="keyframes",t};function Am({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:l=500,modifyTarget:c,min:d,max:h,restDelta:p=.5,restSpeed:y}){const g=t[0],v={done:!1,value:g},S=X=>d!==void 0&&X<d||h!==void 0&&X>h,x=X=>d===void 0?h:h===void 0||Math.abs(d-X)<Math.abs(h-X)?d:h;let T=n*e;const C=g+T,M=c===void 0?C:c(C);M!==C&&(T=M-g);const O=X=>-T*Math.exp(-X/r),_=X=>M+O(X),G=X=>{const pe=O(X),me=_(X);v.done=Math.abs(pe)<=p,v.value=v.done?M:me};let z,ee;const te=X=>{S(v.value)&&(z=X,ee=Xc({keyframes:[v.value,x(v.value)],velocity:xR(_,X,v.value),damping:o,stiffness:l,restDelta:p,restSpeed:y}))};return te(0),{calculatedDuration:null,next:X=>{let pe=!1;return!ee&&z===void 0&&(pe=!0,G(X),te(X)),z!==void 0&&X>=z?ee.next(X-z):(!pe&&G(X),v)}}}function _z(t,e,n){const r=[],o=n||Fi.mix||SR,l=t.length-1;for(let c=0;c<l;c++){let d=o(t[c],t[c+1]);if(e){const h=Array.isArray(e)?e[c]||zn:e;d=$l(h,d)}r.push(d)}return r}function kz(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const l=t.length;if(Hy(l===e.length),l===1)return()=>e[0];if(l===2&&e[0]===e[1])return()=>e[1];const c=t[0]===t[1];t[0]>t[l-1]&&(t=[...t].reverse(),e=[...e].reverse());const d=_z(e,r,o),h=d.length,p=y=>{if(c&&y<t[0])return e[0];let g=0;if(h>1)for(;g<t.length-2&&!(y<t[g+1]);g++);const v=ml(t[g],t[g+1],y);return d[g](v)};return n?y=>p(Hi(t[0],t[l-1],y)):p}function Mz(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=ml(0,e,r);t.push(tt(n,1,o))}}function Cz(t){const e=[0];return Mz(e,t.length-1),e}function Dz(t,e){return t.map(n=>n*e)}function Nz(t,e){return t.map(()=>e||cR).splice(0,t.length-1)}function nl({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=I4(r)?r.map(ox):ox(r),l={done:!1,value:e[0]},c=Dz(n&&n.length===e.length?n:Cz(e),t),d=kz(c,e,{ease:Array.isArray(o)?o:Nz(e,o)});return{calculatedDuration:t,next:h=>(l.value=d(h),l.done=h>=t,l)}}const $z=t=>t!==null;function ng(t,{repeat:e,repeatType:n="loop"},r,o=1){const l=t.filter($z),d=o<0||e&&n!=="loop"&&e%2===1?0:l.length-1;return!d||r===void 0?l[d]:r}const jz={decay:Am,inertia:Am,tween:nl,keyframes:nl,spring:Xc};function TR(t){typeof t.type=="string"&&(t.type=jz[t.type])}class ig{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const Bz=t=>t/100;class rg extends ig{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==on.now()&&this.tick(on.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;TR(e);const{type:n=nl,repeat:r=0,repeatDelay:o=0,repeatType:l,velocity:c=0}=e;let{keyframes:d}=e;const h=n||nl;h!==nl&&typeof d[0]!="number"&&(this.mixKeyframes=$l(Bz,SR(d[0],d[1])),d=[0,100]);const p=h({...e,keyframes:d});l==="mirror"&&(this.mirroredGenerator=h({...e,keyframes:[...d].reverse(),velocity:-c})),p.calculatedDuration===null&&(p.calculatedDuration=tg(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+o,this.totalDuration=this.resolvedDuration*(r+1)-o,this.generator=p}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:o,mixKeyframes:l,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:p=0,keyframes:y,repeat:g,repeatType:v,repeatDelay:S,type:x,onUpdate:T,finalKeyframe:C}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-o/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const M=this.currentTime-p*(this.playbackSpeed>=0?1:-1),O=this.playbackSpeed>=0?M<0:M>o;this.currentTime=Math.max(M,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let _=this.currentTime,G=r;if(g){const X=Math.min(this.currentTime,o)/d;let pe=Math.floor(X),me=X%1;!me&&X>=1&&(me=1),me===1&&pe--,pe=Math.min(pe,g+1),!!(pe%2)&&(v==="reverse"?(me=1-me,S&&(me-=S/d)):v==="mirror"&&(G=c)),_=Hi(0,1,me)*d}const z=O?{done:!1,value:y[0]}:G.next(_);l&&(z.value=l(z.value));let{done:ee}=z;!O&&h!==null&&(ee=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const te=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ee);return te&&x!==Am&&(z.value=ng(y,this.options,C,this.speed)),T&&T(z.value),te&&this.finish(),z}then(e,n){return this.finished.then(e,n)}get duration(){return Vn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Vn(e)}get time(){return Vn(this.currentTime)}set time(e){e=ui(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(on.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Vn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=vz,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),this.options.onPlay?.();const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),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(on.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function Lz(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const ls=t=>t*180/Math.PI,Em=t=>{const e=ls(Math.atan2(t[1],t[0]));return Rm(e)},Vz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Em,rotateZ:Em,skewX:t=>ls(Math.atan(t[1])),skewY:t=>ls(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Rm=t=>(t=t%360,t<0&&(t+=360),t),dx=Em,hx=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),px=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),zz={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hx,scaleY:px,scale:t=>(hx(t)+px(t))/2,rotateX:t=>Rm(ls(Math.atan2(t[6],t[5]))),rotateY:t=>Rm(ls(Math.atan2(-t[2],t[0]))),rotateZ:dx,rotate:dx,skewX:t=>ls(Math.atan(t[4])),skewY:t=>ls(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Om(t){return t.includes("scale")?1:0}function _m(t,e){if(!t||t==="none")return Om(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=zz,o=n;else{const d=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Vz,o=d}if(!o)return Om(e);const l=r[e],c=o[1].split(",").map(Kz);return typeof l=="function"?l(c):c[l]}const Uz=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return _m(n,e)};function Kz(t){return parseFloat(t.trim())}const Ho=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Fo=new Set(Ho),mx=t=>t===Io||t===he,Pz=new Set(["x","y","z"]),qz=Ho.filter(t=>!Pz.has(t));function Iz(t){const e=[];return qz.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const fs={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>_m(e,"x"),y:(t,{transform:e})=>_m(e,"y")};fs.translateX=fs.x;fs.translateY=fs.y;const ds=new Set;let km=!1,Mm=!1,Cm=!1;function AR(){if(Mm){const t=Array.from(ds).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const o=Iz(r);o.length&&(n.set(r,o),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([l,c])=>{r.getValue(l)?.set(c)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Mm=!1,km=!1,ds.forEach(t=>t.complete(Cm)),ds.clear()}function ER(){ds.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Mm=!0)})}function Hz(){Cm=!0,ER(),AR(),Cm=!1}class sg{constructor(e,n,r,o,l,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=o,this.element=l,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(ds.add(this),km||(km=!0,Qe.read(ER),Qe.resolveKeyframes(AR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:o}=this;if(e[0]===null){const l=o?.get(),c=e[e.length-1];if(l!==void 0)e[0]=l;else if(r&&n){const d=r.readValue(n,c);d!=null&&(e[0]=d)}e[0]===void 0&&(e[0]=c),o&&l===void 0&&o.set(e[0])}Lz(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),ds.delete(this)}cancel(){this.state==="scheduled"&&(ds.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Fz=t=>t.startsWith("--");function Gz(t,e,n){Fz(e)?t.style.setProperty(e,n):t.style[e]=n}const Yz=Fy(()=>window.ScrollTimeline!==void 0),Xz={};function Jz(t,e){const n=Fy(t);return()=>Xz[e]??n()}const RR=Jz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Qa=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,yx={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qa([0,.65,.55,1]),circOut:Qa([.55,0,1,.45]),backIn:Qa([.31,.01,.66,-.59]),backOut:Qa([.33,1.53,.69,.99])};function OR(t,e){if(t)return typeof t=="function"?RR()?wR(t,e):"ease-out":fR(t)?Qa(t):Array.isArray(t)?t.map(n=>OR(n,e)||yx.easeOut):yx[t]}function Zz(t,e,n,{delay:r=0,duration:o=300,repeat:l=0,repeatType:c="loop",ease:d="easeOut",times:h}={},p=void 0){const y={[e]:n};h&&(y.offset=h);const g=OR(d,o);Array.isArray(g)&&(y.easing=g);const v={delay:r,duration:o,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:l+1,direction:c==="reverse"?"alternate":"normal"};return p&&(v.pseudoElement=p),t.animate(y,v)}function _R(t){return typeof t=="function"&&"applyToOptions"in t}function Qz({type:t,...e}){return _R(t)&&RR()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class Wz extends ig{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:o,pseudoElement:l,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=e;this.isPseudoElement=!!l,this.allowFlatten=c,this.options=e,Hy(typeof e.type!="string");const p=Qz(e);this.animation=Zz(n,r,o,p,l),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!l){const y=ng(o,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(y):Gz(n,r,y),this.animation.cancel()}h?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return Vn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Vn(e)}get time(){return Vn(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=ui(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&Yz()?(this.animation.timeline=e,zn):n(this)}}const kR={anticipate:aR,backInOut:oR,circInOut:uR};function eU(t){return t in kR}function tU(t){typeof t.ease=="string"&&eU(t.ease)&&(t.ease=kR[t.ease])}const gx=10;class nU extends Wz{constructor(e){tU(e),TR(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:o,element:l,...c}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const d=new rg({...c,autoplay:!1}),h=ui(this.finishedTime??this.time);n.setWithVelocity(d.sample(h-gx).value,d.sample(h).value,gx),d.stop()}}const bx=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Cr.test(t)||t==="0")&&!t.startsWith("url("));function iU(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function rU(t,e,n,r){const o=t[0];if(o===null)return!1;if(e==="display"||e==="visibility")return!0;const l=t[t.length-1],c=bx(o,e),d=bx(l,e);return!c||!d?!1:iU(t)||(n==="spring"||_R(n))&&r}function Dm(t){t.duration=0,t.type="keyframes"}const sU=new Set(["opacity","clipPath","filter","transform"]),oU=Fy(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function aU(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:o,damping:l,type:c}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:p}=e.owner.getProps();return oU()&&n&&sU.has(n)&&(n!=="transform"||!p)&&!h&&!r&&o!=="mirror"&&l!==0&&c!=="inertia"}const lU=40;class uU extends ig{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:l=0,repeatType:c="loop",keyframes:d,name:h,motionValue:p,element:y,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=on.now();const v={autoplay:e,delay:n,type:r,repeat:o,repeatDelay:l,repeatType:c,name:h,motionValue:p,element:y,...g},S=y?.KeyframeResolver||sg;this.keyframeResolver=new S(d,(x,T,C)=>this.onKeyframesResolved(x,T,v,!C),h,p,y),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,r,o){this.keyframeResolver=void 0;const{name:l,type:c,velocity:d,delay:h,isHandoff:p,onUpdate:y}=r;this.resolvedAt=on.now(),rU(e,l,c,d)||((Fi.instantAnimations||!h)&&y?.(ng(e,r,n)),e[0]=e[e.length-1],Dm(r),r.repeat=0);const v={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>lU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},S=!p&&aU(v)?new nU({...v,element:v.motionValue.owner.current}):new rg(v);S.finished.then(()=>this.notifyFinished()).catch(zn),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(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Hz()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const cU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function fU(t){const e=cU.exec(t);if(!e)return[,];const[,n,r,o]=e;return[`--${n??r}`,o]}function MR(t,e,n=1){const[r,o]=fU(t);if(!r)return;const l=window.getComputedStyle(e).getPropertyValue(r);if(l){const c=l.trim();return QE(c)?parseFloat(c):c}return Zy(o)?MR(o,e,n+1):o}function og(t,e){return t?.[e]??t?.default??t}const CR=new Set(["width","height","top","left","right","bottom",...Ho]),dU={test:t=>t==="auto",parse:t=>t},DR=t=>e=>e.test(t),NR=[Io,he,ci,Sr,iz,nz,dU],vx=t=>NR.find(DR(t));function hU(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||eR(t):!0}const pU=new Set(["brightness","contrast","saturate","opacity"]);function mU(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Qy)||[];if(!r)return t;const o=n.replace(r,"");let l=pU.has(e)?1:0;return r!==n&&(l*=100),e+"("+l+o+")"}const yU=/\b([a-z-]*)\(.*?\)/gu,Nm={...Cr,getAnimatableNone:t=>{const e=t.match(yU);return e?e.map(mU).join(" "):t}},Sx={...Io,transform:Math.round},gU={rotate:Sr,rotateX:Sr,rotateY:Sr,rotateZ:Sr,scale:cc,scaleX:cc,scaleY:cc,scaleZ:cc,skew:Sr,skewX:Sr,skewY:Sr,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:yl,originX:ax,originY:ax,originZ:he},ag={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,...gU,zIndex:Sx,fillOpacity:yl,strokeOpacity:yl,numOctaves:Sx},bU={...ag,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:Nm,WebkitFilter:Nm},$R=t=>bU[t];function jR(t,e){let n=$R(t);return n!==Nm&&(n=Cr),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const vU=new Set(["auto","none","0"]);function SU(t,e,n){let r=0,o;for(;r<t.length&&!o;){const l=t[r];typeof l=="string"&&!vU.has(l)&&gl(l).values.length&&(o=t[r]),r++}if(o&&n)for(const l of e)t[l]=jR(n,o)}class wU extends sg{constructor(e,n,r,o,l){super(e,n,r,o,l,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),Zy(p))){const y=MR(p,n.current);y!==void 0&&(e[h]=y),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!CR.has(r)||e.length!==2)return;const[o,l]=e,c=vx(o),d=vx(l);if(c!==d)if(mx(c)&&mx(d))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else fs[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let o=0;o<e.length;o++)(e[o]===null||hU(e[o]))&&r.push(o);r.length&&SU(e,r,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=fs[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&e.getValue(r,o).jump(o,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const o=e.getValue(n);o&&o.jump(this.measuredOrigin,!1);const l=r.length-1,c=r[l];r[l]=fs[n](e.measureViewportBox(),window.getComputedStyle(e.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([d,h])=>{e.getValue(d).set(h)}),this.resolveNoneKeyframes()}}function xU(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const o=n?.[t]??r.querySelectorAll(t);return o?Array.from(o):[]}return Array.from(t)}const BR=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function TU(t){return WE(t)&&"offsetHeight"in t}const wx=30,AU=t=>!isNaN(parseFloat(t));class EU{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const o=on.now();if(this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=on.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=AU(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Gy);const r=this.events[e].add(n);return e==="change"?()=>{r(),Qe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=on.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>wx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,wx);return tR(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(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(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Vo(t,e){return new EU(t,e)}const{schedule:lg}=dR(queueMicrotask,!1),Fn={x:!1,y:!1};function LR(){return Fn.x||Fn.y}function RU(t){return t==="x"||t==="y"?Fn[t]?null:(Fn[t]=!0,()=>{Fn[t]=!1}):Fn.x||Fn.y?null:(Fn.x=Fn.y=!0,()=>{Fn.x=Fn.y=!1})}function VR(t,e){const n=xU(t),r=new AbortController,o={passive:!0,...e,signal:r.signal};return[n,o,()=>r.abort()]}function xx(t){return!(t.pointerType==="touch"||LR())}function OU(t,e,n={}){const[r,o,l]=VR(t,n),c=d=>{if(!xx(d))return;const{target:h}=d,p=e(h,d);if(typeof p!="function"||!h)return;const y=g=>{xx(g)&&(p(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,o)};return r.forEach(d=>{d.addEventListener("pointerenter",c,o)}),l}const zR=(t,e)=>e?t===e?!0:zR(t,e.parentElement):!1,ug=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,_U=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function kU(t){return _U.has(t.tagName)||t.tabIndex!==-1}const Ac=new WeakSet;function Tx(t){return e=>{e.key==="Enter"&&t(e)}}function Tp(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const MU=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=Tx(()=>{if(Ac.has(n))return;Tp(n,"down");const o=Tx(()=>{Tp(n,"up")}),l=()=>Tp(n,"cancel");n.addEventListener("keyup",o,e),n.addEventListener("blur",l,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function Ax(t){return ug(t)&&!LR()}function CU(t,e,n={}){const[r,o,l]=VR(t,n),c=d=>{const h=d.currentTarget;if(!Ax(d))return;Ac.add(h);const p=e(h,d),y=(S,x)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),Ac.has(h)&&Ac.delete(h),Ax(S)&&typeof p=="function"&&p(S,{success:x})},g=S=>{y(S,h===window||h===document||n.useGlobalTarget||zR(h,S.target))},v=S=>{y(S,!1)};window.addEventListener("pointerup",g,o),window.addEventListener("pointercancel",v,o)};return r.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,o),TU(d)&&(d.addEventListener("focus",p=>MU(p,o)),!kU(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),l}function UR(t){return WE(t)&&"ownerSVGElement"in t}function DU(t){return UR(t)&&t.tagName==="svg"}const Ht=t=>!!(t&&t.getVelocity),NU=[...NR,bt,Cr],$U=t=>NU.find(DR(t)),KR=$.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function jU(t=!0){const e=$.useContext(Py);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=e,l=$.useId();$.useEffect(()=>{if(t)return o(l)},[t]);const c=$.useCallback(()=>t&&r&&r(l),[l,r,t]);return!n&&r?[!1,c]:[!0]}const PR=$.createContext({strict:!1}),Ex={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"]},zo={};for(const t in Ex)zo[t]={isEnabled:e=>Ex[t].some(n=>!!e[n])};function BU(t){for(const e in t)zo[e]={...zo[e],...t[e]}}const LU=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 Jc(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||LU.has(t)}let qR=t=>!Jc(t);function VU(t){typeof t=="function"&&(qR=e=>e.startsWith("on")?!Jc(e):t(e))}try{VU(require("@emotion/is-prop-valid").default)}catch{}function zU(t,e,n){const r={};for(const o in t)o==="values"&&typeof t.values=="object"||(qR(o)||n===!0&&Jc(o)||!e&&!Jc(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}const Rf=$.createContext({});function Of(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function bl(t){return typeof t=="string"||Array.isArray(t)}const cg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],fg=["initial",...cg];function _f(t){return Of(t.animate)||fg.some(e=>bl(t[e]))}function IR(t){return!!(_f(t)||t.variants)}function UU(t,e){if(_f(t)){const{initial:n,animate:r}=t;return{initial:n===!1||bl(n)?n:void 0,animate:bl(r)?r:void 0}}return t.inherit!==!1?e:{}}function KU(t){const{initial:e,animate:n}=UU(t,$.useContext(Rf));return $.useMemo(()=>({initial:e,animate:n}),[Rx(e),Rx(n)])}function Rx(t){return Array.isArray(t)?t.join(" "):t}const vl={};function PU(t){for(const e in t)vl[e]=t[e],Jy(e)&&(vl[e].isCSSVariable=!0)}function HR(t,{layout:e,layoutId:n}){return Fo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!vl[t]||t==="opacity")}const qU={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},IU=Ho.length;function HU(t,e,n){let r="",o=!0;for(let l=0;l<IU;l++){const c=Ho[l],d=t[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=BR(d,ag[c]);if(!h){o=!1;const y=qU[c]||c;r+=`${y}(${p}) `}n&&(e[c]=p)}}return r=r.trim(),n?r=n(e,o?"":r):o&&(r="none"),r}function dg(t,e,n){const{style:r,vars:o,transformOrigin:l}=t;let c=!1,d=!1;for(const h in e){const p=e[h];if(Fo.has(h)){c=!0;continue}else if(Jy(h)){o[h]=p;continue}else{const y=BR(p,ag[h]);h.startsWith("origin")?(d=!0,l[h]=y):r[h]=y}}if(e.transform||(c||n?r.transform=HU(e,t.transform,n):r.transform&&(r.transform="none")),d){const{originX:h="50%",originY:p="50%",originZ:y=0}=l;r.transformOrigin=`${h} ${p} ${y}`}}const hg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function FR(t,e,n){for(const r in e)!Ht(e[r])&&!HR(r,n)&&(t[r]=e[r])}function FU({transformTemplate:t},e){return $.useMemo(()=>{const n=hg();return dg(n,e,t),Object.assign({},n.vars,n.style)},[e])}function GU(t,e){const n=t.style||{},r={};return FR(r,n,t),Object.assign(r,FU(t,e)),r}function YU(t,e){const n={},r=GU(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const XU={offset:"stroke-dashoffset",array:"stroke-dasharray"},JU={offset:"strokeDashoffset",array:"strokeDasharray"};function ZU(t,e,n=1,r=0,o=!0){t.pathLength=1;const l=o?XU:JU;t[l.offset]=he.transform(-r);const c=he.transform(e),d=he.transform(n);t[l.array]=`${c} ${d}`}function GR(t,{attrX:e,attrY:n,attrScale:r,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...d},h,p,y){if(dg(t,d,p),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:g,style:v}=t;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?.transformBox??"fill-box",delete g.transformBox),e!==void 0&&(g.x=e),n!==void 0&&(g.y=n),r!==void 0&&(g.scale=r),o!==void 0&&ZU(g,o,l,c,!1)}const YR=()=>({...hg(),attrs:{}}),XR=t=>typeof t=="string"&&t.toLowerCase()==="svg";function QU(t,e,n,r){const o=$.useMemo(()=>{const l=YR();return GR(l,e,XR(r),t.transformTemplate,t.style),{...l.attrs,style:{...l.style}}},[e]);if(t.style){const l={};FR(l,t.style,t),o.style={...l,...o.style}}return o}const WU=["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 pg(t){return typeof t!="string"||t.includes("-")?!1:!!(WU.indexOf(t)>-1||/[A-Z]/u.test(t))}function eK(t,e,n,{latestValues:r},o,l=!1){const d=(pg(t)?QU:YU)(e,r,o,t),h=zU(e,typeof t=="string",l),p=t!==$.Fragment?{...h,...d,ref:n}:{},{children:y}=e,g=$.useMemo(()=>Ht(y)?y.get():y,[y]);return $.createElement(t,{...p,children:g})}function Ox(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function mg(t,e,n,r){if(typeof e=="function"){const[o,l]=Ox(r);e=e(n!==void 0?n:t.custom,o,l)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[o,l]=Ox(r);e=e(n!==void 0?n:t.custom,o,l)}return e}function Ec(t){return Ht(t)?t.get():t}function tK({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,o){return{latestValues:nK(n,r,o,t),renderState:e()}}function nK(t,e,n,r){const o={},l=r(t,{});for(const v in l)o[v]=Ec(l[v]);let{initial:c,animate:d}=t;const h=_f(t),p=IR(t);e&&p&&!h&&t.inherit!==!1&&(c===void 0&&(c=e.initial),d===void 0&&(d=e.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?d:c;if(g&&typeof g!="boolean"&&!Of(g)){const v=Array.isArray(g)?g:[g];for(let S=0;S<v.length;S++){const x=mg(t,v[S]);if(x){const{transitionEnd:T,transition:C,...M}=x;for(const O in M){let _=M[O];if(Array.isArray(_)){const G=y?_.length-1:0;_=_[G]}_!==null&&(o[O]=_)}for(const O in T)o[O]=T[O]}}}return o}const JR=t=>(e,n)=>{const r=$.useContext(Rf),o=$.useContext(Py),l=()=>tK(t,e,r,o);return n?l():B4(l)};function yg(t,e,n){const{style:r}=t,o={};for(const l in r)(Ht(r[l])||e.style&&Ht(e.style[l])||HR(l,t)||n?.getValue(l)?.liveStyle!==void 0)&&(o[l]=r[l]);return o}const iK=JR({scrapeMotionValuesFromProps:yg,createRenderState:hg});function ZR(t,e,n){const r=yg(t,e,n);for(const o in t)if(Ht(t[o])||Ht(e[o])){const l=Ho.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[l]=t[o]}return r}const rK=JR({scrapeMotionValuesFromProps:ZR,createRenderState:YR}),sK=Symbol.for("motionComponentSymbol");function yo(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function oK(t,e,n){return $.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):yo(n)&&(n.current=r))},[e])}const gg=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),aK="framerAppearId",QR="data-"+gg(aK),WR=$.createContext({});function lK(t,e,n,r,o){const{visualElement:l}=$.useContext(Rf),c=$.useContext(PR),d=$.useContext(Py),h=$.useContext(KR).reducedMotion,p=$.useRef(null);r=r||c.renderer,!p.current&&r&&(p.current=r(t,{visualState:e,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const y=p.current,g=$.useContext(WR);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&uK(p.current,n,o,g);const v=$.useRef(!1);$.useInsertionEffect(()=>{y&&v.current&&y.update(n,d)});const S=n[QR],x=$.useRef(!!S&&!window.MotionHandoffIsComplete?.(S)&&window.MotionHasOptimisedAnimation?.(S));return L4(()=>{y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),x.current&&y.animationState&&y.animationState.animateChanges())}),$.useEffect(()=>{y&&(!x.current&&y.animationState&&y.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(S)}),x.current=!1),y.enteringChildren=void 0)}),y}function uK(t,e,n,r){const{layoutId:o,layout:l,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:p,layoutCrossfade:y}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:eO(t.parent)),t.projection.setOptions({layoutId:o,layout:l,alwaysMeasureLayout:!!c||d&&yo(d),visualElement:t,animationType:typeof l=="string"?l:"both",initialPromotionConfig:r,crossfade:y,layoutScroll:h,layoutRoot:p})}function eO(t){if(t)return t.options.allowProjection!==!1?t.projection:eO(t.parent)}function Ap(t,{forwardMotionProps:e=!1}={},n,r){n&&BU(n);const o=pg(t)?rK:iK;function l(d,h){let p;const y={...$.useContext(KR),...d,layoutId:cK(d)},{isStatic:g}=y,v=KU(d),S=o(d,g);if(!g&&Ky){fK();const x=dK(y);p=x.MeasureLayout,v.visualElement=lK(t,S,y,r,x.ProjectionNode)}return H.jsxs(Rf.Provider,{value:v,children:[p&&v.visualElement?H.jsx(p,{visualElement:v.visualElement,...y}):null,eK(t,d,oK(S,v.visualElement,h),S,g,e)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=$.forwardRef(l);return c[sK]=t,c}function cK({layoutId:t}){const e=$.useContext(ZE).id;return e&&t!==void 0?e+"-"+t:t}function fK(t,e){$.useContext(PR).strict}function dK(t){const{drag:e,layout:n}=zo;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function hK(t,e){if(typeof Proxy>"u")return Ap;const n=new Map,r=(l,c)=>Ap(l,c,t,e),o=(l,c)=>r(l,c);return new Proxy(o,{get:(l,c)=>c==="create"?r:(n.has(c)||n.set(c,Ap(c,void 0,t,e)),n.get(c))})}function tO({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function pK({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function mK(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Ep(t){return t===void 0||t===1}function $m({scale:t,scaleX:e,scaleY:n}){return!Ep(t)||!Ep(e)||!Ep(n)}function ss(t){return $m(t)||nO(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function nO(t){return _x(t.x)||_x(t.y)}function _x(t){return t&&t!=="0%"}function Zc(t,e,n){const r=t-n,o=e*r;return n+o}function kx(t,e,n,r,o){return o!==void 0&&(t=Zc(t,o,r)),Zc(t,n,r)+e}function jm(t,e=0,n=1,r,o){t.min=kx(t.min,e,n,r,o),t.max=kx(t.max,e,n,r,o)}function iO(t,{x:e,y:n}){jm(t.x,e.translate,e.scale,e.originPoint),jm(t.y,n.translate,n.scale,n.originPoint)}const Mx=.999999999999,Cx=1.0000000000001;function yK(t,e,n,r=!1){const o=n.length;if(!o)return;e.x=e.y=1;let l,c;for(let d=0;d<o;d++){l=n[d],c=l.projectionDelta;const{visualElement:h}=l.options;h&&h.props.style&&h.props.style.display==="contents"||(r&&l.options.layoutScroll&&l.scroll&&l!==l.root&&bo(t,{x:-l.scroll.offset.x,y:-l.scroll.offset.y}),c&&(e.x*=c.x.scale,e.y*=c.y.scale,iO(t,c)),r&&ss(l.latestValues)&&bo(t,l.latestValues))}e.x<Cx&&e.x>Mx&&(e.x=1),e.y<Cx&&e.y>Mx&&(e.y=1)}function go(t,e){t.min=t.min+e,t.max=t.max+e}function Dx(t,e,n,r,o=.5){const l=tt(t.min,t.max,o);jm(t,e,n,l,r)}function bo(t,e){Dx(t.x,e.x,e.scaleX,e.scale,e.originX),Dx(t.y,e.y,e.scaleY,e.scale,e.originY)}function rO(t,e){return tO(mK(t.getBoundingClientRect(),e))}function gK(t,e,n){const r=rO(t,n),{scroll:o}=e;return o&&(go(r.x,o.offset.x),go(r.y,o.offset.y)),r}const Nx=()=>({translate:0,scale:1,origin:0,originPoint:0}),vo=()=>({x:Nx(),y:Nx()}),$x=()=>({min:0,max:0}),dt=()=>({x:$x(),y:$x()}),Bm={current:null},sO={current:!1};function bK(){if(sO.current=!0,!!Ky)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Bm.current=t.matches;t.addEventListener("change",e),e()}else Bm.current=!1}const vK=new WeakMap;function SK(t,e,n){for(const r in e){const o=e[r],l=n[r];if(Ht(o))t.addValue(r,o);else if(Ht(l))t.addValue(r,Vo(o,{owner:t}));else if(l!==o)if(t.hasValue(r)){const c=t.getValue(r);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=t.getStaticValue(r);t.addValue(r,Vo(c!==void 0?c:o,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const jx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class wK{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:l,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=sg,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=on.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,Qe.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=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=o,this.options=d,this.blockInitialAnimation=!!l,this.isControllingVariants=_f(n),this.isVariantNode=IR(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:y,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const S=g[v];h[v]!==void 0&&Ht(S)&&S.set(h[v])}}mount(e){this.current=e,vK.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),sO.current||bK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Bm.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Mr(this.notifyUpdate),Mr(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=Fo.has(e);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",c=>{this.latestValues[e]=c,this.props.onUpdate&&Qe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{o(),l&&l(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in zo){const n=zo[e];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[e]&&o&&r(this.props)&&(this.features[e]=new o(this)),this.features[e]){const l=this.features[e];l.isMounted?l.update():(l.mount(),l.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):dt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<jx.length;r++){const o=jx[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const l="on"+o,c=e[l];c&&(this.propEventSubscriptions[o]=this.on(o,c))}this.prevMotionValues=SK(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Vo(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(QE(r)||eR(r))?r=parseFloat(r):!$U(r)&&Cr.test(n)&&(r=jR(e,n)),this.setBaseTarget(e,Ht(r)?r.get():r)),Ht(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const l=mg(this.props,n,this.presenceContext?.custom);l&&(r=l[e])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!Ht(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Gy),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){lg.render(this.render)}}class oO extends wK{constructor(){super(...arguments),this.KeyframeResolver=wU}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ht(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function aO(t,{style:e,vars:n},r,o){const l=t.style;let c;for(c in e)l[c]=e[c];o?.applyProjectionStyles(l,r);for(c in n)l.setProperty(c,n[c])}function xK(t){return window.getComputedStyle(t)}class TK extends oO{constructor(){super(...arguments),this.type="html",this.renderInstance=aO}readValueFromInstance(e,n){if(Fo.has(n))return this.projection?.isProjecting?Om(n):Uz(e,n);{const r=xK(e),o=(Jy(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(e,{transformPagePoint:n}){return rO(e,n)}build(e,n,r){dg(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return yg(e,n,r)}}const lO=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 AK(t,e,n,r){aO(t,e,void 0,r);for(const o in e.attrs)t.setAttribute(lO.has(o)?o:gg(o),e.attrs[o])}class EK extends oO{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=dt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Fo.has(n)){const r=$R(n);return r&&r.default||0}return n=lO.has(n)?n:gg(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return ZR(e,n,r)}build(e,n,r){GR(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,o){AK(e,n,r,o)}mount(e){this.isSVGTag=XR(e.tagName),super.mount(e)}}const RK=(t,e)=>pg(t)?new EK(e):new TK(e,{allowProjection:t!==$.Fragment});function Oo(t,e,n){const r=t.getProps();return mg(r,e,n!==void 0?n:r.custom,t)}const Lm=t=>Array.isArray(t);function OK(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Vo(n))}function _K(t){return Lm(t)?t[t.length-1]||0:t}function kK(t,e){const n=Oo(t,e);let{transitionEnd:r={},transition:o={},...l}=n||{};l={...l,...r};for(const c in l){const d=_K(l[c]);OK(t,c,d)}}function MK(t){return!!(Ht(t)&&t.add)}function Vm(t,e){const n=t.getValue("willChange");if(MK(n))return n.add(e);if(!n&&Fi.WillChange){const r=new Fi.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function uO(t){return t.props[QR]}const CK=t=>t!==null;function DK(t,{repeat:e,repeatType:n="loop"},r){const o=t.filter(CK),l=e&&n!=="loop"&&e%2===1?0:o.length-1;return o[l]}const NK={type:"spring",stiffness:500,damping:25,restSpeed:10},$K=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),jK={type:"keyframes",duration:.8},BK={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},LK=(t,{keyframes:e})=>e.length>2?jK:Fo.has(t)?t.startsWith("scale")?$K(e[1]):NK:BK;function VK({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:l,repeatType:c,repeatDelay:d,from:h,elapsed:p,...y}){return!!Object.keys(y).length}const bg=(t,e,n,r={},o,l)=>c=>{const d=og(r,t)||{},h=d.delay||r.delay||0;let{elapsed:p=0}=r;p=p-ui(h);const y={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...d,delay:-p,onUpdate:v=>{e.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:t,motionValue:e,element:l?void 0:o};VK(d)||Object.assign(y,LK(t,y)),y.duration&&(y.duration=ui(y.duration)),y.repeatDelay&&(y.repeatDelay=ui(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let g=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(Dm(y),y.delay===0&&(g=!0)),(Fi.instantAnimations||Fi.skipAnimations)&&(g=!0,Dm(y),y.delay=0),y.allowFlatten=!d.type&&!d.ease,g&&!l&&e.get()!==void 0){const v=DK(y.keyframes,d);if(v!==void 0){Qe.update(()=>{y.onUpdate(v),y.onComplete()});return}}return d.isSync?new rg(y):new uU(y)};function zK({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function cO(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:l=t.getDefaultTransition(),transitionEnd:c,...d}=e;r&&(l=r);const h=[],p=o&&t.animationState&&t.animationState.getState()[o];for(const y in d){const g=t.getValue(y,t.latestValues[y]??null),v=d[y];if(v===void 0||p&&zK(p,y))continue;const S={delay:n,...og(l||{},y)},x=g.get();if(x!==void 0&&!g.isAnimating&&!Array.isArray(v)&&v===x&&!S.velocity)continue;let T=!1;if(window.MotionHandoffAnimation){const M=uO(t);if(M){const O=window.MotionHandoffAnimation(M,y,Qe);O!==null&&(S.startTime=O,T=!0)}}Vm(t,y),g.start(bg(y,g,v,t.shouldReduceMotion&&CR.has(y)?{type:!1}:S,t,T));const C=g.animation;C&&h.push(C)}return c&&Promise.all(h).then(()=>{Qe.update(()=>{c&&kK(t,c)})}),h}function fO(t,e,n,r=0,o=1){const l=Array.from(t).sort((p,y)=>p.sortNodePosition(y)).indexOf(e),c=t.size,d=(c-1)*r;return typeof n=="function"?n(l,c):o===1?l*r:d-l*r}function zm(t,e,n={}){const r=Oo(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const l=r?()=>Promise.all(cO(t,r,n)):()=>Promise.resolve(),c=t.variantChildren&&t.variantChildren.size?(h=0)=>{const{delayChildren:p=0,staggerChildren:y,staggerDirection:g}=o;return UK(t,e,h,p,y,g,n)}:()=>Promise.resolve(),{when:d}=o;if(d){const[h,p]=d==="beforeChildren"?[l,c]:[c,l];return h().then(()=>p())}else return Promise.all([l(),c(n.delay)])}function UK(t,e,n=0,r=0,o=0,l=1,c){const d=[];for(const h of t.variantChildren)h.notify("AnimationStart",e),d.push(zm(h,e,{...c,delay:n+(typeof r=="function"?0:r)+fO(t.variantChildren,h,r,o,l)}).then(()=>h.notify("AnimationComplete",e)));return Promise.all(d)}function KK(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const o=e.map(l=>zm(t,l,n));r=Promise.all(o)}else if(typeof e=="string")r=zm(t,e,n);else{const o=typeof e=="function"?Oo(t,e,n.custom):e;r=Promise.all(cO(t,o,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function dO(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}const PK=fg.length;function hO(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?hO(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<PK;n++){const r=fg[n],o=t.props[r];(bl(o)||o===!1)&&(e[r]=o)}return e}const qK=[...cg].reverse(),IK=cg.length;function HK(t){return e=>Promise.all(e.map(({animation:n,options:r})=>KK(t,n,r)))}function FK(t){let e=HK(t),n=Bx(),r=!0;const o=h=>(p,y)=>{const g=Oo(t,y,h==="exit"?t.presenceContext?.custom:void 0);if(g){const{transition:v,transitionEnd:S,...x}=g;p={...p,...x,...S}}return p};function l(h){e=h(t)}function c(h){const{props:p}=t,y=hO(t.parent)||{},g=[],v=new Set;let S={},x=1/0;for(let C=0;C<IK;C++){const M=qK[C],O=n[M],_=p[M]!==void 0?p[M]:y[M],G=bl(_),z=M===h?O.isActive:null;z===!1&&(x=C);let ee=_===y[M]&&_!==p[M]&&G;if(ee&&r&&t.manuallyAnimateOnMount&&(ee=!1),O.protectedKeys={...S},!O.isActive&&z===null||!_&&!O.prevProp||Of(_)||typeof _=="boolean")continue;const te=GK(O.prevProp,_);let X=te||M===h&&O.isActive&&!ee&&G||C>x&&G,pe=!1;const me=Array.isArray(_)?_:[_];let Se=me.reduce(o(M),{});z===!1&&(Se={});const{prevResolvedValues:Ce={}}=O,ge={...Ce,...Se},J=K=>{X=!0,v.has(K)&&(pe=!0,v.delete(K)),O.needsAnimating[K]=!0;const V=t.getValue(K);V&&(V.liveStyle=!1)};for(const K in ge){const V=Se[K],ne=Ce[K];if(S.hasOwnProperty(K))continue;let A=!1;Lm(V)&&Lm(ne)?A=!dO(V,ne):A=V!==ne,A?V!=null?J(K):v.add(K):V!==void 0&&v.has(K)?J(K):O.protectedKeys[K]=!0}O.prevProp=_,O.prevResolvedValues=Se,O.isActive&&(S={...S,...Se}),r&&t.blockInitialAnimation&&(X=!1);const W=ee&&te;X&&(!W||pe)&&g.push(...me.map(K=>{const V={type:M};if(typeof K=="string"&&r&&!W&&t.manuallyAnimateOnMount&&t.parent){const{parent:ne}=t,A=Oo(ne,K);if(ne.enteringChildren&&A){const{delayChildren:q}=A.transition||{};V.delay=fO(ne.enteringChildren,t,q)}}return{animation:K,options:V}}))}if(v.size){const C={};if(typeof p.initial!="boolean"){const M=Oo(t,Array.isArray(p.initial)?p.initial[0]:p.initial);M&&M.transition&&(C.transition=M.transition)}v.forEach(M=>{const O=t.getBaseTarget(M),_=t.getValue(M);_&&(_.liveStyle=!0),C[M]=O??null}),g.push({animation:C})}let T=!!g.length;return r&&(p.initial===!1||p.initial===p.animate)&&!t.manuallyAnimateOnMount&&(T=!1),r=!1,T?e(g):Promise.resolve()}function d(h,p){if(n[h].isActive===p)return Promise.resolve();t.variantChildren?.forEach(g=>g.animationState?.setActive(h,p)),n[h].isActive=p;const y=c(h);for(const g in n)n[g].protectedKeys={};return y}return{animateChanges:c,setActive:d,setAnimateFunction:l,getState:()=>n,reset:()=>{n=Bx(),r=!0}}}function GK(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!dO(e,t):!1}function ts(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Bx(){return{animate:ts(!0),whileInView:ts(),whileHover:ts(),whileTap:ts(),whileDrag:ts(),whileFocus:ts(),exit:ts()}}class Br{constructor(e){this.isMounted=!1,this.node=e}update(){}}class YK extends Br{constructor(e){super(e),e.animationState||(e.animationState=FK(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Of(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let XK=0;class JK extends Br{constructor(){super(...arguments),this.id=XK++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const o=this.node.animationState.setActive("exit",!e);n&&!e&&o.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ZK={animation:{Feature:YK},exit:{Feature:JK}};function Sl(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Ll(t){return{point:{x:t.pageX,y:t.pageY}}}const QK=t=>e=>ug(e)&&t(e,Ll(e));function il(t,e,n,r){return Sl(t,e,QK(n),r)}const pO=1e-4,WK=1-pO,eP=1+pO,mO=.01,tP=0-mO,nP=0+mO;function Jt(t){return t.max-t.min}function iP(t,e,n){return Math.abs(t-e)<=n}function Lx(t,e,n,r=.5){t.origin=r,t.originPoint=tt(e.min,e.max,t.origin),t.scale=Jt(n)/Jt(e),t.translate=tt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=WK&&t.scale<=eP||isNaN(t.scale))&&(t.scale=1),(t.translate>=tP&&t.translate<=nP||isNaN(t.translate))&&(t.translate=0)}function rl(t,e,n,r){Lx(t.x,e.x,n.x,r?r.originX:void 0),Lx(t.y,e.y,n.y,r?r.originY:void 0)}function Vx(t,e,n){t.min=n.min+e.min,t.max=t.min+Jt(e)}function rP(t,e,n){Vx(t.x,e.x,n.x),Vx(t.y,e.y,n.y)}function zx(t,e,n){t.min=e.min-n.min,t.max=t.min+Jt(e)}function sl(t,e,n){zx(t.x,e.x,n.x),zx(t.y,e.y,n.y)}function $n(t){return[t("x"),t("y")]}const yO=({current:t})=>t?t.ownerDocument.defaultView:null,Ux=(t,e)=>Math.abs(t-e);function sP(t,e){const n=Ux(t.x,e.x),r=Ux(t.y,e.y);return Math.sqrt(n**2+r**2)}class gO{constructor(e,n,{transformPagePoint:r,contextWindow:o=window,dragSnapToOrigin:l=!1,distanceThreshold:c=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Op(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,x=sP(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!x)return;const{point:T}=v,{timestamp:C}=zt;this.history.push({...T,timestamp:C});const{onStart:M,onMove:O}=this.handlers;S||(M&&M(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),O&&O(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=Rp(S,this.transformPagePoint),Qe.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:x,onSessionEnd:T,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const M=Op(v.type==="pointercancel"?this.lastMoveEventInfo:Rp(S,this.transformPagePoint),this.history);this.startEvent&&x&&x(v,M),T&&T(v,M)},!ug(e))return;this.dragSnapToOrigin=l,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=o||window;const d=Ll(e),h=Rp(d,this.transformPagePoint),{point:p}=h,{timestamp:y}=zt;this.history=[{...p,timestamp:y}];const{onSessionStart:g}=n;g&&g(e,Op(h,this.history)),this.removeListeners=$l(il(this.contextWindow,"pointermove",this.handlePointerMove),il(this.contextWindow,"pointerup",this.handlePointerUp),il(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Mr(this.updatePoint)}}function Rp(t,e){return e?{point:e(t.point)}:t}function Kx(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Op({point:t},e){return{point:t,delta:Kx(t,bO(e)),offset:Kx(t,oP(e)),velocity:aP(e,.1)}}function oP(t){return t[0]}function bO(t){return t[t.length-1]}function aP(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=bO(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>ui(e)));)n--;if(!r)return{x:0,y:0};const l=Vn(o.timestamp-r.timestamp);if(l===0)return{x:0,y:0};const c={x:(o.x-r.x)/l,y:(o.y-r.y)/l};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function lP(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?tt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?tt(n,t,r.max):Math.min(t,n)),t}function Px(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function uP(t,{top:e,left:n,bottom:r,right:o}){return{x:Px(t.x,n,o),y:Px(t.y,e,r)}}function qx(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}function cP(t,e){return{x:qx(t.x,e.x),y:qx(t.y,e.y)}}function fP(t,e){let n=.5;const r=Jt(t),o=Jt(e);return o>r?n=ml(e.min,e.max-r,t.min):r>o&&(n=ml(t.min,t.max-o,e.min)),Hi(0,1,n)}function dP(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Um=.35;function hP(t=Um){return t===!1?t=0:t===!0&&(t=Um),{x:Ix(t,"left","right"),y:Ix(t,"top","bottom")}}function Ix(t,e,n){return{min:Hx(t,e),max:Hx(t,n)}}function Hx(t,e){return typeof t=="number"?t:t[e]||0}const pP=new WeakMap;class mP{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=dt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:o}=this.visualElement;if(o&&o.isPresent===!1)return;const l=g=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ll(g).point)},c=(g,v)=>{const{drag:S,dragPropagation:x,onDragStart:T}=this.getProps();if(S&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=RU(S),!this.openDragLock))return;this.latestPointerEvent=g,this.latestPanInfo=v,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 O=this.getAxisMotionValue(M).get()||0;if(ci.test(O)){const{projection:_}=this.visualElement;if(_&&_.layout){const G=_.layout.layoutBox[M];G&&(O=Jt(G)*(parseFloat(O)/100))}}this.originPoint[M]=O}),T&&Qe.postRender(()=>T(g,v)),Vm(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},d=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:S,dragDirectionLock:x,onDirectionLock:T,onDrag:C}=this.getProps();if(!S&&!this.openDragLock)return;const{offset:M}=v;if(x&&this.currentDirection===null){this.currentDirection=yP(M),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",v.point,M),this.updateAxis("y",v.point,M),this.visualElement.render(),C&&C(g,v)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},p=()=>$n(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:y}=this.getProps();this.panSession=new gO(e,{onSessionStart:l,onStart:c,onMove:d,onSessionEnd:h,resumeAnimation:p},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:r,contextWindow:yO(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,o=n||this.latestPanInfo,l=this.isDragging;if(this.cancel(),!l||!o||!r)return;const{velocity:c}=o;this.startAnimation(c);const{onDragEnd:d}=this.getProps();d&&Qe.postRender(()=>d(r,o))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:o}=this.getProps();if(!r||!fc(e,o,this.currentDirection))return;const l=this.getAxisMotionValue(e);let c=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(c=lP(c,this.constraints[e],this.elastic[e])),l.set(c)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,o=this.constraints;e&&yo(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=uP(r.layoutBox,e):this.constraints=!1,this.elastic=hP(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&$n(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=dP(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!yo(e))return!1;const r=e.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const l=gK(r,o.root,this.visualElement.getTransformPagePoint());let c=cP(o.layout.layoutBox,l);if(n){const d=n(pK(c));this.hasMutatedConstraints=!!d,d&&(c=tO(d))}return c}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:l,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},p=$n(y=>{if(!fc(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=o?200:1e6,S=o?40:1e7,x={type:"inertia",velocity:r?e[y]:0,bounceStiffness:v,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...l,...g};return this.startAxisValueAnimation(y,x)});return Promise.all(p).then(d)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Vm(this.visualElement,e),r.start(bg(e,r,0,n,this.visualElement,!1))}stopAnimation(){$n(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){$n(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){$n(n=>{const{drag:r}=this.getProps();if(!fc(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,l=this.getAxisMotionValue(n);if(o&&o.layout){const{min:c,max:d}=o.layout.layoutBox[n];l.set(e[n]-tt(c,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!yo(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};$n(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();o[c]=fP({min:h,max:h},this.constraints[c])}});const{transformTemplate:l}=this.visualElement.getProps();this.visualElement.current.style.transform=l?l({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),$n(c=>{if(!fc(c,e,null))return;const d=this.getAxisMotionValue(c),{min:h,max:p}=this.constraints[c];d.set(tt(h,p,o[c]))})}addListeners(){if(!this.visualElement.current)return;pP.set(this.visualElement,this);const e=this.visualElement.current,n=il(e,"pointerdown",h=>{const{drag:p,dragListener:y=!0}=this.getProps();p&&y&&this.start(h)}),r=()=>{const{dragConstraints:h}=this.getProps();yo(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,l=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Qe.read(r);const c=Sl(window,"resize",()=>this.scalePositionWithinConstraints()),d=o.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(),l(),d&&d()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:l=!1,dragElastic:c=Um,dragMomentum:d=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:l,dragElastic:c,dragMomentum:d}}}function fc(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function yP(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class gP extends Br{constructor(e){super(e),this.removeGroupControls=zn,this.removeListeners=zn,this.controls=new mP(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||zn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Fx=t=>(e,n)=>{t&&Qe.postRender(()=>t(e,n))};class bP extends Br{constructor(){super(...arguments),this.removePointerDownListener=zn}onPointerDown(e){this.session=new gO(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yO(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:Fx(e),onStart:Fx(n),onMove:r,onEnd:(l,c)=>{delete this.session,o&&Qe.postRender(()=>o(l,c))}}}mount(){this.removePointerDownListener=il(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Rc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Gx(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ga={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(he.test(t))t=parseFloat(t);else return t;const n=Gx(t,e.target.x),r=Gx(t,e.target.y);return`${n}% ${r}%`}},vP={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=Cr.parse(t);if(o.length>5)return r;const l=Cr.createTransformer(t),c=typeof o[0]!="number"?1:0,d=n.x.scale*e.x,h=n.y.scale*e.y;o[0+c]/=d,o[1+c]/=h;const p=tt(d,h,.5);return typeof o[2+c]=="number"&&(o[2+c]/=p),typeof o[3+c]=="number"&&(o[3+c]/=p),l(o)}};let _p=!1;class SP extends $.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:l}=e;PU(wP),l&&(n.group&&n.group.add(l),r&&r.register&&o&&r.register(l),_p&&l.root.didUpdate(),l.addEventListener("animationComplete",()=>{this.safeToRemove()}),l.setOptions({...l.options,onExitComplete:()=>this.safeToRemove()})),Rc.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:o,isPresent:l}=this.props,{projection:c}=r;return c&&(c.isPresent=l,_p=!0,o||e.layoutDependency!==n||n===void 0||e.isPresent!==l?c.willUpdate():this.safeToRemove(),e.isPresent!==l&&(l?c.promote():c.relegate()||Qe.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),lg.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=e;_p=!0,o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function vO(t){const[e,n]=jU(),r=$.useContext(ZE);return H.jsx(SP,{...t,layoutGroup:r,switchLayoutGroup:$.useContext(WR),isPresent:e,safeToRemove:n})}const wP={borderRadius:{...Ga,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ga,borderTopRightRadius:Ga,borderBottomLeftRadius:Ga,borderBottomRightRadius:Ga,boxShadow:vP};function xP(t,e,n){const r=Ht(t)?t:Vo(t);return r.start(bg("",r,e,n)),r.animation}const TP=(t,e)=>t.depth-e.depth;class AP{constructor(){this.children=[],this.isDirty=!1}add(e){qy(this.children,e),this.isDirty=!0}remove(e){Iy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(TP),this.isDirty=!1,this.children.forEach(e)}}function EP(t,e){const n=on.now(),r=({timestamp:o})=>{const l=o-n;l>=e&&(Mr(r),t(l-e))};return Qe.setup(r,!0),()=>Mr(r)}const SO=["TopLeft","TopRight","BottomLeft","BottomRight"],RP=SO.length,Yx=t=>typeof t=="string"?parseFloat(t):t,Xx=t=>typeof t=="number"||he.test(t);function OP(t,e,n,r,o,l){o?(t.opacity=tt(0,n.opacity??1,_P(r)),t.opacityExit=tt(e.opacity??1,0,kP(r))):l&&(t.opacity=tt(e.opacity??1,n.opacity??1,r));for(let c=0;c<RP;c++){const d=`border${SO[c]}Radius`;let h=Jx(e,d),p=Jx(n,d);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||Xx(h)===Xx(p)?(t[d]=Math.max(tt(Yx(h),Yx(p),r),0),(ci.test(p)||ci.test(h))&&(t[d]+="%")):t[d]=p}(e.rotate||n.rotate)&&(t.rotate=tt(e.rotate||0,n.rotate||0,r))}function Jx(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const _P=wO(0,.5,lR),kP=wO(.5,.95,zn);function wO(t,e,n){return r=>r<t?0:r>e?1:n(ml(t,e,r))}function Zx(t,e){t.min=e.min,t.max=e.max}function Dn(t,e){Zx(t.x,e.x),Zx(t.y,e.y)}function Qx(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Wx(t,e,n,r,o){return t-=e,t=Zc(t,1/n,r),o!==void 0&&(t=Zc(t,1/o,r)),t}function MP(t,e=0,n=1,r=.5,o,l=t,c=t){if(ci.test(e)&&(e=parseFloat(e),e=tt(c.min,c.max,e/100)-c.min),typeof e!="number")return;let d=tt(l.min,l.max,r);t===l&&(d-=e),t.min=Wx(t.min,e,n,d,o),t.max=Wx(t.max,e,n,d,o)}function e1(t,e,[n,r,o],l,c){MP(t,e[n],e[r],e[o],e.scale,l,c)}const CP=["x","scaleX","originX"],DP=["y","scaleY","originY"];function t1(t,e,n,r){e1(t.x,e,CP,n?n.x:void 0,r?r.x:void 0),e1(t.y,e,DP,n?n.y:void 0,r?r.y:void 0)}function n1(t){return t.translate===0&&t.scale===1}function xO(t){return n1(t.x)&&n1(t.y)}function i1(t,e){return t.min===e.min&&t.max===e.max}function NP(t,e){return i1(t.x,e.x)&&i1(t.y,e.y)}function r1(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function TO(t,e){return r1(t.x,e.x)&&r1(t.y,e.y)}function s1(t){return Jt(t.x)/Jt(t.y)}function o1(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class $P{constructor(){this.members=[]}add(e){qy(this.members,e),e.scheduleRender()}remove(e){if(Iy(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(o=>e===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const l=this.members[o];if(l.isPresent!==!1){r=l;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:o}=e.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function jP(t,e,n){let r="";const o=t.x.translate/e.x,l=t.y.translate/e.y,c=n?.z||0;if((o||l||c)&&(r=`translate3d(${o}px, ${l}px, ${c}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:p,rotate:y,rotateX:g,rotateY:v,skewX:S,skewY:x}=n;p&&(r=`perspective(${p}px) ${r}`),y&&(r+=`rotate(${y}deg) `),g&&(r+=`rotateX(${g}deg) `),v&&(r+=`rotateY(${v}deg) `),S&&(r+=`skewX(${S}deg) `),x&&(r+=`skewY(${x}deg) `)}const d=t.x.scale*e.x,h=t.y.scale*e.y;return(d!==1||h!==1)&&(r+=`scale(${d}, ${h})`),r||"none"}const kp=["","X","Y","Z"],BP=1e3;let LP=0;function Mp(t,e,n,r){const{latestValues:o}=e;o[t]&&(n[t]=o[t],e.setStaticValue(t,0),r&&(r[t]=0))}function AO(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=uO(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:l}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Qe,!(o||l))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&AO(r)}function EO({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(c={},d=e?.()){this.id=LP++,this.animationId=0,this.animationCommitId=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(UP),this.nodes.forEach(IP),this.nodes.forEach(HP),this.nodes.forEach(KP)},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 AP)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Gy),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=UR(c)&&!DU(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),t){let y,g=0;const v=()=>this.root.updateBlockedByResize=!1;Qe.read(()=>{g=window.innerWidth}),t(c,()=>{const S=window.innerWidth;S!==g&&(g=S,this.root.updateBlockedByResize=!0,y&&y(),y=EP(v,250),Rc.hasAnimatedSinceResize&&(Rc.hasAnimatedSinceResize=!1,this.nodes.forEach(u1)))})}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 x=this.options.transition||p.getDefaultTransition()||JP,{onLayoutAnimationStart:T,onLayoutAnimationComplete:C}=p.getProps(),M=!this.targetLayout||!TO(this.targetLayout,S),O=!g&&v;if(this.options.layoutRoot||this.resumeFrom||O||g&&(M||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const _={...og(x,"layout"),onPlay:T,onComplete:C};(p.shouldReduceMotion||this.options.layoutRoot)&&(_.delay=0,_.type=!1),this.startAnimation(_),this.setAnimationOrigin(y,O)}else g||u1(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(),Mr(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(FP),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&&AO(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(a1);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(l1);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(qP),this.nodes.forEach(VP),this.nodes.forEach(zP)):this.nodes.forEach(l1),this.clearAllSnapshots();const d=on.now();zt.delta=Hi(0,1e3/60,d-zt.timestamp),zt.timestamp=d,zt.isProcessing=!0,bp.update.process(zt),bp.preRender.process(zt),bp.render.process(zt),zt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,lg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(PP),this.sharedNodes.forEach(GP)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Qe.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Qe.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Jt(this.snapshot.measuredBox.x)&&!Jt(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=dt(),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=r(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(!o)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!xO(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;c&&this.instance&&(d||ss(this.latestValues)||y)&&(o(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)),ZP(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return dt();const d=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(QP))){const{scroll:p}=this.root;p&&(go(d.x,p.offset.x),go(d.y,p.offset.y))}return d}removeElementScroll(c){const d=dt();if(Dn(d,c),this.scroll?.wasRoot)return d;for(let h=0;h<this.path.length;h++){const p=this.path[h],{scroll:y,options:g}=p;p!==this.root&&y&&g.layoutScroll&&(y.wasRoot&&Dn(d,c),go(d.x,y.offset.x),go(d.y,y.offset.y))}return d}applyTransform(c,d=!1){const h=dt();Dn(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&&bo(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),ss(y.latestValues)&&bo(h,y.latestValues)}return ss(this.latestValues)&&bo(h,this.latestValues),h}removeTransform(c){const d=dt();Dn(d,c);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!ss(p.latestValues))continue;$m(p.latestValues)&&p.updateSnapshot();const y=dt(),g=p.measurePageBox();Dn(y,g),t1(d,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,y)}return ss(this.latestValues)&&t1(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!==zt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){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||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:g}=this.options;if(!(!this.layout||!(y||g))){if(this.resolvedRelativeTargetAt=zt.timestamp,!this.targetDelta&&!this.relativeTarget){const v=this.getClosestProjectingParent();v&&v.layout&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),sl(this.relativeTargetOrigin,this.layout.layoutBox,v.layout.layoutBox),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=dt(),this.targetWithTransforms=dt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),rP(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Dn(this.target,this.layout.layoutBox),iO(this.target,this.targetDelta)):Dn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const v=this.getClosestProjectingParent();v&&!!v.resumingFrom==!!this.resumingFrom&&!v.options.layoutScroll&&v.target&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=dt(),this.relativeTargetOrigin=dt(),sl(this.relativeTargetOrigin,this.target,v.target),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||$m(this.parent.latestValues)||nO(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===zt.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;Dn(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;yK(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=dt());const{target:S}=c;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Qx(this.prevProjectionDelta.x,this.projectionDelta.x),Qx(this.prevProjectionDelta.y,this.projectionDelta.y)),rl(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!o1(this.projectionDelta.x,this.prevProjectionDelta.x)||!o1(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){if(this.options.visualElement?.scheduleRender(),c){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=vo(),this.projectionDelta=vo(),this.projectionDeltaWithTransform=vo()}setAnimationOrigin(c,d=!1){const h=this.snapshot,p=h?h.latestValues:{},y={...this.latestValues},g=vo();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=dt(),S=h?h.source:void 0,x=this.layout?this.layout.source:void 0,T=S!==x,C=this.getStack(),M=!C||C.members.length<=1,O=!!(T&&!M&&this.options.crossfade===!0&&!this.path.some(XP));this.animationProgress=0;let _;this.mixTargetDelta=G=>{const z=G/1e3;c1(g.x,c.x,z),c1(g.y,c.y,z),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(sl(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),YP(this.relativeTarget,this.relativeTargetOrigin,v,z),_&&NP(this.relativeTarget,_)&&(this.isProjectionDirty=!1),_||(_=dt()),Dn(_,this.relativeTarget)),T&&(this.animationValues=y,OP(y,p,this.latestValues,z,O,M)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Mr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qe.update(()=>{Rc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Vo(0)),this.currentAnimation=xP(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),c.onUpdate&&c.onUpdate(d)},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(BP),this.currentAnimation.stop()),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&&RO(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||dt();const g=Jt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Jt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Dn(d,h),bo(d,y),rl(this.projectionDeltaWithTransform,this.layoutCorrected,d,y)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new $P),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(){const{layoutId:c}=this.options;return c?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:c}=this.options;return c?this.getStack()?.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&&Mp("z",c,p,this.animationValues);for(let y=0;y<kp.length;y++)Mp(`rotate${kp[y]}`,c,p,this.animationValues),Mp(`skew${kp[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()}applyProjectionStyles(c,d){if(!this.instance||this.isSVG)return;if(!this.isVisible){c.visibility="hidden";return}const h=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,c.visibility="",c.opacity="",c.pointerEvents=Ec(d?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Ec(d?.pointerEvents)||""),this.hasProjected&&!ss(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const y=p.animationValues||p.latestValues;this.applyTransformsToTarget();let g=jP(this.projectionDeltaWithTransform,this.treeScale,y);h&&(g=h(y,g)),c.transform=g;const{x:v,y:S}=this.projectionDelta;c.transformOrigin=`${v.origin*100}% ${S.origin*100}% 0`,p.animationValues?c.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:c.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const x in vl){if(y[x]===void 0)continue;const{correct:T,applyTo:C,isCSSVariable:M}=vl[x],O=g==="none"?y[x]:T(y[x],p);if(C){const _=C.length;for(let G=0;G<_;G++)c[C[G]]=O}else M?this.options.visualElement.renderState.vars[x]=O:c[x]=O}this.options.layoutId&&(c.pointerEvents=p===this?Ec(d?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(a1),this.root.sharedNodes.clear()}}}function VP(t){t.updateLayout()}function zP(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:r}=t.layout,{animationType:o}=t.options,l=e.source!==t.layout.source;o==="size"?$n(y=>{const g=l?e.measuredBox[y]:e.layoutBox[y],v=Jt(g);g.min=n[y].min,g.max=g.min+v}):RO(o,e.layoutBox,n)&&$n(y=>{const g=l?e.measuredBox[y]:e.layoutBox[y],v=Jt(n[y]);g.max=g.min+v,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[y].max=t.relativeTarget[y].min+v)});const c=vo();rl(c,n,e.layoutBox);const d=vo();l?rl(d,t.applyTransform(r,!0),e.measuredBox):rl(d,n,e.layoutBox);const h=!xO(c);let p=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:g,layout:v}=y;if(g&&v){const S=dt();sl(S,e.layoutBox,g.layoutBox);const x=dt();sl(x,n,v.layoutBox),TO(S,x)||(p=!0),y.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=S,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:d,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:p})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function UP(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function KP(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function PP(t){t.clearSnapshot()}function a1(t){t.clearMeasurements()}function l1(t){t.isLayoutDirty=!1}function qP(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function u1(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function IP(t){t.resolveTargetDelta()}function HP(t){t.calcProjection()}function FP(t){t.resetSkewAndRotation()}function GP(t){t.removeLeadSnapshot()}function c1(t,e,n){t.translate=tt(e.translate,0,n),t.scale=tt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function f1(t,e,n,r){t.min=tt(e.min,n.min,r),t.max=tt(e.max,n.max,r)}function YP(t,e,n,r){f1(t.x,e.x,n.x,r),f1(t.y,e.y,n.y,r)}function XP(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const JP={duration:.45,ease:[.4,0,.1,1]},d1=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),h1=d1("applewebkit/")&&!d1("chrome/")?Math.round:zn;function p1(t){t.min=h1(t.min),t.max=h1(t.max)}function ZP(t){p1(t.x),p1(t.y)}function RO(t,e,n){return t==="position"||t==="preserve-aspect"&&!iP(s1(e),s1(n),.2)}function QP(t){return t!==t.root&&t.scroll?.wasRoot}const WP=EO({attachResizeListener:(t,e)=>Sl(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Cp={current:void 0},OO=EO({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Cp.current){const t=new WP({});t.mount(window),t.setOptions({layoutScroll:!0}),Cp.current=t}return Cp.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),eq={pan:{Feature:bP},drag:{Feature:gP,ProjectionNode:OO,MeasureLayout:vO}};function m1(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,l=r[o];l&&Qe.postRender(()=>l(e,Ll(e)))}class tq extends Br{mount(){const{current:e}=this.node;e&&(this.unmount=OU(e,(n,r)=>(m1(this.node,r,"Start"),o=>m1(this.node,o,"End"))))}unmount(){}}class nq extends Br{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=$l(Sl(this.node.current,"focus",()=>this.onFocus()),Sl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function y1(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),l=r[o];l&&Qe.postRender(()=>l(e,Ll(e)))}class iq extends Br{mount(){const{current:e}=this.node;e&&(this.unmount=CU(e,(n,r)=>(y1(this.node,r,"Start"),(o,{success:l})=>y1(this.node,o,l?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Km=new WeakMap,Dp=new WeakMap,rq=t=>{const e=Km.get(t.target);e&&e(t)},sq=t=>{t.forEach(rq)};function oq({root:t,...e}){const n=t||document;Dp.has(n)||Dp.set(n,{});const r=Dp.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(sq,{root:t,...e})),r[o]}function aq(t,e,n){const r=oq(e);return Km.set(t,n),r.observe(t),()=>{Km.delete(t),r.unobserve(t)}}const lq={some:0,all:1};class uq extends Br{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:l}=e,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:lq[o]},d=h=>{const{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,l&&!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 aq(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(cq(e,n))&&this.startObserver()}unmount(){}}function cq({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const fq={inView:{Feature:uq},tap:{Feature:iq},focus:{Feature:nq},hover:{Feature:tq}},dq={layout:{ProjectionNode:OO,MeasureLayout:vO}},hq={...ZK,...fq,...eq,...dq},pq=hK(hq,RK);function mq(){const t=Yn(Lo),e=Yn(ai),n=Yn(zi),r=vt(Lo),o=vt(ai),l=vt(zi),c=`email-${$.useId()}`,d=`password-${$.useId()}`,h=`one-time-code-${$.useId()}`,[p,y]=$.useState(null),[g,v]=$.useState("email");return H.jsx("form",{onSubmit:async S=>{S.preventDefault();const x=Ze(si);try{switch(g){case"email":{const{nextStep:T,userKey:C}=await sn.declareAuthTarget.query({email:r});switch(De(si,C),T){case"otc_login":case"otc_verify":{v("otc");break}case"password_login":{v("password");break}}break}case"otc":{if(!x){console.error("somehow userKey is null");return}const T=await sn.verifyAccountAction.mutate({oneTimeCode:l,userKey:x});De(ot,T),di.once("connect",()=>{ys("/game"),t(""),n("")});break}case"password":{const T=await sn.openSession.mutate({email:r,password:o});De(ot,T),di.once("connect",()=>{ys("/game"),t(""),e("")});break}}}catch(T){T instanceof pl&&y(T.message)}},children:H.jsxs("main",{children:[p?H.jsx("aside",{children:p}):null,H.jsxs(pq.label,{htmlFor:c,children:[H.jsx("span",{children:"Email"}),H.jsx("input",{id:c,type:"text",value:r,onChange:S=>{t(S.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:g!=="email"})]}),g==="password"?H.jsxs("label",{htmlFor:d,children:[H.jsx("span",{children:"Password"}),H.jsx("input",{id:d,type:"password",value:o,onChange:S=>{e(S.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:g==="password"})]}):null,g==="otc"?H.jsxs("label",{htmlFor:h,children:[H.jsx("span",{children:"One-time Code"}),H.jsx("input",{id:h,type:"otc",value:l,onChange:S=>{n(S.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:g==="otc"})]}):null,H.jsxs("footer",{children:[g==="password"?H.jsx("button",{type:"button",onClick:async()=>{const S=Ze(si);if(!S)return new Error("No userKey");await sn.startPasswordReset.mutate({userKey:S}),v("otc")},children:"Forgot Password?"}):null,H.jsx("span",{}),H.jsx("button",{type:"submit",disabled:!r&&g==="email"||!o&&g==="password"||!l&&g==="otc",children:">>->"})]})]})})}function yq({route:[,t]}){const e=vt(ot),n=vt(zi),r=Yn(zi),o=`code-${$.useId()}`;return $.useEffect(()=>{t&&r(t)},[]),e?H.jsx("form",{onSubmit:async l=>{l.preventDefault();try{const c=await sn.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});De(ot,c),c.action==="resetPassword"?ys("/account"):ys("/game")}catch(c){console.error(c)}},children:H.jsxs("main",{children:[H.jsx("p",{children:"Check your email for a verification code."}),H.jsxs("label",{htmlFor:o,children:[H.jsx("span",{children:"Verification code"}),H.jsx("input",{id:o,type:"text",value:n,onChange:l=>{r(l.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})}):H.jsx("p",{children:"You must be logged in to verify your account."})}function gq(){const t=vt(R4),e=vt(ot),[n,r]=$.useState(!1),{refs:o,floatingStyles:l,context:c}=hN({open:n,onOpenChange:r,placement:"bottom-end",middleware:[VD(5),UD(),zD()],whileElementsMounted:MD}),d=lN(c),h=fN(c),p=yN(c),{getReferenceProps:y,getFloatingProps:g}=pN([d,h,p]),v=vt(pV);return H.jsxs("main",{className:rL.class,children:[H.jsxs("header",{children:[H.jsxs("main",{children:[H.jsx(iL,{}),H.jsx("span",{children:H.jsx(sL,{input:v})})]}),H.jsx("button",{"data-css":"profile",ref:o.setReference,...y(),children:e?.username?e.username.slice(0,2):""}),n&&e&&H.jsx(oN,{context:c,modal:!1,children:H.jsxs("div",{"data-css":"profile-actions",ref:o.setFloating,style:l,...g(),children:[H.jsx("span",{children:e.username}),H.jsx("button",{type:"button",onClick:()=>{ys("/account")},children:"Account"}),H.jsx("button",{type:"button",onClick:async()=>{e&&(await sn.closeSession.mutate({username:e.username}),di.once("disconnect",()=>{De(ot,null),ys("/")}),di.disconnect())},children:"Sign out"})]})})]}),H.jsx("main",{children:typeof t=="number"?H.jsxs("article",{children:[H.jsx("h1",{children:t}),H.jsx("h2",{children:JSON.parse(dE[t])}),H.jsx(hE,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(t[0]){case void 0:return H.jsx(mq,{});case"admin":return H.jsx(C4,{});case"game":return H.jsx(N4,{route:t});case"verify":return H.jsx(yq,{route:t});case"account":return H.jsx(M4,{})}})()})]})}uC.createRoot(document.getElementById("root")).render(H.jsx($.StrictMode,{children:H.jsx(eC,{socket:di,children:H.jsx(gq,{})})}));