tempest.games 0.2.75 → 0.2.77
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.
- package/CHANGELOG.md +15 -0
- package/app/assets/{index-II0hvKAD.js → index-B3RQO18a.js} +7 -7
- package/app/index.html +1 -1
- package/bin/backend.bun.js +523 -651
- package/bin/backend.worker.game.bun.js +17 -14
- package/bin/backend.worker.tribunal.bun.js +307 -304
- package/bin/frontend.bun.js +203 -200
- package/bin/setup-db.bun.js +155 -155
- package/package.json +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function yk(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in t)){const u=Object.getOwnPropertyDescriptor(r,a);u&&Object.defineProperty(t,a,u.get?u:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(a){if(a.ep)return;a.ep=!0;const u=n(a);fetch(a.href,u)}})();function gk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jh={exports:{}},Fa={};var TS;function bk(){if(TS)return Fa;TS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,a,u){var c=null;if(u!==void 0&&(c=""+u),a.key!==void 0&&(c=""+a.key),"key"in a){u={};for(var f in a)f!=="key"&&(u[f]=a[f])}else u=a;return a=u.ref,{$$typeof:t,type:r,key:c,ref:a!==void 0?a:null,props:u}}return Fa.Fragment=e,Fa.jsx=n,Fa.jsxs=n,Fa}var AS;function vk(){return AS||(AS=1,Jh.exports=bk()),Jh.exports}var F=vk();function ft(t){return ff(Ft.STORE,t,void 0)}function Sk(t){return uy(Ft.STORE,t,void 0)}function wk(t){return ey(Ft.STORE,t)}function nt(...t){return An(Ft.STORE,...t)}function xk(t){return hM(Ft.STORE,t)}function Tk(t){return mM(t,Ft.STORE)}const Kr={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]"},Xh=t=>(e,n,r,a,...u)=>{console[t](`${e} ${Kr[n]} \`${r}\` ${a}`,...u)},Ak={error:Xh("error"),info:Xh("info"),warn:Xh("warn")};var Ek=class{logLevel;filter;logger;constructor(t,e,n=Ak){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 Sc(t,e){return[t,e].sort().join("")}function Ok(t){if(typeof t!="string")return null;const[e,n]=t.split("==");if(!n)return null;const r=e.slice(4),[a,u]=n.split("++");return r&&a&&u?[r,a,u]:null}function Wi(t){return rT(Ft.STORE,t)}function _k(t){return eM(Ft.STORE,t)}function De(...t){Lt(Ft.STORE,...t)}function Rk(t,e,n=af()){return cM(Ft.STORE,t,e,n)}function Ck(t){return Xx(Ft.STORE,t)}function kk(t,e=af()){return Jm(Ft.STORE,t,e)}function Mk(t){return Object.entries(t)}function qr(t){return JSON.parse(t)}const zt=t=>JSON.stringify(t);function Dk(t){const e={};let n=0;for(const r of t)e[r]=n,e[n]=r,++n;return e}const zx="",Lx="",Vx="",Ux="",ES=t=>{switch(typeof t){case"string":return Vx+t;case"number":return Ux+t;case"boolean":return zx+ +t;case"object":return Lx}},OS=t=>{switch(t[0]){case Vx:return t.slice(1);case Ux:return+t.slice(1);case zx:return t.slice(1)==="1";case Lx:return null}},_S=Dk(["add","delete","clear"]);var Kx=class Xa extends Set{mode="record";subject=new We;constructor(e){super(e)}READONLY_VIEW=this;toJSON(){return[...this]}static fromJSON(e){return new Xa(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(Xa.packUpdate(e))}do(e){this.mode="playback";const n=Xa.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=Xa.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 a of r)this.add(a)}}return this.mode="record",null}static packUpdate(e){const n=_S[e.type]+"";return e.type==="clear"?n+e.values.map(ES).join(""):n+ES(e.value)}static unpackUpdate(e){const[n,r]=e.split(""),a=_S[n];return a==="clear"?{type:"clear",values:r.split("").map(OS)}:{type:a,value:OS(r)}}};function af(t=Math.random){return t().toString(36).slice(2)}function Re(t){for(;t.child!==null;)t=t.child;return t}function Ym(t){for(;t.parent!==null;)t=t.parent;return t}const Nk=/^\[object (?:Async|Generator|AsyncGenerator)?Function\]$/;function Br(t){const e=Object.prototype.toString.call(t);return Nk.test(e)}function RS(t,e){return Br(t)?t(e):t}var Kp=class extends Promise{fate;resolve;reject;done=!1;constructor(t){let e,n;super((r,a)=>{e=r,n=a}),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}},We=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)}},$k=class extends We{state;constructor(t){super(),this.state=t}next(t){this.state=t,super.next(t)}},jk=class qx{_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 qx([...this._buffer]);return e._index=this._index,e}};function zr(t){const e={key:t.key,type:t.type};return"family"in t&&(e.family=t.family),e}var Xn=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}},Px=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}},Bk=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=new Px(this.source.get(t));return super.set(t,e),e}}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)}},qi=class Ix{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),a=this.relations.get(n);r?r.add(n):(r=new Set([n]),this.relations.set(e,r)),a?a.add(e):(a=new Set([e]),this.relations.set(n,a))}deleteRelation(e,n){const r=this.relations.get(e);if(r){r.delete(n),r.size===0&&this.relations.delete(e);const a=this.relations.get(n);a&&(a.delete(e),a.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(e,n){this.relations.set(e,new Set(n));for(const r of n){const a=new Set().add(e);this.relations.set(r,a)}}replaceRelationsSafely(e,n){const r=this.relations.get(e);let a=this.isAType?.(e)?e:void 0,u=a===void 0?e:void 0;if(r)for(const c of r){a??=c,u??=c;const f=this.relations.get(c);f&&(f.size===1?this.relations.delete(c):f.delete(e),this.contents.delete(this.makeContentKey(a,u)))}this.relations.set(e,new Set(n));for(const c of n){let f=this.relations.get(c);f?f.add(e):(f=new Set().add(e),this.relations.set(c,f))}}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(([a,u])=>[a,new Set(u)])),this.contents=new Map(e.contents)),r&&(this.relations=new Bk(r.relations),this.contents=new Xn(r.contents))}if(n?.externalStore){const r=n.externalStore;this.has=(a,u)=>r.has(a,u),this.addRelation=(a,u)=>{r.addRelation(a,u)},this.deleteRelation=(a,u)=>{r.deleteRelation(a,u)},this.replaceRelationsSafely=(a,u)=>{r.replaceRelationsSafely(a,u)},this.replaceRelationsUnsafely=(a,u)=>{r.replaceRelationsUnsafely(a,u)},this.getRelatedKeys=(a=>r.getRelatedKeys(a)),r.getContent&&(this.getContentInternal=a=>r.getContent(a),this.setContent=(a,u)=>{r.setContent(a,u)},this.deleteContent=a=>{r.deleteContent(a)});for(const[a,u]of e.relations??[]){let c=this.isAType?.(a)?a:void 0,f=c===void 0?a:void 0;for(const h of u)c??=h,f??=h,this.addRelation(c,f)}for(const[a,u]of e.contents??[])this.setContent(a,u)}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,a;switch(e.length){case 1:{const u=e[0];n=u[this.a],r=u[this.b],a=void 0;break}case 2:{const u=e[0];typeof u=="string"?[n,r]=e:(n=u[this.a],r=u[this.b],a=e[1]);break}default:n=e[0],r=e[1],a=e[2];break}switch(this.cardinality){case"1:1":{const u=this.getRelatedKey(n);u&&u!==r&&this.delete(n,u)}case"1:n":{const u=this.getRelatedKey(r);u&&u!==n&&this.delete(u,r)}break}if(a){const u=this.makeContentKey(n,r);this.setContent(u,a)}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 a=this.getRelatedKeys(n);if(a)for(const u of a)this.delete(u,n)}else if(typeof r=="string"&&n===void 0){const a=this.getRelatedKeys(r);if(a)for(const u of a)this.delete(r,u)}else if(typeof r=="string"&&typeof n=="string"){this.deleteRelation(r,n);const a=this.makeContentKey(r,n);this.deleteContent(a)}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(a=>`"${a}"`).join(", ")}). Only one related key was expected.`);let r;for(const a of n){r=a;break}return r}}replaceRelations(e,n,r){const a=!Array.isArray(n),u=a?Object.keys(n):n;if(r?.reckless?this.replaceRelationsUnsafely(e,u):this.replaceRelationsSafely(e,u),a)for(const c of u){const f=this.makeContentKey(e,c),h=n[c];this.setContent(f,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 a=this.getRelatedKeys(n);if(a)return[...a].map(u=>[u,this.getContent(n,u)])}if(n===void 0&&r!==void 0){const a=this.getRelatedKeys(r);if(a)return[...a].map(u=>[u,this.getContent(u,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 Ix({between:[this.a,this.b],cardinality:this.cardinality},e)}incorporate(e){const{relations:n,contents:r}=e;for(const[a,u]of n)if(u instanceof Px){const{source:c}=u;for(const f of u.iterateOwn())c.add(f)}else this.relations.set(a,u);for(const a of n.deleted)this.relations.delete(a);for(const[a,u]of r)this.contents.set(a,u);for(const a of r.deleted)this.contents.delete(a)}};function zk(t){return t.startsWith("🔍 ")}const Lk=t=>{t.logger.info("🪂","transaction",t.transactionMeta.update.token.key,"Aborting transaction"),t.parent.child=null};function Jm(t,e,n){return(...r)=>ct(t,e).run(r,n)}function Vk(t,e,n){const{token:r,update:{newValue:a,oldValue:u}}=e;Lt(t,r,n==="newValue"?a:u)}function Uk(t){const{stack:e}=t;return e?`
|
|
1
|
+
function yk(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in t)){const u=Object.getOwnPropertyDescriptor(r,a);u&&Object.defineProperty(t,a,u.get?u:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const u of a)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const u={};return a.integrity&&(u.integrity=a.integrity),a.referrerPolicy&&(u.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?u.credentials="include":a.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function r(a){if(a.ep)return;a.ep=!0;const u=n(a);fetch(a.href,u)}})();function gk(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Jh={exports:{}},Fa={};var TS;function bk(){if(TS)return Fa;TS=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(r,a,u){var c=null;if(u!==void 0&&(c=""+u),a.key!==void 0&&(c=""+a.key),"key"in a){u={};for(var f in a)f!=="key"&&(u[f]=a[f])}else u=a;return a=u.ref,{$$typeof:t,type:r,key:c,ref:a!==void 0?a:null,props:u}}return Fa.Fragment=e,Fa.jsx=n,Fa.jsxs=n,Fa}var AS;function vk(){return AS||(AS=1,Jh.exports=bk()),Jh.exports}var F=vk();function ft(t){return ff(Jt.STORE,t,void 0)}function Sk(t){return uy(Jt.STORE,t,void 0)}function wk(t){return ey(Jt.STORE,t)}function nt(...t){return An(Jt.STORE,...t)}function xk(t){return hM(Jt.STORE,t)}function Tk(t,e){return mM(Jt.STORE,t)}const Kr={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]"},Xh=t=>(e,n,r,a,...u)=>{console[t](`${e} ${Kr[n]} \`${r}\` ${a}`,...u)},Ak={error:Xh("error"),info:Xh("info"),warn:Xh("warn")};var Ek=class{logLevel;filter;logger;constructor(t,e,n=Ak){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 Sc(t,e){return[t,e].sort().join("")}function Ok(t){if(typeof t!="string")return null;const[e,n]=t.split("==");if(!n)return null;const r=e.slice(4),[a,u]=n.split("++");return r&&a&&u?[r,a,u]:null}function Wi(t){return rT(Jt.STORE,t)}function _k(t){return eM(Jt.STORE,t)}function De(...t){Lt(Jt.STORE,...t)}function Rk(t,e,n=af()){return cM(Jt.STORE,t,e,n)}function Ck(t){return Xx(Jt.STORE,t)}function kk(t,e=af()){return Jm(Jt.STORE,t,e)}function Mk(t){return Object.entries(t)}function qr(t){return JSON.parse(t)}const zt=t=>JSON.stringify(t);function Dk(t){const e={};let n=0;for(const r of t)e[r]=n,e[n]=r,++n;return e}const zx="",Lx="",Vx="",Ux="",ES=t=>{switch(typeof t){case"string":return Vx+t;case"number":return Ux+t;case"boolean":return zx+ +t;case"object":return Lx}},OS=t=>{switch(t[0]){case Vx:return t.slice(1);case Ux:return+t.slice(1);case zx:return t.slice(1)==="1";case Lx:return null}},_S=Dk(["add","delete","clear"]);var Kx=class Xa extends Set{mode="record";subject=new We;constructor(e){super(e)}READONLY_VIEW=this;toJSON(){return[...this]}static fromJSON(e){return new Xa(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(Xa.packUpdate(e))}do(e){this.mode="playback";const n=Xa.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=Xa.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 a of r)this.add(a)}}return this.mode="record",null}static packUpdate(e){const n=_S[e.type]+"";return e.type==="clear"?n+e.values.map(ES).join(""):n+ES(e.value)}static unpackUpdate(e){const[n,r]=e.split(""),a=_S[n];return a==="clear"?{type:"clear",values:r.split("").map(OS)}:{type:a,value:OS(r)}}};function af(t=Math.random){return t().toString(36).slice(2)}function Re(t){for(;t.child!==null;)t=t.child;return t}function Ym(t){for(;t.parent!==null;)t=t.parent;return t}const Nk=/^\[object (?:Async|Generator|AsyncGenerator)?Function\]$/;function Br(t){const e=Object.prototype.toString.call(t);return Nk.test(e)}function RS(t,e){return Br(t)?t(e):t}var Kp=class extends Promise{fate;resolve;reject;done=!1;constructor(t){let e,n;super((r,a)=>{e=r,n=a}),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}},We=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)}},$k=class extends We{state;constructor(t){super(),this.state=t}next(t){this.state=t,super.next(t)}},jk=class qx{_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 qx([...this._buffer]);return e._index=this._index,e}};function zr(t){const e={key:t.key,type:t.type};return"family"in t&&(e.family=t.family),e}var Xn=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}},Px=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}},Bk=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=new Px(this.source.get(t));return super.set(t,e),e}}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)}},qi=class Ix{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),a=this.relations.get(n);r?r.add(n):(r=new Set([n]),this.relations.set(e,r)),a?a.add(e):(a=new Set([e]),this.relations.set(n,a))}deleteRelation(e,n){const r=this.relations.get(e);if(r){r.delete(n),r.size===0&&this.relations.delete(e);const a=this.relations.get(n);a&&(a.delete(e),a.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(e,n){this.relations.set(e,new Set(n));for(const r of n){const a=new Set().add(e);this.relations.set(r,a)}}replaceRelationsSafely(e,n){const r=this.relations.get(e);let a=this.isAType?.(e)?e:void 0,u=a===void 0?e:void 0;if(r)for(const c of r){a??=c,u??=c;const f=this.relations.get(c);f&&(f.size===1?this.relations.delete(c):f.delete(e),this.contents.delete(this.makeContentKey(a,u)))}this.relations.set(e,new Set(n));for(const c of n){let f=this.relations.get(c);f?f.add(e):(f=new Set().add(e),this.relations.set(c,f))}}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(([a,u])=>[a,new Set(u)])),this.contents=new Map(e.contents)),r&&(this.relations=new Bk(r.relations),this.contents=new Xn(r.contents))}if(n?.externalStore){const r=n.externalStore;this.has=(a,u)=>r.has(a,u),this.addRelation=(a,u)=>{r.addRelation(a,u)},this.deleteRelation=(a,u)=>{r.deleteRelation(a,u)},this.replaceRelationsSafely=(a,u)=>{r.replaceRelationsSafely(a,u)},this.replaceRelationsUnsafely=(a,u)=>{r.replaceRelationsUnsafely(a,u)},this.getRelatedKeys=(a=>r.getRelatedKeys(a)),r.getContent&&(this.getContentInternal=a=>r.getContent(a),this.setContent=(a,u)=>{r.setContent(a,u)},this.deleteContent=a=>{r.deleteContent(a)});for(const[a,u]of e.relations??[]){let c=this.isAType?.(a)?a:void 0,f=c===void 0?a:void 0;for(const h of u)c??=h,f??=h,this.addRelation(c,f)}for(const[a,u]of e.contents??[])this.setContent(a,u)}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,a;switch(e.length){case 1:{const u=e[0];n=u[this.a],r=u[this.b],a=void 0;break}case 2:{const u=e[0];typeof u=="string"?[n,r]=e:(n=u[this.a],r=u[this.b],a=e[1]);break}default:n=e[0],r=e[1],a=e[2];break}switch(this.cardinality){case"1:1":{const u=this.getRelatedKey(n);u&&u!==r&&this.delete(n,u)}case"1:n":{const u=this.getRelatedKey(r);u&&u!==n&&this.delete(u,r)}break}if(a){const u=this.makeContentKey(n,r);this.setContent(u,a)}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 a=this.getRelatedKeys(n);if(a)for(const u of a)this.delete(u,n)}else if(typeof r=="string"&&n===void 0){const a=this.getRelatedKeys(r);if(a)for(const u of a)this.delete(r,u)}else if(typeof r=="string"&&typeof n=="string"){this.deleteRelation(r,n);const a=this.makeContentKey(r,n);this.deleteContent(a)}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(a=>`"${a}"`).join(", ")}). Only one related key was expected.`);let r;for(const a of n){r=a;break}return r}}replaceRelations(e,n,r){const a=!Array.isArray(n),u=a?Object.keys(n):n;if(r?.reckless?this.replaceRelationsUnsafely(e,u):this.replaceRelationsSafely(e,u),a)for(const c of u){const f=this.makeContentKey(e,c),h=n[c];this.setContent(f,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 a=this.getRelatedKeys(n);if(a)return[...a].map(u=>[u,this.getContent(n,u)])}if(n===void 0&&r!==void 0){const a=this.getRelatedKeys(r);if(a)return[...a].map(u=>[u,this.getContent(u,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 Ix({between:[this.a,this.b],cardinality:this.cardinality},e)}incorporate(e){const{relations:n,contents:r}=e;for(const[a,u]of n)if(u instanceof Px){const{source:c}=u;for(const f of u.iterateOwn())c.add(f)}else this.relations.set(a,u);for(const a of n.deleted)this.relations.delete(a);for(const[a,u]of r)this.contents.set(a,u);for(const a of r.deleted)this.contents.delete(a)}};function zk(t){return t.startsWith("🔍 ")}const Lk=t=>{t.logger.info("🪂","transaction",t.transactionMeta.update.token.key,"Aborting transaction"),t.parent.child=null};function Jm(t,e,n){return(...r)=>ct(t,e).run(r,n)}function Vk(t,e,n){const{token:r,update:{newValue:a,oldValue:u}}=e;Lt(t,r,n==="newValue"?a:u)}function Uk(t){const{stack:e}=t;return e?`
|
|
2
2
|
`+e.split(`
|
|
3
3
|
`)?.slice(1)?.join(`
|
|
4
4
|
`):""}function Hx(t,e,n,r="any"){const a=e,u=zt(n),c=[],f=Re(t);if(Array.isArray(a))for(const y of a){const g=zt(y);f.molecules.get(g)?t.moleculeGraph.set(g,u,{source:g}):c.push(g)}else{const y=zt(a);f.molecules.get(y)?t.moleculeGraph.set(y,u,{source:y}):c.push(y)}const h=new We;c.length===0&&f.molecules.set(u,{key:n,stringKey:u,dependsOn:r,subject:h});const m={type:"molecule_creation",key:n,provenance:a,timestamp:Date.now()};Tn(f)&&f.transactionMeta.phase==="building"?f.transactionMeta.update.subEvents.push(m):f.on.moleculeCreation.next(m);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?`
|
|
@@ -9,21 +9,21 @@ ${v.trace}`:`No previous disposal trace for ${n} was found.`);return}r.subject.n
|
|
|
9
9
|
${a} was most recently disposed
|
|
10
10
|
${g.trace}`:`No previous disposal trace for ${a} was found.`),n}const f=zt(e),h=u.molecules.get(f);if(!h){const g=t.disposalTraces.buffer.find(v=>v?.key===f);return t.logger.error("❌","key",n,"claim failed:",`Could not allocate to ${f} in store "${t.config.name}".`,g?`
|
|
11
11
|
${f} was most recently disposed
|
|
12
|
-
${g.trace}`:`No previous disposal trace for ${f} was found.`),n}const m=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:g}])=>g!==a).map(([g])=>qr(g));r&&u.moleculeGraph.delete(a),u.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,exclusive:!!r,from:m,to:[h.key],timestamp:Date.now()};return Tn(u)&&u.transactionMeta.phase==="building"&&u.transactionMeta.update.subEvents.push(y),n}function Kk(t,e,n){switch(n){case"newValue":Fx(t,e);break;case"oldValue":lf(t,e.token);break}}function qk(t,e,n){switch(n){case"newValue":lf(t,e.token);break;case"oldValue":Fx(t,e),e.subType==="atom"&&t.valueMap.set(e.token.key,e.value);break}}function Fx(t,e){const{token:n}=e;e.subType==="writable"&&e.value?Lt(t,n,e.value):An(t,n)}function Pk(t,e,n){switch(n){case"newValue":Hx(t,e.provenance,e.key);break;case"oldValue":Xm(t,e.key);break}}function Ik(t,e,n){switch(n){case"newValue":Xm(t,e.key);break;case"oldValue":Hx(t,e.provenance.map(qr),e.key);for(const[r,a]of e.values){const u=t.families.get(r);if(u){An(t,u,e.key);const c=`${r}(${zt(e.key)})`;t.valueMap.set(c,a)}}break}}function Hk(t,e,n){switch(n){case"newValue":for(const r of e.to)CS(t,r,e.key,e.exclusive?"exclusive":void 0);break;case"oldValue":{let r="exclusive";for(const a of e.from)CS(t,a,e.key,r),r=void 0}break}}function wo(t,e,n){const r=n==="newValue"?e.subEvents:[...e.subEvents].reverse();for(const a of r)switch(a.type){case"atom_update":Vk(t,a,n);break;case"state_creation":Kk(t,a,n);break;case"state_disposal":qk(t,a,n);break;case"molecule_creation":Pk(t,a,n);break;case"molecule_disposal":Ik(t,a,n);break;case"molecule_transfer":Hk(t,a,n);break;case"transaction_outcome":wo(t,a,n);break}}function ul(t){return"epoch"in t.transactionMeta}function Tn(t){return"phase"in t.transactionMeta}function Gx(t,e){return t.transactionMeta.actionContinuities.getRelatedKey(e)}function Yx(t,e){return t.transactionMeta.epoch.get(e)}function Fk(t,e){const n=Gx(t,e);if(n!==void 0)return Yx(t,n)}function Zm(t,e,n){t.transactionMeta.epoch.set(e,n)}function Gk(t,e,n){const r=Gx(t,e);r!==void 0&&t.transactionMeta.epoch.set(r,n)}function Yk(t,e){const n=Re(t),{parent:r}=n;n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,r.child=null,r.on.transactionApplying.next(n.transactionMeta);const{subEvents:a}=n.transactionMeta.update;t.logger.info("🛄","transaction",n.transactionMeta.update.token.key,`applying ${a.length} subEvents:`,a),wo(r,n.transactionMeta.update,"newValue"),ul(r)?(Gk(r,n.transactionMeta.update.token.key,n.transactionMeta.update.epoch),ct(t,{key:n.transactionMeta.update.token.key,type:"transaction"})?.subject.next(n.transactionMeta.update),t.logger.info("🛬","transaction",n.transactionMeta.update.token.key,"applied")):Tn(r)&&r.transactionMeta.update.subEvents.push(n.transactionMeta.update),r.on.transactionApplying.next(null)}function Jx(t,e,n){const{epoch:r,actionContinuities:a}=t.transactionMeta;a.set(e,n),r.has(e)||r.set(e,-1)}function Jk(t){return{store:t}}const Xk=(t,e,n,r)=>{const a=Re(t),u={parent:a,child:null,on:a.on,loggers:a.loggers,logger:a.logger,config:a.config,atoms:new Xn(a.atoms),atomsThatAreDefault:new Set(a.atomsThatAreDefault),families:new Xn(a.families),joins:new Xn(a.joins),operation:{open:!1},readonlySelectors:new Xn(a.readonlySelectors),timelines:new Xn(a.timelines),timelineTopics:a.timelineTopics.overlay(),trackers:new Map,transactions:new Xn(a.transactions),selectorAtoms:a.selectorAtoms.overlay(),selectorGraph:a.selectorGraph.overlay(),writableSelectors:new Xn(a.writableSelectors),valueMap:new Xn(a.valueMap),defaults:a.defaults,disposalTraces:t.disposalTraces.copy(),molecules:new Xn(a.molecules),moleculeGraph:a.moleculeGraph.overlay(),moleculeData:a.moleculeData.overlay(),keyRefsInJoins:a.keyRefsInJoins.overlay(),miscResources:new Xn(a.miscResources)},c=Fk(t,e.key),f={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:((...m)=>An(h,...m)),set:((...m)=>{Lt(h,...m)}),reset:((...m)=>{ny(h,...m)}),run:(m,y=af())=>Jm(h,m,y),find:((...m)=>Pr(t,...m)),json:m=>Rs(h,m),dispose:((...m)=>{lf(h,...m)}),env:()=>Jk(h)}},h=Object.assign(u,{transactionMeta:f});return a.child=h,t.logger.info("🛫","transaction",e.key,"building with params:",n),h};function Xx(t,e){const{key:n}=e,r=t.transactions.has(n),a={key:n,type:"transaction",run:(c,f)=>{const h=Xk(t,zr(a),c,f);try{const{toolkit:m}=h.transactionMeta,y=e.do(m,...c);return Yk(h,y),y}catch(m){throw Lk(h),t.logger.warn("💥","transaction",n,"caught:",m),m}},install:c=>Xx(c,e),subject:new We};Re(t).transactions.set(n,a);const u=zr(a);return r||t.on.transactionCreation.next(u),u}var Zk=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 qi({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new qi({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 qi({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new qi({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new jk(100);molecules=new Map;moleculeGraph=new qi({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});moleculeData=new qi({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});keyRefsInJoins=new qi({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});miscResources=new Map;on={atomCreation:new We,atomDisposal:new We,selectorCreation:new We,selectorDisposal:new We,timelineCreation:new We,transactionCreation:new We,transactionApplying:new $k(null),operationClose:new We,moleculeCreation:new We,moleculeDisposal:new We};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral",isProduction:!0};loggers=[new Ek("warn",(t,e,n)=>!zk(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},ul(e)&&(this.transactionMeta={epoch:new Map(e?.transactionMeta.epoch),actionContinuities:new qi(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 a=Rs(e,r),u=lT(r);n.add(a.key),n.add(u.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
|
|
13
|
-
${a.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 u=new n.class;return t.defaults.set(n.key,u),u.READONLY_VIEW}case"atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=n.default,c=u(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 u=n.default(r);return t.defaults.set(n.key,u),u}}}function jc(t,e){const{type:n,key:r,catch:a}=e;switch(n){case"readonly_pure_selector":case"writable_pure_selector":{let u;t.logger.info("🧮",n,r,"computing value");try{if(u=e.getFrom(t),u instanceof Promise)return u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return c}throw c})}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return Kn(t,e,c)}throw c}return Kn(t,e,u)}case"atom":{let u;if(Br(e.default))try{u=e.default(),u instanceof Promise&&(u=u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return c}throw c}))}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return u=Kn(t,e,c),t.logger.info("✨",e.type,r,"computed default",u),u}throw c}else u=e.default,t.logger.info("✨",e.type,r,"using static default",u);return Kn(t,e,u)}}}function _s(t,e,n){if(t.valueMap.has(e.key))return uT(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 jc(t,e);case"mutable_atom":{const a=new e.class;return t.logger.info("✨",e.type,r,"created new instance",a),Kn(t,e,a)}}}function Qm(t,e){return ct(t,{key:e.family.key,type:`${e.type}_family`})}const kS={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"},cl=Symbol("MUST_CREATE"),Wk=Symbol("DO_NOT_CREATE");function fl(t,e,n,r){const a=zt(r),u=e.molecules.get(a);if(!u&&e.config.lifespan==="immortal"){const{type:f,key:h}=n;return e.logger.warn("💣","key",a,"was used to mint a counterfeit token for",f,`"${h}"`),{counterfeit:!0,key:`${h}(${a})`,type:kS[f],family:{key:h,subKey:a}}}let c;if(t===cl)e.logger.info("👪",n.type,n.key,"adds member",typeof r=="string"?`\`${r}\``:r),c=n.create(r),u&&e.moleculeData.set(a,n.key);else{const{type:f,key:h}=n;return{key:`${h}(${a})`,type:kS[f],family:{key:h,subKey:a}}}return c}function Wm(t,...e){let n,r,a,u,c;if(e.length===1){if(c=e[0],"family"in c){const h=Qm(t,c);if(a=ct(t,h),u=qr(c.family.subKey),n=dl(t,h,u),"counterfeit"in c)return{token:c,family:a,subKey:u,isNew:!1};n?c=n:(r=fl(cl,t,h,u),c=r)}}else a=ct(t,e[0]),u=e[1],n=dl(t,a,u),n?c=n:(r=fl(cl,t,a,u),c=r);const f="counterfeit"in c;if(r&&f===!1&&a){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 m={type:"state_creation",subType:h,token:c,timestamp:Date.now()};a.subject.next(m);const y=Re(t);if(c.family)if(ul(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 Tn(y)&&y.on.transactionApplying.state===null&&y.transactionMeta.update.subEvents.push(m)}return{token:c,family:a,subKey:u,isNew:!!r}}function An(t,...e){const{token:n,family:r,subKey:a}=Wm(t,...e);return"counterfeit"in n&&r&&a?Zx(t,n,r,a):_s(t,ct(t,n))}function dl(t,e,n){const r=zt(n),a=`${e.key}(${r})`,u=Re(t);let c;switch(e.type){case"atom_family":case"mutable_atom_family":c=u.atoms.get(a);break;case"writable_held_selector_family":case"writable_pure_selector_family":c=u.writableSelectors.get(a);break;case"readonly_held_selector_family":case"readonly_pure_selector_family":c=u.readonlySelectors.get(a);break}return c&&zr(c)}function Pr(t,e,n){const r=ct(t,e),a=dl(t,e,n);return a||fl(Wk,t,r,n)}function Bc(t,e,n){const r=e.key,a="readonly_pure_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Re(t),T={key:S,get:e.get(y)};return e.catch&&(T.catch=e.catch),sy(x,T,v)},internalRoles:n,subject:f,install:y=>Bc(y,e),default:y=>e.get(y)({get:((...g)=>An(t,...g)),find:((...g)=>Pr(t,...g)),json:g=>Rs(t,g)})};return t.families.set(r,m),u}function ey(t,e,n){const r={key:e.key,type:"atom_family"},a=t.families.get(e.key);a&&t.config.isProduction===!0&&t.logger.error("❗","atom_family",e.key,`Overwriting an existing ${Kr[a.type]} "${a.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const u=new We,f={...r,create:h=>{const m=zt(h),y={key:e.key,subKey:m},g=`${e.key}(${m})`,v=Re(t),S=e.default,x={key:g,default:Br(S)?()=>S(h):S};return e.effects&&(x.effects=e.effects(h)),e.catch&&(x.catch=e.catch),ff(v,x,y)},default:e.default,subject:u,install:h=>ey(h,e),internalRoles:n};return t.families.set(e.key,f),Br(e.default)===!1&&t.defaults.set(e.key,e.default),r}function Qx(t,e,n){const r=e.key,a="readonly_held_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`;return ry(Re(t),{key:S,const:e.const(y),get:e.get(y)},v)},internalRoles:n,subject:f,install:y=>Qx(y,e),default:e.const};return t.families.set(r,m),u}function Wx(t,e,n){const r=e.key,a="writable_held_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`;return oy(Re(t),{key:S,const:e.const(y),get:e.get(y),set:e.set(y)},v)},internalRoles:n,subject:f,install:y=>Wx(y,e),default:e.const};return t.families.set(r,m),u}function ty(t,e,n){const r=e.key,a="writable_pure_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Re(t),T={key:S,get:e.get(y),set:e.set(y)};return e.catch&&(T.catch=e.catch),ay(x,T,v)},internalRoles:n,subject:f,install:y=>ty(y,e),default:y=>e.get(y)({get:((...g)=>An(t,...g)),find:((...g)=>Pr(t,...g)),json:g=>Rs(t,g)})};return t.families.set(r,m),u}function eM(t,e){const n="set"in e,r="const"in e;return r&&n?Wx(t,e,void 0):r?Qx(t,e,void 0):n?ty(t,e):Bc(t,e)}function lf(t,...e){let n;if(e.length===1)n=e[0];else{const r=e[0],a=e[1];n=Pr(t,r,a)}try{ct(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":dy(t,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":lM(t,n);break}}function eT(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}"${Tn(t)?` ${t.transactionMeta.phase} "${t.transactionMeta.update.token.key}"`:""}`),t}function tT(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 nT=(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),uf=(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 qp(t,e,n,r,a){const{oldValue:u,newValue:c}=n,f="oldValue"in n,h=zr(e);if(r&&a){e.subject.next({newValue:c});const S={checkpoint:!0,type:"state_creation",subType:"writable",token:h,timestamp:Date.now(),value:c};t.operation.subEvents.push(S),a.subject.next(S);const x=Re(t);if(h.family)if(ul(x))switch(h.type){case"atom":case"mutable_atom":t.on.atomCreation.next(h);break;case"writable_pure_selector":case"writable_held_selector":t.on.selectorCreation.next(h);break}else Tn(x)&&x.on.transactionApplying.state===null&&x.transactionMeta.update.subEvents.push(S);return}const{key:m,subject:y,type:g}=e;let v;if(f?v={oldValue:sc(u)?u.READONLY_VIEW:u,newValue:sc(c)?c.READONLY_VIEW:c}:v={newValue:sc(c)?c.READONLY_VIEW:c},ul(t)){switch(g){case"mutable_atom":t.logger.info("📢",g,m,"is now (",c,") subscribers:",y.subscribers.keys());break;case"atom":case"writable_pure_selector":case"writable_held_selector":t.logger.info("📢",g,m,"went (",u,"->",c,") subscribers:",y.subscribers.keys())}y.next(v)}if(Tn(t)&&(g==="mutable_atom"||g==="atom")){if(t.on.transactionApplying.state===null){if(sc(c))return;const{timestamp:S}=t.operation,x={type:"atom_update",token:h,timestamp:S,update:v};t.transactionMeta.update.subEvents.push(x),t.logger.info("📁","atom",m,"stowed (",u,"->",c,")");return}if(fy(e,"tracker:signal")){const S=m.slice(1),x=t.atoms.get(S);_s(t,x,"mut").do(v.newValue)===null&&cy(t,x)}}}const MS=Symbol("UNSET"),Pp=(t,e,n)=>{let r,a;if(Br(n)){const u=_s(t,e,"mut");r=u,a=n(u)}else t.valueMap.has(e.key)?r=uT(t,e,"mut"):e.type==="atom"&&!Br(e.default)?r=e.default:r=MS,a=n;return t.logger.info("⭐","atom",e.key,"setting value",a),a=Kn(t,e,a),uf(t,e.key),cy(t,e),r===MS?{newValue:a}:{oldValue:r,newValue:a}};function Zh(t,e){switch(e.type){case"mutable_atom":return Pp(t,e,new e.class);case"atom":{let n;return Br(e.default)?n=jc(t,e):n=e.default,Pp(t,e,n)}}}function tM(t,e){let n;switch(e.type){case"atom":case"mutable_atom":n=Zh(t,e);break;case"writable_held_selector":{const r=hl(t,e.key);for(const u of r.values())qp(t,e,Zh(t,u),!1);const a=e.getFrom(t);n={oldValue:a,newValue:a}}break;case"writable_pure_selector":{const r=jc(t,e),a=hl(t,e.key);for(const u of a.values())qp(t,e,Zh(t,u),!1);n={oldValue:r,newValue:jc(t,e)}}break}return n}function Lt(t,...e){El(Hp,t,...e)}const Ip=Symbol("RESET");function ny(t,...e){Lt(t,...e,Ip)}function nM(t,e,n){let r,a,u;const{type:c,key:f}=e;switch(e.type){case"writable_pure_selector":r=_s(t,e,"mut"),a=RS(n,r),a=Kn(t,e,a);break;case"writable_held_selector":u=e.const,RS(n,u),r=u,a=u}return t.logger.info("⭐",c,f,"setting to",a),uf(t,f),e.setSelf(a),{oldValue:r,newValue:a}}const iM=(t,e,n)=>{let r;switch(e.type){case"atom":case"mutable_atom":r=Pp(t,e,n);break;case"writable_pure_selector":case"writable_held_selector":r=nM(t,e,n);break}return r},Hp=Symbol("OWN_OP"),iy=Symbol("JOIN_OP");function El(t,e,...n){let r,a,u,c,f,h;n.length===2?(u=n[0],h=n[1],"family"in u&&(c=Qm(e,u),f=qr(u.family.subKey),r=dl(e,c,f),r?u=r:u=a=fl(cl,e,c,f))):(c=ct(e,n[0]),f=n[1],h=n[2],r=dl(e,c,f),r?u=r:u=a=fl(cl,e,c,f));const m=h===Ip?"reset":"set";let y;if(t===Hp){const S=eT(e,u);if(typeof S=="number"){const x=S,T=e.on.operationClose.subscribe(`waiting to ${m} "${u.key}" at T-${x}`,function(){T(),e.logger.info("🟢",u.type,u.key,"resuming deferred",m,`from T-${x}`),El(t,e,u,h)});return}y=S}else y=e;if("counterfeit"in u&&"family"in u){const S=u.family.subKey,x=e.disposalTraces.buffer.find(T=>T?.key===S);e.logger.error("❌",u.type,u.key,"could not be",m,"because key",S,"is not allocated.",x?`this key was previously disposed:${x.trace}`:"(no previous disposal trace found)");return}const g=ct(y,u);let v;h===Ip?v=tM(y,g):v=iM(y,g,h),qp(y,g,v,!!a,c),t===Hp&&tT(y)}const iT=(t,e)=>Re(t).atoms.has(e),rM=(t,e)=>Re(t).writableSelectors.has(e),sM=(t,e)=>Re(t).readonlySelectors.has(e),oM=(t,e)=>iT(t,e)||rM(t,e)||sM(t,e);function DS(t,e){return Re(t).selectorGraph.getRelationEntries({downstreamSelectorKey:e}).filter(([n,{source:r}])=>r!==e).map(([n,{source:r}])=>r).filter(n=>oM(t,n))}function hl(t,e,n=new Set){const r=DS(t,e),a=new Map;for(;r.length>0;){const u=r.pop();if(!n.has(u))if(n.add(u),iT(t,u)){const c=t.atoms.get(u);a.set(c.key,c)}else r.push(...DS(t,u))}return a}function aM(t,e,n,r,a){const u=Re(t),{type:c,key:f}=r;if(c==="atom"||c==="mutable_atom")u.selectorAtoms.set({selectorKey:n,atomKey:f}),t.logger.info("🔍",e,n,`discovers root atom "${f}"`);else{const h=hl(t,f,a);t.logger.info("🔍",e,n,`discovers root atoms: [ ${[...h.values()].map(m=>`"${m.key}"`).join(", ")} ]`);for(const{key:m}of h.values())u.selectorAtoms=u.selectorAtoms.set({selectorKey:n,atomKey:m})}a.add(f)}function cf(t,e,n,r){return{get:(...a)=>{const u=Re(t),{token:c,family:f,subKey:h}=Wm(t,...a);let m;return"counterfeit"in c&&f&&h?m=Zx(t,c,f,h):m=_s(t,ct(t,c)),t.logger.info("🔌",e,n,`registers dependency ( "${c.key}" =`,m,")"),u.selectorGraph.set({upstreamSelectorKey:c.key,downstreamSelectorKey:n},{source:c.key}),aM(t,e,n,c,r),m},set:((...a)=>{El(iy,Re(t),...a)}),find:((...a)=>Pr(t,...a)),json:a=>Rs(t,a)}}function ry(t,e,n){const r=Re(t),a=new We,u=new Set,{key:c,const:f}=e,h="readonly_held_selector";t.logger.info("🔨",h,c,"is being created");const{get:m,find:y,json:g}=cf(r,h,c,u),S={...e,type:h,subject:a,getFrom:T=>{const M=T.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[C,{source:_}]of M)_!==c&&T.selectorGraph.delete(C,c);return T.selectorAtoms.delete(c),e.get({get:m,find:y,json:g},f),Kn(T,S,f),t.logger.info("✨",h,c,"=",f),u.clear(),f},install:T=>ry(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 sy(t,e,n){const r=Re(t),a=new We,u=new Set,c=e.key,f="readonly_pure_selector";t.logger.info("🔨",f,c,"is being created");const{get:h,find:m,json:y}=cf(r,f,c,u),v={...e,type:f,subject:a,getFrom:()=>{const x=Re(t),T=x.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[C,{source:_}]of T)_!==c&&x.selectorGraph.delete(C,c);x.selectorAtoms.delete(c);const M=Kn(x,v,e.get({get:h,find:m,json:y}));return t.logger.info("✨",f,c,"=",M),u.clear(),M},install:x=>sy(x,e,n)};n&&(v.family=n),r.readonlySelectors.set(c,v);const S={key:c,type:f};return n&&(S.family=n),S}function oy(t,e,n){const r=Re(t),a=new We,u=new Set,{key:c,const:f}=e,h="writable_held_selector";t.logger.info("🔨",h,c,"is being created");const m=cf(r,h,c,u),{find:y,get:g,json:v}=m,S={find:y,get:g,json:v},M={...e,type:h,subject:a,getFrom:_=>{const R=_.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[G,{source:I}]of R)I!==c&&_.selectorGraph.delete(G,c);return _.selectorAtoms.delete(c),e.get(S,f),Kn(_,M,f),t.logger.info("✨",h,c,"=",f),u.clear(),f},setSelf:()=>{e.set(m,f)},install:_=>oy(_,e,n)};n&&(M.family=n),r.writableSelectors.set(c,M);const C={key:c,type:h};return n&&(C.family=n),C}function ay(t,e,n){const r=Re(t),a=new We,u=new Set,c=e.key,f="writable_pure_selector";t.logger.info("🔨",f,c,"is being created");const h=cf(r,f,c,u),{find:m,get:y,json:g}=h,v={find:m,get:y,json:g},T={...e,type:f,subject:a,getFrom:C=>{const _=C.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[G,{source:I}]of _)I!==c&&C.selectorGraph.delete(G,c);C.selectorAtoms.delete(c);const R=Kn(C,T,e.get(v));return t.logger.info("✨",f,c,"=",R),u.clear(),R},setSelf:C=>{e.set(h,C)},install:C=>ay(C,e,n)};n&&(T.family=n),r.writableSelectors.set(c,T);const M={key:c,type:f};return n&&(M.family=n),M}function rT(t,e){const n="set"in e,r="const"in e;if(r&&n){const u=oy(t,e,void 0);return t.on.selectorCreation.next(u),u}if(r){const u=ry(t,e,void 0);return t.on.selectorCreation.next(u),u}if(n){const u=ay(t,e,void 0);return t.on.selectorCreation.next(u),u}const a=sy(t,e,void 0);return t.on.selectorCreation.next(a),a}function lM(t,e){const n=Re(t),{key:r,type:a,family:u}=e;if(!u)t.logger.error("❌",a,r,"Standalone selectors cannot be disposed.");else{n.molecules.get(u.subKey)&&n.moleculeData.delete(u.subKey,u.key);let c;switch(e.type){case"writable_held_selector":n.writableSelectors.delete(r),c={key:u.key,type:"writable_held_selector_family"},ct(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:u.key,type:"writable_pure_selector_family"},ct(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:u.key,type:"readonly_held_selector_family"},ct(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:u.key,type:"readonly_pure_selector_family"},ct(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(u.key,u.subKey),t.logger.info("🔥",e.type,r,"deleted"),Tn(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 uM=(t,e)=>{const n=Re(t);return n.operation.open?n.operation.prev.get(e.key):n.valueMap.get(e.key)},NS=(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 a=uM(t,e),u=_s(t,e);t.logger.info("✨",e.type,e.key,"went",a,"->",u),e.subject.next({newValue:u,oldValue:a})});function Bo(t,e,n,r){function a(g){if(t.operation.open){if(u?.type==="atom"&&fy(u,"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)}Wm(t,e);const u=ct(t,e);t.logger.info("👀",u.type,u.key,`Adding subscription "${n}"`);const c=u.type==="writable_pure_selector"||u.type==="readonly_pure_selector",f=new Map;let h=a;if(c){_s(t,u);for(const[g,v]of hl(t,u.key))f.set(g,NS(t,u,v));h=function(v){const S=hl(t,u.key);for(const[x,T]of f)S.get(x)?S.delete(x):(T(),f.delete(x));for(const[x,T]of S)f.set(x,NS(t,u,T));a(v)}}const m=u.subject.subscribe(n,h);return()=>{t.logger.info("🙈",u.type,u.key,`Removing subscription "${n}"`),m();for(const g of f.values())g()}}const sT=(t,e,n,r)=>{const a=ct(t,e);t.logger.info("👀","timeline",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","timeline",e.key,`Removing subscription "${n}" from timeline`),u()}},oT=(t,e,n,r)=>{const a=ct(t,e);t.logger.info("👀","transaction",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","transaction",e.key,`Removing subscription "${n}"`),u()}};function cM(t,e,n,r=af()){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 Bo(t,e,r,n);case"transaction":return oT(t,e,r,n);case"timeline":return sT(t,e,r,n)}}var ly=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,a=ff(e,{key:n,default:null},r,["tracker:signal"]);if(e.parent?.valueMap.has(n)){const u=e.parent.valueMap.get(n);e.valueMap.set(n,u)}return a}unsubscribeFromInnerValue;unsubscribeFromState;captureSignalsFromCore(t,e,n){const r=t.key,a=`tracker-from-core:${n.config.name}:${Tn(n)?n.transactionMeta.update.token.key:"main"}:${r}`,u=c=>{El(iy,n,e,c)};this.unsubscribeFromInnerValue=An(n,t).subscribe(a,u),this.unsubscribeFromState=Bo(n,t,a,(function(f){f.newValue!==f.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=f.newValue.subscribe(a,u))}).bind(this))}supplySignalsToCore(t,e,n){const r=t.key,a=`tracker-to-core:${n.config.name}:${Tn(n)?n.transactionMeta.update.token.key:"main"}:${r}`;Bo(n,e,a,Object.assign(function({newValue:c,oldValue:f}){const h=n.timelineTopics.getRelatedKey(e.key);if(h&&n.timelines.get(h)?.timeTraveling){const m=sT(n,{key:h,type:"timeline"},a,function(g){m(),Lt(n,t,v=>(g==="redo"&&c?v.do(c):g==="undo"&&f&&v.undo(f),v))});return}Lt(n,t,m=>(m.do(c),m))},{inboundTracker:!0}))}mutableAtomToken;latestSignalToken;[Symbol.dispose];constructor(t,e){const n=Re(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 uy(t,e,n){t.logger.info("🔨","atom",e.key,`creating in store "${t.config.name}"`);const r=Re(t),{key:a}=e,u=r.atoms.get(a),c="mutable_atom";if(u?.type===c&&t.config.isProduction===!0)return t.logger.error("❌",c,a,"Tried to create atom, but it already exists in the store."),zr(u);const f=new We,h={...e,type:c,install:y=>(y.logger.info("🛠️","atom",a,`installing in store "${y.config.name}"`),uy(y,e,n)),subject:f};n&&(h.family=n),r.atoms.set(h.key,h);const m=zr(h);if(new ly(m,t),n||rT(t,{key:`${a}:JSON`,get:({get:y})=>y(m).toJSON(),set:({set:y},g)=>{y(m,e.class.fromJSON(g))}}),e.effects){let y=0;const g=[];for(const v of e.effects){const S=v({resetSelf:()=>{ny(t,m)},setSelf:x=>{Lt(t,m,x)},onSet:x=>Bo(t,m,`effect[${y}]`,x),token:m,store:Ym(t)});S&&g.push(S),++y}h.cleanup=()=>{for(const v of g)v()}}return t.on.atomCreation.next(m),m}var fM=class{trackers=new Map;latestSignalAtoms;mutableAtoms;constructor(t,e){this.latestSignalAtoms=ct(e,ey(e,{key:`*${t.key}`,default:null},["mutable","updates"])),this.mutableAtoms=t;const n=r=>{const{type:a,token:u}=r;if(u.family){const c=qr(u.family.subKey);switch(a){case"state_creation":this.trackers.set(c,new ly(u,e));break;case"state_disposal":{const f=this.trackers.get(c);f&&(f[Symbol.dispose](),this.trackers.delete(c))}}}};this.mutableAtoms.subject.subscribe(`store=${e.config.name}::tracker-atom-family`,n)}};function aT(t,e,n){const r={key:e.key,type:"mutable_atom_family"},a=t.families.get(e.key);a&&t.config.isProduction===!0&&t.logger.error("❗","mutable_atom_family",e.key,`Overwriting an existing ${Kr[a.type]} "${a.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const u=new We,f={...r,create:h=>{const m=zt(h),y={key:e.key,subKey:m},g=`${e.key}(${m})`,v=Re(t),S={key:g,class:e.class};return e.effects&&(S.effects=e.effects(h)),uy(v,S,y)},class:e.class,subject:u,install:h=>aT(h,e),internalRoles:n};return t.families.set(e.key,f),ty(t,{key:`${e.key}:JSON`,get:h=>({get:m})=>m(r,h).toJSON(),set:h=>({set:m},y)=>{m(r,h,e.class.fromJSON(y))}},["mutable","json"]),new fM(f,t),r}const dM=(t,e)=>{const n=Re(e),r=`${t.key}:JSON`;return n.families.get(r)},Rs=(t,e)=>e.family?Pr(t,ct(Re(t),{key:`${e.family.key}:JSON`,type:"writable_pure_selector_family"}),qr(e.family.subKey)):{type:"writable_pure_selector",key:`${e.key}:JSON`},lT=t=>{const e={type:"atom",key:`*${t.key}`};return t.family&&(e.family={key:`*${t.family.key}`,subKey:t.family.subKey}),e};function sc(t){return typeof t=="object"&&t!==null&&"do"in t&&"undo"in t&&"subscribe"in t&&"READONLY_VIEW"in t&&"toJSON"in t}function Kn(t,e,n){const{key:r,subject:a,type:u}=e,c=t.valueMap.get(r);if(c instanceof Kp&&!c.done){const f=c;return n instanceof Promise?(f.use(n),f):(t.valueMap.set(r,n),n)}if(n instanceof Promise){const f=new Kp(n);return t.valueMap.set(r,f),f.then(function(m){if(t.valueMap.get(r)===f){switch(eT(t,e),Kn(t,e,m),u){case"atom":cy(t,e);break;case"readonly_pure_selector":case"writable_pure_selector":fT(t,r);break}tT(t),a.next({newValue:m,oldValue:f})}}).catch(h=>{t.logger.error("💥",e.type,r,"rejected:",h)}),f}return t.logger.info("📝",e.type,e.key,"writing to cache",n),t.valueMap.set(r,n),n}function uT(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"&&Tn(t)){const a=e,{parent:u}=t;if(t.valueMap.hasOwn(a.key))return r;const c=u.valueMap.get(a.key);t.logger.info("📃","atom",a.key,"copying");const f=c.toJSON(),h=a.class.fromJSON(f);t.valueMap.set(a.key,h),new ly(a,u),r=h}return r}function cT(t,e){const n=t.valueMap.get(e);if(n instanceof Kp){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 cy(t,e){const n=Re(t),{key:r,type:a}=e,u=n.selectorAtoms.getRelatedKeys(r);if(n.logger.info("🧹",a,r,u?`evicting ${u.size} states downstream:`:"no downstream states",u??"to evict"),u){n.operation.open&&n.logger.info("🧹",a,r,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const c of u)nT(n,c)||(cT(n,c),uf(n,c))}}function fT(t,e){const n=Re(t),r=n.selectorGraph.getRelationEntries({upstreamSelectorKey:e}).filter(([a,{source:u}])=>u===e);for(const[a]of r)nT(n,a)||(cT(n,a),uf(n,a),fT(t,a))}function ff(t,e,n,r){const a="atom",{key:u}=e;t.logger.info("🔨",a,u,"is being created");const c=Re(t),f=c.atoms.get(u);if(f?.type===a&&t.config.isProduction===!0)return t.logger.error("❌","atom",u,"Tried to create atom, but it already exists in the store."),zr(f);const h=new We,m={...e,type:a,install:g=>(g.logger.info("🛠️",a,u,`installing in store "${g.config.name}"`),ff(g,e,n)),subject:h};n&&(m.family=n),r&&(m.internalRoles=r),c.atoms.set(u,m);const y=zr(m);if(e.effects){let g=0;const v=[];for(const S of e.effects){const x=S({resetSelf:()=>{ny(t,y)},setSelf:T=>{Lt(t,y,T)},onSet:T=>Bo(t,y,`effect[${g}]`,T),token:y,store:Ym(t)});x&&v.push(x),++g}m.cleanup=()=>{for(const S of v)S()}}return t.on.atomCreation.next(y),y}function fy(t,e){return"internalRoles"in t?t.internalRoles.includes(e):!1}function dy(t,e){const n=Re(t),{key:r,family:a}=e,u=ct(n,e);if(!a)t.logger.error("❌","atom",r,"Standalone atoms cannot be disposed.");else{u.cleanup?.();const c=t.valueMap.get(u.key),f=ct(t,Qm(t,e)).subject,h={type:"state_disposal",subType:"atom",token:e,value:c,timestamp:Date.now()};f.next(h);const m=Tn(n);if(n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),n.moleculeData.delete(a.key,a.subKey),t.timelineTopics.delete(r),e.type==="mutable_atom"&&(dy(t,lT(e)),t.trackers.delete(r)),t.logger.info("🔥","atom",r,"deleted"),m&&n.transactionMeta.phase==="building"){const y=n.transactionMeta.update.subEvents.at(-1),g=y?.type==="molecule_disposal"&&y.values.some(([S])=>S===u.family?.key),v=fy(u,"tracker:signal");!g&&!v&&n.transactionMeta.update.subEvents.push(h)}else t.on.atomDisposal.next(e)}}function hs(t){return t[0].toUpperCase()+t.slice(1)}var dT=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=Ft.STORE){this.store=e,this.options=t,this.store.miscResources.set(`join:${t.key}`,this),this.toolkit={get:((...y)=>An(e,...y)),set:((...y)=>{Lt(e,...y)}),find:((...y)=>Pr(e,...y)),json:y=>Rs(e,y)};const n=t.between[0],r=t.between[1],a=aT(e,{key:`${t.key}/relatedKeys`,class:Kx},["join","relations"]);this.relatedKeysAtoms=a;const u=(y,g,v)=>{const{find:S,get:x,set:T}=y,M=S(a,g),C=x(M);for(const _ of C)v.includes(_)||T(a,_,R=>(R.delete(g),R));T(M,_=>{_.clear();for(const R of v){const G=S(a,R),I=x(G),ee=I.has(g);if(this.relations.cardinality==="1:n"){const J=[];for(const X of I){if(X===g)continue;let he;El(iy,this.store,a,X,pe=>(pe.delete(R),he=pe.size,pe)),he===0&&J.push(X)}!ee&&I.size>0&&T(G,X=>(X.clear(),X));for(const X of J)e.keyRefsInJoins.delete(Sc(R,X))}ee||T(G,J=>(J.add(g),J)),_.add(R)}return _})},c=(y,g,v)=>{const{set:S}=y;S(a,g,x=>{for(const T of v)x.add(T);return x});for(const x of v)S(a,x,T=>(T.add(g),T));return!0},f=new qi(t,{externalStore:{getRelatedKeys:y=>this.toolkit.get(a,y),addRelation:(y,g)=>{this.store.keyRefsInJoins.set(`"${y}"`,t.key),this.store.keyRefsInJoins.set(`"${g}"`,t.key),this.store.keyRefsInJoins.set(Sc(y,g),t.key),this.toolkit.set(a,y,v=>v.add(g)),this.toolkit.set(a,g,v=>v.add(y))},deleteRelation:(y,g)=>{this.toolkit.set(a,y,S=>(S.delete(g),S)),this.toolkit.set(a,g,S=>(S.delete(y),S));const v=Sc(y,g);this.store.keyRefsInJoins.delete(v)},replaceRelationsSafely:(y,g)=>{u(this.toolkit,y,g)},replaceRelationsUnsafely:(y,g)=>{c(this.toolkit,y,g)},has:(y,g)=>{const v=this.toolkit.get(a,y);return g?v.has(g):v.size>0}},isAType:t.isAType,isBType:t.isBType}),h=()=>Bc(e,{key:`${t.key}/singleRelatedKey`,get:y=>({get:g})=>{const v=g(a,y);for(const S of v)return S;return null}},["join","keys"]),m=()=>Bc(e,{key:`${t.key}/multipleRelatedKeys`,get:y=>({get:g})=>g(dM(a,e),y)},["join","keys"]);switch(t.cardinality){case"1:1":{const y=h(),g=`${n}KeyOf${hs(r)}`,v=`${r}KeyOf${hs(n)}`;this.relations=f,this.states={[g]:y,[v]:y};break}case"1:n":{const y=h(),g=m(),v=`${n}KeyOf${hs(r)}`,S=`${r}KeysOf${hs(n)}`,x={[v]:y,[S]:g};this.relations=f,this.states=x;break}case"n:n":{const y=m(),g=`${n}KeysOf${hs(r)}`,v=`${r}KeysOf${hs(n)}`;this.relations=f,this.states={[g]:y,[v]:y}}}}};function hM(t,e){return t.joins.set(e.key,new dT(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=Ft.STORE.joins.get(t.key);if(r===void 0)throw new Error(`Join "${t.key}" not found in store "${e.config.name}"`);const a=Ym(e);n=new dT(r.options,a),e.joins.set(t.key,n)}return n}function mM(t,e){return pM(t,e).relatedKeysAtoms}var Qh={exports:{}},ye={};var $S;function yM(){if($S)return ye;$S=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,M={};function C(E,q,H){this.props=E,this.context=q,this.refs=M,this.updater=H||x}C.prototype.isReactComponent={},C.prototype.setState=function(E,q){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,q,"setState")},C.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function _(){}_.prototype=C.prototype;function R(E,q,H){this.props=E,this.context=q,this.refs=M,this.updater=H||x}var G=R.prototype=new _;G.constructor=R,T(G,C.prototype),G.isPureReactComponent=!0;var I=Array.isArray;function ee(){}var J={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function he(E,q,H){var Q=H.ref;return{$$typeof:t,type:E,key:q,ref:Q!==void 0?Q:null,props:H}}function pe(E,q){return he(E.type,q,E.props)}function we(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function je(E){var q={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(H){return q[H]})}var ve=/\/+/g;function Z(E,q){return typeof E=="object"&&E!==null&&E.key!=null?je(""+E.key):q.toString(36)}function ne(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ee,ee):(E.status="pending",E.then(function(q){E.status==="pending"&&(E.status="fulfilled",E.value=q)},function(q){E.status==="pending"&&(E.status="rejected",E.reason=q)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function j(E,q,H,Q,re){var ce=typeof E;(ce==="undefined"||ce==="boolean")&&(E=null);var Te=!1;if(E===null)Te=!0;else switch(ce){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(E.$$typeof){case t:case e:Te=!0;break;case y:return Te=E._init,j(Te(E._payload),q,H,Q,re)}}if(Te)return re=re(E),Te=Q===""?"."+Z(E,0):Q,I(re)?(H="",Te!=null&&(H=Te.replace(ve,"$&/")+"/"),j(re,q,H,"",function(ii){return ii})):re!=null&&(we(re)&&(re=pe(re,H+(re.key==null||E&&E.key===re.key?"":(""+re.key).replace(ve,"$&/")+"/")+Te)),q.push(re)),1;Te=0;var Ct=Q===""?".":Q+":";if(I(E))for(var Je=0;Je<E.length;Je++)Q=E[Je],ce=Ct+Z(Q,Je),Te+=j(Q,q,H,ce,re);else if(Je=S(E),typeof Je=="function")for(E=Je.call(E),Je=0;!(Q=E.next()).done;)Q=Q.value,ce=Ct+Z(Q,Je++),Te+=j(Q,q,H,ce,re);else if(ce==="object"){if(typeof E.then=="function")return j(ne(E),q,H,Q,re);throw q=String(E),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Te}function U(E,q,H){if(E==null)return E;var Q=[],re=0;return j(E,Q,"","",function(ce){return q.call(H,ce,re++)}),Q}function L(E){if(E._status===-1){var q=E._result;q=q(),q.then(function(H){(E._status===0||E._status===-1)&&(E._status=1,E._result=H)},function(H){(E._status===0||E._status===-1)&&(E._status=2,E._result=H)}),E._status===-1&&(E._status=0,E._result=q)}if(E._status===1)return E._result.default;throw E._result}var te=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},oe={map:U,forEach:function(E,q,H){U(E,function(){q.apply(this,arguments)},H)},count:function(E){var q=0;return U(E,function(){q++}),q},toArray:function(E){return U(E,function(q){return q})||[]},only:function(E){if(!we(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return ye.Activity=g,ye.Children=oe,ye.Component=C,ye.Fragment=n,ye.Profiler=a,ye.PureComponent=R,ye.StrictMode=r,ye.Suspense=h,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,ye.__COMPILER_RUNTIME={__proto__:null,c:function(E){return J.H.useMemoCache(E)}},ye.cache=function(E){return function(){return E.apply(null,arguments)}},ye.cacheSignal=function(){return null},ye.cloneElement=function(E,q,H){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var Q=T({},E.props),re=E.key;if(q!=null)for(ce in q.key!==void 0&&(re=""+q.key),q)!X.call(q,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&q.ref===void 0||(Q[ce]=q[ce]);var ce=arguments.length-2;if(ce===1)Q.children=H;else if(1<ce){for(var Te=Array(ce),Ct=0;Ct<ce;Ct++)Te[Ct]=arguments[Ct+2];Q.children=Te}return he(E.type,re,Q)},ye.createContext=function(E){return E={$$typeof:c,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:u,_context:E},E},ye.createElement=function(E,q,H){var Q,re={},ce=null;if(q!=null)for(Q in q.key!==void 0&&(ce=""+q.key),q)X.call(q,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(re[Q]=q[Q]);var Te=arguments.length-2;if(Te===1)re.children=H;else if(1<Te){for(var Ct=Array(Te),Je=0;Je<Te;Je++)Ct[Je]=arguments[Je+2];re.children=Ct}if(E&&E.defaultProps)for(Q in Te=E.defaultProps,Te)re[Q]===void 0&&(re[Q]=Te[Q]);return he(E,ce,re)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(E){return{$$typeof:f,render:E}},ye.isValidElement=we,ye.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:L}},ye.memo=function(E,q){return{$$typeof:m,type:E,compare:q===void 0?null:q}},ye.startTransition=function(E){var q=J.T,H={};J.T=H;try{var Q=E(),re=J.S;re!==null&&re(H,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(ee,te)}catch(ce){te(ce)}finally{q!==null&&H.types!==null&&(q.types=H.types),J.T=q}},ye.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},ye.use=function(E){return J.H.use(E)},ye.useActionState=function(E,q,H){return J.H.useActionState(E,q,H)},ye.useCallback=function(E,q){return J.H.useCallback(E,q)},ye.useContext=function(E){return J.H.useContext(E)},ye.useDebugValue=function(){},ye.useDeferredValue=function(E,q){return J.H.useDeferredValue(E,q)},ye.useEffect=function(E,q){return J.H.useEffect(E,q)},ye.useEffectEvent=function(E){return J.H.useEffectEvent(E)},ye.useId=function(){return J.H.useId()},ye.useImperativeHandle=function(E,q,H){return J.H.useImperativeHandle(E,q,H)},ye.useInsertionEffect=function(E,q){return J.H.useInsertionEffect(E,q)},ye.useLayoutEffect=function(E,q){return J.H.useLayoutEffect(E,q)},ye.useMemo=function(E,q){return J.H.useMemo(E,q)},ye.useOptimistic=function(E,q){return J.H.useOptimistic(E,q)},ye.useReducer=function(E,q,H){return J.H.useReducer(E,q,H)},ye.useRef=function(E){return J.H.useRef(E)},ye.useState=function(E){return J.H.useState(E)},ye.useSyncExternalStore=function(E,q,H){return J.H.useSyncExternalStore(E,q,H)},ye.useTransition=function(){return J.H.useTransition()},ye.version="19.2.0",ye}var jS;function hy(){return jS||(jS=1,Qh.exports=yM()),Qh.exports}var $=hy();const gM=gk($),hT=yk({__proto__:null,default:gM},[$]),py=$.createContext(Ft.STORE);function pT(t,...e){let n;if(e.length===2){const r=e[0],a=e[1];n=Pr(t,r,a)}else n=e[0];return n}function Wn(...t){const e=$.useContext(py),n=pT(e,...t),r=$.useRef(null);return r.current??=a=>{Lt(e,n,a)},r.current}function Et(...t){const e=$.useContext(py),n=pT(e,...t),r=$.useId();return $.useSyncExternalStore(a=>Bo(e,n,`use-o:${r}`,a),()=>An(e,n),()=>An(e,n))}const mT=(t,{stringify:e,parse:n},r)=>({setSelf:a,onSet:u})=>{if(!t)return;const c=t.getItem(r);c!=null&&a(n(c)),u(({newValue:f})=>{if(f==null){t.removeItem(r);return}t.setItem(r,e(f))})};wk({key:"mutex",default:!1});var bM=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)}},vM=class Fp{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(e){this.key=e}static existing=new bM;static create(e,n){const{type:r,globals:a,actions:u,perspectives:c}=n(new Fp(e)),f={type:r,key:e,globals:a,actions:u,perspectives:c};return Fp.existing.set(e,f),f}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 SM(t){const{key:e,config:n}=t,r=vM.create(e,n),{actions:a}=r;for(const u of a)Jx(Ft.STORE,e,u.key);return Zm(Ft.STORE,e,-1),r}const wM=t=>t.startsWith("user::"),xM=t=>t.startsWith("room::");Sk({key:"roomIndex",class:Kx});const TM=xk({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:xM,isBType:wM});_k({key:"usersInMyRoomView",get:t=>({find:e})=>[e(Tk(TM),t)]});const AM=(t,e,n,r,a)=>u=>{function c(h,m){if(t.logger.info("🧑⚖️","continuity",e,"reconciling updates"),Lt(t,wc,g=>(g.shift(),g)),h.id===m.id){if(JSON.stringify(h.subEvents)===JSON.stringify(m.subEvents)){t.logger.info("✅","continuity",e,`results for ${h.id} match between client and server`),n.emit(`ack:${e}`,m.epoch);return}}else t.logger.info("❌","continuity",e,`thought update #${m.epoch} was ${h.token.key}:${h.id}, but it was actually ${m.token.key}:${m.id}`);t.logger.info("🧑⚖️","continuity",e,"updates do not match",h,m);const y=r.toReversed();for(const g of y)wo(t,g,"oldValue");t.logger.info("⏪","continuity",e,"undid optimistic updates:",y),wo(t,h,"oldValue"),t.logger.info("⏪","continuity",e,"undid zeroth optimistic update",h),wo(t,m,"newValue"),t.logger.info("⏩","continuity",e,"applied confirmed update",m),n.emit(`ack:${e}`,m.epoch);for(const g of r){const v={type:"transaction",key:g.token.key},{id:S,params:x}=g;Jm(t,v,S)(...x)}t.logger.info("⏩","continuity",e,"reapplied subsequent optimistic updates:",r)}t.logger.info("🧑⚖️","continuity",e,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:a,optimisticUpdates:r});const f=r[0];if(f)if(t.logger.info("🧑⚖️","continuity",e,"has optimistic updates to reconcile"),u.epoch===f.epoch){t.logger.info("🧑⚖️","continuity",e,`epoch of confirmed update #${u.epoch} matches zeroth optimistic update`),c(f,u);for(const h of a){const m=r[0];if(h.epoch===m?.epoch)c(m,h);else break}}else t.logger.info("🧑⚖️","continuity",e,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${f.epoch}`),a.some(h=>h.epoch===u.epoch)||(t.logger.info("👈","continuity",e,"pushing confirmed update to queue",u),Lt(t,Gp,h=>(h.push(u),h.sort((m,y)=>m.epoch-y.epoch),h)));else{t.logger.info("🧑⚖️","continuity",e,"has no optimistic updates to deal with");let h;h=Yx(t,e),h===u.epoch-1?(t.logger.info("✅","continuity",e,`integrating update #${u.epoch} (${u.token.key} ${u.id})`),wo(t,u,"newValue"),n.emit(`ack:${e}`,u.epoch),Zm(t,e,u.epoch)):h!==void 0&&(t.logger.info("🧑⚖️","continuity",e,`received update #${u.epoch} but still waiting for update #${h+1}`,{clientEpoch:h,serverEpoch:u.epoch}),a.some(m=>m.epoch===u.epoch)?t.logger.info("👍","continuity",e,`confirmed update #${u.epoch} is already enqueued`):(t.logger.info("👈","continuity",e,`pushing confirmed update #${u.epoch} to queue`),Lt(t,Gp,m=>(m.push(u),m.sort((y,g)=>y.epoch-g.epoch),m))))}};function EM(t){return e=>{for(const n of e)dy(t,n)}}function OM(t){return e=>{let n=0,r,a;for(const u of e)n%2===0?r=u:(a=u,Lt(t,r,a)),n++}}const _M=ft({key:"mySocketKey",default:void 0});ft({key:"myUserKey",default:null,effects:[mT(globalThis.localStorage,JSON,"myUserKey")]});const wc=ft({key:"optimisticUpdateQueue",default:()=>[]}),Gp=ft({key:"confirmedUpdateQueue",default:()=>[]});function RM(t,e,n){const r=n.key,a=An(t,wc),u=An(t,Gp),c=(g,v)=>{e.off(`continuity-init:${r}`,c);let S=0,x,T;for(const M of v)S%2===0?x=M:(T=M,"type"in x&&x.type==="mutable_atom"&&(x=Rs(t,x)),Lt(t,x,T)),S++;Zm(t,r,g)};e.off(`continuity-init:${r}`),e.on(`continuity-init:${r}`,c);const f=AM(t,r,e,a,u);e.off(`tx-new:${r}`),e.on(`tx-new:${r}`,f);const h=n.actions.map(g=>(Jx(t,r,g.key),oT(t,g,`tx-run:${r}`,v=>{t.logger.info("🤞","continuity",r,"enqueuing optimistic update");const S=a.findIndex(x=>x.id===v.id);S===-1?(t.logger.info("🤞","continuity",r,"enqueuing new optimistic update"),Lt(t,wc,x=>(x.push(v),x.sort((T,M)=>T.epoch-M.epoch),x))):(t.logger.info("🤞","continuity",r,`replacing existing optimistic update at index ${S}`),Lt(t,wc,x=>(x[S]=v,x))),e.emit(`tx-run:${r}`,{id:v.id,token:g,params:v.params})}))),m=OM(t),y=EM(t);return e.on(`reveal:${r}`,m),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 yT=$.createContext({socket:null,services:null}),CM=({children:t,socket:e})=>{const n=$.useRef(new Map).current,r=Wn(_M);return $.useEffect(()=>{r(e?.id?`socket::${e.id}`:void 0),e?.on("connect",()=>{r(e?.id?`socket::${e.id}`:void 0)}),e?.on("disconnect",()=>{r(void 0)})},[e,r]),F.jsx(yT.Provider,{value:{socket:e,services:n},children:t})};function kM(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()=>{Br(r)&&r(),n.current=!1}},e)}else $.useEffect(t,e)}function MM(t,e){const{socket:n,services:r}=$.useContext(yT);kM(()=>{let a=r?.get(t);return a?++a.consumerCount:n&&(a={consumerCount:1,dispose:e(n)},r?.set(t,a)),()=>{a&&(--a.consumerCount,a.consumerCount===0&&(a.dispose?.(),r?.delete(t)))}},[n,t])}function DM(t){const e=$.useContext(py);MM(`tx-sync:${t.key}`,n=>RM(e,n,t))}var Wh={exports:{}},Ga={},ep={exports:{}},tp={};var BS;function NM(){return BS||(BS=1,(function(t){function e(j,U){var L=j.length;j.push(U);e:for(;0<L;){var te=L-1>>>1,oe=j[te];if(0<a(oe,U))j[te]=U,j[L]=oe,L=te;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var U=j[0],L=j.pop();if(L!==U){j[0]=L;e:for(var te=0,oe=j.length,E=oe>>>1;te<E;){var q=2*(te+1)-1,H=j[q],Q=q+1,re=j[Q];if(0>a(H,L))Q<oe&&0>a(re,H)?(j[te]=re,j[Q]=L,te=Q):(j[te]=H,j[q]=L,te=q);else if(Q<oe&&0>a(re,L))j[te]=re,j[Q]=L,te=Q;else break e}}return U}function a(j,U){var L=j.sortIndex-U.sortIndex;return L!==0?L:j.id-U.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();t.unstable_now=function(){return c.now()-f}}var h=[],m=[],y=1,g=null,v=3,S=!1,x=!1,T=!1,M=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function G(j){for(var U=n(m);U!==null;){if(U.callback===null)r(m);else if(U.startTime<=j)r(m),U.sortIndex=U.expirationTime,e(h,U);else break;U=n(m)}}function I(j){if(T=!1,G(j),!x)if(n(h)!==null)x=!0,ee||(ee=!0,je());else{var U=n(m);U!==null&&ne(I,U.startTime-j)}}var ee=!1,J=-1,X=5,he=-1;function pe(){return M?!0:!(t.unstable_now()-he<X)}function we(){if(M=!1,ee){var j=t.unstable_now();he=j;var U=!0;try{e:{x=!1,T&&(T=!1,_(J),J=-1),S=!0;var L=v;try{t:{for(G(j),g=n(h);g!==null&&!(g.expirationTime>j&&pe());){var te=g.callback;if(typeof te=="function"){g.callback=null,v=g.priorityLevel;var oe=te(g.expirationTime<=j);if(j=t.unstable_now(),typeof oe=="function"){g.callback=oe,G(j),U=!0;break t}g===n(h)&&r(h),G(j)}else r(h);g=n(h)}if(g!==null)U=!0;else{var E=n(m);E!==null&&ne(I,E.startTime-j),U=!1}}break e}finally{g=null,v=L,S=!1}U=void 0}}finally{U?je():ee=!1}}}var je;if(typeof R=="function")je=function(){R(we)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,Z=ve.port2;ve.port1.onmessage=we,je=function(){Z.postMessage(null)}}else je=function(){C(we,0)};function ne(j,U){J=C(function(){j(t.unstable_now())},U)}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(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(j){switch(v){case 1:case 2:case 3:var U=3;break;default:U=v}var L=v;v=U;try{return j()}finally{v=L}},t.unstable_requestPaint=function(){M=!0},t.unstable_runWithPriority=function(j,U){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var L=v;v=j;try{return U()}finally{v=L}},t.unstable_scheduleCallback=function(j,U,L){var te=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?te+L:te):L=te,j){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=L+oe,j={id:y++,callback:U,priorityLevel:j,startTime:L,expirationTime:oe,sortIndex:-1},L>te?(j.sortIndex=L,e(m,j),n(h)===null&&j===n(m)&&(T?(_(J),J=-1):T=!0,ne(I,L-te))):(j.sortIndex=oe,e(h,j),x||S||(x=!0,ee||(ee=!0,je()))),j},t.unstable_shouldYield=pe,t.unstable_wrapCallback=function(j){var U=v;return function(){var L=v;v=U;try{return j.apply(this,arguments)}finally{v=L}}}})(tp)),tp}var zS;function $M(){return zS||(zS=1,ep.exports=NM()),ep.exports}var np={exports:{}},Yt={};var LS;function jM(){if(LS)return Yt;LS=1;var t=hy();function e(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+m+" 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},a=Symbol.for("react.portal");function u(h,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:h,containerInfo:m,implementation:y}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Yt.createPortal=function(h,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(e(299));return u(h,m,null,y)},Yt.flushSync=function(h){var m=c.T,y=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=m,r.p=y,r.d.f()}},Yt.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},Yt.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Yt.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:S}):y==="script"&&r.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Yt.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=f(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},Yt.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin);r.d.L(h,y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Yt.preloadModule=function(h,m){if(typeof h=="string")if(m){var y=f(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},Yt.requestFormReset=function(h){r.d.r(h)},Yt.unstable_batchedUpdates=function(h,m){return h(m)},Yt.useFormState=function(h,m,y){return c.H.useFormState(h,m,y)},Yt.useFormStatus=function(){return c.H.useHostTransitionStatus()},Yt.version="19.2.0",Yt}var VS;function gT(){if(VS)return np.exports;VS=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(),np.exports=jM(),np.exports}var US;function BM(){if(US)return Ga;US=1;var t=$M(),e=hy(),n=gT();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}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 a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function u(i){var s=i,o=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(o=s.return),i=s.return;while(i)}return s.tag===3?o: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 f(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function h(i){if(u(i)!==i)throw Error(r(188))}function m(i){var s=i.alternate;if(!s){if(s=u(i),s===null)throw Error(r(188));return s!==i?null:i}for(var o=i,l=s;;){var d=o.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){o=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===o)return h(d),i;if(p===l)return h(d),s;p=p.sibling}throw Error(r(188))}if(o.return!==l.return)o=d,l=p;else{for(var b=!1,w=d.child;w;){if(w===o){b=!0,o=d,l=p;break}if(w===l){b=!0,l=d,o=p;break}w=w.sibling}if(!b){for(w=p.child;w;){if(w===o){b=!0,o=p,l=d;break}if(w===l){b=!0,l=p,o=d;break}w=w.sibling}if(!b)throw Error(r(189))}}if(o.alternate!==l)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:s}function y(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=y(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),R=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),pe=Symbol.for("react.memo_cache_sentinel"),we=Symbol.iterator;function je(i){return i===null||typeof i!="object"?null:(i=we&&i[we]||i["@@iterator"],typeof i=="function"?i:null)}var ve=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===ve?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case T:return"Fragment";case C:return"Profiler";case M:return"StrictMode";case I:return"Suspense";case ee:return"SuspenseList";case he:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case R:return i.displayName||"Context";case _: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 J:return s=i.displayName||null,s!==null?s:Z(i.type)||"Memo";case X:s=i._payload,i=i._init;try{return Z(i(s))}catch{}}return null}var ne=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},te=[],oe=-1;function E(i){return{current:i}}function q(i){0>oe||(i.current=te[oe],te[oe]=null,oe--)}function H(i,s){oe++,te[oe]=i.current,i.current=s}var Q=E(null),re=E(null),ce=E(null),Te=E(null);function Ct(i,s){switch(H(ce,s),H(re,i),H(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?F0(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=F0(s),i=G0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(Q),H(Q,i)}function Je(){q(Q),q(re),q(ce)}function ii(i){i.memoizedState!==null&&H(Te,i);var s=Q.current,o=G0(s,i.type);s!==o&&(H(re,i),H(Q,o))}function xi(i){re.current===i&&(q(Q),q(re)),Te.current===i&&(q(Te),qa._currentValue=L)}var xe,Me;function ge(i){if(xe===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);xe=s&&s[1]||"",Me=-1<o.stack.indexOf(`
|
|
12
|
+
${g.trace}`:`No previous disposal trace for ${f} was found.`),n}const m=t.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:g}])=>g!==a).map(([g])=>qr(g));r&&u.moleculeGraph.delete(a),u.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,exclusive:!!r,from:m,to:[h.key],timestamp:Date.now()};return Tn(u)&&u.transactionMeta.phase==="building"&&u.transactionMeta.update.subEvents.push(y),n}function Kk(t,e,n){switch(n){case"newValue":Fx(t,e);break;case"oldValue":lf(t,e.token);break}}function qk(t,e,n){switch(n){case"newValue":lf(t,e.token);break;case"oldValue":Fx(t,e),e.subType==="atom"&&t.valueMap.set(e.token.key,e.value);break}}function Fx(t,e){const{token:n}=e;e.subType==="writable"&&e.value?Lt(t,n,e.value):An(t,n)}function Pk(t,e,n){switch(n){case"newValue":Hx(t,e.provenance,e.key);break;case"oldValue":Xm(t,e.key);break}}function Ik(t,e,n){switch(n){case"newValue":Xm(t,e.key);break;case"oldValue":Hx(t,e.provenance.map(qr),e.key);for(const[r,a]of e.values){const u=t.families.get(r);if(u){An(t,u,e.key);const c=`${r}(${zt(e.key)})`;t.valueMap.set(c,a)}}break}}function Hk(t,e,n){switch(n){case"newValue":for(const r of e.to)CS(t,r,e.key,e.exclusive?"exclusive":void 0);break;case"oldValue":{let r="exclusive";for(const a of e.from)CS(t,a,e.key,r),r=void 0}break}}function wo(t,e,n){const r=n==="newValue"?e.subEvents:[...e.subEvents].reverse();for(const a of r)switch(a.type){case"atom_update":Vk(t,a,n);break;case"state_creation":Kk(t,a,n);break;case"state_disposal":qk(t,a,n);break;case"molecule_creation":Pk(t,a,n);break;case"molecule_disposal":Ik(t,a,n);break;case"molecule_transfer":Hk(t,a,n);break;case"transaction_outcome":wo(t,a,n);break}}function ul(t){return"epoch"in t.transactionMeta}function Tn(t){return"phase"in t.transactionMeta}function Gx(t,e){return t.transactionMeta.actionContinuities.getRelatedKey(e)}function Yx(t,e){return t.transactionMeta.epoch.get(e)}function Fk(t,e){const n=Gx(t,e);if(n!==void 0)return Yx(t,n)}function Zm(t,e,n){t.transactionMeta.epoch.set(e,n)}function Gk(t,e,n){const r=Gx(t,e);r!==void 0&&t.transactionMeta.epoch.set(r,n)}function Yk(t,e){const n=Re(t),{parent:r}=n;n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,r.child=null,r.on.transactionApplying.next(n.transactionMeta);const{subEvents:a}=n.transactionMeta.update;t.logger.info("🛄","transaction",n.transactionMeta.update.token.key,`applying ${a.length} subEvents:`,a),wo(r,n.transactionMeta.update,"newValue"),ul(r)?(Gk(r,n.transactionMeta.update.token.key,n.transactionMeta.update.epoch),ct(t,{key:n.transactionMeta.update.token.key,type:"transaction"})?.subject.next(n.transactionMeta.update),t.logger.info("🛬","transaction",n.transactionMeta.update.token.key,"applied")):Tn(r)&&r.transactionMeta.update.subEvents.push(n.transactionMeta.update),r.on.transactionApplying.next(null)}function Jx(t,e,n){const{epoch:r,actionContinuities:a}=t.transactionMeta;a.set(e,n),r.has(e)||r.set(e,-1)}function Jk(t){return{store:t}}const Xk=(t,e,n,r)=>{const a=Re(t),u={parent:a,child:null,on:a.on,loggers:a.loggers,logger:a.logger,config:a.config,atoms:new Xn(a.atoms),atomsThatAreDefault:new Set(a.atomsThatAreDefault),families:new Xn(a.families),joins:new Xn(a.joins),operation:{open:!1},readonlySelectors:new Xn(a.readonlySelectors),timelines:new Xn(a.timelines),timelineTopics:a.timelineTopics.overlay(),trackers:new Map,transactions:new Xn(a.transactions),selectorAtoms:a.selectorAtoms.overlay(),selectorGraph:a.selectorGraph.overlay(),writableSelectors:new Xn(a.writableSelectors),valueMap:new Xn(a.valueMap),defaults:a.defaults,disposalTraces:t.disposalTraces.copy(),molecules:new Xn(a.molecules),moleculeGraph:a.moleculeGraph.overlay(),moleculeData:a.moleculeData.overlay(),keyRefsInJoins:a.keyRefsInJoins.overlay(),miscResources:new Xn(a.miscResources)},c=Fk(t,e.key),f={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:((...m)=>An(h,...m)),set:((...m)=>{Lt(h,...m)}),reset:((...m)=>{ny(h,...m)}),run:(m,y=af())=>Jm(h,m,y),find:((...m)=>Pr(t,...m)),json:m=>Rs(h,m),dispose:((...m)=>{lf(h,...m)}),env:()=>Jk(h)}},h=Object.assign(u,{transactionMeta:f});return a.child=h,t.logger.info("🛫","transaction",e.key,"building with params:",n),h};function Xx(t,e){const{key:n}=e,r=t.transactions.has(n),a={key:n,type:"transaction",run:(c,f)=>{const h=Xk(t,zr(a),c,f);try{const{toolkit:m}=h.transactionMeta,y=e.do(m,...c);return Yk(h,y),y}catch(m){throw Lk(h),t.logger.warn("💥","transaction",n,"caught:",m),m}},install:c=>Xx(c,e),subject:new We};Re(t).transactions.set(n,a);const u=zr(a);return r||t.on.transactionCreation.next(u),u}var Zk=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 qi({between:["selectorKey","atomKey"],cardinality:"n:n"});selectorGraph=new qi({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 qi({between:["continuity","action"],cardinality:"1:n"})};timelines=new Map;timelineTopics=new qi({between:["timelineKey","topicKey"],cardinality:"1:n"});disposalTraces=new jk(100);molecules=new Map;moleculeGraph=new qi({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});moleculeData=new qi({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});keyRefsInJoins=new qi({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")});miscResources=new Map;on={atomCreation:new We,atomDisposal:new We,selectorCreation:new We,selectorDisposal:new We,timelineCreation:new We,transactionCreation:new We,transactionApplying:new $k(null),operationClose:new We,moleculeCreation:new We,moleculeDisposal:new We};operation={open:!1};config={name:"IMPLICIT_STORE",lifespan:"ephemeral",isProduction:!0};loggers=[new Ek("warn",(t,e,n)=>!zk(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},ul(e)&&(this.transactionMeta={epoch:new Map(e?.transactionMeta.epoch),actionContinuities:new qi(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 a=Rs(e,r),u=lT(r);n.add(a.key),n.add(u.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 Jt={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??=new Zk({name:"IMPLICIT_STORE",lifespan:"ephemeral",isProduction:!0}),globalThis.ATOM_IO_IMPLICIT_STORE}};var Qk=class extends Error{constructor(t,e){super(`${Kr[t.type]} ${zt(t.key)} not found in store "${e.config.name}".`)}};function ct(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 Qk(e,t)}function Zx(t,e,n,r){const a=t.disposalTraces.buffer.find(u=>u?.key===zt(r));switch(t.logger.error("❌",e.type,e.key,"gets a fallback value because key",r,"is not allocated",a?`This key was previously disposed:
|
|
13
|
+
${a.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 u=new n.class;return t.defaults.set(n.key,u),u.READONLY_VIEW}case"atom_family":{if(t.defaults.has(n.key))return t.defaults.get(n.key);const u=n.default,c=u(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 u=n.default(r);return t.defaults.set(n.key,u),u}}}function jc(t,e){const{type:n,key:r,catch:a}=e;switch(n){case"readonly_pure_selector":case"writable_pure_selector":{let u;t.logger.info("🧮",n,r,"computing value");try{if(u=e.getFrom(t),u instanceof Promise)return u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return c}throw c})}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return Kn(t,e,c)}throw c}return Kn(t,e,u)}case"atom":{let u;if(Br(e.default))try{u=e.default(),u instanceof Promise&&(u=u.catch(c=>{if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return c}throw c}))}catch(c){if(t.logger.error("💥",n,r,"rejected:",c),a){for(const f of a)if(c instanceof f)return u=Kn(t,e,c),t.logger.info("✨",e.type,r,"computed default",u),u}throw c}else u=e.default,t.logger.info("✨",e.type,r,"using static default",u);return Kn(t,e,u)}}}function _s(t,e,n){if(t.valueMap.has(e.key))return uT(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 jc(t,e);case"mutable_atom":{const a=new e.class;return t.logger.info("✨",e.type,r,"created new instance",a),Kn(t,e,a)}}}function Qm(t,e){return ct(t,{key:e.family.key,type:`${e.type}_family`})}const kS={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"},cl=Symbol("MUST_CREATE"),Wk=Symbol("DO_NOT_CREATE");function fl(t,e,n,r){const a=zt(r),u=e.molecules.get(a);if(!u&&e.config.lifespan==="immortal"){const{type:f,key:h}=n;return e.logger.warn("💣","key",a,"was used to mint a counterfeit token for",f,`"${h}"`),{counterfeit:!0,key:`${h}(${a})`,type:kS[f],family:{key:h,subKey:a}}}let c;if(t===cl)e.logger.info("👪",n.type,n.key,"adds member",typeof r=="string"?`\`${r}\``:r),c=n.create(r),u&&e.moleculeData.set(a,n.key);else{const{type:f,key:h}=n;return{key:`${h}(${a})`,type:kS[f],family:{key:h,subKey:a}}}return c}function Wm(t,...e){let n,r,a,u,c;if(e.length===1){if(c=e[0],"family"in c){const h=Qm(t,c);if(a=ct(t,h),u=qr(c.family.subKey),n=dl(t,h,u),"counterfeit"in c)return{token:c,family:a,subKey:u,isNew:!1};n?c=n:(r=fl(cl,t,h,u),c=r)}}else a=ct(t,e[0]),u=e[1],n=dl(t,a,u),n?c=n:(r=fl(cl,t,a,u),c=r);const f="counterfeit"in c;if(r&&f===!1&&a){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 m={type:"state_creation",subType:h,token:c,timestamp:Date.now()};a.subject.next(m);const y=Re(t);if(c.family)if(ul(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 Tn(y)&&y.on.transactionApplying.state===null&&y.transactionMeta.update.subEvents.push(m)}return{token:c,family:a,subKey:u,isNew:!!r}}function An(t,...e){const{token:n,family:r,subKey:a}=Wm(t,...e);return"counterfeit"in n&&r&&a?Zx(t,n,r,a):_s(t,ct(t,n))}function dl(t,e,n){const r=zt(n),a=`${e.key}(${r})`,u=Re(t);let c;switch(e.type){case"atom_family":case"mutable_atom_family":c=u.atoms.get(a);break;case"writable_held_selector_family":case"writable_pure_selector_family":c=u.writableSelectors.get(a);break;case"readonly_held_selector_family":case"readonly_pure_selector_family":c=u.readonlySelectors.get(a);break}return c&&zr(c)}function Pr(t,e,n){const r=ct(t,e),a=dl(t,e,n);return a||fl(Wk,t,r,n)}function Bc(t,e,n){const r=e.key,a="readonly_pure_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Re(t),T={key:S,get:e.get(y)};return e.catch&&(T.catch=e.catch),sy(x,T,v)},internalRoles:n,subject:f,install:y=>Bc(y,e),default:y=>e.get(y)({get:((...g)=>An(t,...g)),find:((...g)=>Pr(t,...g)),json:g=>Rs(t,g)})};return t.families.set(r,m),u}function ey(t,e,n){const r={key:e.key,type:"atom_family"},a=t.families.get(e.key);a&&t.config.isProduction===!0&&t.logger.error("❗","atom_family",e.key,`Overwriting an existing ${Kr[a.type]} "${a.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const u=new We,f={...r,create:h=>{const m=zt(h),y={key:e.key,subKey:m},g=`${e.key}(${m})`,v=Re(t),S=e.default,x={key:g,default:Br(S)?()=>S(h):S};return e.effects&&(x.effects=e.effects(h)),e.catch&&(x.catch=e.catch),ff(v,x,y)},default:e.default,subject:u,install:h=>ey(h,e),internalRoles:n};return t.families.set(e.key,f),Br(e.default)===!1&&t.defaults.set(e.key,e.default),r}function Qx(t,e,n){const r=e.key,a="readonly_held_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`;return ry(Re(t),{key:S,const:e.const(y),get:e.get(y)},v)},internalRoles:n,subject:f,install:y=>Qx(y,e),default:e.const};return t.families.set(r,m),u}function Wx(t,e,n){const r=e.key,a="writable_held_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`;return oy(Re(t),{key:S,const:e.const(y),get:e.get(y),set:e.set(y)},v)},internalRoles:n,subject:f,install:y=>Wx(y,e),default:e.const};return t.families.set(r,m),u}function ty(t,e,n){const r=e.key,a="writable_pure_selector_family",u={key:r,type:a},c=t.families.get(r);c&&t.config.isProduction===!0&&t.logger.error("❗",a,r,`Overwriting an existing ${Kr[c.type]} "${c.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new We,m={...u,create:y=>{const g=zt(y),v={key:r,subKey:g},S=`${r}(${g})`,x=Re(t),T={key:S,get:e.get(y),set:e.set(y)};return e.catch&&(T.catch=e.catch),ay(x,T,v)},internalRoles:n,subject:f,install:y=>ty(y,e),default:y=>e.get(y)({get:((...g)=>An(t,...g)),find:((...g)=>Pr(t,...g)),json:g=>Rs(t,g)})};return t.families.set(r,m),u}function eM(t,e){const n="set"in e,r="const"in e;return r&&n?Wx(t,e,void 0):r?Qx(t,e,void 0):n?ty(t,e):Bc(t,e)}function lf(t,...e){let n;if(e.length===1)n=e[0];else{const r=e[0],a=e[1];n=Pr(t,r,a)}try{ct(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":dy(t,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":lM(t,n);break}}function eT(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}"${Tn(t)?` ${t.transactionMeta.phase} "${t.transactionMeta.update.token.key}"`:""}`),t}function tT(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 nT=(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),uf=(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 qp(t,e,n,r,a){const{oldValue:u,newValue:c}=n,f="oldValue"in n,h=zr(e);if(r&&a){e.subject.next({newValue:c});const S={checkpoint:!0,type:"state_creation",subType:"writable",token:h,timestamp:Date.now(),value:c};t.operation.subEvents.push(S),a.subject.next(S);const x=Re(t);if(h.family)if(ul(x))switch(h.type){case"atom":case"mutable_atom":t.on.atomCreation.next(h);break;case"writable_pure_selector":case"writable_held_selector":t.on.selectorCreation.next(h);break}else Tn(x)&&x.on.transactionApplying.state===null&&x.transactionMeta.update.subEvents.push(S);return}const{key:m,subject:y,type:g}=e;let v;if(f?v={oldValue:sc(u)?u.READONLY_VIEW:u,newValue:sc(c)?c.READONLY_VIEW:c}:v={newValue:sc(c)?c.READONLY_VIEW:c},ul(t)){switch(g){case"mutable_atom":t.logger.info("📢",g,m,"is now (",c,") subscribers:",y.subscribers.keys());break;case"atom":case"writable_pure_selector":case"writable_held_selector":t.logger.info("📢",g,m,"went (",u,"->",c,") subscribers:",y.subscribers.keys())}y.next(v)}if(Tn(t)&&(g==="mutable_atom"||g==="atom")){if(t.on.transactionApplying.state===null){if(sc(c))return;const{timestamp:S}=t.operation,x={type:"atom_update",token:h,timestamp:S,update:v};t.transactionMeta.update.subEvents.push(x),t.logger.info("📁","atom",m,"stowed (",u,"->",c,")");return}if(fy(e,"tracker:signal")){const S=m.slice(1),x=t.atoms.get(S);_s(t,x,"mut").do(v.newValue)===null&&cy(t,x)}}}const MS=Symbol("UNSET"),Pp=(t,e,n)=>{let r,a;if(Br(n)){const u=_s(t,e,"mut");r=u,a=n(u)}else t.valueMap.has(e.key)?r=uT(t,e,"mut"):e.type==="atom"&&!Br(e.default)?r=e.default:r=MS,a=n;return t.logger.info("⭐","atom",e.key,"setting value",a),a=Kn(t,e,a),uf(t,e.key),cy(t,e),r===MS?{newValue:a}:{oldValue:r,newValue:a}};function Zh(t,e){switch(e.type){case"mutable_atom":return Pp(t,e,new e.class);case"atom":{let n;return Br(e.default)?n=jc(t,e):n=e.default,Pp(t,e,n)}}}function tM(t,e){let n;switch(e.type){case"atom":case"mutable_atom":n=Zh(t,e);break;case"writable_held_selector":{const r=hl(t,e.key);for(const u of r.values())qp(t,e,Zh(t,u),!1);const a=e.getFrom(t);n={oldValue:a,newValue:a}}break;case"writable_pure_selector":{const r=jc(t,e),a=hl(t,e.key);for(const u of a.values())qp(t,e,Zh(t,u),!1);n={oldValue:r,newValue:jc(t,e)}}break}return n}function Lt(t,...e){El(Hp,t,...e)}const Ip=Symbol("RESET");function ny(t,...e){Lt(t,...e,Ip)}function nM(t,e,n){let r,a,u;const{type:c,key:f}=e;switch(e.type){case"writable_pure_selector":r=_s(t,e,"mut"),a=RS(n,r),a=Kn(t,e,a);break;case"writable_held_selector":u=e.const,RS(n,u),r=u,a=u}return t.logger.info("⭐",c,f,"setting to",a),uf(t,f),e.setSelf(a),{oldValue:r,newValue:a}}const iM=(t,e,n)=>{let r;switch(e.type){case"atom":case"mutable_atom":r=Pp(t,e,n);break;case"writable_pure_selector":case"writable_held_selector":r=nM(t,e,n);break}return r},Hp=Symbol("OWN_OP"),iy=Symbol("JOIN_OP");function El(t,e,...n){let r,a,u,c,f,h;n.length===2?(u=n[0],h=n[1],"family"in u&&(c=Qm(e,u),f=qr(u.family.subKey),r=dl(e,c,f),r?u=r:u=a=fl(cl,e,c,f))):(c=ct(e,n[0]),f=n[1],h=n[2],r=dl(e,c,f),r?u=r:u=a=fl(cl,e,c,f));const m=h===Ip?"reset":"set";let y;if(t===Hp){const S=eT(e,u);if(typeof S=="number"){const x=S,T=e.on.operationClose.subscribe(`waiting to ${m} "${u.key}" at T-${x}`,function(){T(),e.logger.info("🟢",u.type,u.key,"resuming deferred",m,`from T-${x}`),El(t,e,u,h)});return}y=S}else y=e;if("counterfeit"in u&&"family"in u){const S=u.family.subKey,x=e.disposalTraces.buffer.find(T=>T?.key===S);e.logger.error("❌",u.type,u.key,"could not be",m,"because key",S,"is not allocated.",x?`this key was previously disposed:${x.trace}`:"(no previous disposal trace found)");return}const g=ct(y,u);let v;h===Ip?v=tM(y,g):v=iM(y,g,h),qp(y,g,v,!!a,c),t===Hp&&tT(y)}const iT=(t,e)=>Re(t).atoms.has(e),rM=(t,e)=>Re(t).writableSelectors.has(e),sM=(t,e)=>Re(t).readonlySelectors.has(e),oM=(t,e)=>iT(t,e)||rM(t,e)||sM(t,e);function DS(t,e){return Re(t).selectorGraph.getRelationEntries({downstreamSelectorKey:e}).filter(([n,{source:r}])=>r!==e).map(([n,{source:r}])=>r).filter(n=>oM(t,n))}function hl(t,e,n=new Set){const r=DS(t,e),a=new Map;for(;r.length>0;){const u=r.pop();if(!n.has(u))if(n.add(u),iT(t,u)){const c=t.atoms.get(u);a.set(c.key,c)}else r.push(...DS(t,u))}return a}function aM(t,e,n,r,a){const u=Re(t),{type:c,key:f}=r;if(c==="atom"||c==="mutable_atom")u.selectorAtoms.set({selectorKey:n,atomKey:f}),t.logger.info("🔍",e,n,`discovers root atom "${f}"`);else{const h=hl(t,f,a);t.logger.info("🔍",e,n,`discovers root atoms: [ ${[...h.values()].map(m=>`"${m.key}"`).join(", ")} ]`);for(const{key:m}of h.values())u.selectorAtoms=u.selectorAtoms.set({selectorKey:n,atomKey:m})}a.add(f)}function cf(t,e,n,r){return{get:(...a)=>{const u=Re(t),{token:c,family:f,subKey:h}=Wm(t,...a);let m;return"counterfeit"in c&&f&&h?m=Zx(t,c,f,h):m=_s(t,ct(t,c)),t.logger.info("🔌",e,n,`registers dependency ( "${c.key}" =`,m,")"),u.selectorGraph.set({upstreamSelectorKey:c.key,downstreamSelectorKey:n},{source:c.key}),aM(t,e,n,c,r),m},set:((...a)=>{El(iy,Re(t),...a)}),find:((...a)=>Pr(t,...a)),json:a=>Rs(t,a)}}function ry(t,e,n){const r=Re(t),a=new We,u=new Set,{key:c,const:f}=e,h="readonly_held_selector";t.logger.info("🔨",h,c,"is being created");const{get:m,find:y,json:g}=cf(r,h,c,u),S={...e,type:h,subject:a,getFrom:T=>{const M=T.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[C,{source:_}]of M)_!==c&&T.selectorGraph.delete(C,c);return T.selectorAtoms.delete(c),e.get({get:m,find:y,json:g},f),Kn(T,S,f),t.logger.info("✨",h,c,"=",f),u.clear(),f},install:T=>ry(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 sy(t,e,n){const r=Re(t),a=new We,u=new Set,c=e.key,f="readonly_pure_selector";t.logger.info("🔨",f,c,"is being created");const{get:h,find:m,json:y}=cf(r,f,c,u),v={...e,type:f,subject:a,getFrom:()=>{const x=Re(t),T=x.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[C,{source:_}]of T)_!==c&&x.selectorGraph.delete(C,c);x.selectorAtoms.delete(c);const M=Kn(x,v,e.get({get:h,find:m,json:y}));return t.logger.info("✨",f,c,"=",M),u.clear(),M},install:x=>sy(x,e,n)};n&&(v.family=n),r.readonlySelectors.set(c,v);const S={key:c,type:f};return n&&(S.family=n),S}function oy(t,e,n){const r=Re(t),a=new We,u=new Set,{key:c,const:f}=e,h="writable_held_selector";t.logger.info("🔨",h,c,"is being created");const m=cf(r,h,c,u),{find:y,get:g,json:v}=m,S={find:y,get:g,json:v},M={...e,type:h,subject:a,getFrom:_=>{const R=_.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[G,{source:I}]of R)I!==c&&_.selectorGraph.delete(G,c);return _.selectorAtoms.delete(c),e.get(S,f),Kn(_,M,f),t.logger.info("✨",h,c,"=",f),u.clear(),f},setSelf:()=>{e.set(m,f)},install:_=>oy(_,e,n)};n&&(M.family=n),r.writableSelectors.set(c,M);const C={key:c,type:h};return n&&(C.family=n),C}function ay(t,e,n){const r=Re(t),a=new We,u=new Set,c=e.key,f="writable_pure_selector";t.logger.info("🔨",f,c,"is being created");const h=cf(r,f,c,u),{find:m,get:y,json:g}=h,v={find:m,get:y,json:g},T={...e,type:f,subject:a,getFrom:C=>{const _=C.selectorGraph.getRelationEntries({downstreamSelectorKey:c});for(const[G,{source:I}]of _)I!==c&&C.selectorGraph.delete(G,c);C.selectorAtoms.delete(c);const R=Kn(C,T,e.get(v));return t.logger.info("✨",f,c,"=",R),u.clear(),R},setSelf:C=>{e.set(h,C)},install:C=>ay(C,e,n)};n&&(T.family=n),r.writableSelectors.set(c,T);const M={key:c,type:f};return n&&(M.family=n),M}function rT(t,e){const n="set"in e,r="const"in e;if(r&&n){const u=oy(t,e,void 0);return t.on.selectorCreation.next(u),u}if(r){const u=ry(t,e,void 0);return t.on.selectorCreation.next(u),u}if(n){const u=ay(t,e,void 0);return t.on.selectorCreation.next(u),u}const a=sy(t,e,void 0);return t.on.selectorCreation.next(a),a}function lM(t,e){const n=Re(t),{key:r,type:a,family:u}=e;if(!u)t.logger.error("❌",a,r,"Standalone selectors cannot be disposed.");else{n.molecules.get(u.subKey)&&n.moleculeData.delete(u.subKey,u.key);let c;switch(e.type){case"writable_held_selector":n.writableSelectors.delete(r),c={key:u.key,type:"writable_held_selector_family"},ct(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:u.key,type:"writable_pure_selector_family"},ct(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:u.key,type:"readonly_held_selector_family"},ct(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:u.key,type:"readonly_pure_selector_family"},ct(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(u.key,u.subKey),t.logger.info("🔥",e.type,r,"deleted"),Tn(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 uM=(t,e)=>{const n=Re(t);return n.operation.open?n.operation.prev.get(e.key):n.valueMap.get(e.key)},NS=(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 a=uM(t,e),u=_s(t,e);t.logger.info("✨",e.type,e.key,"went",a,"->",u),e.subject.next({newValue:u,oldValue:a})});function Bo(t,e,n,r){function a(g){if(t.operation.open){if(u?.type==="atom"&&fy(u,"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)}Wm(t,e);const u=ct(t,e);t.logger.info("👀",u.type,u.key,`Adding subscription "${n}"`);const c=u.type==="writable_pure_selector"||u.type==="readonly_pure_selector",f=new Map;let h=a;if(c){_s(t,u);for(const[g,v]of hl(t,u.key))f.set(g,NS(t,u,v));h=function(v){const S=hl(t,u.key);for(const[x,T]of f)S.get(x)?S.delete(x):(T(),f.delete(x));for(const[x,T]of S)f.set(x,NS(t,u,T));a(v)}}const m=u.subject.subscribe(n,h);return()=>{t.logger.info("🙈",u.type,u.key,`Removing subscription "${n}"`),m();for(const g of f.values())g()}}const sT=(t,e,n,r)=>{const a=ct(t,e);t.logger.info("👀","timeline",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","timeline",e.key,`Removing subscription "${n}" from timeline`),u()}},oT=(t,e,n,r)=>{const a=ct(t,e);t.logger.info("👀","transaction",e.key,`Adding subscription "${n}"`);const u=a.subject.subscribe(n,r);return()=>{t.logger.info("🙈","transaction",e.key,`Removing subscription "${n}"`),u()}};function cM(t,e,n,r=af()){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 Bo(t,e,r,n);case"transaction":return oT(t,e,r,n);case"timeline":return sT(t,e,r,n)}}var ly=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,a=ff(e,{key:n,default:null},r,["tracker:signal"]);if(e.parent?.valueMap.has(n)){const u=e.parent.valueMap.get(n);e.valueMap.set(n,u)}return a}unsubscribeFromInnerValue;unsubscribeFromState;captureSignalsFromCore(t,e,n){const r=t.key,a=`tracker-from-core:${n.config.name}:${Tn(n)?n.transactionMeta.update.token.key:"main"}:${r}`,u=c=>{El(iy,n,e,c)};this.unsubscribeFromInnerValue=An(n,t).subscribe(a,u),this.unsubscribeFromState=Bo(n,t,a,(function(f){f.newValue!==f.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=f.newValue.subscribe(a,u))}).bind(this))}supplySignalsToCore(t,e,n){const r=t.key,a=`tracker-to-core:${n.config.name}:${Tn(n)?n.transactionMeta.update.token.key:"main"}:${r}`;Bo(n,e,a,Object.assign(function({newValue:c,oldValue:f}){const h=n.timelineTopics.getRelatedKey(e.key);if(h&&n.timelines.get(h)?.timeTraveling){const m=sT(n,{key:h,type:"timeline"},a,function(g){m(),Lt(n,t,v=>(g==="redo"&&c?v.do(c):g==="undo"&&f&&v.undo(f),v))});return}Lt(n,t,m=>(m.do(c),m))},{inboundTracker:!0}))}mutableAtomToken;latestSignalToken;[Symbol.dispose];constructor(t,e){const n=Re(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 uy(t,e,n){t.logger.info("🔨","atom",e.key,`creating in store "${t.config.name}"`);const r=Re(t),{key:a}=e,u=r.atoms.get(a),c="mutable_atom";if(u?.type===c&&t.config.isProduction===!0)return t.logger.error("❌",c,a,"Tried to create atom, but it already exists in the store."),zr(u);const f=new We,h={...e,type:c,install:y=>(y.logger.info("🛠️","atom",a,`installing in store "${y.config.name}"`),uy(y,e,n)),subject:f};n&&(h.family=n),r.atoms.set(h.key,h);const m=zr(h);if(new ly(m,t),n||rT(t,{key:`${a}:JSON`,get:({get:y})=>y(m).toJSON(),set:({set:y},g)=>{y(m,e.class.fromJSON(g))}}),e.effects){let y=0;const g=[];for(const v of e.effects){const S=v({resetSelf:()=>{ny(t,m)},setSelf:x=>{Lt(t,m,x)},onSet:x=>Bo(t,m,`effect[${y}]`,x),token:m,store:Ym(t)});S&&g.push(S),++y}h.cleanup=()=>{for(const v of g)v()}}return t.on.atomCreation.next(m),m}var fM=class{trackers=new Map;latestSignalAtoms;mutableAtoms;constructor(t,e){this.latestSignalAtoms=ct(e,ey(e,{key:`*${t.key}`,default:null},["mutable","updates"])),this.mutableAtoms=t;const n=r=>{const{type:a,token:u}=r;if(u.family){const c=qr(u.family.subKey);switch(a){case"state_creation":this.trackers.set(c,new ly(u,e));break;case"state_disposal":{const f=this.trackers.get(c);f&&(f[Symbol.dispose](),this.trackers.delete(c))}}}};this.mutableAtoms.subject.subscribe(`store=${e.config.name}::tracker-atom-family`,n)}};function aT(t,e,n){const r={key:e.key,type:"mutable_atom_family"},a=t.families.get(e.key);a&&t.config.isProduction===!0&&t.logger.error("❗","mutable_atom_family",e.key,`Overwriting an existing ${Kr[a.type]} "${a.key}" in store "${t.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const u=new We,f={...r,create:h=>{const m=zt(h),y={key:e.key,subKey:m},g=`${e.key}(${m})`,v=Re(t),S={key:g,class:e.class};return e.effects&&(S.effects=e.effects(h)),uy(v,S,y)},class:e.class,subject:u,install:h=>aT(h,e),internalRoles:n};return t.families.set(e.key,f),ty(t,{key:`${e.key}:JSON`,get:h=>({get:m})=>m(r,h).toJSON(),set:h=>({set:m},y)=>{m(r,h,e.class.fromJSON(y))}},["mutable","json"]),new fM(f,t),r}const dM=(t,e)=>{const n=Re(e),r=`${t.key}:JSON`;return n.families.get(r)},Rs=(t,e)=>e.family?Pr(t,ct(Re(t),{key:`${e.family.key}:JSON`,type:"writable_pure_selector_family"}),qr(e.family.subKey)):{type:"writable_pure_selector",key:`${e.key}:JSON`},lT=t=>{const e={type:"atom",key:`*${t.key}`};return t.family&&(e.family={key:`*${t.family.key}`,subKey:t.family.subKey}),e};function sc(t){return typeof t=="object"&&t!==null&&"do"in t&&"undo"in t&&"subscribe"in t&&"READONLY_VIEW"in t&&"toJSON"in t}function Kn(t,e,n){const{key:r,subject:a,type:u}=e,c=t.valueMap.get(r);if(c instanceof Kp&&!c.done){const f=c;return n instanceof Promise?(f.use(n),f):(t.valueMap.set(r,n),n)}if(n instanceof Promise){const f=new Kp(n);return t.valueMap.set(r,f),f.then(function(m){if(t.valueMap.get(r)===f){switch(eT(t,e),Kn(t,e,m),u){case"atom":cy(t,e);break;case"readonly_pure_selector":case"writable_pure_selector":fT(t,r);break}tT(t),a.next({newValue:m,oldValue:f})}}).catch(h=>{t.logger.error("💥",e.type,r,"rejected:",h)}),f}return t.logger.info("📝",e.type,e.key,"writing to cache",n),t.valueMap.set(r,n),n}function uT(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"&&Tn(t)){const a=e,{parent:u}=t;if(t.valueMap.hasOwn(a.key))return r;const c=u.valueMap.get(a.key);t.logger.info("📃","atom",a.key,"copying");const f=c.toJSON(),h=a.class.fromJSON(f);t.valueMap.set(a.key,h),new ly(a,u),r=h}return r}function cT(t,e){const n=t.valueMap.get(e);if(n instanceof Kp){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 cy(t,e){const n=Re(t),{key:r,type:a}=e,u=n.selectorAtoms.getRelatedKeys(r);if(n.logger.info("🧹",a,r,u?`evicting ${u.size} states downstream:`:"no downstream states",u??"to evict"),u){n.operation.open&&n.logger.info("🧹",a,r,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const c of u)nT(n,c)||(cT(n,c),uf(n,c))}}function fT(t,e){const n=Re(t),r=n.selectorGraph.getRelationEntries({upstreamSelectorKey:e}).filter(([a,{source:u}])=>u===e);for(const[a]of r)nT(n,a)||(cT(n,a),uf(n,a),fT(t,a))}function ff(t,e,n,r){const a="atom",{key:u}=e;t.logger.info("🔨",a,u,"is being created");const c=Re(t),f=c.atoms.get(u);if(f?.type===a&&t.config.isProduction===!0)return t.logger.error("❌","atom",u,"Tried to create atom, but it already exists in the store."),zr(f);const h=new We,m={...e,type:a,install:g=>(g.logger.info("🛠️",a,u,`installing in store "${g.config.name}"`),ff(g,e,n)),subject:h};n&&(m.family=n),r&&(m.internalRoles=r),c.atoms.set(u,m);const y=zr(m);if(e.effects){let g=0;const v=[];for(const S of e.effects){const x=S({resetSelf:()=>{ny(t,y)},setSelf:T=>{Lt(t,y,T)},onSet:T=>Bo(t,y,`effect[${g}]`,T),token:y,store:Ym(t)});x&&v.push(x),++g}m.cleanup=()=>{for(const S of v)S()}}return t.on.atomCreation.next(y),y}function fy(t,e){return"internalRoles"in t?t.internalRoles.includes(e):!1}function dy(t,e){const n=Re(t),{key:r,family:a}=e,u=ct(n,e);if(!a)t.logger.error("❌","atom",r,"Standalone atoms cannot be disposed.");else{u.cleanup?.();const c=t.valueMap.get(u.key),f=ct(t,Qm(t,e)).subject,h={type:"state_disposal",subType:"atom",token:e,value:c,timestamp:Date.now()};f.next(h);const m=Tn(n);if(n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),n.moleculeData.delete(a.key,a.subKey),t.timelineTopics.delete(r),e.type==="mutable_atom"&&(dy(t,lT(e)),t.trackers.delete(r)),t.logger.info("🔥","atom",r,"deleted"),m&&n.transactionMeta.phase==="building"){const y=n.transactionMeta.update.subEvents.at(-1),g=y?.type==="molecule_disposal"&&y.values.some(([S])=>S===u.family?.key),v=fy(u,"tracker:signal");!g&&!v&&n.transactionMeta.update.subEvents.push(h)}else t.on.atomDisposal.next(e)}}function hs(t){return t[0].toUpperCase()+t.slice(1)}var dT=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){this.store=t,this.options=e,this.store.miscResources.set(`join:${e.key}`,this),this.toolkit={get:((...y)=>An(t,...y)),set:((...y)=>{Lt(t,...y)}),find:((...y)=>Pr(t,...y)),json:y=>Rs(t,y)};const n=e.between[0],r=e.between[1],a=aT(t,{key:`${e.key}/relatedKeys`,class:Kx},["join","relations"]);this.relatedKeysAtoms=a;const u=(y,g,v)=>{const{find:S,get:x,set:T}=y,M=S(a,g),C=x(M);for(const _ of C)v.includes(_)||T(a,_,R=>(R.delete(g),R));T(M,_=>{_.clear();for(const R of v){const G=S(a,R),I=x(G),ee=I.has(g);if(this.relations.cardinality==="1:n"){const J=[];for(const X of I){if(X===g)continue;let he;El(iy,this.store,a,X,pe=>(pe.delete(R),he=pe.size,pe)),he===0&&J.push(X)}!ee&&I.size>0&&T(G,X=>(X.clear(),X));for(const X of J)t.keyRefsInJoins.delete(Sc(R,X))}ee||T(G,J=>(J.add(g),J)),_.add(R)}return _})},c=(y,g,v)=>{const{set:S}=y;S(a,g,x=>{for(const T of v)x.add(T);return x});for(const x of v)S(a,x,T=>(T.add(g),T));return!0},f=new qi(e,{externalStore:{getRelatedKeys:y=>this.toolkit.get(a,y),addRelation:(y,g)=>{this.store.keyRefsInJoins.set(`"${y}"`,e.key),this.store.keyRefsInJoins.set(`"${g}"`,e.key),this.store.keyRefsInJoins.set(Sc(y,g),e.key),this.toolkit.set(a,y,v=>v.add(g)),this.toolkit.set(a,g,v=>v.add(y))},deleteRelation:(y,g)=>{this.toolkit.set(a,y,S=>(S.delete(g),S)),this.toolkit.set(a,g,S=>(S.delete(y),S));const v=Sc(y,g);this.store.keyRefsInJoins.delete(v)},replaceRelationsSafely:(y,g)=>{u(this.toolkit,y,g)},replaceRelationsUnsafely:(y,g)=>{c(this.toolkit,y,g)},has:(y,g)=>{const v=this.toolkit.get(a,y);return g?v.has(g):v.size>0}},isAType:e.isAType,isBType:e.isBType}),h=()=>Bc(t,{key:`${e.key}/singleRelatedKey`,get:y=>({get:g})=>{const v=g(a,y);for(const S of v)return S;return null}},["join","keys"]),m=()=>Bc(t,{key:`${e.key}/multipleRelatedKeys`,get:y=>({get:g})=>g(dM(a,t),y)},["join","keys"]);switch(e.cardinality){case"1:1":{const y=h(),g=`${n}KeyOf${hs(r)}`,v=`${r}KeyOf${hs(n)}`;this.relations=f,this.states={[g]:y,[v]:y};break}case"1:n":{const y=h(),g=m(),v=`${n}KeyOf${hs(r)}`,S=`${r}KeysOf${hs(n)}`,x={[v]:y,[S]:g};this.relations=f,this.states=x;break}case"n:n":{const y=m(),g=`${n}KeysOf${hs(r)}`,v=`${r}KeysOf${hs(n)}`;this.relations=f,this.states={[g]:y,[v]:y}}}}};function hM(t,e){return t.joins.set(e.key,new dT(t,e)),{key:e.key,type:"join",a:e.between[0],b:e.between[1],cardinality:e.cardinality}}function pM(t,e){let n=t.joins.get(e.key);if(n===void 0){const r=Jt.STORE.joins.get(e.key);if(r===void 0)throw new Error(`Join "${e.key}" not found in store "${t.config.name}"`);n=new dT(Ym(t),r.options),t.joins.set(e.key,n)}return n}function mM(t,e,n){const r=pM(t,e);return[r.relatedKeysAtoms,r.relatedKeysAtoms]}var Qh={exports:{}},ye={};var $S;function yM(){if($S)return ye;$S=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=v&&E[v]||E["@@iterator"],typeof E=="function"?E:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,M={};function C(E,q,H){this.props=E,this.context=q,this.refs=M,this.updater=H||x}C.prototype.isReactComponent={},C.prototype.setState=function(E,q){if(typeof E!="object"&&typeof E!="function"&&E!=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,E,q,"setState")},C.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function _(){}_.prototype=C.prototype;function R(E,q,H){this.props=E,this.context=q,this.refs=M,this.updater=H||x}var G=R.prototype=new _;G.constructor=R,T(G,C.prototype),G.isPureReactComponent=!0;var I=Array.isArray;function ee(){}var J={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function he(E,q,H){var Q=H.ref;return{$$typeof:t,type:E,key:q,ref:Q!==void 0?Q:null,props:H}}function pe(E,q){return he(E.type,q,E.props)}function we(E){return typeof E=="object"&&E!==null&&E.$$typeof===t}function je(E){var q={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(H){return q[H]})}var ve=/\/+/g;function Z(E,q){return typeof E=="object"&&E!==null&&E.key!=null?je(""+E.key):q.toString(36)}function ne(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then(ee,ee):(E.status="pending",E.then(function(q){E.status==="pending"&&(E.status="fulfilled",E.value=q)},function(q){E.status==="pending"&&(E.status="rejected",E.reason=q)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function j(E,q,H,Q,re){var ce=typeof E;(ce==="undefined"||ce==="boolean")&&(E=null);var Te=!1;if(E===null)Te=!0;else switch(ce){case"bigint":case"string":case"number":Te=!0;break;case"object":switch(E.$$typeof){case t:case e:Te=!0;break;case y:return Te=E._init,j(Te(E._payload),q,H,Q,re)}}if(Te)return re=re(E),Te=Q===""?"."+Z(E,0):Q,I(re)?(H="",Te!=null&&(H=Te.replace(ve,"$&/")+"/"),j(re,q,H,"",function(ii){return ii})):re!=null&&(we(re)&&(re=pe(re,H+(re.key==null||E&&E.key===re.key?"":(""+re.key).replace(ve,"$&/")+"/")+Te)),q.push(re)),1;Te=0;var Ct=Q===""?".":Q+":";if(I(E))for(var Je=0;Je<E.length;Je++)Q=E[Je],ce=Ct+Z(Q,Je),Te+=j(Q,q,H,ce,re);else if(Je=S(E),typeof Je=="function")for(E=Je.call(E),Je=0;!(Q=E.next()).done;)Q=Q.value,ce=Ct+Z(Q,Je++),Te+=j(Q,q,H,ce,re);else if(ce==="object"){if(typeof E.then=="function")return j(ne(E),q,H,Q,re);throw q=String(E),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Te}function U(E,q,H){if(E==null)return E;var Q=[],re=0;return j(E,Q,"","",function(ce){return q.call(H,ce,re++)}),Q}function L(E){if(E._status===-1){var q=E._result;q=q(),q.then(function(H){(E._status===0||E._status===-1)&&(E._status=1,E._result=H)},function(H){(E._status===0||E._status===-1)&&(E._status=2,E._result=H)}),E._status===-1&&(E._status=0,E._result=q)}if(E._status===1)return E._result.default;throw E._result}var te=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},oe={map:U,forEach:function(E,q,H){U(E,function(){q.apply(this,arguments)},H)},count:function(E){var q=0;return U(E,function(){q++}),q},toArray:function(E){return U(E,function(q){return q})||[]},only:function(E){if(!we(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return ye.Activity=g,ye.Children=oe,ye.Component=C,ye.Fragment=n,ye.Profiler=a,ye.PureComponent=R,ye.StrictMode=r,ye.Suspense=h,ye.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,ye.__COMPILER_RUNTIME={__proto__:null,c:function(E){return J.H.useMemoCache(E)}},ye.cache=function(E){return function(){return E.apply(null,arguments)}},ye.cacheSignal=function(){return null},ye.cloneElement=function(E,q,H){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var Q=T({},E.props),re=E.key;if(q!=null)for(ce in q.key!==void 0&&(re=""+q.key),q)!X.call(q,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&q.ref===void 0||(Q[ce]=q[ce]);var ce=arguments.length-2;if(ce===1)Q.children=H;else if(1<ce){for(var Te=Array(ce),Ct=0;Ct<ce;Ct++)Te[Ct]=arguments[Ct+2];Q.children=Te}return he(E.type,re,Q)},ye.createContext=function(E){return E={$$typeof:c,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:u,_context:E},E},ye.createElement=function(E,q,H){var Q,re={},ce=null;if(q!=null)for(Q in q.key!==void 0&&(ce=""+q.key),q)X.call(q,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(re[Q]=q[Q]);var Te=arguments.length-2;if(Te===1)re.children=H;else if(1<Te){for(var Ct=Array(Te),Je=0;Je<Te;Je++)Ct[Je]=arguments[Je+2];re.children=Ct}if(E&&E.defaultProps)for(Q in Te=E.defaultProps,Te)re[Q]===void 0&&(re[Q]=Te[Q]);return he(E,ce,re)},ye.createRef=function(){return{current:null}},ye.forwardRef=function(E){return{$$typeof:f,render:E}},ye.isValidElement=we,ye.lazy=function(E){return{$$typeof:y,_payload:{_status:-1,_result:E},_init:L}},ye.memo=function(E,q){return{$$typeof:m,type:E,compare:q===void 0?null:q}},ye.startTransition=function(E){var q=J.T,H={};J.T=H;try{var Q=E(),re=J.S;re!==null&&re(H,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(ee,te)}catch(ce){te(ce)}finally{q!==null&&H.types!==null&&(q.types=H.types),J.T=q}},ye.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},ye.use=function(E){return J.H.use(E)},ye.useActionState=function(E,q,H){return J.H.useActionState(E,q,H)},ye.useCallback=function(E,q){return J.H.useCallback(E,q)},ye.useContext=function(E){return J.H.useContext(E)},ye.useDebugValue=function(){},ye.useDeferredValue=function(E,q){return J.H.useDeferredValue(E,q)},ye.useEffect=function(E,q){return J.H.useEffect(E,q)},ye.useEffectEvent=function(E){return J.H.useEffectEvent(E)},ye.useId=function(){return J.H.useId()},ye.useImperativeHandle=function(E,q,H){return J.H.useImperativeHandle(E,q,H)},ye.useInsertionEffect=function(E,q){return J.H.useInsertionEffect(E,q)},ye.useLayoutEffect=function(E,q){return J.H.useLayoutEffect(E,q)},ye.useMemo=function(E,q){return J.H.useMemo(E,q)},ye.useOptimistic=function(E,q){return J.H.useOptimistic(E,q)},ye.useReducer=function(E,q,H){return J.H.useReducer(E,q,H)},ye.useRef=function(E){return J.H.useRef(E)},ye.useState=function(E){return J.H.useState(E)},ye.useSyncExternalStore=function(E,q,H){return J.H.useSyncExternalStore(E,q,H)},ye.useTransition=function(){return J.H.useTransition()},ye.version="19.2.0",ye}var jS;function hy(){return jS||(jS=1,Qh.exports=yM()),Qh.exports}var $=hy();const gM=gk($),hT=yk({__proto__:null,default:gM},[$]),py=$.createContext(Jt.STORE);function pT(t,...e){let n;if(e.length===2){const r=e[0],a=e[1];n=Pr(t,r,a)}else n=e[0];return n}function Wn(...t){const e=$.useContext(py),n=pT(e,...t),r=$.useRef(null);return r.current??=a=>{Lt(e,n,a)},r.current}function Et(...t){const e=$.useContext(py),n=pT(e,...t),r=$.useId();return $.useSyncExternalStore(a=>Bo(e,n,`use-o:${r}`,a),()=>An(e,n),()=>An(e,n))}const mT=(t,{stringify:e,parse:n},r)=>({setSelf:a,onSet:u})=>{if(!t)return;const c=t.getItem(r);c!=null&&a(n(c)),u(({newValue:f})=>{if(f==null){t.removeItem(r);return}t.setItem(r,e(f))})};wk({key:"mutex",default:!1});var bM=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)}},vM=class Fp{type="continuity";globals=[];actions=[];perspectives=[];key;constructor(e){this.key=e}static existing=new bM;static create(e,n){const{type:r,globals:a,actions:u,perspectives:c}=n(new Fp(e)),f={type:r,key:e,globals:a,actions:u,perspectives:c};return Fp.existing.set(e,f),f}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 SM(t){const{key:e,config:n}=t,r=vM.create(e,n),{actions:a}=r;for(const u of a)Jx(Jt.STORE,e,u.key);return Zm(Jt.STORE,e,-1),r}const wM=t=>t.startsWith("user::"),xM=t=>t.startsWith("room::");Sk({key:"roomIndex",class:Kx});const TM=xk({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:xM,isBType:wM});_k({key:"usersInMyRoomView",get:t=>({find:e})=>{const[,n]=Tk(TM);return[e(n,t)]}});const AM=(t,e,n,r,a)=>u=>{function c(h,m){if(t.logger.info("🧑⚖️","continuity",e,"reconciling updates"),Lt(t,wc,g=>(g.shift(),g)),h.id===m.id){if(JSON.stringify(h.subEvents)===JSON.stringify(m.subEvents)){t.logger.info("✅","continuity",e,`results for ${h.id} match between client and server`),n.emit(`ack:${e}`,m.epoch);return}}else t.logger.info("❌","continuity",e,`thought update #${m.epoch} was ${h.token.key}:${h.id}, but it was actually ${m.token.key}:${m.id}`);t.logger.info("🧑⚖️","continuity",e,"updates do not match",h,m);const y=r.toReversed();for(const g of y)wo(t,g,"oldValue");t.logger.info("⏪","continuity",e,"undid optimistic updates:",y),wo(t,h,"oldValue"),t.logger.info("⏪","continuity",e,"undid zeroth optimistic update",h),wo(t,m,"newValue"),t.logger.info("⏩","continuity",e,"applied confirmed update",m),n.emit(`ack:${e}`,m.epoch);for(const g of r){const v={type:"transaction",key:g.token.key},{id:S,params:x}=g;Jm(t,v,S)(...x)}t.logger.info("⏩","continuity",e,"reapplied subsequent optimistic updates:",r)}t.logger.info("🧑⚖️","continuity",e,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:a,optimisticUpdates:r});const f=r[0];if(f)if(t.logger.info("🧑⚖️","continuity",e,"has optimistic updates to reconcile"),u.epoch===f.epoch){t.logger.info("🧑⚖️","continuity",e,`epoch of confirmed update #${u.epoch} matches zeroth optimistic update`),c(f,u);for(const h of a){const m=r[0];if(h.epoch===m?.epoch)c(m,h);else break}}else t.logger.info("🧑⚖️","continuity",e,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${f.epoch}`),a.some(h=>h.epoch===u.epoch)||(t.logger.info("👈","continuity",e,"pushing confirmed update to queue",u),Lt(t,Gp,h=>(h.push(u),h.sort((m,y)=>m.epoch-y.epoch),h)));else{t.logger.info("🧑⚖️","continuity",e,"has no optimistic updates to deal with");let h;h=Yx(t,e),h===u.epoch-1?(t.logger.info("✅","continuity",e,`integrating update #${u.epoch} (${u.token.key} ${u.id})`),wo(t,u,"newValue"),n.emit(`ack:${e}`,u.epoch),Zm(t,e,u.epoch)):h!==void 0&&(t.logger.info("🧑⚖️","continuity",e,`received update #${u.epoch} but still waiting for update #${h+1}`,{clientEpoch:h,serverEpoch:u.epoch}),a.some(m=>m.epoch===u.epoch)?t.logger.info("👍","continuity",e,`confirmed update #${u.epoch} is already enqueued`):(t.logger.info("👈","continuity",e,`pushing confirmed update #${u.epoch} to queue`),Lt(t,Gp,m=>(m.push(u),m.sort((y,g)=>y.epoch-g.epoch),m))))}};function EM(t){return e=>{for(const n of e)dy(t,n)}}function OM(t){return e=>{let n=0,r,a;for(const u of e)n%2===0?r=u:(a=u,Lt(t,r,a)),n++}}const _M=ft({key:"mySocketKey",default:void 0});ft({key:"myUserKey",default:null,effects:[mT(globalThis.localStorage,JSON,"myUserKey")]});const wc=ft({key:"optimisticUpdateQueue",default:()=>[]}),Gp=ft({key:"confirmedUpdateQueue",default:()=>[]});function RM(t,e,n){const r=n.key,a=An(t,wc),u=An(t,Gp),c=(g,v)=>{e.off(`continuity-init:${r}`,c);let S=0,x,T;for(const M of v)S%2===0?x=M:(T=M,"type"in x&&x.type==="mutable_atom"&&(x=Rs(t,x)),Lt(t,x,T)),S++;Zm(t,r,g)};e.off(`continuity-init:${r}`),e.on(`continuity-init:${r}`,c);const f=AM(t,r,e,a,u);e.off(`tx-new:${r}`),e.on(`tx-new:${r}`,f);const h=n.actions.map(g=>(Jx(t,r,g.key),oT(t,g,`tx-run:${r}`,v=>{t.logger.info("🤞","continuity",r,"enqueuing optimistic update");const S=a.findIndex(x=>x.id===v.id);S===-1?(t.logger.info("🤞","continuity",r,"enqueuing new optimistic update"),Lt(t,wc,x=>(x.push(v),x.sort((T,M)=>T.epoch-M.epoch),x))):(t.logger.info("🤞","continuity",r,`replacing existing optimistic update at index ${S}`),Lt(t,wc,x=>(x[S]=v,x))),e.emit(`tx-run:${r}`,{id:v.id,token:g,params:v.params})}))),m=OM(t),y=EM(t);return e.on(`reveal:${r}`,m),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 yT=$.createContext({socket:null,services:null}),CM=({children:t,socket:e})=>{const n=$.useRef(new Map).current,r=Wn(_M);return $.useEffect(()=>{r(e?.id?`socket::${e.id}`:void 0),e?.on("connect",()=>{r(e?.id?`socket::${e.id}`:void 0)}),e?.on("disconnect",()=>{r(void 0)})},[e,r]),F.jsx(yT.Provider,{value:{socket:e,services:n},children:t})};function kM(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()=>{Br(r)&&r(),n.current=!1}},e)}else $.useEffect(t,e)}function MM(t,e){const{socket:n,services:r}=$.useContext(yT);kM(()=>{let a=r?.get(t);return a?++a.consumerCount:n&&(a={consumerCount:1,dispose:e(n)},r?.set(t,a)),()=>{a&&(--a.consumerCount,a.consumerCount===0&&(a.dispose?.(),r?.delete(t)))}},[n,t])}function DM(t){const e=$.useContext(py);MM(`tx-sync:${t.key}`,n=>RM(e,n,t))}var Wh={exports:{}},Ga={},ep={exports:{}},tp={};var BS;function NM(){return BS||(BS=1,(function(t){function e(j,U){var L=j.length;j.push(U);e:for(;0<L;){var te=L-1>>>1,oe=j[te];if(0<a(oe,U))j[te]=U,j[L]=oe,L=te;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var U=j[0],L=j.pop();if(L!==U){j[0]=L;e:for(var te=0,oe=j.length,E=oe>>>1;te<E;){var q=2*(te+1)-1,H=j[q],Q=q+1,re=j[Q];if(0>a(H,L))Q<oe&&0>a(re,H)?(j[te]=re,j[Q]=L,te=Q):(j[te]=H,j[q]=L,te=q);else if(Q<oe&&0>a(re,L))j[te]=re,j[Q]=L,te=Q;else break e}}return U}function a(j,U){var L=j.sortIndex-U.sortIndex;return L!==0?L:j.id-U.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();t.unstable_now=function(){return c.now()-f}}var h=[],m=[],y=1,g=null,v=3,S=!1,x=!1,T=!1,M=!1,C=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function G(j){for(var U=n(m);U!==null;){if(U.callback===null)r(m);else if(U.startTime<=j)r(m),U.sortIndex=U.expirationTime,e(h,U);else break;U=n(m)}}function I(j){if(T=!1,G(j),!x)if(n(h)!==null)x=!0,ee||(ee=!0,je());else{var U=n(m);U!==null&&ne(I,U.startTime-j)}}var ee=!1,J=-1,X=5,he=-1;function pe(){return M?!0:!(t.unstable_now()-he<X)}function we(){if(M=!1,ee){var j=t.unstable_now();he=j;var U=!0;try{e:{x=!1,T&&(T=!1,_(J),J=-1),S=!0;var L=v;try{t:{for(G(j),g=n(h);g!==null&&!(g.expirationTime>j&&pe());){var te=g.callback;if(typeof te=="function"){g.callback=null,v=g.priorityLevel;var oe=te(g.expirationTime<=j);if(j=t.unstable_now(),typeof oe=="function"){g.callback=oe,G(j),U=!0;break t}g===n(h)&&r(h),G(j)}else r(h);g=n(h)}if(g!==null)U=!0;else{var E=n(m);E!==null&&ne(I,E.startTime-j),U=!1}}break e}finally{g=null,v=L,S=!1}U=void 0}}finally{U?je():ee=!1}}}var je;if(typeof R=="function")je=function(){R(we)};else if(typeof MessageChannel<"u"){var ve=new MessageChannel,Z=ve.port2;ve.port1.onmessage=we,je=function(){Z.postMessage(null)}}else je=function(){C(we,0)};function ne(j,U){J=C(function(){j(t.unstable_now())},U)}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(j){j.callback=null},t.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<j?Math.floor(1e3/j):5},t.unstable_getCurrentPriorityLevel=function(){return v},t.unstable_next=function(j){switch(v){case 1:case 2:case 3:var U=3;break;default:U=v}var L=v;v=U;try{return j()}finally{v=L}},t.unstable_requestPaint=function(){M=!0},t.unstable_runWithPriority=function(j,U){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var L=v;v=j;try{return U()}finally{v=L}},t.unstable_scheduleCallback=function(j,U,L){var te=t.unstable_now();switch(typeof L=="object"&&L!==null?(L=L.delay,L=typeof L=="number"&&0<L?te+L:te):L=te,j){case 1:var oe=-1;break;case 2:oe=250;break;case 5:oe=1073741823;break;case 4:oe=1e4;break;default:oe=5e3}return oe=L+oe,j={id:y++,callback:U,priorityLevel:j,startTime:L,expirationTime:oe,sortIndex:-1},L>te?(j.sortIndex=L,e(m,j),n(h)===null&&j===n(m)&&(T?(_(J),J=-1):T=!0,ne(I,L-te))):(j.sortIndex=oe,e(h,j),x||S||(x=!0,ee||(ee=!0,je()))),j},t.unstable_shouldYield=pe,t.unstable_wrapCallback=function(j){var U=v;return function(){var L=v;v=U;try{return j.apply(this,arguments)}finally{v=L}}}})(tp)),tp}var zS;function $M(){return zS||(zS=1,ep.exports=NM()),ep.exports}var np={exports:{}},Gt={};var LS;function jM(){if(LS)return Gt;LS=1;var t=hy();function e(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)m+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+m+" 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},a=Symbol.for("react.portal");function u(h,m,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:h,containerInfo:m,implementation:y}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Gt.createPortal=function(h,m){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(e(299));return u(h,m,null,y)},Gt.flushSync=function(h){var m=c.T,y=r.p;try{if(c.T=null,r.p=2,h)return h()}finally{c.T=m,r.p=y,r.d.f()}},Gt.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(h,m))},Gt.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Gt.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin),v=typeof m.integrity=="string"?m.integrity:void 0,S=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;y==="style"?r.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:S}):y==="script"&&r.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:S,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Gt.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var y=f(m.as,m.crossOrigin);r.d.M(h,{crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(h)},Gt.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var y=m.as,g=f(y,m.crossOrigin);r.d.L(h,y,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},Gt.preloadModule=function(h,m){if(typeof h=="string")if(m){var y=f(m.as,m.crossOrigin);r.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:y,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(h)},Gt.requestFormReset=function(h){r.d.r(h)},Gt.unstable_batchedUpdates=function(h,m){return h(m)},Gt.useFormState=function(h,m,y){return c.H.useFormState(h,m,y)},Gt.useFormStatus=function(){return c.H.useHostTransitionStatus()},Gt.version="19.2.0",Gt}var VS;function gT(){if(VS)return np.exports;VS=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(),np.exports=jM(),np.exports}var US;function BM(){if(US)return Ga;US=1;var t=$M(),e=hy(),n=gT();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)s+="&args[]="+encodeURIComponent(arguments[o])}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 a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function u(i){var s=i,o=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(o=s.return),i=s.return;while(i)}return s.tag===3?o: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 f(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function h(i){if(u(i)!==i)throw Error(r(188))}function m(i){var s=i.alternate;if(!s){if(s=u(i),s===null)throw Error(r(188));return s!==i?null:i}for(var o=i,l=s;;){var d=o.return;if(d===null)break;var p=d.alternate;if(p===null){if(l=d.return,l!==null){o=l;continue}break}if(d.child===p.child){for(p=d.child;p;){if(p===o)return h(d),i;if(p===l)return h(d),s;p=p.sibling}throw Error(r(188))}if(o.return!==l.return)o=d,l=p;else{for(var b=!1,w=d.child;w;){if(w===o){b=!0,o=d,l=p;break}if(w===l){b=!0,l=d,o=p;break}w=w.sibling}if(!b){for(w=p.child;w;){if(w===o){b=!0,o=p,l=d;break}if(w===l){b=!0,l=p,o=d;break}w=w.sibling}if(!b)throw Error(r(189))}}if(o.alternate!==l)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?i:s}function y(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=y(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),R=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),he=Symbol.for("react.activity"),pe=Symbol.for("react.memo_cache_sentinel"),we=Symbol.iterator;function je(i){return i===null||typeof i!="object"?null:(i=we&&i[we]||i["@@iterator"],typeof i=="function"?i:null)}var ve=Symbol.for("react.client.reference");function Z(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===ve?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case T:return"Fragment";case C:return"Profiler";case M:return"StrictMode";case I:return"Suspense";case ee:return"SuspenseList";case he:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case x:return"Portal";case R:return i.displayName||"Context";case _: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 J:return s=i.displayName||null,s!==null?s:Z(i.type)||"Memo";case X:s=i._payload,i=i._init;try{return Z(i(s))}catch{}}return null}var ne=Array.isArray,j=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L={pending:!1,data:null,method:null,action:null},te=[],oe=-1;function E(i){return{current:i}}function q(i){0>oe||(i.current=te[oe],te[oe]=null,oe--)}function H(i,s){oe++,te[oe]=i.current,i.current=s}var Q=E(null),re=E(null),ce=E(null),Te=E(null);function Ct(i,s){switch(H(ce,s),H(re,i),H(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?F0(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=F0(s),i=G0(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(Q),H(Q,i)}function Je(){q(Q),q(re),q(ce)}function ii(i){i.memoizedState!==null&&H(Te,i);var s=Q.current,o=G0(s,i.type);s!==o&&(H(re,i),H(Q,o))}function xi(i){re.current===i&&(q(Q),q(re)),Te.current===i&&(q(Te),qa._currentValue=L)}var xe,Me;function ge(i){if(xe===void 0)try{throw Error()}catch(o){var s=o.stack.trim().match(/\n( *(at )?)/);xe=s&&s[1]||"",Me=-1<o.stack.indexOf(`
|
|
14
14
|
at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
15
15
|
`+xe+i+Me}var Xe=!1;function ht(i,s){if(!i||Xe)return"";Xe=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(s){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(z){var B=z}Reflect.construct(i,[],P)}else{try{P.call()}catch(z){B=z}i.call(P.prototype)}}else{try{throw Error()}catch(z){B=z}(P=i())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(z){if(z&&B&&typeof z.stack=="string")return[z.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=l.DetermineComponentFrameRoot(),b=p[0],w=p[1];if(b&&w){var A=b.split(`
|
|
16
16
|
`),N=w.split(`
|
|
17
17
|
`);for(d=l=0;l<A.length&&!A[l].includes("DetermineComponentFrameRoot");)l++;for(;d<N.length&&!N[d].includes("DetermineComponentFrameRoot");)d++;if(l===A.length||d===N.length)for(l=A.length-1,d=N.length-1;1<=l&&0<=d&&A[l]!==N[d];)d--;for(;1<=l&&0<=d;l--,d--)if(A[l]!==N[d]){if(l!==1||d!==1)do if(l--,d--,0>d||A[l]!==N[d]){var V=`
|
|
18
18
|
`+A[l].replace(" at new "," at ");return i.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",i.displayName)),V}while(1<=l&&0<=d);break}}}finally{Xe=!1,Error.prepareStackTrace=o}return(o=i?i.displayName||i.name:"")?ge(o):""}function Le(i,s){switch(i.tag){case 26:case 27:case 5:return ge(i.type);case 16:return ge("Lazy");case 13:return i.child!==s&&s!==null?ge("Suspense Fallback"):ge("Suspense");case 19:return ge("SuspenseList");case 0:case 15:return ht(i.type,!1);case 11:return ht(i.type.render,!1);case 1:return ht(i.type,!0);case 31:return ge("Activity");default:return""}}function En(i){try{var s="",o=null;do s+=Le(i,o),o=i,i=i.return;while(i);return s}catch(l){return`
|
|
19
19
|
Error generating stack: `+l.message+`
|
|
20
|
-
`+l.stack}}var Gt=Object.prototype.hasOwnProperty,Vt=t.unstable_scheduleCallback,Hn=t.unstable_cancelCallback,ri=t.unstable_shouldYield,Fn=t.unstable_requestPaint,st=t.unstable_now,Kl=t.unstable_getCurrentPriorityLevel,Ag=t.unstable_ImmediatePriority,Eg=t.unstable_UserBlockingPriority,ql=t.unstable_NormalPriority,Z_=t.unstable_LowPriority,Og=t.unstable_IdlePriority,Q_=t.log,W_=t.unstable_setDisableYieldValue,ea=null,dn=null;function tr(i){if(typeof Q_=="function"&&W_(i),dn&&typeof dn.setStrictMode=="function")try{dn.setStrictMode(ea,i)}catch{}}var hn=Math.clz32?Math.clz32:nR,eR=Math.log,tR=Math.LN2;function nR(i){return i>>>=0,i===0?32:31-(eR(i)/tR|0)|0}var Pl=256,Il=262144,Hl=4194304;function Yr(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:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;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 Fl(i,s,o){var l=i.pendingLanes;if(l===0)return 0;var d=0,p=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var w=l&134217727;return w!==0?(l=w&~p,l!==0?d=Yr(l):(b&=w,b!==0?d=Yr(b):o||(o=w&~i,o!==0&&(d=Yr(o))))):(w=l&~p,w!==0?d=Yr(w):b!==0?d=Yr(b):o||(o=l&~i,o!==0&&(d=Yr(o)))),d===0?0:s!==0&&s!==d&&(s&p)===0&&(p=d&-d,o=s&-s,p>=o||p===32&&(o&4194048)!==0)?s:d}function ta(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function iR(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 _g(){var i=Hl;return Hl<<=1,(Hl&62914560)===0&&(Hl=4194304),i}function zf(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function na(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function rR(i,s,o,l,d,p){var b=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var w=i.entanglements,A=i.expirationTimes,N=i.hiddenUpdates;for(o=b&~o;0<o;){var V=31-hn(o),P=1<<V;w[V]=0,A[V]=-1;var B=N[V];if(B!==null)for(N[V]=null,V=0;V<B.length;V++){var z=B[V];z!==null&&(z.lane&=-536870913)}o&=~P}l!==0&&Rg(i,l,0),p!==0&&d===0&&i.tag!==0&&(i.suspendedLanes|=p&~(b&~s))}function Rg(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var l=31-hn(s);i.entangledLanes|=s,i.entanglements[l]=i.entanglements[l]|1073741824|o&261930}function Cg(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var l=31-hn(o),d=1<<l;d&s|i[l]&s&&(i[l]|=s),o&=~d}}function kg(i,s){var o=s&-s;return o=(o&42)!==0?1:Lf(o),(o&(i.suspendedLanes|s))!==0?0:o}function Lf(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Vf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Mg(){var i=U.p;return i!==0?i:(i=window.event,i===void 0?32:yS(i.type))}function Dg(i,s){var o=U.p;try{return U.p=i,s()}finally{U.p=o}}var nr=Math.random().toString(36).slice(2),Ut="__reactFiber$"+nr,tn="__reactProps$"+nr,Ms="__reactContainer$"+nr,Uf="__reactEvents$"+nr,sR="__reactListeners$"+nr,oR="__reactHandles$"+nr,Ng="__reactResources$"+nr,ia="__reactMarker$"+nr;function Kf(i){delete i[Ut],delete i[tn],delete i[Uf],delete i[sR],delete i[oR]}function Ds(i){var s=i[Ut];if(s)return s;for(var o=i.parentNode;o;){if(s=o[Ms]||o[Ut]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=eS(i);i!==null;){if(o=i[Ut])return o;i=eS(i)}return s}i=o,o=i.parentNode}return null}function Ns(i){if(i=i[Ut]||i[Ms]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function ra(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function $s(i){var s=i[Ng];return s||(s=i[Ng]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Nt(i){i[ia]=!0}var $g=new Set,jg={};function Jr(i,s){js(i,s),js(i+"Capture",s)}function js(i,s){for(jg[i]=s,i=0;i<s.length;i++)$g.add(s[i])}var aR=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]*$"),Bg={},zg={};function lR(i){return Gt.call(zg,i)?!0:Gt.call(Bg,i)?!1:aR.test(i)?zg[i]=!0:(Bg[i]=!0,!1)}function Gl(i,s,o){if(lR(s))if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var l=s.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+o)}}function Yl(i,s,o){if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+o)}}function Ti(i,s,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(s,o,""+l)}}function On(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Lg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function uR(i,s,o){var l=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,p=l.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return d.call(this)},set:function(b){o=""+b,p.call(this,b)}}),Object.defineProperty(i,s,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(b){o=""+b},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function qf(i){if(!i._valueTracker){var s=Lg(i)?"checked":"value";i._valueTracker=uR(i,s,""+i[s])}}function Vg(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),l="";return i&&(l=Lg(i)?i.checked?"true":"false":i.value),i=l,i!==o?(s.setValue(i),!0):!1}function Jl(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 cR=/[\n"\\]/g;function _n(i){return i.replace(cR,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Pf(i,s,o,l,d,p,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=""+On(s)):i.value!==""+On(s)&&(i.value=""+On(s)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),s!=null?If(i,b,On(s)):o!=null?If(i,b,On(o)):l!=null&&i.removeAttribute("value"),d==null&&p!=null&&(i.defaultChecked=!!p),d!=null&&(i.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+On(w):i.removeAttribute("name")}function Ug(i,s,o,l,d,p,b,w){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(i.type=p),s!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||s!=null)){qf(i);return}o=o!=null?""+On(o):"",s=s!=null?""+On(s):o,w||s===i.value||(i.value=s),i.defaultValue=s}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=w?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b),qf(i)}function If(i,s,o){s==="number"&&Jl(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function Bs(i,s,o,l){if(i=i.options,s){s={};for(var d=0;d<o.length;d++)s["$"+o[d]]=!0;for(o=0;o<i.length;o++)d=s.hasOwnProperty("$"+i[o].value),i[o].selected!==d&&(i[o].selected=d),d&&l&&(i[o].defaultSelected=!0)}else{for(o=""+On(o),s=null,d=0;d<i.length;d++){if(i[d].value===o){i[d].selected=!0,l&&(i[d].defaultSelected=!0);return}s!==null||i[d].disabled||(s=i[d])}s!==null&&(s.selected=!0)}}function Kg(i,s,o){if(s!=null&&(s=""+On(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+On(o):""}function qg(i,s,o,l){if(s==null){if(l!=null){if(o!=null)throw Error(r(92));if(ne(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),s=o}o=On(s),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l),qf(i)}function zs(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var fR=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 Pg(i,s,o){var l=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":l?i.setProperty(s,o):typeof o!="number"||o===0||fR.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function Ig(i,s,o){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||s!=null&&s.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var d in s)l=s[d],s.hasOwnProperty(d)&&o[d]!==l&&Pg(i,d,l)}else for(var p in s)s.hasOwnProperty(p)&&Pg(i,p,s[p])}function Hf(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 dR=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"]]),hR=/^[\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 Xl(i){return hR.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ai(){}var Ff=null;function Gf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ls=null,Vs=null;function Hg(i){var s=Ns(i);if(s&&(i=s.stateNode)){var o=i[tn]||null;e:switch(i=s.stateNode,s.type){case"input":if(Pf(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+_n(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var l=o[s];if(l!==i&&l.form===i.form){var d=l[tn]||null;if(!d)throw Error(r(90));Pf(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(s=0;s<o.length;s++)l=o[s],l.form===i.form&&Vg(l)}break e;case"textarea":Kg(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&Bs(i,!!o.multiple,s,!1)}}}var Yf=!1;function Fg(i,s,o){if(Yf)return i(s,o);Yf=!0;try{var l=i(s);return l}finally{if(Yf=!1,(Ls!==null||Vs!==null)&&(zu(),Ls&&(s=Ls,i=Vs,Vs=Ls=null,Hg(s),i)))for(s=0;s<i.length;s++)Hg(i[s])}}function sa(i,s){var o=i.stateNode;if(o===null)return null;var l=o[tn]||null;if(l===null)return null;o=l[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":(l=!l.disabled)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,s,typeof o));return o}var Ei=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jf=!1;if(Ei)try{var oa={};Object.defineProperty(oa,"passive",{get:function(){Jf=!0}}),window.addEventListener("test",oa,oa),window.removeEventListener("test",oa,oa)}catch{Jf=!1}var ir=null,Xf=null,Zl=null;function Gg(){if(Zl)return Zl;var i,s=Xf,o=s.length,l,d="value"in ir?ir.value:ir.textContent,p=d.length;for(i=0;i<o&&s[i]===d[i];i++);var b=o-i;for(l=1;l<=b&&s[o-l]===d[p-l];l++);return Zl=d.slice(i,1<l?1-l:void 0)}function Ql(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 Wl(){return!0}function Yg(){return!1}function nn(i){function s(o,l,d,p,b){this._reactName=o,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=b,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(o=i[w],this[w]=o?o(p):p[w]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Wl:Yg,this.isPropagationStopped=Yg,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Wl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),s}var Xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eu=nn(Xr),aa=g({},Xr,{view:0,detail:0}),pR=nn(aa),Zf,Qf,la,tu=g({},aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ed,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!==la&&(la&&i.type==="mousemove"?(Zf=i.screenX-la.screenX,Qf=i.screenY-la.screenY):Qf=Zf=0,la=i),Zf)},movementY:function(i){return"movementY"in i?i.movementY:Qf}}),Jg=nn(tu),mR=g({},tu,{dataTransfer:0}),yR=nn(mR),gR=g({},aa,{relatedTarget:0}),Wf=nn(gR),bR=g({},Xr,{animationName:0,elapsedTime:0,pseudoElement:0}),vR=nn(bR),SR=g({},Xr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),wR=nn(SR),xR=g({},Xr,{data:0}),Xg=nn(xR),TR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AR={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"},ER={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OR(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=ER[i])?!!s[i]:!1}function ed(){return OR}var _R=g({},aa,{key:function(i){if(i.key){var s=TR[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Ql(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?AR[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ed,charCode:function(i){return i.type==="keypress"?Ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),RR=nn(_R),CR=g({},tu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zg=nn(CR),kR=g({},aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ed}),MR=nn(kR),DR=g({},Xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),NR=nn(DR),$R=g({},tu,{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}),jR=nn($R),BR=g({},Xr,{newState:0,oldState:0}),zR=nn(BR),LR=[9,13,27,32],td=Ei&&"CompositionEvent"in window,ua=null;Ei&&"documentMode"in document&&(ua=document.documentMode);var VR=Ei&&"TextEvent"in window&&!ua,Qg=Ei&&(!td||ua&&8<ua&&11>=ua),Wg=" ",eb=!1;function tb(i,s){switch(i){case"keyup":return LR.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nb(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Us=!1;function UR(i,s){switch(i){case"compositionend":return nb(s);case"keypress":return s.which!==32?null:(eb=!0,Wg);case"textInput":return i=s.data,i===Wg&&eb?null:i;default:return null}}function KR(i,s){if(Us)return i==="compositionend"||!td&&tb(i,s)?(i=Gg(),Zl=Xf=ir=null,Us=!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 Qg&&s.locale!=="ko"?null:s.data;default:return null}}var qR={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 ib(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!qR[i.type]:s==="textarea"}function rb(i,s,o,l){Ls?Vs?Vs.push(l):Vs=[l]:Ls=l,s=Iu(s,"onChange"),0<s.length&&(o=new eu("onChange","change",null,o,l),i.push({event:o,listeners:s}))}var ca=null,fa=null;function PR(i){U0(i,0)}function nu(i){var s=ra(i);if(Vg(s))return i}function sb(i,s){if(i==="change")return s}var ob=!1;if(Ei){var nd;if(Ei){var id="oninput"in document;if(!id){var ab=document.createElement("div");ab.setAttribute("oninput","return;"),id=typeof ab.oninput=="function"}nd=id}else nd=!1;ob=nd&&(!document.documentMode||9<document.documentMode)}function lb(){ca&&(ca.detachEvent("onpropertychange",ub),fa=ca=null)}function ub(i){if(i.propertyName==="value"&&nu(fa)){var s=[];rb(s,fa,i,Gf(i)),Fg(PR,s)}}function IR(i,s,o){i==="focusin"?(lb(),ca=s,fa=o,ca.attachEvent("onpropertychange",ub)):i==="focusout"&&lb()}function HR(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return nu(fa)}function FR(i,s){if(i==="click")return nu(s)}function GR(i,s){if(i==="input"||i==="change")return nu(s)}function YR(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var pn=typeof Object.is=="function"?Object.is:YR;function da(i,s){if(pn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var o=Object.keys(i),l=Object.keys(s);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var d=o[l];if(!Gt.call(s,d)||!pn(i[d],s[d]))return!1}return!0}function cb(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function fb(i,s){var o=cb(i);i=0;for(var l;o;){if(o.nodeType===3){if(l=i+o.textContent.length,i<=s&&l>=s)return{node:o,offset:s-i};i=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=cb(o)}}function db(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?db(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function hb(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Jl(i.document);s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Jl(i.document)}return s}function rd(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 JR=Ei&&"documentMode"in document&&11>=document.documentMode,Ks=null,sd=null,ha=null,od=!1;function pb(i,s,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;od||Ks==null||Ks!==Jl(l)||(l=Ks,"selectionStart"in l&&rd(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ha&&da(ha,l)||(ha=l,l=Iu(sd,"onSelect"),0<l.length&&(s=new eu("onSelect","select",null,s,o),i.push({event:s,listeners:l}),s.target=Ks)))}function Zr(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var qs={animationend:Zr("Animation","AnimationEnd"),animationiteration:Zr("Animation","AnimationIteration"),animationstart:Zr("Animation","AnimationStart"),transitionrun:Zr("Transition","TransitionRun"),transitionstart:Zr("Transition","TransitionStart"),transitioncancel:Zr("Transition","TransitionCancel"),transitionend:Zr("Transition","TransitionEnd")},ad={},mb={};Ei&&(mb=document.createElement("div").style,"AnimationEvent"in window||(delete qs.animationend.animation,delete qs.animationiteration.animation,delete qs.animationstart.animation),"TransitionEvent"in window||delete qs.transitionend.transition);function Qr(i){if(ad[i])return ad[i];if(!qs[i])return i;var s=qs[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in mb)return ad[i]=s[o];return i}var yb=Qr("animationend"),gb=Qr("animationiteration"),bb=Qr("animationstart"),XR=Qr("transitionrun"),ZR=Qr("transitionstart"),QR=Qr("transitioncancel"),vb=Qr("transitionend"),Sb=new Map,ld="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(" ");ld.push("scrollEnd");function Gn(i,s){Sb.set(i,s),Jr(s,[i])}var iu=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)},Rn=[],Ps=0,ud=0;function ru(){for(var i=Ps,s=ud=Ps=0;s<i;){var o=Rn[s];Rn[s++]=null;var l=Rn[s];Rn[s++]=null;var d=Rn[s];Rn[s++]=null;var p=Rn[s];if(Rn[s++]=null,l!==null&&d!==null){var b=l.pending;b===null?d.next=d:(d.next=b.next,b.next=d),l.pending=d}p!==0&&wb(o,d,p)}}function su(i,s,o,l){Rn[Ps++]=i,Rn[Ps++]=s,Rn[Ps++]=o,Rn[Ps++]=l,ud|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function cd(i,s,o,l){return su(i,s,o,l),ou(i)}function Wr(i,s){return su(i,null,null,s),ou(i)}function wb(i,s,o){i.lanes|=o;var l=i.alternate;l!==null&&(l.lanes|=o);for(var d=!1,p=i.return;p!==null;)p.childLanes|=o,l=p.alternate,l!==null&&(l.childLanes|=o),p.tag===22&&(i=p.stateNode,i===null||i._visibility&1||(d=!0)),i=p,p=p.return;return i.tag===3?(p=i.stateNode,d&&s!==null&&(d=31-hn(o),i=p.hiddenUpdates,l=i[d],l===null?i[d]=[s]:l.push(s),s.lane=o|536870912),p):null}function ou(i){if(50<ja)throw ja=0,vh=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Is={};function WR(i,s,o,l){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(i,s,o,l){return new WR(i,s,o,l)}function fd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Oi(i,s){var o=i.alternate;return o===null?(o=mn(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function xb(i,s){i.flags&=65011714;var o=i.alternate;return o===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=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,s=o.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function au(i,s,o,l,d,p){var b=0;if(l=i,typeof i=="function")fd(i)&&(b=1);else if(typeof i=="string")b=rk(i,o,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case he:return i=mn(31,o,s,d),i.elementType=he,i.lanes=p,i;case T:return es(o.children,d,p,s);case M:b=8,d|=24;break;case C:return i=mn(12,o,s,d|2),i.elementType=C,i.lanes=p,i;case I:return i=mn(13,o,s,d),i.elementType=I,i.lanes=p,i;case ee:return i=mn(19,o,s,d),i.elementType=ee,i.lanes=p,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:b=10;break e;case _:b=9;break e;case G:b=11;break e;case J:b=14;break e;case X:b=16,l=null;break e}b=29,o=Error(r(130,i===null?"null":typeof i,"")),l=null}return s=mn(b,o,s,d),s.elementType=i,s.type=l,s.lanes=p,s}function es(i,s,o,l){return i=mn(7,i,l,s),i.lanes=o,i}function dd(i,s,o){return i=mn(6,i,null,s),i.lanes=o,i}function Tb(i){var s=mn(18,null,null,0);return s.stateNode=i,s}function hd(i,s,o){return s=mn(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Ab=new WeakMap;function Cn(i,s){if(typeof i=="object"&&i!==null){var o=Ab.get(i);return o!==void 0?o:(s={value:i,source:s,stack:En(s)},Ab.set(i,s),s)}return{value:i,source:s,stack:En(s)}}var Hs=[],Fs=0,lu=null,pa=0,kn=[],Mn=0,rr=null,si=1,oi="";function _i(i,s){Hs[Fs++]=pa,Hs[Fs++]=lu,lu=i,pa=s}function Eb(i,s,o){kn[Mn++]=si,kn[Mn++]=oi,kn[Mn++]=rr,rr=i;var l=si;i=oi;var d=32-hn(l)-1;l&=~(1<<d),o+=1;var p=32-hn(s)+d;if(30<p){var b=d-d%5;p=(l&(1<<b)-1).toString(32),l>>=b,d-=b,si=1<<32-hn(s)+d|o<<d|l,oi=p+i}else si=1<<p|o<<d|l,oi=i}function pd(i){i.return!==null&&(_i(i,1),Eb(i,1,0))}function md(i){for(;i===lu;)lu=Hs[--Fs],Hs[Fs]=null,pa=Hs[--Fs],Hs[Fs]=null;for(;i===rr;)rr=kn[--Mn],kn[Mn]=null,oi=kn[--Mn],kn[Mn]=null,si=kn[--Mn],kn[Mn]=null}function Ob(i,s){kn[Mn++]=si,kn[Mn++]=oi,kn[Mn++]=rr,si=s.id,oi=s.overflow,rr=i}var Kt=null,Ze=null,Ce=!1,sr=null,Dn=!1,yd=Error(r(519));function or(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ma(Cn(s,i)),yd}function _b(i){var s=i.stateNode,o=i.type,l=i.memoizedProps;switch(s[Ut]=i,s[tn]=l,o){case"dialog":Ee("cancel",s),Ee("close",s);break;case"iframe":case"object":case"embed":Ee("load",s);break;case"video":case"audio":for(o=0;o<za.length;o++)Ee(za[o],s);break;case"source":Ee("error",s);break;case"img":case"image":case"link":Ee("error",s),Ee("load",s);break;case"details":Ee("toggle",s);break;case"input":Ee("invalid",s),Ug(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ee("invalid",s);break;case"textarea":Ee("invalid",s),qg(s,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||l.suppressHydrationWarning===!0||I0(s.textContent,o)?(l.popover!=null&&(Ee("beforetoggle",s),Ee("toggle",s)),l.onScroll!=null&&Ee("scroll",s),l.onScrollEnd!=null&&Ee("scrollend",s),l.onClick!=null&&(s.onclick=Ai),s=!0):s=!1,s||or(i,!0)}function Rb(i){for(Kt=i.return;Kt;)switch(Kt.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:Kt=Kt.return}}function Gs(i){if(i!==Kt)return!1;if(!Ce)return Rb(i),Ce=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||$h(i.type,i.memoizedProps)),o=!o),o&&Ze&&or(i),Rb(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ze=W0(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ze=W0(i)}else s===27?(s=Ze,Sr(i.type)?(i=Vh,Vh=null,Ze=i):Ze=s):Ze=Kt?$n(i.stateNode.nextSibling):null;return!0}function ts(){Ze=Kt=null,Ce=!1}function gd(){var i=sr;return i!==null&&(an===null?an=i:an.push.apply(an,i),sr=null),i}function ma(i){sr===null?sr=[i]:sr.push(i)}var bd=E(null),ns=null,Ri=null;function ar(i,s,o){H(bd,s._currentValue),s._currentValue=o}function Ci(i){i._currentValue=bd.current,q(bd)}function vd(i,s,o){for(;i!==null;){var l=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,l!==null&&(l.childLanes|=s)):l!==null&&(l.childLanes&s)!==s&&(l.childLanes|=s),i===o)break;i=i.return}}function Sd(i,s,o,l){var d=i.child;for(d!==null&&(d.return=i);d!==null;){var p=d.dependencies;if(p!==null){var b=d.child;p=p.firstContext;e:for(;p!==null;){var w=p;p=d;for(var A=0;A<s.length;A++)if(w.context===s[A]){p.lanes|=o,w=p.alternate,w!==null&&(w.lanes|=o),vd(p.return,o,i),l||(b=null);break e}p=w.next}}else if(d.tag===18){if(b=d.return,b===null)throw Error(r(341));b.lanes|=o,p=b.alternate,p!==null&&(p.lanes|=o),vd(b,o,i),b=null}else b=d.child;if(b!==null)b.return=d;else for(b=d;b!==null;){if(b===i){b=null;break}if(d=b.sibling,d!==null){d.return=b.return,b=d;break}b=b.return}d=b}}function Ys(i,s,o,l){i=null;for(var d=s,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var b=d.alternate;if(b===null)throw Error(r(387));if(b=b.memoizedProps,b!==null){var w=d.type;pn(d.pendingProps.value,b.value)||(i!==null?i.push(w):i=[w])}}else if(d===Te.current){if(b=d.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(i!==null?i.push(qa):i=[qa])}d=d.return}i!==null&&Sd(s,i,o,l),s.flags|=262144}function uu(i){for(i=i.firstContext;i!==null;){if(!pn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function is(i){ns=i,Ri=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function qt(i){return Cb(ns,i)}function cu(i,s){return ns===null&&is(i),Cb(i,s)}function Cb(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},Ri===null){if(i===null)throw Error(r(308));Ri=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ri=Ri.next=s;return o}var eC=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(o,l){i.push(l)}};this.abort=function(){s.aborted=!0,i.forEach(function(o){return o()})}},tC=t.unstable_scheduleCallback,nC=t.unstable_NormalPriority,vt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wd(){return{controller:new eC,data:new Map,refCount:0}}function ya(i){i.refCount--,i.refCount===0&&tC(nC,function(){i.controller.abort()})}var ga=null,xd=0,Js=0,Xs=null;function iC(i,s){if(ga===null){var o=ga=[];xd=0,Js=Eh(),Xs={status:"pending",value:void 0,then:function(l){o.push(l)}}}return xd++,s.then(kb,kb),s}function kb(){if(--xd===0&&ga!==null){Xs!==null&&(Xs.status="fulfilled");var i=ga;ga=null,Js=0,Xs=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function rC(i,s){var o=[],l={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return i.then(function(){l.status="fulfilled",l.value=s;for(var d=0;d<o.length;d++)(0,o[d])(s)},function(d){for(l.status="rejected",l.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),l}var Mb=j.S;j.S=function(i,s){p0=st(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&iC(i,s),Mb!==null&&Mb(i,s)};var rs=E(null);function Td(){var i=rs.current;return i!==null?i:He.pooledCache}function fu(i,s){s===null?H(rs,rs.current):H(rs,s.pool)}function Db(){var i=Td();return i===null?null:{parent:vt._currentValue,pool:i}}var Zs=Error(r(460)),Ad=Error(r(474)),du=Error(r(542)),hu={then:function(){}};function Nb(i){return i=i.status,i==="fulfilled"||i==="rejected"}function $b(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(Ai,Ai),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Bb(i),i;default:if(typeof s.status=="string")s.then(Ai,Ai);else{if(i=He,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(l){if(s.status==="pending"){var d=s;d.status="fulfilled",d.value=l}},function(l){if(s.status==="pending"){var d=s;d.status="rejected",d.reason=l}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Bb(i),i}throw os=s,Zs}}function ss(i){try{var s=i._init;return s(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(os=o,Zs):o}}var os=null;function jb(){if(os===null)throw Error(r(459));var i=os;return os=null,i}function Bb(i){if(i===Zs||i===du)throw Error(r(483))}var Qs=null,ba=0;function pu(i){var s=ba;return ba+=1,Qs===null&&(Qs=[]),$b(Qs,i,s)}function va(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function mu(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function zb(i){function s(k,O){if(i){var D=k.deletions;D===null?(k.deletions=[O],k.flags|=16):D.push(O)}}function o(k,O){if(!i)return null;for(;O!==null;)s(k,O),O=O.sibling;return null}function l(k){for(var O=new Map;k!==null;)k.key!==null?O.set(k.key,k):O.set(k.index,k),k=k.sibling;return O}function d(k,O){return k=Oi(k,O),k.index=0,k.sibling=null,k}function p(k,O,D){return k.index=D,i?(D=k.alternate,D!==null?(D=D.index,D<O?(k.flags|=67108866,O):D):(k.flags|=67108866,O)):(k.flags|=1048576,O)}function b(k){return i&&k.alternate===null&&(k.flags|=67108866),k}function w(k,O,D,K){return O===null||O.tag!==6?(O=dd(D,k.mode,K),O.return=k,O):(O=d(O,D),O.return=k,O)}function A(k,O,D,K){var le=D.type;return le===T?V(k,O,D.props.children,K,D.key):O!==null&&(O.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===X&&ss(le)===O.type)?(O=d(O,D.props),va(O,D),O.return=k,O):(O=au(D.type,D.key,D.props,null,k.mode,K),va(O,D),O.return=k,O)}function N(k,O,D,K){return O===null||O.tag!==4||O.stateNode.containerInfo!==D.containerInfo||O.stateNode.implementation!==D.implementation?(O=hd(D,k.mode,K),O.return=k,O):(O=d(O,D.children||[]),O.return=k,O)}function V(k,O,D,K,le){return O===null||O.tag!==7?(O=es(D,k.mode,K,le),O.return=k,O):(O=d(O,D),O.return=k,O)}function P(k,O,D){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=dd(""+O,k.mode,D),O.return=k,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case S:return D=au(O.type,O.key,O.props,null,k.mode,D),va(D,O),D.return=k,D;case x:return O=hd(O,k.mode,D),O.return=k,O;case X:return O=ss(O),P(k,O,D)}if(ne(O)||je(O))return O=es(O,k.mode,D,null),O.return=k,O;if(typeof O.then=="function")return P(k,pu(O),D);if(O.$$typeof===R)return P(k,cu(k,O),D);mu(k,O)}return null}function B(k,O,D,K){var le=O!==null?O.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return le!==null?null:w(k,O,""+D,K);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case S:return D.key===le?A(k,O,D,K):null;case x:return D.key===le?N(k,O,D,K):null;case X:return D=ss(D),B(k,O,D,K)}if(ne(D)||je(D))return le!==null?null:V(k,O,D,K,null);if(typeof D.then=="function")return B(k,O,pu(D),K);if(D.$$typeof===R)return B(k,O,cu(k,D),K);mu(k,D)}return null}function z(k,O,D,K,le){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return k=k.get(D)||null,w(O,k,""+K,le);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return k=k.get(K.key===null?D:K.key)||null,A(O,k,K,le);case x:return k=k.get(K.key===null?D:K.key)||null,N(O,k,K,le);case X:return K=ss(K),z(k,O,D,K,le)}if(ne(K)||je(K))return k=k.get(D)||null,V(O,k,K,le,null);if(typeof K.then=="function")return z(k,O,D,pu(K),le);if(K.$$typeof===R)return z(k,O,D,cu(O,K),le);mu(O,K)}return null}function ie(k,O,D,K){for(var le=null,Ne=null,se=O,Se=O=0,_e=null;se!==null&&Se<D.length;Se++){se.index>Se?(_e=se,se=null):_e=se.sibling;var $e=B(k,se,D[Se],K);if($e===null){se===null&&(se=_e);break}i&&se&&$e.alternate===null&&s(k,se),O=p($e,O,Se),Ne===null?le=$e:Ne.sibling=$e,Ne=$e,se=_e}if(Se===D.length)return o(k,se),Ce&&_i(k,Se),le;if(se===null){for(;Se<D.length;Se++)se=P(k,D[Se],K),se!==null&&(O=p(se,O,Se),Ne===null?le=se:Ne.sibling=se,Ne=se);return Ce&&_i(k,Se),le}for(se=l(se);Se<D.length;Se++)_e=z(se,k,Se,D[Se],K),_e!==null&&(i&&_e.alternate!==null&&se.delete(_e.key===null?Se:_e.key),O=p(_e,O,Se),Ne===null?le=_e:Ne.sibling=_e,Ne=_e);return i&&se.forEach(function(Er){return s(k,Er)}),Ce&&_i(k,Se),le}function ue(k,O,D,K){if(D==null)throw Error(r(151));for(var le=null,Ne=null,se=O,Se=O=0,_e=null,$e=D.next();se!==null&&!$e.done;Se++,$e=D.next()){se.index>Se?(_e=se,se=null):_e=se.sibling;var Er=B(k,se,$e.value,K);if(Er===null){se===null&&(se=_e);break}i&&se&&Er.alternate===null&&s(k,se),O=p(Er,O,Se),Ne===null?le=Er:Ne.sibling=Er,Ne=Er,se=_e}if($e.done)return o(k,se),Ce&&_i(k,Se),le;if(se===null){for(;!$e.done;Se++,$e=D.next())$e=P(k,$e.value,K),$e!==null&&(O=p($e,O,Se),Ne===null?le=$e:Ne.sibling=$e,Ne=$e);return Ce&&_i(k,Se),le}for(se=l(se);!$e.done;Se++,$e=D.next())$e=z(se,k,Se,$e.value,K),$e!==null&&(i&&$e.alternate!==null&&se.delete($e.key===null?Se:$e.key),O=p($e,O,Se),Ne===null?le=$e:Ne.sibling=$e,Ne=$e);return i&&se.forEach(function(mk){return s(k,mk)}),Ce&&_i(k,Se),le}function Pe(k,O,D,K){if(typeof D=="object"&&D!==null&&D.type===T&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case S:e:{for(var le=D.key;O!==null;){if(O.key===le){if(le=D.type,le===T){if(O.tag===7){o(k,O.sibling),K=d(O,D.props.children),K.return=k,k=K;break e}}else if(O.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===X&&ss(le)===O.type){o(k,O.sibling),K=d(O,D.props),va(K,D),K.return=k,k=K;break e}o(k,O);break}else s(k,O);O=O.sibling}D.type===T?(K=es(D.props.children,k.mode,K,D.key),K.return=k,k=K):(K=au(D.type,D.key,D.props,null,k.mode,K),va(K,D),K.return=k,k=K)}return b(k);case x:e:{for(le=D.key;O!==null;){if(O.key===le)if(O.tag===4&&O.stateNode.containerInfo===D.containerInfo&&O.stateNode.implementation===D.implementation){o(k,O.sibling),K=d(O,D.children||[]),K.return=k,k=K;break e}else{o(k,O);break}else s(k,O);O=O.sibling}K=hd(D,k.mode,K),K.return=k,k=K}return b(k);case X:return D=ss(D),Pe(k,O,D,K)}if(ne(D))return ie(k,O,D,K);if(je(D)){if(le=je(D),typeof le!="function")throw Error(r(150));return D=le.call(D),ue(k,O,D,K)}if(typeof D.then=="function")return Pe(k,O,pu(D),K);if(D.$$typeof===R)return Pe(k,O,cu(k,D),K);mu(k,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,O!==null&&O.tag===6?(o(k,O.sibling),K=d(O,D),K.return=k,k=K):(o(k,O),K=dd(D,k.mode,K),K.return=k,k=K),b(k)):o(k,O)}return function(k,O,D,K){try{ba=0;var le=Pe(k,O,D,K);return Qs=null,le}catch(se){if(se===Zs||se===du)throw se;var Ne=mn(29,se,null,k.mode);return Ne.lanes=K,Ne.return=k,Ne}finally{}}}var as=zb(!0),Lb=zb(!1),lr=!1;function Ed(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Od(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 ur(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function cr(i,s,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var d=l.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),l.pending=s,s=ou(i),wb(i,null,o),s}return su(i,l,s,o),ou(i)}function Sa(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Cg(i,o)}}function _d(i,s){var o=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var d=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var b={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};p===null?d=p=b:p=p.next=b,o=o.next}while(o!==null);p===null?d=p=s:p=p.next=s}else d=p=s;o={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,callbacks:l.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}var Rd=!1;function wa(){if(Rd){var i=Xs;if(i!==null)throw i}}function xa(i,s,o,l){Rd=!1;var d=i.updateQueue;lr=!1;var p=d.firstBaseUpdate,b=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var A=w,N=A.next;A.next=null,b===null?p=N:b.next=N,b=A;var V=i.alternate;V!==null&&(V=V.updateQueue,w=V.lastBaseUpdate,w!==b&&(w===null?V.firstBaseUpdate=N:w.next=N,V.lastBaseUpdate=A))}if(p!==null){var P=d.baseState;b=0,V=N=A=null,w=p;do{var B=w.lane&-536870913,z=B!==w.lane;if(z?(Oe&B)===B:(l&B)===B){B!==0&&B===Js&&(Rd=!0),V!==null&&(V=V.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ie=i,ue=w;B=s;var Pe=o;switch(ue.tag){case 1:if(ie=ue.payload,typeof ie=="function"){P=ie.call(Pe,P,B);break e}P=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=ue.payload,B=typeof ie=="function"?ie.call(Pe,P,B):ie,B==null)break e;P=g({},P,B);break e;case 2:lr=!0}}B=w.callback,B!==null&&(i.flags|=64,z&&(i.flags|=8192),z=d.callbacks,z===null?d.callbacks=[B]:z.push(B))}else z={lane:B,tag:w.tag,payload:w.payload,callback:w.callback,next:null},V===null?(N=V=z,A=P):V=V.next=z,b|=B;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;z=w,w=z.next,z.next=null,d.lastBaseUpdate=z,d.shared.pending=null}}while(!0);V===null&&(A=P),d.baseState=A,d.firstBaseUpdate=N,d.lastBaseUpdate=V,p===null&&(d.shared.lanes=0),mr|=b,i.lanes=b,i.memoizedState=P}}function Vb(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Ub(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Vb(o[i],s)}var Ws=E(null),yu=E(0);function Kb(i,s){i=Li,H(yu,i),H(Ws,s),Li=i|s.baseLanes}function Cd(){H(yu,Li),H(Ws,Ws.current)}function kd(){Li=yu.current,q(Ws),q(yu)}var yn=E(null),Nn=null;function fr(i){var s=i.alternate;H(pt,pt.current&1),H(yn,i),Nn===null&&(s===null||Ws.current!==null||s.memoizedState!==null)&&(Nn=i)}function Md(i){H(pt,pt.current),H(yn,i),Nn===null&&(Nn=i)}function qb(i){i.tag===22?(H(pt,pt.current),H(yn,i),Nn===null&&(Nn=i)):dr()}function dr(){H(pt,pt.current),H(yn,yn.current)}function gn(i){q(yn),Nn===i&&(Nn=null),q(pt)}var pt=E(0);function gu(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||zh(o)||Lh(o)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){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}var ki=0,be=null,Ke=null,St=null,bu=!1,eo=!1,ls=!1,vu=0,Ta=0,to=null,sC=0;function ot(){throw Error(r(321))}function Dd(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!pn(i[o],s[o]))return!1;return!0}function Nd(i,s,o,l,d,p){return ki=p,be=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=i===null||i.memoizedState===null?Ev:Yd,ls=!1,p=o(l,d),ls=!1,eo&&(p=Ib(s,o,l,d)),Pb(i),p}function Pb(i){j.H=Oa;var s=Ke!==null&&Ke.next!==null;if(ki=0,St=Ke=be=null,bu=!1,Ta=0,to=null,s)throw Error(r(300));i===null||wt||(i=i.dependencies,i!==null&&uu(i)&&(wt=!0))}function Ib(i,s,o,l){be=i;var d=0;do{if(eo&&(to=null),Ta=0,eo=!1,25<=d)throw Error(r(301));if(d+=1,St=Ke=null,i.updateQueue!=null){var p=i.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}j.H=Ov,p=s(o,l)}while(eo);return p}function oC(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?Aa(s):s,i=i.useState()[0],(Ke!==null?Ke.memoizedState:null)!==i&&(be.flags|=1024),s}function $d(){var i=vu!==0;return vu=0,i}function jd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function Bd(i){if(bu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}bu=!1}ki=0,St=Ke=be=null,eo=!1,Ta=vu=0,to=null}function Zt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?be.memoizedState=St=i:St=St.next=i,St}function mt(){if(Ke===null){var i=be.alternate;i=i!==null?i.memoizedState:null}else i=Ke.next;var s=St===null?be.memoizedState:St.next;if(s!==null)St=s,Ke=i;else{if(i===null)throw be.alternate===null?Error(r(467)):Error(r(310));Ke=i,i={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},St===null?be.memoizedState=St=i:St=St.next=i}return St}function Su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Aa(i){var s=Ta;return Ta+=1,to===null&&(to=[]),i=$b(to,i,s),s=be,(St===null?s.memoizedState:St.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?Ev:Yd),i}function wu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Aa(i);if(i.$$typeof===R)return qt(i)}throw Error(r(438,String(i)))}function zd(i){var s=null,o=be.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var l=be.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(s={data:l.data.map(function(d){return d.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=Su(),be.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(i),l=0;l<i;l++)o[l]=pe;return s.index++,o}function Mi(i,s){return typeof s=="function"?s(i):s}function xu(i){var s=mt();return Ld(s,Ke,i)}function Ld(i,s,o){var l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=i.baseQueue,p=l.pending;if(p!==null){if(d!==null){var b=d.next;d.next=p.next,p.next=b}s.baseQueue=d=p,l.pending=null}if(p=i.baseState,d===null)i.memoizedState=p;else{s=d.next;var w=b=null,A=null,N=s,V=!1;do{var P=N.lane&-536870913;if(P!==N.lane?(Oe&P)===P:(ki&P)===P){var B=N.revertLane;if(B===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),P===Js&&(V=!0);else if((ki&B)===B){N=N.next,B===Js&&(V=!0);continue}else P={lane:0,revertLane:N.revertLane,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},A===null?(w=A=P,b=p):A=A.next=P,be.lanes|=B,mr|=B;P=N.action,ls&&o(p,P),p=N.hasEagerState?N.eagerState:o(p,P)}else B={lane:P,revertLane:N.revertLane,gesture:N.gesture,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},A===null?(w=A=B,b=p):A=A.next=B,be.lanes|=P,mr|=P;N=N.next}while(N!==null&&N!==s);if(A===null?b=p:A.next=w,!pn(p,i.memoizedState)&&(wt=!0,V&&(o=Xs,o!==null)))throw o;i.memoizedState=p,i.baseState=b,i.baseQueue=A,l.lastRenderedState=p}return d===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function Vd(i){var s=mt(),o=s.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var l=o.dispatch,d=o.pending,p=s.memoizedState;if(d!==null){o.pending=null;var b=d=d.next;do p=i(p,b.action),b=b.next;while(b!==d);pn(p,s.memoizedState)||(wt=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),o.lastRenderedState=p}return[p,l]}function Hb(i,s,o){var l=be,d=mt(),p=Ce;if(p){if(o===void 0)throw Error(r(407));o=o()}else o=s();var b=!pn((Ke||d).memoizedState,o);if(b&&(d.memoizedState=o,wt=!0),d=d.queue,qd(Yb.bind(null,l,d,i),[i]),d.getSnapshot!==s||b||St!==null&&St.memoizedState.tag&1){if(l.flags|=2048,no(9,{destroy:void 0},Gb.bind(null,l,d,o,s),null),He===null)throw Error(r(349));p||(ki&127)!==0||Fb(l,s,o)}return o}function Fb(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=be.updateQueue,s===null?(s=Su(),be.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function Gb(i,s,o,l){s.value=o,s.getSnapshot=l,Jb(s)&&Xb(i)}function Yb(i,s,o){return o(function(){Jb(s)&&Xb(i)})}function Jb(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!pn(i,o)}catch{return!0}}function Xb(i){var s=Wr(i,2);s!==null&&ln(s,i,2)}function Ud(i){var s=Zt();if(typeof i=="function"){var o=i;if(i=o(),ls){tr(!0);try{o()}finally{tr(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:i},s}function Zb(i,s,o,l){return i.baseState=o,Ld(i,Ke,typeof l=="function"?l:Mi)}function aC(i,s,o,l,d){if(Eu(i))throw Error(r(485));if(i=s.action,i!==null){var p={payload:d,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){p.listeners.push(b)}};j.T!==null?o(!0):p.isTransition=!1,l(p),o=s.pending,o===null?(p.next=s.pending=p,Qb(s,p)):(p.next=o.next,s.pending=o.next=p)}}function Qb(i,s){var o=s.action,l=s.payload,d=i.state;if(s.isTransition){var p=j.T,b={};j.T=b;try{var w=o(d,l),A=j.S;A!==null&&A(b,w),Wb(i,s,w)}catch(N){Kd(i,s,N)}finally{p!==null&&b.types!==null&&(p.types=b.types),j.T=p}}else try{p=o(d,l),Wb(i,s,p)}catch(N){Kd(i,s,N)}}function Wb(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){ev(i,s,l)},function(l){return Kd(i,s,l)}):ev(i,s,o)}function ev(i,s,o){s.status="fulfilled",s.value=o,tv(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Qb(i,o)))}function Kd(i,s,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=o,tv(s),s=s.next;while(s!==l)}i.action=null}function tv(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function nv(i,s){return s}function iv(i,s){if(Ce){var o=He.formState;if(o!==null){e:{var l=be;if(Ce){if(Ze){t:{for(var d=Ze,p=Dn;d.nodeType!==8;){if(!p){d=null;break t}if(d=$n(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){Ze=$n(d.nextSibling),l=d.data==="F!";break e}}or(l)}l=!1}l&&(s=o[0])}}return o=Zt(),o.memoizedState=o.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nv,lastRenderedState:s},o.queue=l,o=xv.bind(null,be,l),l.dispatch=o,l=Ud(!1),p=Gd.bind(null,be,!1,l.queue),l=Zt(),d={state:s,dispatch:null,action:i,pending:null},l.queue=d,o=aC.bind(null,be,d,p,o),d.dispatch=o,l.memoizedState=i,[s,o,!1]}function rv(i){var s=mt();return sv(s,Ke,i)}function sv(i,s,o){if(s=Ld(i,s,nv)[0],i=xu(Mi)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=Aa(s)}catch(b){throw b===Zs?du:b}else l=s;s=mt();var d=s.queue,p=d.dispatch;return o!==s.memoizedState&&(be.flags|=2048,no(9,{destroy:void 0},lC.bind(null,d,o),null)),[l,p,i]}function lC(i,s){i.action=s}function ov(i){var s=mt(),o=Ke;if(o!==null)return sv(s,o,i);mt(),s=s.memoizedState,o=mt();var l=o.queue.dispatch;return o.memoizedState=i,[s,l,!1]}function no(i,s,o,l){return i={tag:i,create:o,deps:l,inst:s,next:null},s=be.updateQueue,s===null&&(s=Su(),be.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=i.next=i:(l=o.next,o.next=i,i.next=l,s.lastEffect=i),i}function av(){return mt().memoizedState}function Tu(i,s,o,l){var d=Zt();be.flags|=i,d.memoizedState=no(1|s,{destroy:void 0},o,l===void 0?null:l)}function Au(i,s,o,l){var d=mt();l=l===void 0?null:l;var p=d.memoizedState.inst;Ke!==null&&l!==null&&Dd(l,Ke.memoizedState.deps)?d.memoizedState=no(s,p,o,l):(be.flags|=i,d.memoizedState=no(1|s,p,o,l))}function lv(i,s){Tu(8390656,8,i,s)}function qd(i,s){Au(2048,8,i,s)}function uC(i){be.flags|=4;var s=be.updateQueue;if(s===null)s=Su(),be.updateQueue=s,s.events=[i];else{var o=s.events;o===null?s.events=[i]:o.push(i)}}function uv(i){var s=mt().memoizedState;return uC({ref:s,nextImpl:i}),function(){if((Be&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function cv(i,s){return Au(4,2,i,s)}function fv(i,s){return Au(4,4,i,s)}function dv(i,s){if(typeof s=="function"){i=i();var o=s(i);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function hv(i,s,o){o=o!=null?o.concat([i]):null,Au(4,4,dv.bind(null,s,i),o)}function Pd(){}function pv(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;return s!==null&&Dd(s,l[1])?l[0]:(o.memoizedState=[i,s],i)}function mv(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;if(s!==null&&Dd(s,l[1]))return l[0];if(l=i(),ls){tr(!0);try{i()}finally{tr(!1)}}return o.memoizedState=[l,s],l}function Id(i,s,o){return o===void 0||(ki&1073741824)!==0&&(Oe&261930)===0?i.memoizedState=s:(i.memoizedState=o,i=y0(),be.lanes|=i,mr|=i,o)}function yv(i,s,o,l){return pn(o,s)?o:Ws.current!==null?(i=Id(i,o,l),pn(i,s)||(wt=!0),i):(ki&42)===0||(ki&1073741824)!==0&&(Oe&261930)===0?(wt=!0,i.memoizedState=o):(i=y0(),be.lanes|=i,mr|=i,s)}function gv(i,s,o,l,d){var p=U.p;U.p=p!==0&&8>p?p:8;var b=j.T,w={};j.T=w,Gd(i,!1,s,o);try{var A=d(),N=j.S;if(N!==null&&N(w,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var V=rC(A,l);Ea(i,s,V,Sn(i))}else Ea(i,s,l,Sn(i))}catch(P){Ea(i,s,{then:function(){},status:"rejected",reason:P},Sn())}finally{U.p=p,b!==null&&w.types!==null&&(b.types=w.types),j.T=b}}function cC(){}function Hd(i,s,o,l){if(i.tag!==5)throw Error(r(476));var d=bv(i).queue;gv(i,d,s,L,o===null?cC:function(){return vv(i),o(l)})}function bv(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:L},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function vv(i){var s=bv(i);s.next===null&&(s=i.alternate.memoizedState),Ea(i,s.next.queue,{},Sn())}function Fd(){return qt(qa)}function Sv(){return mt().memoizedState}function wv(){return mt().memoizedState}function fC(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=Sn();i=ur(o);var l=cr(s,i,o);l!==null&&(ln(l,s,o),Sa(l,s,o)),s={cache:wd()},i.payload=s;return}s=s.return}}function dC(i,s,o){var l=Sn();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Eu(i)?Tv(s,o):(o=cd(i,s,o,l),o!==null&&(ln(o,i,l),Av(o,s,l)))}function xv(i,s,o){var l=Sn();Ea(i,s,o,l)}function Ea(i,s,o,l){var d={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Eu(i))Tv(s,d);else{var p=i.alternate;if(i.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var b=s.lastRenderedState,w=p(b,o);if(d.hasEagerState=!0,d.eagerState=w,pn(w,b))return su(i,s,d,0),He===null&&ru(),!1}catch{}finally{}if(o=cd(i,s,d,l),o!==null)return ln(o,i,l),Av(o,s,l),!0}return!1}function Gd(i,s,o,l){if(l={lane:2,revertLane:Eh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Eu(i)){if(s)throw Error(r(479))}else s=cd(i,o,l,2),s!==null&&ln(s,i,2)}function Eu(i){var s=i.alternate;return i===be||s!==null&&s===be}function Tv(i,s){eo=bu=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function Av(i,s,o){if((o&4194048)!==0){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Cg(i,o)}}var Oa={readContext:qt,use:wu,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Oa.useEffectEvent=ot;var Ev={readContext:qt,use:wu,useCallback:function(i,s){return Zt().memoizedState=[i,s===void 0?null:s],i},useContext:qt,useEffect:lv,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,Tu(4194308,4,dv.bind(null,s,i),o)},useLayoutEffect:function(i,s){return Tu(4194308,4,i,s)},useInsertionEffect:function(i,s){Tu(4,2,i,s)},useMemo:function(i,s){var o=Zt();s=s===void 0?null:s;var l=i();if(ls){tr(!0);try{i()}finally{tr(!1)}}return o.memoizedState=[l,s],l},useReducer:function(i,s,o){var l=Zt();if(o!==void 0){var d=o(s);if(ls){tr(!0);try{o(s)}finally{tr(!1)}}}else d=s;return l.memoizedState=l.baseState=d,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:d},l.queue=i,i=i.dispatch=dC.bind(null,be,i),[l.memoizedState,i]},useRef:function(i){var s=Zt();return i={current:i},s.memoizedState=i},useState:function(i){i=Ud(i);var s=i.queue,o=xv.bind(null,be,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Pd,useDeferredValue:function(i,s){var o=Zt();return Id(o,i,s)},useTransition:function(){var i=Ud(!1);return i=gv.bind(null,be,i.queue,!0,!1),Zt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var l=be,d=Zt();if(Ce){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),He===null)throw Error(r(349));(Oe&127)!==0||Fb(l,s,o)}d.memoizedState=o;var p={value:o,getSnapshot:s};return d.queue=p,lv(Yb.bind(null,l,p,i),[i]),l.flags|=2048,no(9,{destroy:void 0},Gb.bind(null,l,p,o,s),null),o},useId:function(){var i=Zt(),s=He.identifierPrefix;if(Ce){var o=oi,l=si;o=(l&~(1<<32-hn(l)-1)).toString(32)+o,s="_"+s+"R_"+o,o=vu++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=sC++,s="_"+s+"r_"+o.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Fd,useFormState:iv,useActionState:iv,useOptimistic:function(i){var s=Zt();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=Gd.bind(null,be,!0,o),o.dispatch=s,[i,s]},useMemoCache:zd,useCacheRefresh:function(){return Zt().memoizedState=fC.bind(null,be)},useEffectEvent:function(i){var s=Zt(),o={impl:i};return s.memoizedState=o,function(){if((Be&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},Yd={readContext:qt,use:wu,useCallback:pv,useContext:qt,useEffect:qd,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:fv,useMemo:mv,useReducer:xu,useRef:av,useState:function(){return xu(Mi)},useDebugValue:Pd,useDeferredValue:function(i,s){var o=mt();return yv(o,Ke.memoizedState,i,s)},useTransition:function(){var i=xu(Mi)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:Aa(i),s]},useSyncExternalStore:Hb,useId:Sv,useHostTransitionStatus:Fd,useFormState:rv,useActionState:rv,useOptimistic:function(i,s){var o=mt();return Zb(o,Ke,i,s)},useMemoCache:zd,useCacheRefresh:wv};Yd.useEffectEvent=uv;var Ov={readContext:qt,use:wu,useCallback:pv,useContext:qt,useEffect:qd,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:fv,useMemo:mv,useReducer:Vd,useRef:av,useState:function(){return Vd(Mi)},useDebugValue:Pd,useDeferredValue:function(i,s){var o=mt();return Ke===null?Id(o,i,s):yv(o,Ke.memoizedState,i,s)},useTransition:function(){var i=Vd(Mi)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:Aa(i),s]},useSyncExternalStore:Hb,useId:Sv,useHostTransitionStatus:Fd,useFormState:ov,useActionState:ov,useOptimistic:function(i,s){var o=mt();return Ke!==null?Zb(o,Ke,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:zd,useCacheRefresh:wv};Ov.useEffectEvent=uv;function Jd(i,s,o,l){s=i.memoizedState,o=o(l,s),o=o==null?s:g({},s,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var Xd={enqueueSetState:function(i,s,o){i=i._reactInternals;var l=Sn(),d=ur(l);d.payload=s,o!=null&&(d.callback=o),s=cr(i,d,l),s!==null&&(ln(s,i,l),Sa(s,i,l))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var l=Sn(),d=ur(l);d.tag=1,d.payload=s,o!=null&&(d.callback=o),s=cr(i,d,l),s!==null&&(ln(s,i,l),Sa(s,i,l))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=Sn(),l=ur(o);l.tag=2,s!=null&&(l.callback=s),s=cr(i,l,o),s!==null&&(ln(s,i,o),Sa(s,i,o))}};function _v(i,s,o,l,d,p,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,p,b):s.prototype&&s.prototype.isPureReactComponent?!da(o,l)||!da(d,p):!0}function Rv(i,s,o,l){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,l),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,l),s.state!==i&&Xd.enqueueReplaceState(s,s.state,null)}function us(i,s){var o=s;if("ref"in s){o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}if(i=i.defaultProps){o===s&&(o=g({},o));for(var d in i)o[d]===void 0&&(o[d]=i[d])}return o}function Cv(i){iu(i)}function kv(i){console.error(i)}function Mv(i){iu(i)}function Ou(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function Dv(i,s,o){try{var l=i.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Zd(i,s,o){return o=ur(o),o.tag=3,o.payload={element:null},o.callback=function(){Ou(i,s)},o}function Nv(i){return i=ur(i),i.tag=3,i}function $v(i,s,o,l){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var p=l.value;i.payload=function(){return d(p)},i.callback=function(){Dv(s,o,l)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){Dv(s,o,l),typeof d!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function hC(i,s,o,l,d){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=o.alternate,s!==null&&Ys(s,o,d,!0),o=yn.current,o!==null){switch(o.tag){case 31:case 13:return Nn===null?Lu():o.alternate===null&&at===0&&(at=3),o.flags&=-257,o.flags|=65536,o.lanes=d,l===hu?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([l]):s.add(l),xh(i,l,d)),!1;case 22:return o.flags|=65536,l===hu?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([l]):o.add(l)),xh(i,l,d)),!1}throw Error(r(435,o.tag))}return xh(i,l,d),Lu(),!1}if(Ce)return s=yn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=d,l!==yd&&(i=Error(r(422),{cause:l}),ma(Cn(i,o)))):(l!==yd&&(s=Error(r(423),{cause:l}),ma(Cn(s,o))),i=i.current.alternate,i.flags|=65536,d&=-d,i.lanes|=d,l=Cn(l,o),d=Zd(i.stateNode,l,d),_d(i,d),at!==4&&(at=2)),!1;var p=Error(r(520),{cause:l});if(p=Cn(p,o),$a===null?$a=[p]:$a.push(p),at!==4&&(at=2),s===null)return!0;l=Cn(l,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=d&-d,o.lanes|=i,i=Zd(o.stateNode,l,i),_d(o,i),!1;case 1:if(s=o.type,p=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(yr===null||!yr.has(p))))return o.flags|=65536,d&=-d,o.lanes|=d,d=Nv(d),$v(d,i,o,l),_d(o,d),!1}o=o.return}while(o!==null);return!1}var Qd=Error(r(461)),wt=!1;function Pt(i,s,o,l){s.child=i===null?Lb(s,null,o,l):as(s,i.child,o,l)}function jv(i,s,o,l,d){o=o.render;var p=s.ref;if("ref"in l){var b={};for(var w in l)w!=="ref"&&(b[w]=l[w])}else b=l;return is(s),l=Nd(i,s,o,b,p,d),w=$d(),i!==null&&!wt?(jd(i,s,d),Di(i,s,d)):(Ce&&w&&pd(s),s.flags|=1,Pt(i,s,l,d),s.child)}function Bv(i,s,o,l,d){if(i===null){var p=o.type;return typeof p=="function"&&!fd(p)&&p.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=p,zv(i,s,p,l,d)):(i=au(o.type,null,l,s,s.mode,d),i.ref=s.ref,i.return=s,s.child=i)}if(p=i.child,!oh(i,d)){var b=p.memoizedProps;if(o=o.compare,o=o!==null?o:da,o(b,l)&&i.ref===s.ref)return Di(i,s,d)}return s.flags|=1,i=Oi(p,l),i.ref=s.ref,i.return=s,s.child=i}function zv(i,s,o,l,d){if(i!==null){var p=i.memoizedProps;if(da(p,l)&&i.ref===s.ref)if(wt=!1,s.pendingProps=l=p,oh(i,d))(i.flags&131072)!==0&&(wt=!0);else return s.lanes=i.lanes,Di(i,s,d)}return Wd(i,s,o,l,d)}function Lv(i,s,o,l){var d=l.children,p=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((s.flags&128)!==0){if(p=p!==null?p.baseLanes|o:o,i!==null){for(l=s.child=i.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~p}else l=0,s.child=null;return Vv(i,s,p,o,l)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&fu(s,p!==null?p.cachePool:null),p!==null?Kb(s,p):Cd(),qb(s);else return l=s.lanes=536870912,Vv(i,s,p!==null?p.baseLanes|o:o,o,l)}else p!==null?(fu(s,p.cachePool),Kb(s,p),dr(),s.memoizedState=null):(i!==null&&fu(s,null),Cd(),dr());return Pt(i,s,d,o),s.child}function _a(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Vv(i,s,o,l,d){var p=Td();return p=p===null?null:{parent:vt._currentValue,pool:p},s.memoizedState={baseLanes:o,cachePool:p},i!==null&&fu(s,null),Cd(),qb(s),i!==null&&Ys(i,s,l,!0),s.childLanes=d,null}function _u(i,s){return s=Cu({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Uv(i,s,o){return as(s,i.child,null,o),i=_u(s,s.pendingProps),i.flags|=2,gn(s),s.memoizedState=null,i}function pC(i,s,o){var l=s.pendingProps,d=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Ce){if(l.mode==="hidden")return i=_u(s,l),s.lanes=536870912,_a(null,i);if(Md(s),(i=Ze)?(i=Q0(i,Dn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:rr!==null?{id:si,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},o=Tb(i),o.return=s,s.child=o,Kt=s,Ze=null)):i=null,i===null)throw or(s);return s.lanes=536870912,null}return _u(s,l)}var p=i.memoizedState;if(p!==null){var b=p.dehydrated;if(Md(s),d)if(s.flags&256)s.flags&=-257,s=Uv(i,s,o);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(wt||Ys(i,s,o,!1),d=(o&i.childLanes)!==0,wt||d){if(l=He,l!==null&&(b=kg(l,o),b!==0&&b!==p.retryLane))throw p.retryLane=b,Wr(i,b),ln(l,i,b),Qd;Lu(),s=Uv(i,s,o)}else i=p.treeContext,Ze=$n(b.nextSibling),Kt=s,Ce=!0,sr=null,Dn=!1,i!==null&&Ob(s,i),s=_u(s,l),s.flags|=4096;return s}return i=Oi(i.child,{mode:l.mode,children:l.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Ru(i,s){var o=s.ref;if(o===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(s.flags|=4194816)}}function Wd(i,s,o,l,d){return is(s),o=Nd(i,s,o,l,void 0,d),l=$d(),i!==null&&!wt?(jd(i,s,d),Di(i,s,d)):(Ce&&l&&pd(s),s.flags|=1,Pt(i,s,o,d),s.child)}function Kv(i,s,o,l,d,p){return is(s),s.updateQueue=null,o=Ib(s,l,o,d),Pb(i),l=$d(),i!==null&&!wt?(jd(i,s,p),Di(i,s,p)):(Ce&&l&&pd(s),s.flags|=1,Pt(i,s,o,p),s.child)}function qv(i,s,o,l,d){if(is(s),s.stateNode===null){var p=Is,b=o.contextType;typeof b=="object"&&b!==null&&(p=qt(b)),p=new o(l,p),s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Xd,s.stateNode=p,p._reactInternals=s,p=s.stateNode,p.props=l,p.state=s.memoizedState,p.refs={},Ed(s),b=o.contextType,p.context=typeof b=="object"&&b!==null?qt(b):Is,p.state=s.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(Jd(s,o,b,l),p.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(b=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),b!==p.state&&Xd.enqueueReplaceState(p,p.state,null),xa(s,l,p,d),wa(),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(i===null){p=s.stateNode;var w=s.memoizedProps,A=us(o,w);p.props=A;var N=p.context,V=o.contextType;b=Is,typeof V=="object"&&V!==null&&(b=qt(V));var P=o.getDerivedStateFromProps;V=typeof P=="function"||typeof p.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,V||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w||N!==b)&&Rv(s,p,l,b),lr=!1;var B=s.memoizedState;p.state=B,xa(s,l,p,d),wa(),N=s.memoizedState,w||B!==N||lr?(typeof P=="function"&&(Jd(s,o,P,l),N=s.memoizedState),(A=lr||_v(s,o,A,l,B,N,b))?(V||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(s.flags|=4194308)):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=l,s.memoizedState=N),p.props=l,p.state=N,p.context=b,l=A):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{p=s.stateNode,Od(i,s),b=s.memoizedProps,V=us(o,b),p.props=V,P=s.pendingProps,B=p.context,N=o.contextType,A=Is,typeof N=="object"&&N!==null&&(A=qt(N)),w=o.getDerivedStateFromProps,(N=typeof w=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(b!==P||B!==A)&&Rv(s,p,l,A),lr=!1,B=s.memoizedState,p.state=B,xa(s,l,p,d),wa();var z=s.memoizedState;b!==P||B!==z||lr||i!==null&&i.dependencies!==null&&uu(i.dependencies)?(typeof w=="function"&&(Jd(s,o,w,l),z=s.memoizedState),(V=lr||_v(s,o,V,l,B,z,A)||i!==null&&i.dependencies!==null&&uu(i.dependencies))?(N||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,z,A),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,z,A)),typeof p.componentDidUpdate=="function"&&(s.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof p.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=z),p.props=l,p.state=z,p.context=A,l=V):(typeof p.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),l=!1)}return p=l,Ru(i,s),l=(s.flags&128)!==0,p||l?(p=s.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:p.render(),s.flags|=1,i!==null&&l?(s.child=as(s,i.child,null,d),s.child=as(s,null,o,d)):Pt(i,s,o,d),s.memoizedState=p.state,i=s.child):i=Di(i,s,d),i}function Pv(i,s,o,l){return ts(),s.flags|=256,Pt(i,s,o,l),s.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function th(i){return{baseLanes:i,cachePool:Db()}}function nh(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=vn),i}function Iv(i,s,o){var l=s.pendingProps,d=!1,p=(s.flags&128)!==0,b;if((b=p)||(b=i!==null&&i.memoizedState===null?!1:(pt.current&2)!==0),b&&(d=!0,s.flags&=-129),b=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ce){if(d?fr(s):dr(),(i=Ze)?(i=Q0(i,Dn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:rr!==null?{id:si,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},o=Tb(i),o.return=s,s.child=o,Kt=s,Ze=null)):i=null,i===null)throw or(s);return Lh(i)?s.lanes=32:s.lanes=536870912,null}var w=l.children;return l=l.fallback,d?(dr(),d=s.mode,w=Cu({mode:"hidden",children:w},d),l=es(l,d,o,null),w.return=s,l.return=s,w.sibling=l,s.child=w,l=s.child,l.memoizedState=th(o),l.childLanes=nh(i,b,o),s.memoizedState=eh,_a(null,l)):(fr(s),ih(s,w))}var A=i.memoizedState;if(A!==null&&(w=A.dehydrated,w!==null)){if(p)s.flags&256?(fr(s),s.flags&=-257,s=rh(i,s,o)):s.memoizedState!==null?(dr(),s.child=i.child,s.flags|=128,s=null):(dr(),w=l.fallback,d=s.mode,l=Cu({mode:"visible",children:l.children},d),w=es(w,d,o,null),w.flags|=2,l.return=s,w.return=s,l.sibling=w,s.child=l,as(s,i.child,null,o),l=s.child,l.memoizedState=th(o),l.childLanes=nh(i,b,o),s.memoizedState=eh,s=_a(null,l));else if(fr(s),Lh(w)){if(b=w.nextSibling&&w.nextSibling.dataset,b)var N=b.dgst;b=N,l=Error(r(419)),l.stack="",l.digest=b,ma({value:l,source:null,stack:null}),s=rh(i,s,o)}else if(wt||Ys(i,s,o,!1),b=(o&i.childLanes)!==0,wt||b){if(b=He,b!==null&&(l=kg(b,o),l!==0&&l!==A.retryLane))throw A.retryLane=l,Wr(i,l),ln(b,i,l),Qd;zh(w)||Lu(),s=rh(i,s,o)}else zh(w)?(s.flags|=192,s.child=i.child,s=null):(i=A.treeContext,Ze=$n(w.nextSibling),Kt=s,Ce=!0,sr=null,Dn=!1,i!==null&&Ob(s,i),s=ih(s,l.children),s.flags|=4096);return s}return d?(dr(),w=l.fallback,d=s.mode,A=i.child,N=A.sibling,l=Oi(A,{mode:"hidden",children:l.children}),l.subtreeFlags=A.subtreeFlags&65011712,N!==null?w=Oi(N,w):(w=es(w,d,o,null),w.flags|=2),w.return=s,l.return=s,l.sibling=w,s.child=l,_a(null,l),l=s.child,w=i.child.memoizedState,w===null?w=th(o):(d=w.cachePool,d!==null?(A=vt._currentValue,d=d.parent!==A?{parent:A,pool:A}:d):d=Db(),w={baseLanes:w.baseLanes|o,cachePool:d}),l.memoizedState=w,l.childLanes=nh(i,b,o),s.memoizedState=eh,_a(i.child,l)):(fr(s),o=i.child,i=o.sibling,o=Oi(o,{mode:"visible",children:l.children}),o.return=s,o.sibling=null,i!==null&&(b=s.deletions,b===null?(s.deletions=[i],s.flags|=16):b.push(i)),s.child=o,s.memoizedState=null,o)}function ih(i,s){return s=Cu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Cu(i,s){return i=mn(22,i,null,s),i.lanes=0,i}function rh(i,s,o){return as(s,i.child,null,o),i=ih(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Hv(i,s,o){i.lanes|=s;var l=i.alternate;l!==null&&(l.lanes|=s),vd(i.return,s,o)}function sh(i,s,o,l,d,p){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:d,treeForkCount:p}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=l,b.tail=o,b.tailMode=d,b.treeForkCount=p)}function Fv(i,s,o){var l=s.pendingProps,d=l.revealOrder,p=l.tail;l=l.children;var b=pt.current,w=(b&2)!==0;if(w?(b=b&1|2,s.flags|=128):b&=1,H(pt,b),Pt(i,s,l,o),l=Ce?pa:0,!w&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Hv(i,o,s);else if(i.tag===19)Hv(i,o,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}switch(d){case"forwards":for(o=s.child,d=null;o!==null;)i=o.alternate,i!==null&&gu(i)===null&&(d=o),o=o.sibling;o=d,o===null?(d=s.child,s.child=null):(d=o.sibling,o.sibling=null),sh(s,!1,d,o,p,l);break;case"backwards":case"unstable_legacy-backwards":for(o=null,d=s.child,s.child=null;d!==null;){if(i=d.alternate,i!==null&&gu(i)===null){s.child=d;break}i=d.sibling,d.sibling=o,o=d,d=i}sh(s,!0,o,null,p,l);break;case"together":sh(s,!1,null,null,void 0,l);break;default:s.memoizedState=null}return s.child}function Di(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),mr|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(Ys(i,s,o,!1),(o&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,o=Oi(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=Oi(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function oh(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&uu(i)))}function mC(i,s,o){switch(s.tag){case 3:Ct(s,s.stateNode.containerInfo),ar(s,vt,i.memoizedState.cache),ts();break;case 27:case 5:ii(s);break;case 4:Ct(s,s.stateNode.containerInfo);break;case 10:ar(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Md(s),null;break;case 13:var l=s.memoizedState;if(l!==null)return l.dehydrated!==null?(fr(s),s.flags|=128,null):(o&s.child.childLanes)!==0?Iv(i,s,o):(fr(s),i=Di(i,s,o),i!==null?i.sibling:null);fr(s);break;case 19:var d=(i.flags&128)!==0;if(l=(o&s.childLanes)!==0,l||(Ys(i,s,o,!1),l=(o&s.childLanes)!==0),d){if(l)return Fv(i,s,o);s.flags|=128}if(d=s.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),H(pt,pt.current),l)break;return null;case 22:return s.lanes=0,Lv(i,s,o,s.pendingProps);case 24:ar(s,vt,i.memoizedState.cache)}return Di(i,s,o)}function Gv(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)wt=!0;else{if(!oh(i,o)&&(s.flags&128)===0)return wt=!1,mC(i,s,o);wt=(i.flags&131072)!==0}else wt=!1,Ce&&(s.flags&1048576)!==0&&Eb(s,pa,s.index);switch(s.lanes=0,s.tag){case 16:e:{var l=s.pendingProps;if(i=ss(s.elementType),s.type=i,typeof i=="function")fd(i)?(l=us(i,l),s.tag=1,s=qv(null,s,i,l,o)):(s.tag=0,s=Wd(null,s,i,l,o));else{if(i!=null){var d=i.$$typeof;if(d===G){s.tag=11,s=jv(null,s,i,l,o);break e}else if(d===J){s.tag=14,s=Bv(null,s,i,l,o);break e}}throw s=Z(i)||i,Error(r(306,s,""))}}return s;case 0:return Wd(i,s,s.type,s.pendingProps,o);case 1:return l=s.type,d=us(l,s.pendingProps),qv(i,s,l,d,o);case 3:e:{if(Ct(s,s.stateNode.containerInfo),i===null)throw Error(r(387));l=s.pendingProps;var p=s.memoizedState;d=p.element,Od(i,s),xa(s,l,null,o);var b=s.memoizedState;if(l=b.cache,ar(s,vt,l),l!==p.cache&&Sd(s,[vt],o,!0),wa(),l=b.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:b.cache},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){s=Pv(i,s,l,o);break e}else if(l!==d){d=Cn(Error(r(424)),s),ma(d),s=Pv(i,s,l,o);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(Ze=$n(i.firstChild),Kt=s,Ce=!0,sr=null,Dn=!0,o=Lb(s,null,l,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(ts(),l===d){s=Di(i,s,o);break e}Pt(i,s,l,o)}s=s.child}return s;case 26:return Ru(i,s),i===null?(o=rS(s.type,null,s.pendingProps,null))?s.memoizedState=o:Ce||(o=s.type,i=s.pendingProps,l=Hu(ce.current).createElement(o),l[Ut]=s,l[tn]=i,It(l,o,i),Nt(l),s.stateNode=l):s.memoizedState=rS(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ii(s),i===null&&Ce&&(l=s.stateNode=tS(s.type,s.pendingProps,ce.current),Kt=s,Dn=!0,d=Ze,Sr(s.type)?(Vh=d,Ze=$n(l.firstChild)):Ze=d),Pt(i,s,s.pendingProps.children,o),Ru(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ce&&((d=l=Ze)&&(l=HC(l,s.type,s.pendingProps,Dn),l!==null?(s.stateNode=l,Kt=s,Ze=$n(l.firstChild),Dn=!1,d=!0):d=!1),d||or(s)),ii(s),d=s.type,p=s.pendingProps,b=i!==null?i.memoizedProps:null,l=p.children,$h(d,p)?l=null:b!==null&&$h(d,b)&&(s.flags|=32),s.memoizedState!==null&&(d=Nd(i,s,oC,null,null,o),qa._currentValue=d),Ru(i,s),Pt(i,s,l,o),s.child;case 6:return i===null&&Ce&&((i=o=Ze)&&(o=FC(o,s.pendingProps,Dn),o!==null?(s.stateNode=o,Kt=s,Ze=null,i=!0):i=!1),i||or(s)),null;case 13:return Iv(i,s,o);case 4:return Ct(s,s.stateNode.containerInfo),l=s.pendingProps,i===null?s.child=as(s,null,l,o):Pt(i,s,l,o),s.child;case 11:return jv(i,s,s.type,s.pendingProps,o);case 7:return Pt(i,s,s.pendingProps,o),s.child;case 8:return Pt(i,s,s.pendingProps.children,o),s.child;case 12:return Pt(i,s,s.pendingProps.children,o),s.child;case 10:return l=s.pendingProps,ar(s,s.type,l.value),Pt(i,s,l.children,o),s.child;case 9:return d=s.type._context,l=s.pendingProps.children,is(s),d=qt(d),l=l(d),s.flags|=1,Pt(i,s,l,o),s.child;case 14:return Bv(i,s,s.type,s.pendingProps,o);case 15:return zv(i,s,s.type,s.pendingProps,o);case 19:return Fv(i,s,o);case 31:return pC(i,s,o);case 22:return Lv(i,s,o,s.pendingProps);case 24:return is(s),l=qt(vt),i===null?(d=Td(),d===null&&(d=He,p=wd(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=o),d=p),s.memoizedState={parent:l,cache:d},Ed(s),ar(s,vt,d)):((i.lanes&o)!==0&&(Od(i,s),xa(s,null,null,o),wa()),d=i.memoizedState,p=s.memoizedState,d.parent!==l?(d={parent:l,cache:l},s.memoizedState=d,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=d),ar(s,vt,l)):(l=p.cache,ar(s,vt,l),l!==d.cache&&Sd(s,[vt],o,!0))),Pt(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ni(i){i.flags|=4}function ah(i,s,o,l,d){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(d&335544128)===d)if(i.stateNode.complete)i.flags|=8192;else if(S0())i.flags|=8192;else throw os=hu,Ad}else i.flags&=-16777217}function Yv(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!uS(s))if(S0())i.flags|=8192;else throw os=hu,Ad}function ku(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?_g():536870912,i.lanes|=s,oo|=s)}function Ra(i,s){if(!Ce)switch(i.tailMode){case"hidden":s=i.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function Qe(i){var s=i.alternate!==null&&i.alternate.child===i.child,o=0,l=0;if(s)for(var d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=i,d=d.sibling;else for(d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=i,d=d.sibling;return i.subtreeFlags|=l,i.childLanes=o,s}function yC(i,s,o){var l=s.pendingProps;switch(md(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(s),null;case 1:return Qe(s),null;case 3:return o=s.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),Ci(vt),Je(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Gs(s)?Ni(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,gd())),Qe(s),null;case 26:var d=s.type,p=s.memoizedState;return i===null?(Ni(s),p!==null?(Qe(s),Yv(s,p)):(Qe(s),ah(s,d,null,l,o))):p?p!==i.memoizedState?(Ni(s),Qe(s),Yv(s,p)):(Qe(s),s.flags&=-16777217):(i=i.memoizedProps,i!==l&&Ni(s),Qe(s),ah(s,d,i,l,o)),null;case 27:if(xi(s),o=ce.current,d=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Ni(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return Qe(s),null}i=Q.current,Gs(s)?_b(s):(i=tS(d,l,o),s.stateNode=i,Ni(s))}return Qe(s),null;case 5:if(xi(s),d=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Ni(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return Qe(s),null}if(p=Q.current,Gs(s))_b(s);else{var b=Hu(ce.current);switch(p){case 1:p=b.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:p=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":p=b.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":p=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":p=b.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof l.is=="string"?b.createElement("select",{is:l.is}):b.createElement("select"),l.multiple?p.multiple=!0:l.size&&(p.size=l.size);break;default:p=typeof l.is=="string"?b.createElement(d,{is:l.is}):b.createElement(d)}}p[Ut]=s,p[tn]=l;e:for(b=s.child;b!==null;){if(b.tag===5||b.tag===6)p.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===s)break e;for(;b.sibling===null;){if(b.return===null||b.return===s)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}s.stateNode=p;e:switch(It(p,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ni(s)}}return Qe(s),ah(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,o),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==l&&Ni(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(r(166));if(i=ce.current,Gs(s)){if(i=s.stateNode,o=s.memoizedProps,l=null,d=Kt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}i[Ut]=s,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||I0(i.nodeValue,o)),i||or(s,!0)}else i=Hu(i).createTextNode(l),i[Ut]=s,s.stateNode=i}return Qe(s),null;case 31:if(o=s.memoizedState,i===null||i.memoizedState!==null){if(l=Gs(s),o!==null){if(i===null){if(!l)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ut]=s}else ts(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Qe(s),i=!1}else o=gd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return s.flags&256?(gn(s),s):(gn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Qe(s),null;case 13:if(l=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(d=Gs(s),l!==null&&l.dehydrated!==null){if(i===null){if(!d)throw Error(r(318));if(d=s.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[Ut]=s}else ts(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Qe(s),d=!1}else d=gd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),d=!0;if(!d)return s.flags&256?(gn(s),s):(gn(s),null)}return gn(s),(s.flags&128)!==0?(s.lanes=o,s):(o=l!==null,i=i!==null&&i.memoizedState!==null,o&&(l=s.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048)),o!==i&&o&&(s.child.flags|=8192),ku(s,s.updateQueue),Qe(s),null);case 4:return Je(),i===null&&Ch(s.stateNode.containerInfo),Qe(s),null;case 10:return Ci(s.type),Qe(s),null;case 19:if(q(pt),l=s.memoizedState,l===null)return Qe(s),null;if(d=(s.flags&128)!==0,p=l.rendering,p===null)if(d)Ra(l,!1);else{if(at!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(p=gu(i),p!==null){for(s.flags|=128,Ra(l,!1),i=p.updateQueue,s.updateQueue=i,ku(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)xb(o,i),o=o.sibling;return H(pt,pt.current&1|2),Ce&&_i(s,l.treeForkCount),s.child}i=i.sibling}l.tail!==null&&st()>ju&&(s.flags|=128,d=!0,Ra(l,!1),s.lanes=4194304)}else{if(!d)if(i=gu(p),i!==null){if(s.flags|=128,d=!0,i=i.updateQueue,s.updateQueue=i,ku(s,i),Ra(l,!0),l.tail===null&&l.tailMode==="hidden"&&!p.alternate&&!Ce)return Qe(s),null}else 2*st()-l.renderingStartTime>ju&&o!==536870912&&(s.flags|=128,d=!0,Ra(l,!1),s.lanes=4194304);l.isBackwards?(p.sibling=s.child,s.child=p):(i=l.last,i!==null?i.sibling=p:s.child=p,l.last=p)}return l.tail!==null?(i=l.tail,l.rendering=i,l.tail=i.sibling,l.renderingStartTime=st(),i.sibling=null,o=pt.current,H(pt,d?o&1|2:o&1),Ce&&_i(s,l.treeForkCount),i):(Qe(s),null);case 22:case 23:return gn(s),kd(),l=s.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(s.flags|=8192):l&&(s.flags|=8192),l?(o&536870912)!==0&&(s.flags&128)===0&&(Qe(s),s.subtreeFlags&6&&(s.flags|=8192)):Qe(s),o=s.updateQueue,o!==null&&ku(s,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),l=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==o&&(s.flags|=2048),i!==null&&q(rs),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),Ci(vt),Qe(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function gC(i,s){switch(md(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ci(vt),Je(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return xi(s),null;case 31:if(s.memoizedState!==null){if(gn(s),s.alternate===null)throw Error(r(340));ts()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(gn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ts()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return q(pt),null;case 4:return Je(),null;case 10:return Ci(s.type),null;case 22:case 23:return gn(s),kd(),i!==null&&q(rs),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ci(vt),null;case 25:return null;default:return null}}function Jv(i,s){switch(md(s),s.tag){case 3:Ci(vt),Je();break;case 26:case 27:case 5:xi(s);break;case 4:Je();break;case 31:s.memoizedState!==null&&gn(s);break;case 13:gn(s);break;case 19:q(pt);break;case 10:Ci(s.type);break;case 22:case 23:gn(s),kd(),i!==null&&q(rs);break;case 24:Ci(vt)}}function Ca(i,s){try{var o=s.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var d=l.next;o=d;do{if((o.tag&i)===i){l=void 0;var p=o.create,b=o.inst;l=p(),b.destroy=l}o=o.next}while(o!==d)}}catch(w){Ue(s,s.return,w)}}function hr(i,s,o){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&i)===i){var b=l.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,d=s;var A=o,N=w;try{N()}catch(V){Ue(d,A,V)}}}l=l.next}while(l!==p)}}catch(V){Ue(s,s.return,V)}}function Xv(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{Ub(s,o)}catch(l){Ue(i,i.return,l)}}}function Zv(i,s,o){o.props=us(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Ue(i,s,l)}}function ka(i,s){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof o=="function"?i.refCleanup=o(l):o.current=l}}catch(d){Ue(i,s,d)}}function ai(i,s){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(d){Ue(i,s,d)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){Ue(i,s,d)}else o.current=null}function Qv(i){var s=i.type,o=i.memoizedProps,l=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(d){Ue(i,i.return,d)}}function lh(i,s,o){try{var l=i.stateNode;VC(l,i.type,o,s),l[tn]=s}catch(d){Ue(i,i.return,d)}}function Wv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Sr(i.type)||i.tag===4}function uh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Wv(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&&Sr(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 ch(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(i),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Ai));else if(l!==4&&(l===27&&Sr(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(ch(i,s,o),i=i.sibling;i!==null;)ch(i,s,o),i=i.sibling}function Mu(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(l!==4&&(l===27&&Sr(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Mu(i,s,o),i=i.sibling;i!==null;)Mu(i,s,o),i=i.sibling}function e0(i){var s=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,d=s.attributes;d.length;)s.removeAttributeNode(d[0]);It(s,l,o),s[Ut]=i,s[tn]=o}catch(p){Ue(i,i.return,p)}}var $i=!1,xt=!1,fh=!1,t0=typeof WeakSet=="function"?WeakSet:Set,$t=null;function bC(i,s){if(i=i.containerInfo,Dh=Qu,i=hb(i),rd(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var b=0,w=-1,A=-1,N=0,V=0,P=i,B=null;t:for(;;){for(var z;P!==o||d!==0&&P.nodeType!==3||(w=b+d),P!==p||l!==0&&P.nodeType!==3||(A=b+l),P.nodeType===3&&(b+=P.nodeValue.length),(z=P.firstChild)!==null;)B=P,P=z;for(;;){if(P===i)break t;if(B===o&&++N===d&&(w=b),B===p&&++V===l&&(A=b),(z=P.nextSibling)!==null)break;P=B,B=P.parentNode}P=z}o=w===-1||A===-1?null:{start:w,end:A}}else o=null}o=o||{start:0,end:0}}else o=null;for(Nh={focusedElem:i,selectionRange:o},Qu=!1,$t=s;$t!==null;)if(s=$t,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,$t=i;else for(;$t!==null;){switch(s=$t,p=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)d=i[o],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&p!==null){i=void 0,o=s,d=p.memoizedProps,p=p.memoizedState,l=o.stateNode;try{var ie=us(o.type,d);i=l.getSnapshotBeforeUpdate(ie,p),l.__reactInternalSnapshotBeforeUpdate=i}catch(ue){Ue(o,o.return,ue)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)Bh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bh(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,$t=i;break}$t=s.return}}function n0(i,s,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:Bi(i,o),l&4&&Ca(5,o);break;case 1:if(Bi(i,o),l&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(b){Ue(o,o.return,b)}else{var d=us(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(d,s,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ue(o,o.return,b)}}l&64&&Xv(o),l&512&&ka(o,o.return);break;case 3:if(Bi(i,o),l&64&&(i=o.updateQueue,i!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{Ub(i,s)}catch(b){Ue(o,o.return,b)}}break;case 27:s===null&&l&4&&e0(o);case 26:case 5:Bi(i,o),s===null&&l&4&&Qv(o),l&512&&ka(o,o.return);break;case 12:Bi(i,o);break;case 31:Bi(i,o),l&4&&s0(i,o);break;case 13:Bi(i,o),l&4&&o0(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=_C.bind(null,o),GC(i,o))));break;case 22:if(l=o.memoizedState!==null||$i,!l){s=s!==null&&s.memoizedState!==null||xt,d=$i;var p=xt;$i=l,(xt=s)&&!p?zi(i,o,(o.subtreeFlags&8772)!==0):Bi(i,o),$i=d,xt=p}break;case 30:break;default:Bi(i,o)}}function i0(i){var s=i.alternate;s!==null&&(i.alternate=null,i0(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Kf(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 tt=null,rn=!1;function ji(i,s,o){for(o=o.child;o!==null;)r0(i,s,o),o=o.sibling}function r0(i,s,o){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount(ea,o)}catch{}switch(o.tag){case 26:xt||ai(o,s),ji(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:xt||ai(o,s);var l=tt,d=rn;Sr(o.type)&&(tt=o.stateNode,rn=!1),ji(i,s,o),Va(o.stateNode),tt=l,rn=d;break;case 5:xt||ai(o,s);case 6:if(l=tt,d=rn,tt=null,ji(i,s,o),tt=l,rn=d,tt!==null)if(rn)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(o.stateNode)}catch(p){Ue(o,s,p)}else try{tt.removeChild(o.stateNode)}catch(p){Ue(o,s,p)}break;case 18:tt!==null&&(rn?(i=tt,X0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),mo(i)):X0(tt,o.stateNode));break;case 4:l=tt,d=rn,tt=o.stateNode.containerInfo,rn=!0,ji(i,s,o),tt=l,rn=d;break;case 0:case 11:case 14:case 15:hr(2,o,s),xt||hr(4,o,s),ji(i,s,o);break;case 1:xt||(ai(o,s),l=o.stateNode,typeof l.componentWillUnmount=="function"&&Zv(o,s,l)),ji(i,s,o);break;case 21:ji(i,s,o);break;case 22:xt=(l=xt)||o.memoizedState!==null,ji(i,s,o),xt=l;break;default:ji(i,s,o)}}function s0(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{mo(i)}catch(o){Ue(s,s.return,o)}}}function o0(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{mo(i)}catch(o){Ue(s,s.return,o)}}function vC(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new t0),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new t0),s;default:throw Error(r(435,i.tag))}}function Du(i,s){var o=vC(i);s.forEach(function(l){if(!o.has(l)){o.add(l);var d=RC.bind(null,i,l);l.then(d,d)}})}function sn(i,s){var o=s.deletions;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l],p=i,b=s,w=b;e:for(;w!==null;){switch(w.tag){case 27:if(Sr(w.type)){tt=w.stateNode,rn=!1;break e}break;case 5:tt=w.stateNode,rn=!1;break e;case 3:case 4:tt=w.stateNode.containerInfo,rn=!0;break e}w=w.return}if(tt===null)throw Error(r(160));r0(p,b,d),tt=null,rn=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)a0(s,i),s=s.sibling}var Yn=null;function a0(i,s){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:sn(s,i),on(i),l&4&&(hr(3,i,i.return),Ca(3,i),hr(5,i,i.return));break;case 1:sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),l&64&&$i&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var d=Yn;if(sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),l&4){var p=o!==null?o.memoizedState:null;if(l=i.memoizedState,o===null)if(l===null)if(i.stateNode===null){e:{l=i.type,o=i.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":p=d.getElementsByTagName("title")[0],(!p||p[ia]||p[Ut]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(l),d.head.insertBefore(p,d.querySelector("head > title"))),It(p,l,o),p[Ut]=i,Nt(p),l=p;break e;case"link":var b=aS("link","href",d).get(l+(o.href||""));if(b){for(var w=0;w<b.length;w++)if(p=b[w],p.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&p.getAttribute("rel")===(o.rel==null?null:o.rel)&&p.getAttribute("title")===(o.title==null?null:o.title)&&p.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){b.splice(w,1);break t}}p=d.createElement(l),It(p,l,o),d.head.appendChild(p);break;case"meta":if(b=aS("meta","content",d).get(l+(o.content||""))){for(w=0;w<b.length;w++)if(p=b[w],p.getAttribute("content")===(o.content==null?null:""+o.content)&&p.getAttribute("name")===(o.name==null?null:o.name)&&p.getAttribute("property")===(o.property==null?null:o.property)&&p.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&p.getAttribute("charset")===(o.charSet==null?null:o.charSet)){b.splice(w,1);break t}}p=d.createElement(l),It(p,l,o),d.head.appendChild(p);break;default:throw Error(r(468,l))}p[Ut]=i,Nt(p),l=p}i.stateNode=l}else lS(d,i.type,i.stateNode);else i.stateNode=oS(d,l,i.memoizedProps);else p!==l?(p===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):p.count--,l===null?lS(d,i.type,i.stateNode):oS(d,l,i.memoizedProps)):l===null&&i.stateNode!==null&&lh(i,i.memoizedProps,o.memoizedProps)}break;case 27:sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),o!==null&&l&4&&lh(i,i.memoizedProps,o.memoizedProps);break;case 5:if(sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),i.flags&32){d=i.stateNode;try{zs(d,"")}catch(ie){Ue(i,i.return,ie)}}l&4&&i.stateNode!=null&&(d=i.memoizedProps,lh(i,d,o!==null?o.memoizedProps:d)),l&1024&&(fh=!0);break;case 6:if(sn(s,i),on(i),l&4){if(i.stateNode===null)throw Error(r(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(ie){Ue(i,i.return,ie)}}break;case 3:if(Yu=null,d=Yn,Yn=Fu(s.containerInfo),sn(s,i),Yn=d,on(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{mo(s.containerInfo)}catch(ie){Ue(i,i.return,ie)}fh&&(fh=!1,l0(i));break;case 4:l=Yn,Yn=Fu(i.stateNode.containerInfo),sn(s,i),on(i),Yn=l;break;case 12:sn(s,i),on(i);break;case 31:sn(s,i),on(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Du(i,l)));break;case 13:sn(s,i),on(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&($u=st()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Du(i,l)));break;case 22:d=i.memoizedState!==null;var A=o!==null&&o.memoizedState!==null,N=$i,V=xt;if($i=N||d,xt=V||A,sn(s,i),xt=V,$i=N,on(i),l&8192)e:for(s=i.stateNode,s._visibility=d?s._visibility&-2:s._visibility|1,d&&(o===null||A||$i||xt||cs(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){A=o=s;try{if(p=A.stateNode,d)b=p.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{w=A.stateNode;var P=A.memoizedProps.style,B=P!=null&&P.hasOwnProperty("display")?P.display:null;w.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(ie){Ue(A,A.return,ie)}}}else if(s.tag===6){if(o===null){A=s;try{A.stateNode.nodeValue=d?"":A.memoizedProps}catch(ie){Ue(A,A.return,ie)}}}else if(s.tag===18){if(o===null){A=s;try{var z=A.stateNode;d?Z0(z,!0):Z0(A.stateNode,!1)}catch(ie){Ue(A,A.return,ie)}}}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;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}l&4&&(l=i.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,Du(i,o))));break;case 19:sn(s,i),on(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Du(i,l)));break;case 30:break;case 21:break;default:sn(s,i),on(i)}}function on(i){var s=i.flags;if(s&2){try{for(var o,l=i.return;l!==null;){if(Wv(l)){o=l;break}l=l.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var d=o.stateNode,p=uh(i);Mu(i,p,d);break;case 5:var b=o.stateNode;o.flags&32&&(zs(b,""),o.flags&=-33);var w=uh(i);Mu(i,w,b);break;case 3:case 4:var A=o.stateNode.containerInfo,N=uh(i);ch(i,N,A);break;default:throw Error(r(161))}}catch(V){Ue(i,i.return,V)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function l0(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;l0(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Bi(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)n0(i,s.alternate,s),s=s.sibling}function cs(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:hr(4,s,s.return),cs(s);break;case 1:ai(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Zv(s,s.return,o),cs(s);break;case 27:Va(s.stateNode);case 26:case 5:ai(s,s.return),cs(s);break;case 22:s.memoizedState===null&&cs(s);break;case 30:cs(s);break;default:cs(s)}i=i.sibling}}function zi(i,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var l=s.alternate,d=i,p=s,b=p.flags;switch(p.tag){case 0:case 11:case 15:zi(d,p,o),Ca(4,p);break;case 1:if(zi(d,p,o),l=p,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(N){Ue(l,l.return,N)}if(l=p,d=l.updateQueue,d!==null){var w=l.stateNode;try{var A=d.shared.hiddenCallbacks;if(A!==null)for(d.shared.hiddenCallbacks=null,d=0;d<A.length;d++)Vb(A[d],w)}catch(N){Ue(l,l.return,N)}}o&&b&64&&Xv(p),ka(p,p.return);break;case 27:e0(p);case 26:case 5:zi(d,p,o),o&&l===null&&b&4&&Qv(p),ka(p,p.return);break;case 12:zi(d,p,o);break;case 31:zi(d,p,o),o&&b&4&&s0(d,p);break;case 13:zi(d,p,o),o&&b&4&&o0(d,p);break;case 22:p.memoizedState===null&&zi(d,p,o),ka(p,p.return);break;case 30:break;default:zi(d,p,o)}s=s.sibling}}function dh(i,s){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&ya(o))}function hh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ya(i))}function Jn(i,s,o,l){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)u0(i,s,o,l),s=s.sibling}function u0(i,s,o,l){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Jn(i,s,o,l),d&2048&&Ca(9,s);break;case 1:Jn(i,s,o,l);break;case 3:Jn(i,s,o,l),d&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ya(i)));break;case 12:if(d&2048){Jn(i,s,o,l),i=s.stateNode;try{var p=s.memoizedProps,b=p.id,w=p.onPostCommit;typeof w=="function"&&w(b,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(A){Ue(s,s.return,A)}}else Jn(i,s,o,l);break;case 31:Jn(i,s,o,l);break;case 13:Jn(i,s,o,l);break;case 23:break;case 22:p=s.stateNode,b=s.alternate,s.memoizedState!==null?p._visibility&2?Jn(i,s,o,l):Ma(i,s):p._visibility&2?Jn(i,s,o,l):(p._visibility|=2,io(i,s,o,l,(s.subtreeFlags&10256)!==0||!1)),d&2048&&dh(b,s);break;case 24:Jn(i,s,o,l),d&2048&&hh(s.alternate,s);break;default:Jn(i,s,o,l)}}function io(i,s,o,l,d){for(d=d&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var p=i,b=s,w=o,A=l,N=b.flags;switch(b.tag){case 0:case 11:case 15:io(p,b,w,A,d),Ca(8,b);break;case 23:break;case 22:var V=b.stateNode;b.memoizedState!==null?V._visibility&2?io(p,b,w,A,d):Ma(p,b):(V._visibility|=2,io(p,b,w,A,d)),d&&N&2048&&dh(b.alternate,b);break;case 24:io(p,b,w,A,d),d&&N&2048&&hh(b.alternate,b);break;default:io(p,b,w,A,d)}s=s.sibling}}function Ma(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=i,l=s,d=l.flags;switch(l.tag){case 22:Ma(o,l),d&2048&&dh(l.alternate,l);break;case 24:Ma(o,l),d&2048&&hh(l.alternate,l);break;default:Ma(o,l)}s=s.sibling}}var Da=8192;function ro(i,s,o){if(i.subtreeFlags&Da)for(i=i.child;i!==null;)c0(i,s,o),i=i.sibling}function c0(i,s,o){switch(i.tag){case 26:ro(i,s,o),i.flags&Da&&i.memoizedState!==null&&sk(o,Yn,i.memoizedState,i.memoizedProps);break;case 5:ro(i,s,o);break;case 3:case 4:var l=Yn;Yn=Fu(i.stateNode.containerInfo),ro(i,s,o),Yn=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=Da,Da=16777216,ro(i,s,o),Da=l):ro(i,s,o));break;default:ro(i,s,o)}}function f0(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 Na(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];$t=l,h0(l,i)}f0(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)d0(i),i=i.sibling}function d0(i){switch(i.tag){case 0:case 11:case 15:Na(i),i.flags&2048&&hr(9,i,i.return);break;case 3:Na(i);break;case 12:Na(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Nu(i)):Na(i);break;default:Na(i)}}function Nu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];$t=l,h0(l,i)}f0(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:hr(8,s,s.return),Nu(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,Nu(s));break;default:Nu(s)}i=i.sibling}}function h0(i,s){for(;$t!==null;){var o=$t;switch(o.tag){case 0:case 11:case 15:hr(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ya(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,$t=l;else e:for(o=i;$t!==null;){l=$t;var d=l.sibling,p=l.return;if(i0(l),l===o){$t=null;break e}if(d!==null){d.return=p,$t=d;break e}$t=p}}}var SC={getCacheForType:function(i){var s=qt(vt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o},cacheSignal:function(){return qt(vt).controller.signal}},wC=typeof WeakMap=="function"?WeakMap:Map,Be=0,He=null,Ae=null,Oe=0,Ve=0,bn=null,pr=!1,so=!1,ph=!1,Li=0,at=0,mr=0,fs=0,mh=0,vn=0,oo=0,$a=null,an=null,yh=!1,$u=0,p0=0,ju=1/0,Bu=null,yr=null,kt=0,gr=null,ao=null,Vi=0,gh=0,bh=null,m0=null,ja=0,vh=null;function Sn(){return(Be&2)!==0&&Oe!==0?Oe&-Oe:j.T!==null?Eh():Mg()}function y0(){if(vn===0)if((Oe&536870912)===0||Ce){var i=Il;Il<<=1,(Il&3932160)===0&&(Il=262144),vn=i}else vn=536870912;return i=yn.current,i!==null&&(i.flags|=32),vn}function ln(i,s,o){(i===He&&(Ve===2||Ve===9)||i.cancelPendingCommit!==null)&&(lo(i,0),br(i,Oe,vn,!1)),na(i,o),((Be&2)===0||i!==He)&&(i===He&&((Be&2)===0&&(fs|=o),at===4&&br(i,Oe,vn,!1)),li(i))}function g0(i,s,o){if((Be&6)!==0)throw Error(r(327));var l=!o&&(s&127)===0&&(s&i.expiredLanes)===0||ta(i,s),d=l?AC(i,s):wh(i,s,!0),p=l;do{if(d===0){so&&!l&&br(i,s,0,!1);break}else{if(o=i.current.alternate,p&&!xC(o)){d=wh(i,s,!1),p=!1;continue}if(d===2){if(p=s,i.errorRecoveryDisabledLanes&p)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;d=$a;var A=w.current.memoizedState.isDehydrated;if(A&&(lo(w,b).flags|=256),b=wh(w,b,!1),b!==2){if(ph&&!A){w.errorRecoveryDisabledLanes|=p,fs|=p,d=4;break e}p=an,an=d,p!==null&&(an===null?an=p:an.push.apply(an,p))}d=b}if(p=!1,d!==2)continue}}if(d===1){lo(i,0),br(i,s,0,!0);break}e:{switch(l=i,p=d,p){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:br(l,s,vn,!pr);break e;case 2:an=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(d=$u+300-st(),10<d)){if(br(l,s,vn,!pr),Fl(l,0,!0)!==0)break e;Vi=s,l.timeoutHandle=Y0(b0.bind(null,l,o,an,Bu,yh,s,vn,fs,oo,pr,p,"Throttled",-0,0),d);break e}b0(l,o,an,Bu,yh,s,vn,fs,oo,pr,p,null,-0,0)}}break}while(!0);li(i)}function b0(i,s,o,l,d,p,b,w,A,N,V,P,B,z){if(i.timeoutHandle=-1,P=s.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ai},c0(s,p,P);var ie=(p&62914560)===p?$u-st():(p&4194048)===p?p0-st():0;if(ie=ok(P,ie),ie!==null){Vi=p,i.cancelPendingCommit=ie(O0.bind(null,i,s,p,o,l,d,b,w,A,V,P,null,B,z)),br(i,p,b,!N);return}}O0(i,s,p,o,l,d,b,w,A)}function xC(i){for(var s=i;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var d=o[l],p=d.getSnapshot;d=d.value;try{if(!pn(p(),d))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;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 br(i,s,o,l){s&=~mh,s&=~fs,i.suspendedLanes|=s,i.pingedLanes&=~s,l&&(i.warmLanes|=s),l=i.expirationTimes;for(var d=s;0<d;){var p=31-hn(d),b=1<<p;l[p]=-1,d&=~b}o!==0&&Rg(i,o,s)}function zu(){return(Be&6)===0?(Ba(0),!1):!0}function Sh(){if(Ae!==null){if(Ve===0)var i=Ae.return;else i=Ae,Ri=ns=null,Bd(i),Qs=null,ba=0,i=Ae;for(;i!==null;)Jv(i.alternate,i),i=i.return;Ae=null}}function lo(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,qC(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Vi=0,Sh(),He=i,Ae=o=Oi(i.current,null),Oe=s,Ve=0,bn=null,pr=!1,so=ta(i,s),ph=!1,oo=vn=mh=fs=mr=at=0,an=$a=null,yh=!1,(s&8)!==0&&(s|=s&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=s;0<l;){var d=31-hn(l),p=1<<d;s|=i[d],l&=~p}return Li=s,ru(),o}function v0(i,s){be=null,j.H=Oa,s===Zs||s===du?(s=jb(),Ve=3):s===Ad?(s=jb(),Ve=4):Ve=s===Qd?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,bn=s,Ae===null&&(at=1,Ou(i,Cn(s,i.current)))}function S0(){var i=yn.current;return i===null?!0:(Oe&4194048)===Oe?Nn===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?i===Nn:!1}function w0(){var i=j.H;return j.H=Oa,i===null?Oa:i}function x0(){var i=j.A;return j.A=SC,i}function Lu(){at=4,pr||(Oe&4194048)!==Oe&&yn.current!==null||(so=!0),(mr&134217727)===0&&(fs&134217727)===0||He===null||br(He,Oe,vn,!1)}function wh(i,s,o){var l=Be;Be|=2;var d=w0(),p=x0();(He!==i||Oe!==s)&&(Bu=null,lo(i,s)),s=!1;var b=at;e:do try{if(Ve!==0&&Ae!==null){var w=Ae,A=bn;switch(Ve){case 8:Sh(),b=6;break e;case 3:case 2:case 9:case 6:yn.current===null&&(s=!0);var N=Ve;if(Ve=0,bn=null,uo(i,w,A,N),o&&so){b=0;break e}break;default:N=Ve,Ve=0,bn=null,uo(i,w,A,N)}}TC(),b=at;break}catch(V){v0(i,V)}while(!0);return s&&i.shellSuspendCounter++,Ri=ns=null,Be=l,j.H=d,j.A=p,Ae===null&&(He=null,Oe=0,ru()),b}function TC(){for(;Ae!==null;)T0(Ae)}function AC(i,s){var o=Be;Be|=2;var l=w0(),d=x0();He!==i||Oe!==s?(Bu=null,ju=st()+500,lo(i,s)):so=ta(i,s);e:do try{if(Ve!==0&&Ae!==null){s=Ae;var p=bn;t:switch(Ve){case 1:Ve=0,bn=null,uo(i,s,p,1);break;case 2:case 9:if(Nb(p)){Ve=0,bn=null,A0(s);break}s=function(){Ve!==2&&Ve!==9||He!==i||(Ve=7),li(i)},p.then(s,s);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:Nb(p)?(Ve=0,bn=null,A0(s)):(Ve=0,bn=null,uo(i,s,p,7));break;case 5:var b=null;switch(Ae.tag){case 26:b=Ae.memoizedState;case 5:case 27:var w=Ae;if(b?uS(b):w.stateNode.complete){Ve=0,bn=null;var A=w.sibling;if(A!==null)Ae=A;else{var N=w.return;N!==null?(Ae=N,Vu(N)):Ae=null}break t}}Ve=0,bn=null,uo(i,s,p,5);break;case 6:Ve=0,bn=null,uo(i,s,p,6);break;case 8:Sh(),at=6;break e;default:throw Error(r(462))}}EC();break}catch(V){v0(i,V)}while(!0);return Ri=ns=null,j.H=l,j.A=d,Be=o,Ae!==null?0:(He=null,Oe=0,ru(),at)}function EC(){for(;Ae!==null&&!ri();)T0(Ae)}function T0(i){var s=Gv(i.alternate,i,Li);i.memoizedProps=i.pendingProps,s===null?Vu(i):Ae=s}function A0(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=Kv(o,s,s.pendingProps,s.type,void 0,Oe);break;case 11:s=Kv(o,s,s.pendingProps,s.type.render,s.ref,Oe);break;case 5:Bd(s);default:Jv(o,s),s=Ae=xb(s,Li),s=Gv(o,s,Li)}i.memoizedProps=i.pendingProps,s===null?Vu(i):Ae=s}function uo(i,s,o,l){Ri=ns=null,Bd(s),Qs=null,ba=0;var d=s.return;try{if(hC(i,d,s,o,Oe)){at=1,Ou(i,Cn(o,i.current)),Ae=null;return}}catch(p){if(d!==null)throw Ae=d,p;at=1,Ou(i,Cn(o,i.current)),Ae=null;return}s.flags&32768?(Ce||l===1?i=!0:so||(Oe&536870912)!==0?i=!1:(pr=i=!0,(l===2||l===9||l===3||l===6)&&(l=yn.current,l!==null&&l.tag===13&&(l.flags|=16384))),E0(s,i)):Vu(s)}function Vu(i){var s=i;do{if((s.flags&32768)!==0){E0(s,pr);return}i=s.return;var o=yC(s.alternate,s,Li);if(o!==null){Ae=o;return}if(s=s.sibling,s!==null){Ae=s;return}Ae=s=i}while(s!==null);at===0&&(at=5)}function E0(i,s){do{var o=gC(i.alternate,i);if(o!==null){o.flags&=32767,Ae=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Ae=i;return}Ae=i=o}while(i!==null);at=6,Ae=null}function O0(i,s,o,l,d,p,b,w,A){i.cancelPendingCommit=null;do Uu();while(kt!==0);if((Be&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(p=s.lanes|s.childLanes,p|=ud,rR(i,o,p,b,w,A),i===He&&(Ae=He=null,Oe=0),ao=s,gr=i,Vi=o,gh=p,bh=d,m0=l,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,CC(ql,function(){return M0(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=j.T,j.T=null,d=U.p,U.p=2,b=Be,Be|=4;try{bC(i,s,o)}finally{Be=b,U.p=d,j.T=l}}kt=1,_0(),R0(),C0()}}function _0(){if(kt===1){kt=0;var i=gr,s=ao,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=j.T,j.T=null;var l=U.p;U.p=2;var d=Be;Be|=4;try{a0(s,i);var p=Nh,b=hb(i.containerInfo),w=p.focusedElem,A=p.selectionRange;if(b!==w&&w&&w.ownerDocument&&db(w.ownerDocument.documentElement,w)){if(A!==null&&rd(w)){var N=A.start,V=A.end;if(V===void 0&&(V=N),"selectionStart"in w)w.selectionStart=N,w.selectionEnd=Math.min(V,w.value.length);else{var P=w.ownerDocument||document,B=P&&P.defaultView||window;if(B.getSelection){var z=B.getSelection(),ie=w.textContent.length,ue=Math.min(A.start,ie),Pe=A.end===void 0?ue:Math.min(A.end,ie);!z.extend&&ue>Pe&&(b=Pe,Pe=ue,ue=b);var k=fb(w,ue),O=fb(w,Pe);if(k&&O&&(z.rangeCount!==1||z.anchorNode!==k.node||z.anchorOffset!==k.offset||z.focusNode!==O.node||z.focusOffset!==O.offset)){var D=P.createRange();D.setStart(k.node,k.offset),z.removeAllRanges(),ue>Pe?(z.addRange(D),z.extend(O.node,O.offset)):(D.setEnd(O.node,O.offset),z.addRange(D))}}}}for(P=[],z=w;z=z.parentNode;)z.nodeType===1&&P.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<P.length;w++){var K=P[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Qu=!!Dh,Nh=Dh=null}finally{Be=d,U.p=l,j.T=o}}i.current=s,kt=2}}function R0(){if(kt===2){kt=0;var i=gr,s=ao,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=j.T,j.T=null;var l=U.p;U.p=2;var d=Be;Be|=4;try{n0(i,s.alternate,s)}finally{Be=d,U.p=l,j.T=o}}kt=3}}function C0(){if(kt===4||kt===3){kt=0,Fn();var i=gr,s=ao,o=Vi,l=m0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?kt=5:(kt=0,ao=gr=null,k0(i,i.pendingLanes));var d=i.pendingLanes;if(d===0&&(yr=null),Vf(o),s=s.stateNode,dn&&typeof dn.onCommitFiberRoot=="function")try{dn.onCommitFiberRoot(ea,s,void 0,(s.current.flags&128)===128)}catch{}if(l!==null){s=j.T,d=U.p,U.p=2,j.T=null;try{for(var p=i.onRecoverableError,b=0;b<l.length;b++){var w=l[b];p(w.value,{componentStack:w.stack})}}finally{j.T=s,U.p=d}}(Vi&3)!==0&&Uu(),li(i),d=i.pendingLanes,(o&261930)!==0&&(d&42)!==0?i===vh?ja++:(ja=0,vh=i):ja=0,Ba(0)}}function k0(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,ya(s)))}function Uu(){return _0(),R0(),C0(),M0()}function M0(){if(kt!==5)return!1;var i=gr,s=gh;gh=0;var o=Vf(Vi),l=j.T,d=U.p;try{U.p=32>o?32:o,j.T=null,o=bh,bh=null;var p=gr,b=Vi;if(kt=0,ao=gr=null,Vi=0,(Be&6)!==0)throw Error(r(331));var w=Be;if(Be|=4,d0(p.current),u0(p,p.current,b,o),Be=w,Ba(0,!1),dn&&typeof dn.onPostCommitFiberRoot=="function")try{dn.onPostCommitFiberRoot(ea,p)}catch{}return!0}finally{U.p=d,j.T=l,k0(i,s)}}function D0(i,s,o){s=Cn(o,s),s=Zd(i.stateNode,s,2),i=cr(i,s,2),i!==null&&(na(i,2),li(i))}function Ue(i,s,o){if(i.tag===3)D0(i,i,o);else for(;s!==null;){if(s.tag===3){D0(s,i,o);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(yr===null||!yr.has(l))){i=Cn(o,i),o=Nv(2),l=cr(s,o,2),l!==null&&($v(o,l,s,i),na(l,2),li(l));break}}s=s.return}}function xh(i,s,o){var l=i.pingCache;if(l===null){l=i.pingCache=new wC;var d=new Set;l.set(s,d)}else d=l.get(s),d===void 0&&(d=new Set,l.set(s,d));d.has(o)||(ph=!0,d.add(o),i=OC.bind(null,i,s,o),s.then(i,i))}function OC(i,s,o){var l=i.pingCache;l!==null&&l.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,He===i&&(Oe&o)===o&&(at===4||at===3&&(Oe&62914560)===Oe&&300>st()-$u?(Be&2)===0&&lo(i,0):mh|=o,oo===Oe&&(oo=0)),li(i)}function N0(i,s){s===0&&(s=_g()),i=Wr(i,s),i!==null&&(na(i,s),li(i))}function _C(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),N0(i,o)}function RC(i,s){var o=0;switch(i.tag){case 31:case 13:var l=i.stateNode,d=i.memoizedState;d!==null&&(o=d.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(s),N0(i,o)}function CC(i,s){return Vt(i,s)}var Ku=null,co=null,Th=!1,qu=!1,Ah=!1,vr=0;function li(i){i!==co&&i.next===null&&(co===null?Ku=co=i:co=co.next=i),qu=!0,Th||(Th=!0,MC())}function Ba(i,s){if(!Ah&&qu){Ah=!0;do for(var o=!1,l=Ku;l!==null;){if(i!==0){var d=l.pendingLanes;if(d===0)var p=0;else{var b=l.suspendedLanes,w=l.pingedLanes;p=(1<<31-hn(42|i)+1)-1,p&=d&~(b&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(o=!0,z0(l,p))}else p=Oe,p=Fl(l,l===He?p:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(p&3)===0||ta(l,p)||(o=!0,z0(l,p));l=l.next}while(o);Ah=!1}}function kC(){$0()}function $0(){qu=Th=!1;var i=0;vr!==0&&KC()&&(i=vr);for(var s=st(),o=null,l=Ku;l!==null;){var d=l.next,p=j0(l,s);p===0?(l.next=null,o===null?Ku=d:o.next=d,d===null&&(co=o)):(o=l,(i!==0||(p&3)!==0)&&(qu=!0)),l=d}kt!==0&&kt!==5||Ba(i),vr!==0&&(vr=0)}function j0(i,s){for(var o=i.suspendedLanes,l=i.pingedLanes,d=i.expirationTimes,p=i.pendingLanes&-62914561;0<p;){var b=31-hn(p),w=1<<b,A=d[b];A===-1?((w&o)===0||(w&l)!==0)&&(d[b]=iR(w,s)):A<=s&&(i.expiredLanes|=w),p&=~w}if(s=He,o=Oe,o=Fl(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===s&&(Ve===2||Ve===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&Hn(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||ta(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(l!==null&&Hn(l),Vf(o)){case 2:case 8:o=Eg;break;case 32:o=ql;break;case 268435456:o=Og;break;default:o=ql}return l=B0.bind(null,i),o=Vt(o,l),i.callbackPriority=s,i.callbackNode=o,s}return l!==null&&l!==null&&Hn(l),i.callbackPriority=2,i.callbackNode=null,2}function B0(i,s){if(kt!==0&&kt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Uu()&&i.callbackNode!==o)return null;var l=Oe;return l=Fl(i,i===He?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(g0(i,l,s),j0(i,st()),i.callbackNode!=null&&i.callbackNode===o?B0.bind(null,i):null)}function z0(i,s){if(Uu())return null;g0(i,s,!0)}function MC(){PC(function(){(Be&6)!==0?Vt(Ag,kC):$0()})}function Eh(){if(vr===0){var i=Js;i===0&&(i=Pl,Pl<<=1,(Pl&261888)===0&&(Pl=256)),vr=i}return vr}function L0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Xl(""+i)}function V0(i,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,i.id&&o.setAttribute("form",i.id),s.parentNode.insertBefore(o,s),i=new FormData(i),o.parentNode.removeChild(o),i}function DC(i,s,o,l,d){if(s==="submit"&&o&&o.stateNode===d){var p=L0((d[tn]||null).action),b=l.submitter;b&&(s=(s=b[tn]||null)?L0(s.formAction):b.getAttribute("formAction"),s!==null&&(p=s,b=null));var w=new eu("action","action",null,l,d);i.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(vr!==0){var A=b?V0(d,b):new FormData(d);Hd(o,{pending:!0,data:A,method:d.method,action:p},null,A)}}else typeof p=="function"&&(w.preventDefault(),A=b?V0(d,b):new FormData(d),Hd(o,{pending:!0,data:A,method:d.method,action:p},p,A))},currentTarget:d}]})}}for(var Oh=0;Oh<ld.length;Oh++){var _h=ld[Oh],NC=_h.toLowerCase(),$C=_h[0].toUpperCase()+_h.slice(1);Gn(NC,"on"+$C)}Gn(yb,"onAnimationEnd"),Gn(gb,"onAnimationIteration"),Gn(bb,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(XR,"onTransitionRun"),Gn(ZR,"onTransitionStart"),Gn(QR,"onTransitionCancel"),Gn(vb,"onTransitionEnd"),js("onMouseEnter",["mouseout","mouseover"]),js("onMouseLeave",["mouseout","mouseover"]),js("onPointerEnter",["pointerout","pointerover"]),js("onPointerLeave",["pointerout","pointerover"]),Jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var za="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(" "),jC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(za));function U0(i,s){s=(s&4)!==0;for(var o=0;o<i.length;o++){var l=i[o],d=l.event;l=l.listeners;e:{var p=void 0;if(s)for(var b=l.length-1;0<=b;b--){var w=l[b],A=w.instance,N=w.currentTarget;if(w=w.listener,A!==p&&d.isPropagationStopped())break e;p=w,d.currentTarget=N;try{p(d)}catch(V){iu(V)}d.currentTarget=null,p=A}else for(b=0;b<l.length;b++){if(w=l[b],A=w.instance,N=w.currentTarget,w=w.listener,A!==p&&d.isPropagationStopped())break e;p=w,d.currentTarget=N;try{p(d)}catch(V){iu(V)}d.currentTarget=null,p=A}}}}function Ee(i,s){var o=s[Uf];o===void 0&&(o=s[Uf]=new Set);var l=i+"__bubble";o.has(l)||(K0(s,i,2,!1),o.add(l))}function Rh(i,s,o){var l=0;s&&(l|=4),K0(o,i,l,s)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Ch(i){if(!i[Pu]){i[Pu]=!0,$g.forEach(function(o){o!=="selectionchange"&&(jC.has(o)||Rh(o,!1,i),Rh(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Pu]||(s[Pu]=!0,Rh("selectionchange",!1,s))}}function K0(i,s,o,l){switch(yS(s)){case 2:var d=uk;break;case 8:d=ck;break;default:d=Ih}o=d.bind(null,s,o,i),d=void 0,!Jf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(d=!0),l?d!==void 0?i.addEventListener(s,o,{capture:!0,passive:d}):i.addEventListener(s,o,!0):d!==void 0?i.addEventListener(s,o,{passive:d}):i.addEventListener(s,o,!1)}function kh(i,s,o,l,d){var p=l;if((s&1)===0&&(s&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var w=l.stateNode.containerInfo;if(w===d)break;if(b===4)for(b=l.return;b!==null;){var A=b.tag;if((A===3||A===4)&&b.stateNode.containerInfo===d)return;b=b.return}for(;w!==null;){if(b=Ds(w),b===null)return;if(A=b.tag,A===5||A===6||A===26||A===27){l=p=b;continue e}w=w.parentNode}}l=l.return}Fg(function(){var N=p,V=Gf(o),P=[];e:{var B=Sb.get(i);if(B!==void 0){var z=eu,ie=i;switch(i){case"keypress":if(Ql(o)===0)break e;case"keydown":case"keyup":z=RR;break;case"focusin":ie="focus",z=Wf;break;case"focusout":ie="blur",z=Wf;break;case"beforeblur":case"afterblur":z=Wf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":z=Jg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=yR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=MR;break;case yb:case gb:case bb:z=vR;break;case vb:z=NR;break;case"scroll":case"scrollend":z=pR;break;case"wheel":z=jR;break;case"copy":case"cut":case"paste":z=wR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Zg;break;case"toggle":case"beforetoggle":z=zR}var ue=(s&4)!==0,Pe=!ue&&(i==="scroll"||i==="scrollend"),k=ue?B!==null?B+"Capture":null:B;ue=[];for(var O=N,D;O!==null;){var K=O;if(D=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||D===null||k===null||(K=sa(O,k),K!=null&&ue.push(La(O,K,D))),Pe)break;O=O.return}0<ue.length&&(B=new z(B,ie,null,o,V),P.push({event:B,listeners:ue}))}}if((s&7)===0){e:{if(B=i==="mouseover"||i==="pointerover",z=i==="mouseout"||i==="pointerout",B&&o!==Ff&&(ie=o.relatedTarget||o.fromElement)&&(Ds(ie)||ie[Ms]))break e;if((z||B)&&(B=V.window===V?V:(B=V.ownerDocument)?B.defaultView||B.parentWindow:window,z?(ie=o.relatedTarget||o.toElement,z=N,ie=ie?Ds(ie):null,ie!==null&&(Pe=u(ie),ue=ie.tag,ie!==Pe||ue!==5&&ue!==27&&ue!==6)&&(ie=null)):(z=null,ie=N),z!==ie)){if(ue=Jg,K="onMouseLeave",k="onMouseEnter",O="mouse",(i==="pointerout"||i==="pointerover")&&(ue=Zg,K="onPointerLeave",k="onPointerEnter",O="pointer"),Pe=z==null?B:ra(z),D=ie==null?B:ra(ie),B=new ue(K,O+"leave",z,o,V),B.target=Pe,B.relatedTarget=D,K=null,Ds(V)===N&&(ue=new ue(k,O+"enter",ie,o,V),ue.target=D,ue.relatedTarget=Pe,K=ue),Pe=K,z&&ie)t:{for(ue=BC,k=z,O=ie,D=0,K=k;K;K=ue(K))D++;K=0;for(var le=O;le;le=ue(le))K++;for(;0<D-K;)k=ue(k),D--;for(;0<K-D;)O=ue(O),K--;for(;D--;){if(k===O||O!==null&&k===O.alternate){ue=k;break t}k=ue(k),O=ue(O)}ue=null}else ue=null;z!==null&&q0(P,B,z,ue,!1),ie!==null&&Pe!==null&&q0(P,Pe,ie,ue,!0)}}e:{if(B=N?ra(N):window,z=B.nodeName&&B.nodeName.toLowerCase(),z==="select"||z==="input"&&B.type==="file")var Ne=sb;else if(ib(B))if(ob)Ne=GR;else{Ne=HR;var se=IR}else z=B.nodeName,!z||z.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?N&&Hf(N.elementType)&&(Ne=sb):Ne=FR;if(Ne&&(Ne=Ne(i,N))){rb(P,Ne,o,V);break e}se&&se(i,B,N),i==="focusout"&&N&&B.type==="number"&&N.memoizedProps.value!=null&&If(B,"number",B.value)}switch(se=N?ra(N):window,i){case"focusin":(ib(se)||se.contentEditable==="true")&&(Ks=se,sd=N,ha=null);break;case"focusout":ha=sd=Ks=null;break;case"mousedown":od=!0;break;case"contextmenu":case"mouseup":case"dragend":od=!1,pb(P,o,V);break;case"selectionchange":if(JR)break;case"keydown":case"keyup":pb(P,o,V)}var Se;if(td)e:{switch(i){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else Us?tb(i,o)&&(_e="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(_e="onCompositionStart");_e&&(Qg&&o.locale!=="ko"&&(Us||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&Us&&(Se=Gg()):(ir=V,Xf="value"in ir?ir.value:ir.textContent,Us=!0)),se=Iu(N,_e),0<se.length&&(_e=new Xg(_e,i,null,o,V),P.push({event:_e,listeners:se}),Se?_e.data=Se:(Se=nb(o),Se!==null&&(_e.data=Se)))),(Se=VR?UR(i,o):KR(i,o))&&(_e=Iu(N,"onBeforeInput"),0<_e.length&&(se=new Xg("onBeforeInput","beforeinput",null,o,V),P.push({event:se,listeners:_e}),se.data=Se)),DC(P,i,N,o,V)}U0(P,s)})}function La(i,s,o){return{instance:i,listener:s,currentTarget:o}}function Iu(i,s){for(var o=s+"Capture",l=[];i!==null;){var d=i,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=sa(i,o),d!=null&&l.unshift(La(i,d,p)),d=sa(i,s),d!=null&&l.push(La(i,d,p))),i.tag===3)return l;i=i.return}return[]}function BC(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function q0(i,s,o,l,d){for(var p=s._reactName,b=[];o!==null&&o!==l;){var w=o,A=w.alternate,N=w.stateNode;if(w=w.tag,A!==null&&A===l)break;w!==5&&w!==26&&w!==27||N===null||(A=N,d?(N=sa(o,p),N!=null&&b.unshift(La(o,N,A))):d||(N=sa(o,p),N!=null&&b.push(La(o,N,A)))),o=o.return}b.length!==0&&i.push({event:s,listeners:b})}var zC=/\r\n?/g,LC=/\u0000|\uFFFD/g;function P0(i){return(typeof i=="string"?i:""+i).replace(zC,`
|
|
21
|
-
`).replace(LC,"")}function I0(i,s){return s=P0(s),P0(i)===s}function qe(i,s,o,l,d,p){switch(o){case"children":typeof l=="string"?s==="body"||s==="textarea"&&l===""||zs(i,l):(typeof l=="number"||typeof l=="bigint")&&s!=="body"&&zs(i,""+l);break;case"className":Yl(i,"class",l);break;case"tabIndex":Yl(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yl(i,o,l);break;case"style":Ig(i,l,p);break;case"data":if(s!=="object"){Yl(i,"data",l);break}case"src":case"href":if(l===""&&(s!=="a"||o!=="href")){i.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Xl(""+l),i.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){i.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(o==="formAction"?(s!=="input"&&qe(i,s,"name",d.name,d,null),qe(i,s,"formEncType",d.formEncType,d,null),qe(i,s,"formMethod",d.formMethod,d,null),qe(i,s,"formTarget",d.formTarget,d,null)):(qe(i,s,"encType",d.encType,d,null),qe(i,s,"method",d.method,d,null),qe(i,s,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Xl(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=Ai);break;case"onScroll":l!=null&&Ee("scroll",i);break;case"onScrollEnd":l!=null&&Ee("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){i.removeAttribute("xlink:href");break}o=Xl(""+l),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""+l):i.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":l===!0?i.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,l):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(o,l):i.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(o):i.setAttribute(o,l);break;case"popover":Ee("beforetoggle",i),Ee("toggle",i),Gl(i,"popover",l);break;case"xlinkActuate":Ti(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ti(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ti(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ti(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ti(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ti(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Gl(i,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=dR.get(o)||o,Gl(i,o,l))}}function Mh(i,s,o,l,d,p){switch(o){case"style":Ig(i,l,p);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof l=="string"?zs(i,l):(typeof l=="number"||typeof l=="bigint")&&zs(i,""+l);break;case"onScroll":l!=null&&Ee("scroll",i);break;case"onScrollEnd":l!=null&&Ee("scrollend",i);break;case"onClick":l!=null&&(i.onclick=Ai);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jg.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),s=o.slice(2,d?o.length-7:void 0),p=i[tn]||null,p=p!=null?p[o]:null,typeof p=="function"&&i.removeEventListener(s,p,d),typeof l=="function")){typeof p!="function"&&p!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(s,l,d);break e}o in i?i[o]=l:l===!0?i.setAttribute(o,""):Gl(i,o,l)}}}function It(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",i),Ee("load",i);var l=!1,d=!1,p;for(p in o)if(o.hasOwnProperty(p)){var b=o[p];if(b!=null)switch(p){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:qe(i,s,p,b,o,null)}}d&&qe(i,s,"srcSet",o.srcSet,o,null),l&&qe(i,s,"src",o.src,o,null);return;case"input":Ee("invalid",i);var w=p=b=d=null,A=null,N=null;for(l in o)if(o.hasOwnProperty(l)){var V=o[l];if(V!=null)switch(l){case"name":d=V;break;case"type":b=V;break;case"checked":A=V;break;case"defaultChecked":N=V;break;case"value":p=V;break;case"defaultValue":w=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(137,s));break;default:qe(i,s,l,V,o,null)}}Ug(i,p,w,A,N,b,d,!1);return;case"select":Ee("invalid",i),l=b=p=null;for(d in o)if(o.hasOwnProperty(d)&&(w=o[d],w!=null))switch(d){case"value":p=w;break;case"defaultValue":b=w;break;case"multiple":l=w;default:qe(i,s,d,w,o,null)}s=p,o=b,i.multiple=!!l,s!=null?Bs(i,!!l,s,!1):o!=null&&Bs(i,!!l,o,!0);return;case"textarea":Ee("invalid",i),p=d=l=null;for(b in o)if(o.hasOwnProperty(b)&&(w=o[b],w!=null))switch(b){case"value":l=w;break;case"defaultValue":d=w;break;case"children":p=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:qe(i,s,b,w,o,null)}qg(i,l,d,p);return;case"option":for(A in o)if(o.hasOwnProperty(A)&&(l=o[A],l!=null))switch(A){case"selected":i.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:qe(i,s,A,l,o,null)}return;case"dialog":Ee("beforetoggle",i),Ee("toggle",i),Ee("cancel",i),Ee("close",i);break;case"iframe":case"object":Ee("load",i);break;case"video":case"audio":for(l=0;l<za.length;l++)Ee(za[l],i);break;case"image":Ee("error",i),Ee("load",i);break;case"details":Ee("toggle",i);break;case"embed":case"source":case"link":Ee("error",i),Ee("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(N in o)if(o.hasOwnProperty(N)&&(l=o[N],l!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:qe(i,s,N,l,o,null)}return;default:if(Hf(s)){for(V in o)o.hasOwnProperty(V)&&(l=o[V],l!==void 0&&Mh(i,s,V,l,o,void 0));return}}for(w in o)o.hasOwnProperty(w)&&(l=o[w],l!=null&&qe(i,s,w,l,o,null))}function VC(i,s,o,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,p=null,b=null,w=null,A=null,N=null,V=null;for(z in o){var P=o[z];if(o.hasOwnProperty(z)&&P!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":A=P;default:l.hasOwnProperty(z)||qe(i,s,z,null,l,P)}}for(var B in l){var z=l[B];if(P=o[B],l.hasOwnProperty(B)&&(z!=null||P!=null))switch(B){case"type":p=z;break;case"name":d=z;break;case"checked":N=z;break;case"defaultChecked":V=z;break;case"value":b=z;break;case"defaultValue":w=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(137,s));break;default:z!==P&&qe(i,s,B,z,l,P)}}Pf(i,b,w,A,N,V,p,d);return;case"select":z=b=w=B=null;for(p in o)if(A=o[p],o.hasOwnProperty(p)&&A!=null)switch(p){case"value":break;case"multiple":z=A;default:l.hasOwnProperty(p)||qe(i,s,p,null,l,A)}for(d in l)if(p=l[d],A=o[d],l.hasOwnProperty(d)&&(p!=null||A!=null))switch(d){case"value":B=p;break;case"defaultValue":w=p;break;case"multiple":b=p;default:p!==A&&qe(i,s,d,p,l,A)}s=w,o=b,l=z,B!=null?Bs(i,!!o,B,!1):!!l!=!!o&&(s!=null?Bs(i,!!o,s,!0):Bs(i,!!o,o?[]:"",!1));return;case"textarea":z=B=null;for(w in o)if(d=o[w],o.hasOwnProperty(w)&&d!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:qe(i,s,w,null,l,d)}for(b in l)if(d=l[b],p=o[b],l.hasOwnProperty(b)&&(d!=null||p!=null))switch(b){case"value":B=d;break;case"defaultValue":z=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(r(91));break;default:d!==p&&qe(i,s,b,d,l,p)}Kg(i,B,z);return;case"option":for(var ie in o)if(B=o[ie],o.hasOwnProperty(ie)&&B!=null&&!l.hasOwnProperty(ie))switch(ie){case"selected":i.selected=!1;break;default:qe(i,s,ie,null,l,B)}for(A in l)if(B=l[A],z=o[A],l.hasOwnProperty(A)&&B!==z&&(B!=null||z!=null))switch(A){case"selected":i.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:qe(i,s,A,B,l,z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in o)B=o[ue],o.hasOwnProperty(ue)&&B!=null&&!l.hasOwnProperty(ue)&&qe(i,s,ue,null,l,B);for(N in l)if(B=l[N],z=o[N],l.hasOwnProperty(N)&&B!==z&&(B!=null||z!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,s));break;default:qe(i,s,N,B,l,z)}return;default:if(Hf(s)){for(var Pe in o)B=o[Pe],o.hasOwnProperty(Pe)&&B!==void 0&&!l.hasOwnProperty(Pe)&&Mh(i,s,Pe,void 0,l,B);for(V in l)B=l[V],z=o[V],!l.hasOwnProperty(V)||B===z||B===void 0&&z===void 0||Mh(i,s,V,B,l,z);return}}for(var k in o)B=o[k],o.hasOwnProperty(k)&&B!=null&&!l.hasOwnProperty(k)&&qe(i,s,k,null,l,B);for(P in l)B=l[P],z=o[P],!l.hasOwnProperty(P)||B===z||B==null&&z==null||qe(i,s,P,B,l,z)}function H0(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function UC(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var d=o[l],p=d.transferSize,b=d.initiatorType,w=d.duration;if(p&&w&&H0(b)){for(b=0,w=d.responseEnd,l+=1;l<o.length;l++){var A=o[l],N=A.startTime;if(N>w)break;var V=A.transferSize,P=A.initiatorType;V&&H0(P)&&(A=A.responseEnd,b+=V*(A<w?1:(w-N)/(A-N)))}if(--l,s+=8*(p+b)/(d.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Dh=null,Nh=null;function Hu(i){return i.nodeType===9?i:i.ownerDocument}function F0(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 G0(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 $h(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 jh=null;function KC(){var i=window.event;return i&&i.type==="popstate"?i===jh?!1:(jh=i,!0):(jh=null,!1)}var Y0=typeof setTimeout=="function"?setTimeout:void 0,qC=typeof clearTimeout=="function"?clearTimeout:void 0,J0=typeof Promise=="function"?Promise:void 0,PC=typeof queueMicrotask=="function"?queueMicrotask:typeof J0<"u"?function(i){return J0.resolve(null).then(i).catch(IC)}:Y0;function IC(i){setTimeout(function(){throw i})}function Sr(i){return i==="head"}function X0(i,s){var o=s,l=0;do{var d=o.nextSibling;if(i.removeChild(o),d&&d.nodeType===8)if(o=d.data,o==="/$"||o==="/&"){if(l===0){i.removeChild(d),mo(s);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")Va(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,Va(o);for(var p=o.firstChild;p;){var b=p.nextSibling,w=p.nodeName;p[ia]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&p.rel.toLowerCase()==="stylesheet"||o.removeChild(p),p=b}}else o==="body"&&Va(i.ownerDocument.body);o=d}while(o);mo(s)}function Z0(i,s){var o=i;i=0;do{var l=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=l}while(o)}function Bh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Bh(o),Kf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function HC(i,s,o,l){for(;i.nodeType===1;){var d=o;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[ia])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(p=i.getAttribute("rel"),p==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(p!==d.rel||i.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||i.getAttribute("title")!==(d.title==null?null:d.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(p=i.getAttribute("src"),(p!==(d.src==null?null:d.src)||i.getAttribute("type")!==(d.type==null?null:d.type)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&i.getAttribute("name")===p)return i}else return i;if(i=$n(i.nextSibling),i===null)break}return null}function FC(i,s,o){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=$n(i.nextSibling),i===null))return null;return i}function Q0(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=$n(i.nextSibling),i===null))return null;return i}function zh(i){return i.data==="$?"||i.data==="$~"}function Lh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function GC(i,s){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||o.readyState!=="loading")s();else{var l=function(){s(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function $n(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==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Vh=null;function W0(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(s===0)return $n(i.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}i=i.nextSibling}return null}function eS(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return i;s--}else o!=="/$"&&o!=="/&"||s++}i=i.previousSibling}return null}function tS(i,s,o){switch(s=Hu(o),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 Va(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Kf(i)}var jn=new Map,nS=new Set;function Fu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ui=U.d;U.d={f:YC,r:JC,D:XC,C:ZC,L:QC,m:WC,X:tk,S:ek,M:nk};function YC(){var i=Ui.f(),s=zu();return i||s}function JC(i){var s=Ns(i);s!==null&&s.tag===5&&s.type==="form"?vv(s):Ui.r(i)}var fo=typeof document>"u"?null:document;function iS(i,s,o){var l=fo;if(l&&typeof s=="string"&&s){var d=_n(s);d='link[rel="'+i+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),nS.has(d)||(nS.add(d),i={rel:i,crossOrigin:o,href:s},l.querySelector(d)===null&&(s=l.createElement("link"),It(s,"link",i),Nt(s),l.head.appendChild(s)))}}function XC(i){Ui.D(i),iS("dns-prefetch",i,null)}function ZC(i,s){Ui.C(i,s),iS("preconnect",i,s)}function QC(i,s,o){Ui.L(i,s,o);var l=fo;if(l&&i&&s){var d='link[rel="preload"][as="'+_n(s)+'"]';s==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+_n(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+_n(o.imageSizes)+'"]')):d+='[href="'+_n(i)+'"]';var p=d;switch(s){case"style":p=ho(i);break;case"script":p=po(i)}jn.has(p)||(i=g({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),jn.set(p,i),l.querySelector(d)!==null||s==="style"&&l.querySelector(Ua(p))||s==="script"&&l.querySelector(Ka(p))||(s=l.createElement("link"),It(s,"link",i),Nt(s),l.head.appendChild(s)))}}function WC(i,s){Ui.m(i,s);var o=fo;if(o&&i){var l=s&&typeof s.as=="string"?s.as:"script",d='link[rel="modulepreload"][as="'+_n(l)+'"][href="'+_n(i)+'"]',p=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=po(i)}if(!jn.has(p)&&(i=g({rel:"modulepreload",href:i},s),jn.set(p,i),o.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ka(p)))return}l=o.createElement("link"),It(l,"link",i),Nt(l),o.head.appendChild(l)}}}function ek(i,s,o){Ui.S(i,s,o);var l=fo;if(l&&i){var d=$s(l).hoistableStyles,p=ho(i);s=s||"default";var b=d.get(p);if(!b){var w={loading:0,preload:null};if(b=l.querySelector(Ua(p)))w.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},o),(o=jn.get(p))&&Uh(i,o);var A=b=l.createElement("link");Nt(A),It(A,"link",i),A._p=new Promise(function(N,V){A.onload=N,A.onerror=V}),A.addEventListener("load",function(){w.loading|=1}),A.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Gu(b,s,l)}b={type:"stylesheet",instance:b,count:1,state:w},d.set(p,b)}}}function tk(i,s){Ui.X(i,s);var o=fo;if(o&&i){var l=$s(o).hoistableScripts,d=po(i),p=l.get(d);p||(p=o.querySelector(Ka(d)),p||(i=g({src:i,async:!0},s),(s=jn.get(d))&&Kh(i,s),p=o.createElement("script"),Nt(p),It(p,"link",i),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(d,p))}}function nk(i,s){Ui.M(i,s);var o=fo;if(o&&i){var l=$s(o).hoistableScripts,d=po(i),p=l.get(d);p||(p=o.querySelector(Ka(d)),p||(i=g({src:i,async:!0,type:"module"},s),(s=jn.get(d))&&Kh(i,s),p=o.createElement("script"),Nt(p),It(p,"link",i),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(d,p))}}function rS(i,s,o,l){var d=(d=ce.current)?Fu(d):null;if(!d)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=ho(o.href),o=$s(d).hoistableStyles,l=o.get(s),l||(l={type:"style",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=ho(o.href);var p=$s(d).hoistableStyles,b=p.get(i);if(b||(d=d.ownerDocument||d,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(i,b),(p=d.querySelector(Ua(i)))&&!p._p&&(b.instance=p,b.state.loading=5),jn.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},jn.set(i,o),p||ik(d,i,o,b.state))),s&&l===null)throw Error(r(528,""));return b}if(s&&l!==null)throw Error(r(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=po(o),o=$s(d).hoistableScripts,l=o.get(s),l||(l={type:"script",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ho(i){return'href="'+_n(i)+'"'}function Ua(i){return'link[rel="stylesheet"]['+i+"]"}function sS(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function ik(i,s,o,l){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=i.createElement("link"),l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2}),It(s,"link",o),Nt(s),i.head.appendChild(s))}function po(i){return'[src="'+_n(i)+'"]'}function Ka(i){return"script[async]"+i}function oS(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var l=i.querySelector('style[data-href~="'+_n(o.href)+'"]');if(l)return s.instance=l,Nt(l),l;var d=g({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),Nt(l),It(l,"style",d),Gu(l,o.precedence,i),s.instance=l;case"stylesheet":d=ho(o.href);var p=i.querySelector(Ua(d));if(p)return s.state.loading|=4,s.instance=p,Nt(p),p;l=sS(o),(d=jn.get(d))&&Uh(l,d),p=(i.ownerDocument||i).createElement("link"),Nt(p);var b=p;return b._p=new Promise(function(w,A){b.onload=w,b.onerror=A}),It(p,"link",l),s.state.loading|=4,Gu(p,o.precedence,i),s.instance=p;case"script":return p=po(o.src),(d=i.querySelector(Ka(p)))?(s.instance=d,Nt(d),d):(l=o,(d=jn.get(p))&&(l=g({},o),Kh(l,d)),i=i.ownerDocument||i,d=i.createElement("script"),Nt(d),It(d,"link",l),i.head.appendChild(d),s.instance=d);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(l=s.instance,s.state.loading|=4,Gu(l,o.precedence,i));return s.instance}function Gu(i,s,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,p=d,b=0;b<l.length;b++){var w=l[b];if(w.dataset.precedence===s)p=w;else if(p!==d)break}p?p.parentNode.insertBefore(i,p.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(i,s.firstChild))}function Uh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Kh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Yu=null;function aS(i,s,o){if(Yu===null){var l=new Map,d=Yu=new Map;d.set(o,l)}else d=Yu,l=d.get(o),l||(l=new Map,d.set(o,l));if(l.has(i))return l;for(l.set(i,null),o=o.getElementsByTagName(i),d=0;d<o.length;d++){var p=o[d];if(!(p[ia]||p[Ut]||i==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var b=p.getAttribute(s)||"";b=i+b;var w=l.get(b);w?w.push(p):l.set(b,[p])}}return l}function lS(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function rk(i,s,o){if(o===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 uS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function sk(i,s,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var d=ho(l.href),p=s.querySelector(Ua(d));if(p){s=p._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Ju.bind(i),s.then(i,i)),o.state.loading|=4,o.instance=p,Nt(p);return}p=s.ownerDocument||s,l=sS(l),(d=jn.get(d))&&Uh(l,d),p=p.createElement("link"),Nt(p);var b=p;b._p=new Promise(function(w,A){b.onload=w,b.onerror=A}),It(p,"link",l),o.instance=p}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Ju.bind(i),s.addEventListener("load",o),s.addEventListener("error",o))}}var qh=0;function ok(i,s){return i.stylesheets&&i.count===0&&Zu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var l=setTimeout(function(){if(i.stylesheets&&Zu(i,i.stylesheets),i.unsuspend){var p=i.unsuspend;i.unsuspend=null,p()}},6e4+s);0<i.imgBytes&&qh===0&&(qh=62500*UC());var d=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Zu(i,i.stylesheets),i.unsuspend)){var p=i.unsuspend;i.unsuspend=null,p()}},(i.imgBytes>qh?50:800)+s);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function Ju(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Xu=null;function Zu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Xu=new Map,s.forEach(ak,i),Xu=null,Ju.call(i))}function ak(i,s){if(!(s.state.loading&4)){var o=Xu.get(i);if(o)var l=o.get(null);else{o=new Map,Xu.set(i,o);for(var d=i.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var b=d[p];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(o.set(b.dataset.precedence,b),l=b)}l&&o.set(null,l)}d=s.instance,b=d.getAttribute("data-precedence"),p=o.get(b)||l,p===l&&o.set(null,d),o.set(b,d),this.count++,l=Ju.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),p?p.parentNode.insertBefore(d,p.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(d,i.firstChild)),s.state.loading|=4}}var qa={$$typeof:R,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function lk(i,s,o,l,d,p,b,w,A){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=zf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zf(0),this.hiddenUpdates=zf(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function cS(i,s,o,l,d,p,b,w,A,N,V,P){return i=new lk(i,s,o,b,A,N,V,P,w),s=1,p===!0&&(s|=24),p=mn(3,null,null,s),i.current=p,p.stateNode=i,s=wd(),s.refCount++,i.pooledCache=s,s.refCount++,p.memoizedState={element:l,isDehydrated:o,cache:s},Ed(p),i}function fS(i){return i?(i=Is,i):Is}function dS(i,s,o,l,d,p){d=fS(d),l.context===null?l.context=d:l.pendingContext=d,l=ur(s),l.payload={element:o},p=p===void 0?null:p,p!==null&&(l.callback=p),o=cr(i,l,s),o!==null&&(ln(o,i,s),Sa(o,i,s))}function hS(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function Ph(i,s){hS(i,s),(i=i.alternate)&&hS(i,s)}function pS(i){if(i.tag===13||i.tag===31){var s=Wr(i,67108864);s!==null&&ln(s,i,67108864),Ph(i,67108864)}}function mS(i){if(i.tag===13||i.tag===31){var s=Sn();s=Lf(s);var o=Wr(i,s);o!==null&&ln(o,i,s),Ph(i,s)}}var Qu=!0;function uk(i,s,o,l){var d=j.T;j.T=null;var p=U.p;try{U.p=2,Ih(i,s,o,l)}finally{U.p=p,j.T=d}}function ck(i,s,o,l){var d=j.T;j.T=null;var p=U.p;try{U.p=8,Ih(i,s,o,l)}finally{U.p=p,j.T=d}}function Ih(i,s,o,l){if(Qu){var d=Hh(l);if(d===null)kh(i,s,l,Wu,o),gS(i,l);else if(dk(d,i,s,o,l))l.stopPropagation();else if(gS(i,l),s&4&&-1<fk.indexOf(i)){for(;d!==null;){var p=Ns(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var b=Yr(p.pendingLanes);if(b!==0){var w=p;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var A=1<<31-hn(b);w.entanglements[1]|=A,b&=~A}li(p),(Be&6)===0&&(ju=st()+500,Ba(0))}}break;case 31:case 13:w=Wr(p,2),w!==null&&ln(w,p,2),zu(),Ph(p,2)}if(p=Hh(l),p===null&&kh(i,s,l,Wu,o),p===d)break;d=p}d!==null&&l.stopPropagation()}else kh(i,s,l,null,o)}}function Hh(i){return i=Gf(i),Fh(i)}var Wu=null;function Fh(i){if(Wu=null,i=Ds(i),i!==null){var s=u(i);if(s===null)i=null;else{var o=s.tag;if(o===13){if(i=c(s),i!==null)return i;i=null}else if(o===31){if(i=f(s),i!==null)return i;i=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Wu=i,null}function yS(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(Kl()){case Ag:return 2;case Eg:return 8;case ql:case Z_:return 32;case Og:return 268435456;default:return 32}default:return 32}}var Gh=!1,wr=null,xr=null,Tr=null,Pa=new Map,Ia=new Map,Ar=[],fk="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 gS(i,s){switch(i){case"focusin":case"focusout":wr=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":Tr=null;break;case"pointerover":case"pointerout":Pa.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ia.delete(s.pointerId)}}function Ha(i,s,o,l,d,p){return i===null||i.nativeEvent!==p?(i={blockedOn:s,domEventName:o,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},s!==null&&(s=Ns(s),s!==null&&pS(s)),i):(i.eventSystemFlags|=l,s=i.targetContainers,d!==null&&s.indexOf(d)===-1&&s.push(d),i)}function dk(i,s,o,l,d){switch(s){case"focusin":return wr=Ha(wr,i,s,o,l,d),!0;case"dragenter":return xr=Ha(xr,i,s,o,l,d),!0;case"mouseover":return Tr=Ha(Tr,i,s,o,l,d),!0;case"pointerover":var p=d.pointerId;return Pa.set(p,Ha(Pa.get(p)||null,i,s,o,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Ia.set(p,Ha(Ia.get(p)||null,i,s,o,l,d)),!0}return!1}function bS(i){var s=Ds(i.target);if(s!==null){var o=u(s);if(o!==null){if(s=o.tag,s===13){if(s=c(o),s!==null){i.blockedOn=s,Dg(i.priority,function(){mS(o)});return}}else if(s===31){if(s=f(o),s!==null){i.blockedOn=s,Dg(i.priority,function(){mS(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function ec(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=Hh(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);Ff=l,o.target.dispatchEvent(l),Ff=null}else return s=Ns(o),s!==null&&pS(s),i.blockedOn=o,!1;s.shift()}return!0}function vS(i,s,o){ec(i)&&o.delete(s)}function hk(){Gh=!1,wr!==null&&ec(wr)&&(wr=null),xr!==null&&ec(xr)&&(xr=null),Tr!==null&&ec(Tr)&&(Tr=null),Pa.forEach(vS),Ia.forEach(vS)}function tc(i,s){i.blockedOn===s&&(i.blockedOn=null,Gh||(Gh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,hk)))}var nc=null;function SS(i){nc!==i&&(nc=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){nc===i&&(nc=null);for(var s=0;s<i.length;s+=3){var o=i[s],l=i[s+1],d=i[s+2];if(typeof l!="function"){if(Fh(l||o)===null)continue;break}var p=Ns(o);p!==null&&(i.splice(s,3),s-=3,Hd(p,{pending:!0,data:d,method:o.method,action:l},l,d))}}))}function mo(i){function s(A){return tc(A,i)}wr!==null&&tc(wr,i),xr!==null&&tc(xr,i),Tr!==null&&tc(Tr,i),Pa.forEach(s),Ia.forEach(s);for(var o=0;o<Ar.length;o++){var l=Ar[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<Ar.length&&(o=Ar[0],o.blockedOn===null);)bS(o),o.blockedOn===null&&Ar.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var d=o[l],p=o[l+1],b=d[tn]||null;if(typeof p=="function")b||SS(o);else if(b){var w=null;if(p&&p.hasAttribute("formAction")){if(d=p,b=p[tn]||null)w=b.formAction;else if(Fh(d)!==null)continue}else w=b.action;typeof w=="function"?o[l+1]=w:(o.splice(l,3),l-=3),SS(o)}}}function wS(){function i(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(b){return d=b})},focusReset:"manual",scroll:"manual"})}function s(){d!==null&&(d(),d=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),d!==null&&(d(),d=null)}}}function Yh(i){this._internalRoot=i}ic.prototype.render=Yh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,l=Sn();dS(o,l,i,s,null,null)},ic.prototype.unmount=Yh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;dS(i.current,2,null,i,null,null),zu(),s[Ms]=null}};function ic(i){this._internalRoot=i}ic.prototype.unstable_scheduleHydration=function(i){if(i){var s=Mg();i={blockedOn:null,target:i,priority:s};for(var o=0;o<Ar.length&&s!==0&&s<Ar[o].priority;o++);Ar.splice(o,0,i),o===0&&bS(i)}};var xS=e.version;if(xS!=="19.2.0")throw Error(r(527,xS,"19.2.0"));U.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=m(s),i=i!==null?y(i):null,i=i===null?null:i.stateNode,i};var pk={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{ea=rc.inject(pk),dn=rc}catch{}}return Ga.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,l="",d=Cv,p=kv,b=Mv;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(b=s.onRecoverableError)),s=cS(i,1,!1,null,null,o,l,null,d,p,b,wS),i[Ms]=s.current,Ch(i),new Yh(s)},Ga.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var l=!1,d="",p=Cv,b=kv,w=Mv,A=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(b=o.onCaughtError),o.onRecoverableError!==void 0&&(w=o.onRecoverableError),o.formState!==void 0&&(A=o.formState)),s=cS(i,1,!0,s,o??null,l,d,A,p,b,w,wS),s.context=fS(null),o=s.current,l=Sn(),l=Lf(l),d=ur(l),d.callback=null,cr(o,d,l),o=l,s.current.lanes=o,na(s,o),li(s),i[Ms]=s.current,Ch(i),new ic(s)},Ga.version="19.2.0",Ga}var KS;function zM(){if(KS)return Wh.exports;KS=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(),Wh.exports=BM(),Wh.exports}var LM=zM();function df(){return typeof window<"u"}function Ir(t){return bT(t)?(t.nodeName||"").toLowerCase():"#document"}function xn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function bi(t){var e;return(e=(bT(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function bT(t){return df()?t instanceof Node||t instanceof xn(t).Node:!1}function gt(t){return df()?t instanceof Element||t instanceof xn(t).Element:!1}function Dt(t){return df()?t instanceof HTMLElement||t instanceof xn(t).HTMLElement:!1}function Yp(t){return!df()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xn(t).ShadowRoot}const VM=new Set(["inline","contents"]);function Ol(t){const{overflow:e,overflowX:n,overflowY:r,display:a}=In(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!VM.has(a)}const UM=new Set(["table","td","th"]);function KM(t){return UM.has(Ir(t))}const qM=[":popover-open",":modal"];function hf(t){return qM.some(e=>{try{return t.matches(e)}catch{return!1}})}const PM=["transform","translate","scale","rotate","perspective"],IM=["transform","translate","scale","rotate","perspective","filter"],HM=["paint","layout","strict","content"];function my(t){const e=pf(),n=gt(t)?In(t):t;return PM.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)||IM.some(r=>(n.willChange||"").includes(r))||HM.some(r=>(n.contain||"").includes(r))}function FM(t){let e=Fi(t);for(;Dt(e)&&!Ii(e);){if(my(e))return e;if(hf(e))return null;e=Fi(e)}return null}function pf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const GM=new Set(["html","body","#document"]);function Ii(t){return GM.has(Ir(t))}function In(t){return xn(t).getComputedStyle(t)}function mf(t){return gt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fi(t){if(Ir(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Yp(t)&&t.host||bi(t);return Yp(e)?e.host:e}function vT(t){const e=Fi(t);return Ii(e)?t.ownerDocument?t.ownerDocument.body:t.body:Dt(e)&&Ol(e)?e:vT(e)}function $r(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=vT(t),u=a===((r=t.ownerDocument)==null?void 0:r.body),c=xn(a);if(u){const f=Jp(c);return e.concat(c,c.visualViewport||[],Ol(a)?a:[],f&&n?$r(f):[])}return e.concat(a,$r(a,[],n))}function Jp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const zc=Math.min,vs=Math.max,Lc=Math.round,oc=Math.floor,hi=t=>({x:t,y:t}),YM={left:"right",right:"left",bottom:"top",top:"bottom"},JM={start:"end",end:"start"};function qS(t,e,n){return vs(t,zc(e,n))}function yf(t,e){return typeof t=="function"?t(e):t}function Ts(t){return t.split("-")[0]}function gf(t){return t.split("-")[1]}function ST(t){return t==="x"?"y":"x"}function wT(t){return t==="y"?"height":"width"}const XM=new Set(["top","bottom"]);function Mr(t){return XM.has(Ts(t))?"y":"x"}function xT(t){return ST(Mr(t))}function ZM(t,e,n){n===void 0&&(n=!1);const r=gf(t),a=xT(t),u=wT(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[u]>e.floating[u]&&(c=Vc(c)),[c,Vc(c)]}function QM(t){const e=Vc(t);return[Xp(t),e,Xp(e)]}function Xp(t){return t.replace(/start|end/g,e=>JM[e])}const PS=["left","right"],IS=["right","left"],WM=["top","bottom"],eD=["bottom","top"];function tD(t,e,n){switch(t){case"top":case"bottom":return n?e?IS:PS:e?PS:IS;case"left":case"right":return e?WM:eD;default:return[]}}function nD(t,e,n,r){const a=gf(t);let u=tD(Ts(t),n==="start",r);return a&&(u=u.map(c=>c+"-"+a),e&&(u=u.concat(u.map(Xp)))),u}function Vc(t){return t.replace(/left|right|bottom|top/g,e=>YM[e])}function iD(t){return{top:0,right:0,bottom:0,left:0,...t}}function rD(t){return typeof t!="number"?iD(t):{top:t,right:t,bottom:t,left:t}}function Uc(t){const{x:e,y:n,width:r,height:a}=t;return{width:r,height:a,top:n,left:e,right:e+r,bottom:n+a,x:e,y:n}}var sD=["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])"],Kc=sD.join(","),TT=typeof Element>"u",zo=TT?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qc=!TT&&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},pl=function(e,n){var r;n===void 0&&(n=!0);var a=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),u=a===""||a==="true",c=u||n&&e&&pl(e.parentNode);return c},oD=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},AT=function(e,n,r){if(pl(e))return[];var a=Array.prototype.slice.apply(e.querySelectorAll(Kc));return n&&zo.call(e,Kc)&&a.unshift(e),a=a.filter(r),a},Pc=function(e,n,r){for(var a=[],u=Array.from(e);u.length;){var c=u.shift();if(!pl(c,!1))if(c.tagName==="SLOT"){var f=c.assignedElements(),h=f.length?f:c.children,m=Pc(h,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:c,candidates:m})}else{var y=zo.call(c,Kc);y&&r.filter(c)&&(n||!e.includes(c))&&a.push(c);var g=c.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(c),v=!pl(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(g&&v){var S=Pc(g===!0?c.children:g.children,!0,r);r.flatten?a.push.apply(a,S):a.push({scopeParent:c,candidates:S})}else u.unshift.apply(u,c.children)}}return a},ET=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},OT=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||oD(e))&&!ET(e)?0:e.tabIndex},aD=function(e,n){var r=OT(e);return r<0&&n&&!ET(e)?0:r},lD=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},_T=function(e){return e.tagName==="INPUT"},uD=function(e){return _T(e)&&e.type==="hidden"},cD=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},fD=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},dD=function(e){if(!e.name)return!0;var n=e.form||qc(e),r=function(f){return n.querySelectorAll('input[type="radio"][name="'+f+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(e.name));else try{a=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 u=fD(a,e.form);return!u||u===e},hD=function(e){return _T(e)&&e.type==="radio"},pD=function(e){return hD(e)&&!dD(e)},mD=function(e){var n,r=e&&qc(e),a=(n=r)===null||n===void 0?void 0:n.host,u=!1;if(r&&r!==e){var c,f,h;for(u=!!((c=a)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(a)||e!=null&&(h=e.ownerDocument)!==null&&h!==void 0&&h.contains(e));!u&&a;){var m,y,g;r=qc(a),a=(m=r)===null||m===void 0?void 0:m.host,u=!!((y=a)!==null&&y!==void 0&&(g=y.ownerDocument)!==null&&g!==void 0&&g.contains(a))}}return u},HS=function(e){var n=e.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},yD=function(e,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var u=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!u}if(getComputedStyle(e).visibility==="hidden")return!0;var c=zo.call(e,"details>summary:first-of-type"),f=c?e.parentElement:e;if(zo.call(f,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var h=e;e;){var m=e.parentElement,y=qc(e);if(m&&!m.shadowRoot&&a(m)===!0)return HS(e);e.assignedSlot?e=e.assignedSlot:!m&&y!==e.ownerDocument?e=y.host:e=m}e=h}if(mD(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return HS(e);return!1},gD=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 a=n.children.item(r);if(a.tagName==="LEGEND")return zo.call(n,"fieldset[disabled] *")?!0:!a.contains(e)}return!0}n=n.parentElement}return!1},Zp=function(e,n){return!(n.disabled||pl(n)||uD(n)||yD(n,e)||cD(n)||gD(n))},Qp=function(e,n){return!(pD(n)||OT(n)<0||!Zp(e,n))},bD=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},RT=function(e){var n=[],r=[];return e.forEach(function(a,u){var c=!!a.scopeParent,f=c?a.scopeParent:a,h=aD(f,c),m=c?RT(a.candidates):f;h===0?c?n.push.apply(n,m):n.push(f):r.push({documentOrder:u,tabIndex:h,item:a,isScope:c,content:m})}),r.sort(lD).reduce(function(a,u){return u.isScope?a.push.apply(a,u.content):a.push(u.content),a},[]).concat(n)},yy=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Pc([e],n.includeContainer,{filter:Qp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:bD}):r=AT(e,n.includeContainer,Qp.bind(null,n)),RT(r)},vD=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Pc([e],n.includeContainer,{filter:Zp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=AT(e,n.includeContainer,Zp.bind(null,n)),r},CT=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return zo.call(e,Kc)===!1?!1:Qp(n,e)};function SD(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function kT(){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 wD(){return/apple/i.test(navigator.vendor)}function Wp(){const t=/android/i;return t.test(SD())||t.test(kT())}function xD(){return kT().includes("jsdom/")}const FS="data-floating-ui-focusable",TD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function So(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 wn(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Yp(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Cr(t){return"composedPath"in t?t.composedPath()[0]:t.target}function ip(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 AD(t){return t.matches("html,body")}function ei(t){return t?.ownerDocument||document}function MT(t){return Dt(t)&&t.matches(TD)}function GS(t){return t?t.getAttribute("role")==="combobox"&&MT(t):!1}function em(t){return t?t.hasAttribute(FS)?t:t.querySelector("["+FS+"]")||t:null}function Ro(t,e,n){return n===void 0&&(n=!0),t.filter(a=>{var u;return a.parentId===e&&(!n||((u=a.context)==null?void 0:u.open))}).flatMap(a=>[a,...Ro(t,a.id,n)])}function YS(t,e){var n;let r=[],a=(n=t.find(u=>u.id===e))==null?void 0:n.parentId;for(;a;){const u=t.find(c=>c.id===a);a=u?.parentId,u&&(r=r.concat(u))}return r}function rp(t){t.preventDefault(),t.stopPropagation()}function ED(t){return"nativeEvent"in t}function OD(t){return t.mozInputSource===0&&t.isTrusted?!0:Wp()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function _D(t){return xD()?!1:!Wp()&&t.width===0&&t.height===0||Wp()&&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 JS(t,e){return["mouse","pen"].includes(t)}var RD=typeof document<"u",CD=function(){},Pi=RD?$.useLayoutEffect:CD;const kD={...hT};function sp(t){const e=$.useRef(t);return Pi(()=>{e.current=t}),e}const MD=kD.useInsertionEffect,DD=MD||(t=>t());function fi(t){const e=$.useRef(()=>{});return DD(()=>{e.current=t}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.current==null?void 0:e.current(...r)},[])}const bf=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function DT(t,e){const n=yy(t,bf()),r=n.length;if(r===0)return;const a=So(ei(t)),u=n.indexOf(a),c=u===-1?e===1?0:r-1:u+e;return n[c]}function ND(t){return DT(ei(t).body,1)||t}function $D(t){return DT(ei(t).body,-1)||t}function XS(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!wn(n,r)}var jD=gT();function ZS(t,e,n){let{reference:r,floating:a}=t;const u=Mr(e),c=xT(e),f=wT(c),h=Ts(e),m=u==="y",y=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[f]/2-a[f]/2;let S;switch(h){case"top":S={x:y,y:r.y-a.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-a.width,y:g};break;default:S={x:r.x,y:r.y}}switch(gf(e)){case"start":S[c]-=v*(n&&m?-1:1);break;case"end":S[c]+=v*(n&&m?-1:1);break}return S}const BD=async(t,e,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:u=[],platform:c}=n,f=u.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(e));let m=await c.getElementRects({reference:t,floating:e,strategy:a}),{x:y,y:g}=ZS(m,r,h),v=r,S={},x=0;for(let T=0;T<f.length;T++){const{name:M,fn:C}=f[T],{x:_,y:R,data:G,reset:I}=await C({x:y,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:S,rects:m,platform:c,elements:{reference:t,floating:e}});y=_??y,g=R??g,S={...S,[M]:{...S[M],...G}},I&&x<=50&&(x++,typeof I=="object"&&(I.placement&&(v=I.placement),I.rects&&(m=I.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:a}):I.rects),{x:y,y:g}=ZS(m,v,h)),T=-1)}return{x:y,y:g,placement:v,strategy:a,middlewareData:S}};async function NT(t,e){var n;e===void 0&&(e={});const{x:r,y:a,platform:u,rects:c,elements:f,strategy:h}=t,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=yf(e,t),x=rD(S),M=f[v?g==="floating"?"reference":"floating":g],C=Uc(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(M)))==null||n?M:M.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:m,rootBoundary:y,strategy:h})),_=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),G=await(u.isElement==null?void 0:u.isElement(R))?await(u.getScale==null?void 0:u.getScale(R))||{x:1,y:1}:{x:1,y:1},I=Uc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:_,offsetParent:R,strategy:h}):_);return{top:(C.top-I.top+x.top)/G.y,bottom:(I.bottom-C.bottom+x.bottom)/G.y,left:(C.left-I.left+x.left)/G.x,right:(I.right-C.right+x.right)/G.x}}const zD=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:a,middlewareData:u,rects:c,initialPlacement:f,platform:h,elements:m}=e,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:T=!0,...M}=yf(t,e);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const C=Ts(a),_=Mr(f),R=Ts(f)===f,G=await(h.isRTL==null?void 0:h.isRTL(m.floating)),I=v||(R||!T?[Vc(f)]:QM(f)),ee=x!=="none";!v&&ee&&I.push(...nD(f,T,x,G));const J=[f,...I],X=await NT(e,M),he=[];let pe=((r=u.flip)==null?void 0:r.overflows)||[];if(y&&he.push(X[C]),g){const Z=ZM(a,c,G);he.push(X[Z[0]],X[Z[1]])}if(pe=[...pe,{placement:a,overflows:he}],!he.every(Z=>Z<=0)){var we,je;const Z=(((we=u.flip)==null?void 0:we.index)||0)+1,ne=J[Z];if(ne&&(!(g==="alignment"?_!==Mr(ne):!1)||pe.every(L=>Mr(L.placement)===_?L.overflows[0]>0:!0)))return{data:{index:Z,overflows:pe},reset:{placement:ne}};let j=(je=pe.filter(U=>U.overflows[0]<=0).sort((U,L)=>U.overflows[1]-L.overflows[1])[0])==null?void 0:je.placement;if(!j)switch(S){case"bestFit":{var ve;const U=(ve=pe.filter(L=>{if(ee){const te=Mr(L.placement);return te===_||te==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(te=>te>0).reduce((te,oe)=>te+oe,0)]).sort((L,te)=>L[1]-te[1])[0])==null?void 0:ve[0];U&&(j=U);break}case"initialPlacement":j=f;break}if(a!==j)return{reset:{placement:j}}}return{}}}},LD=new Set(["left","top"]);async function VD(t,e){const{placement:n,platform:r,elements:a}=t,u=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Ts(n),f=gf(n),h=Mr(n)==="y",m=LD.has(c)?-1:1,y=u&&h?-1:1,g=yf(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 f&&typeof x=="number"&&(S=f==="end"?x*-1:x),h?{x:S*y,y:v*m}:{x:v*m,y:S*y}}const UD=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:a,y:u,placement:c,middlewareData:f}=e,h=await VD(e,t);return c===((n=f.offset)==null?void 0:n.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:a+h.x,y:u+h.y,data:{...h,placement:c}}}}},KD=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:a}=e,{mainAxis:u=!0,crossAxis:c=!1,limiter:f={fn:M=>{let{x:C,y:_}=M;return{x:C,y:_}}},...h}=yf(t,e),m={x:n,y:r},y=await NT(e,h),g=Mr(Ts(a)),v=ST(g);let S=m[v],x=m[g];if(u){const M=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=S+y[M],R=S-y[C];S=qS(_,S,R)}if(c){const M=g==="y"?"top":"left",C=g==="y"?"bottom":"right",_=x+y[M],R=x-y[C];x=qS(_,x,R)}const T=f.fn({...e,[v]:S,[g]:x});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[v]:u,[g]:c}}}}}};function $T(t){const e=In(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const a=Dt(t),u=a?t.offsetWidth:n,c=a?t.offsetHeight:r,f=Lc(n)!==u||Lc(r)!==c;return f&&(n=u,r=c),{width:n,height:r,$:f}}function gy(t){return gt(t)?t:t.contextElement}function Co(t){const e=gy(t);if(!Dt(e))return hi(1);const n=e.getBoundingClientRect(),{width:r,height:a,$:u}=$T(e);let c=(u?Lc(n.width):n.width)/r,f=(u?Lc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const qD=hi(0);function jT(t){const e=xn(t);return!pf()||!e.visualViewport?qD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function PD(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xn(t)?!1:e}function As(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect(),u=gy(t);let c=hi(1);e&&(r?gt(r)&&(c=Co(r)):c=Co(t));const f=PD(u,n,r)?jT(u):hi(0);let h=(a.left+f.x)/c.x,m=(a.top+f.y)/c.y,y=a.width/c.x,g=a.height/c.y;if(u){const v=xn(u),S=r&>(r)?xn(r):r;let x=v,T=Jp(x);for(;T&&r&&S!==x;){const M=Co(T),C=T.getBoundingClientRect(),_=In(T),R=C.left+(T.clientLeft+parseFloat(_.paddingLeft))*M.x,G=C.top+(T.clientTop+parseFloat(_.paddingTop))*M.y;h*=M.x,m*=M.y,y*=M.x,g*=M.y,h+=R,m+=G,x=xn(T),T=Jp(x)}}return Uc({width:y,height:g,x:h,y:m})}function vf(t,e){const n=mf(t).scrollLeft;return e?e.left+n:As(bi(t)).left+n}function BT(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-vf(t,n),a=n.top+e.scrollTop;return{x:r,y:a}}function ID(t){let{elements:e,rect:n,offsetParent:r,strategy:a}=t;const u=a==="fixed",c=bi(r),f=e?hf(e.floating):!1;if(r===c||f&&u)return n;let h={scrollLeft:0,scrollTop:0},m=hi(1);const y=hi(0),g=Dt(r);if((g||!g&&!u)&&((Ir(r)!=="body"||Ol(c))&&(h=mf(r)),Dt(r))){const S=As(r);m=Co(r),y.x=S.x+r.clientLeft,y.y=S.y+r.clientTop}const v=c&&!g&&!u?BT(c,h):hi(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-h.scrollLeft*m.x+y.x+v.x,y:n.y*m.y-h.scrollTop*m.y+y.y+v.y}}function HD(t){return Array.from(t.getClientRects())}function FD(t){const e=bi(t),n=mf(t),r=t.ownerDocument.body,a=vs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),u=vs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+vf(t);const f=-n.scrollTop;return In(r).direction==="rtl"&&(c+=vs(e.clientWidth,r.clientWidth)-a),{width:a,height:u,x:c,y:f}}const QS=25;function GD(t,e){const n=xn(t),r=bi(t),a=n.visualViewport;let u=r.clientWidth,c=r.clientHeight,f=0,h=0;if(a){u=a.width,c=a.height;const y=pf();(!y||y&&e==="fixed")&&(f=a.offsetLeft,h=a.offsetTop)}const m=vf(r);if(m<=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<=QS&&(u-=x)}else m<=QS&&(u+=m);return{width:u,height:c,x:f,y:h}}const YD=new Set(["absolute","fixed"]);function JD(t,e){const n=As(t,!0,e==="fixed"),r=n.top+t.clientTop,a=n.left+t.clientLeft,u=Dt(t)?Co(t):hi(1),c=t.clientWidth*u.x,f=t.clientHeight*u.y,h=a*u.x,m=r*u.y;return{width:c,height:f,x:h,y:m}}function WS(t,e,n){let r;if(e==="viewport")r=GD(t,n);else if(e==="document")r=FD(bi(t));else if(gt(e))r=JD(e,n);else{const a=jT(t);r={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Uc(r)}function zT(t,e){const n=Fi(t);return n===e||!gt(n)||Ii(n)?!1:In(n).position==="fixed"||zT(n,e)}function XD(t,e){const n=e.get(t);if(n)return n;let r=$r(t,[],!1).filter(f=>gt(f)&&Ir(f)!=="body"),a=null;const u=In(t).position==="fixed";let c=u?Fi(t):t;for(;gt(c)&&!Ii(c);){const f=In(c),h=my(c);!h&&f.position==="fixed"&&(a=null),(u?!h&&!a:!h&&f.position==="static"&&!!a&&YD.has(a.position)||Ol(c)&&!h&&zT(t,c))?r=r.filter(y=>y!==c):a=f,c=Fi(c)}return e.set(t,r),r}function ZD(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const c=[...n==="clippingAncestors"?hf(e)?[]:XD(e,this._c):[].concat(n),r],f=c[0],h=c.reduce((m,y)=>{const g=WS(e,y,a);return m.top=vs(g.top,m.top),m.right=zc(g.right,m.right),m.bottom=zc(g.bottom,m.bottom),m.left=vs(g.left,m.left),m},WS(e,f,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function QD(t){const{width:e,height:n}=$T(t);return{width:e,height:n}}function WD(t,e,n){const r=Dt(e),a=bi(e),u=n==="fixed",c=As(t,!0,u,e);let f={scrollLeft:0,scrollTop:0};const h=hi(0);function m(){h.x=vf(a)}if(r||!r&&!u)if((Ir(e)!=="body"||Ol(a))&&(f=mf(e)),r){const S=As(e,!0,u,e);h.x=S.x+e.clientLeft,h.y=S.y+e.clientTop}else a&&m();u&&!r&&a&&m();const y=a&&!r&&!u?BT(a,f):hi(0),g=c.left+f.scrollLeft-h.x-y.x,v=c.top+f.scrollTop-h.y-y.y;return{x:g,y:v,width:c.width,height:c.height}}function op(t){return In(t).position==="static"}function ew(t,e){if(!Dt(t)||In(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return bi(t)===n&&(n=n.ownerDocument.body),n}function LT(t,e){const n=xn(t);if(hf(t))return n;if(!Dt(t)){let a=Fi(t);for(;a&&!Ii(a);){if(gt(a)&&!op(a))return a;a=Fi(a)}return n}let r=ew(t,e);for(;r&&KM(r)&&op(r);)r=ew(r,e);return r&&Ii(r)&&op(r)&&!my(r)?n:r||FM(t)||n}const e2=async function(t){const e=this.getOffsetParent||LT,n=this.getDimensions,r=await n(t.floating);return{reference:WD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function t2(t){return In(t).direction==="rtl"}const n2={convertOffsetParentRelativeRectToViewportRelativeRect:ID,getDocumentElement:bi,getClippingRect:ZD,getOffsetParent:LT,getElementRects:e2,getClientRects:HD,getDimensions:QD,getScale:Co,isElement:gt,isRTL:t2};function VT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function i2(t,e){let n=null,r;const a=bi(t);function u(){var f;clearTimeout(r),(f=n)==null||f.disconnect(),n=null}function c(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),u();const m=t.getBoundingClientRect(),{left:y,top:g,width:v,height:S}=m;if(f||e(),!v||!S)return;const x=oc(g),T=oc(a.clientWidth-(y+v)),M=oc(a.clientHeight-(g+S)),C=oc(y),R={rootMargin:-x+"px "+-T+"px "+-M+"px "+-C+"px",threshold:vs(0,zc(1,h))||1};let G=!0;function I(ee){const J=ee[0].intersectionRatio;if(J!==h){if(!G)return c();J?c(!1,J):r=setTimeout(()=>{c(!1,1e-7)},1e3)}J===1&&!VT(m,t.getBoundingClientRect())&&c(),G=!1}try{n=new IntersectionObserver(I,{...R,root:a.ownerDocument})}catch{n=new IntersectionObserver(I,R)}n.observe(t)}return c(!0),u}function r2(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:u=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,m=gy(t),y=a||u?[...m?$r(m):[],...$r(e)]:[];y.forEach(C=>{a&&C.addEventListener("scroll",n,{passive:!0}),u&&C.addEventListener("resize",n)});const g=m&&f?i2(m,n):null;let v=-1,S=null;c&&(S=new ResizeObserver(C=>{let[_]=C;_&&_.target===m&&S&&(S.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var R;(R=S)==null||R.observe(e)})),n()}),m&&!h&&S.observe(m),S.observe(e));let x,T=h?As(t):null;h&&M();function M(){const C=As(t);T&&!VT(T,C)&&n(),T=C,x=requestAnimationFrame(M)}return n(),()=>{var C;y.forEach(_=>{a&&_.removeEventListener("scroll",n),u&&_.removeEventListener("resize",n)}),g?.(),(C=S)==null||C.disconnect(),S=null,h&&cancelAnimationFrame(x)}}const s2=UD,o2=KD,a2=zD,l2=(t,e,n)=>{const r=new Map,a={platform:n2,...n},u={...a.platform,_c:r};return BD(t,e,{...a,platform:u})};var u2=typeof document<"u",c2=function(){},xc=u2?$.useLayoutEffect:c2;function Ic(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,a;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(!Ic(t[r],e[r]))return!1;return!0}if(a=Object.keys(t),n=a.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,a[r]))return!1;for(r=n;r--!==0;){const u=a[r];if(!(u==="_owner"&&t.$$typeof)&&!Ic(t[u],e[u]))return!1}return!0}return t!==t&&e!==e}function UT(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function tw(t,e){const n=UT(t);return Math.round(e*n)/n}function ap(t){const e=$.useRef(t);return xc(()=>{e.current=t}),e}function f2(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:u,floating:c}={},transform:f=!0,whileElementsMounted:h,open:m}=t,[y,g]=$.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,S]=$.useState(r);Ic(v,r)||S(r);const[x,T]=$.useState(null),[M,C]=$.useState(null),_=$.useCallback(L=>{L!==ee.current&&(ee.current=L,T(L))},[]),R=$.useCallback(L=>{L!==J.current&&(J.current=L,C(L))},[]),G=u||x,I=c||M,ee=$.useRef(null),J=$.useRef(null),X=$.useRef(y),he=h!=null,pe=ap(h),we=ap(a),je=ap(m),ve=$.useCallback(()=>{if(!ee.current||!J.current)return;const L={placement:e,strategy:n,middleware:v};we.current&&(L.platform=we.current),l2(ee.current,J.current,L).then(te=>{const oe={...te,isPositioned:je.current!==!1};Z.current&&!Ic(X.current,oe)&&(X.current=oe,jD.flushSync(()=>{g(oe)}))})},[v,e,n,we,je]);xc(()=>{m===!1&&X.current.isPositioned&&(X.current.isPositioned=!1,g(L=>({...L,isPositioned:!1})))},[m]);const Z=$.useRef(!1);xc(()=>(Z.current=!0,()=>{Z.current=!1}),[]),xc(()=>{if(G&&(ee.current=G),I&&(J.current=I),G&&I){if(pe.current)return pe.current(G,I,ve);ve()}},[G,I,ve,pe,he]);const ne=$.useMemo(()=>({reference:ee,floating:J,setReference:_,setFloating:R}),[_,R]),j=$.useMemo(()=>({reference:G,floating:I}),[G,I]),U=$.useMemo(()=>{const L={position:n,left:0,top:0};if(!j.floating)return L;const te=tw(j.floating,y.x),oe=tw(j.floating,y.y);return f?{...L,transform:"translate("+te+"px, "+oe+"px)",...UT(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:oe}},[n,f,j.floating,y.x,y.y]);return $.useMemo(()=>({...y,update:ve,refs:ne,elements:j,floatingStyles:U}),[y,ve,ne,j,U])}const d2=(t,e)=>({...s2(t),options:[t,e]}),h2=(t,e)=>({...o2(t),options:[t,e]}),p2=(t,e)=>({...a2(t),options:[t,e]}),m2="data-floating-ui-focusable",nw="active",iw="selected",y2={...hT};let rw=!1,g2=0;const sw=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+g2++;function b2(){const[t,e]=$.useState(()=>rw?sw():void 0);return Pi(()=>{t==null&&e(sw())},[]),$.useEffect(()=>{rw=!0},[]),t}const v2=y2.useId,KT=v2||b2;function S2(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(a=>a(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 w2=$.createContext(null),x2=$.createContext(null),qT=()=>{var t;return((t=$.useContext(w2))==null?void 0:t.id)||null},by=()=>$.useContext(x2);function Hc(t){return"data-floating-ui-"+t}function T2(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}let ow=0;function yo(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=e;r&&cancelAnimationFrame(ow);const u=()=>t?.focus({preventScroll:n});a?u():ow=requestAnimationFrame(u)}function A2(t){return t?.ownerDocument||document}const ko={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function aw(t){return t==="inert"?ko.inert:t==="aria-hidden"?ko["aria-hidden"]:ko.none}let ac=new WeakSet,lc={},lp=0;const E2=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,PT=t=>t&&(t.host||PT(t.parentNode)),O2=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=PT(n);return t.contains(r)?r:null}).filter(n=>n!=null);function _2(t,e,n,r){const a="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,c=O2(e,t),f=new Set,h=new Set(c),m=[];lc[a]||(lc[a]=new WeakMap);const y=lc[a];c.forEach(g),v(e),f.clear();function g(S){!S||f.has(S)||(f.add(S),S.parentNode&&g(S.parentNode))}function v(S){!S||h.has(S)||[].forEach.call(S.children,x=>{if(Ir(x)!=="script")if(f.has(x))v(x);else{const T=u?x.getAttribute(u):null,M=T!==null&&T!=="false",C=aw(u),_=(C.get(x)||0)+1,R=(y.get(x)||0)+1;C.set(x,_),y.set(x,R),m.push(x),_===1&&M&&ac.add(x),R===1&&x.setAttribute(a,""),!M&&u&&x.setAttribute(u,u==="inert"?"":"true")}})}return lp++,()=>{m.forEach(S=>{const x=aw(u),M=(x.get(S)||0)-1,C=(y.get(S)||0)-1;x.set(S,M),y.set(S,C),M||(!ac.has(S)&&u&&S.removeAttribute(u),ac.delete(S)),C||S.removeAttribute(a)}),lp--,lp||(ko.inert=new WeakMap,ko["aria-hidden"]=new WeakMap,ko.none=new WeakMap,ac=new WeakSet,lc={})}}function lw(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=A2(t[0]).body;return _2(t.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,e,n)}const vy={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},uw=$.forwardRef(function(e,n){const[r,a]=$.useState();Pi(()=>{wD()&&a("button")},[]);const u={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Hc("focus-guard")]:"",style:vy};return F.jsx("span",{...e,...u})}),R2=$.createContext(null),C2=()=>$.useContext(R2);function cw(t){return $.useMemo(()=>e=>{t.forEach(n=>{n&&(n.current=e)})},t)}const k2=20;let Dr=[];function Sy(){Dr=Dr.filter(t=>t.isConnected)}function M2(t){Sy(),t&&Ir(t)!=="body"&&(Dr.push(t),Dr.length>k2&&(Dr=Dr.slice(-20)))}function fw(){return Sy(),Dr[Dr.length-1]}function D2(t){const e=bf();return CT(t,e)?t:yy(t,e)[0]||t}function dw(t,e){var n;if(!e.current.includes("floating")&&!((n=t.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=bf(),u=vD(t,r).filter(f=>{const h=f.getAttribute("data-tabindex")||"";return CT(f,r)||f.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=t.getAttribute("tabindex");e.current.includes("floating")||u.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 N2=$.forwardRef(function(e,n){return F.jsx("button",{...e,type:"button",ref:n,tabIndex:-1,style:vy})});function $2(t){const{context:e,children:n,disabled:r=!1,order:a=["content"],guards:u=!0,initialFocus:c=0,returnFocus:f=!0,restoreFocus:h=!1,modal:m=!0,visuallyHiddenDismiss:y=!1,closeOnFocusOut:g=!0,outsideElementsInert:v=!1,getInsideElements:S=()=>[]}=t,{open:x,onOpenChange:T,events:M,dataRef:C,elements:{domReference:_,floating:R}}=e,G=fi(()=>{var xe;return(xe=C.current.floatingContext)==null?void 0:xe.nodeId}),I=fi(S),ee=typeof c=="number"&&c<0,J=GS(_)&&ee,X=E2(),he=X?u:!0,pe=!he||X&&v,we=sp(a),je=sp(c),ve=sp(f),Z=by(),ne=C2(),j=$.useRef(null),U=$.useRef(null),L=$.useRef(!1),te=$.useRef(!1),oe=$.useRef(-1),E=$.useRef(-1),q=ne!=null,H=em(R),Q=fi(function(xe){return xe===void 0&&(xe=H),xe?yy(xe,bf()):[]}),re=fi(xe=>{const Me=Q(xe);return we.current.map(ge=>_&&ge==="reference"?_:H&&ge==="floating"?H:Me).filter(Boolean).flat()});$.useEffect(()=>{if(r||!m)return;function xe(ge){if(ge.key==="Tab"){wn(H,So(ei(H)))&&Q().length===0&&!J&&rp(ge);const Xe=re(),ht=Cr(ge);we.current[0]==="reference"&&ht===_&&(rp(ge),ge.shiftKey?yo(Xe[Xe.length-1]):yo(Xe[1])),we.current[1]==="floating"&&ht===H&&ge.shiftKey&&(rp(ge),yo(Xe[0]))}}const Me=ei(H);return Me.addEventListener("keydown",xe),()=>{Me.removeEventListener("keydown",xe)}},[r,_,H,m,we,J,Q,re]),$.useEffect(()=>{if(r||!R)return;function xe(Me){const ge=Cr(Me),ht=Q().indexOf(ge);ht!==-1&&(oe.current=ht)}return R.addEventListener("focusin",xe),()=>{R.removeEventListener("focusin",xe)}},[r,R,Q]),$.useEffect(()=>{if(r||!g)return;function xe(){te.current=!0,setTimeout(()=>{te.current=!1})}function Me(ht){const Le=ht.relatedTarget,En=ht.currentTarget,Gt=Cr(ht);queueMicrotask(()=>{const Vt=G(),Hn=!(wn(_,Le)||wn(R,Le)||wn(Le,R)||wn(ne?.portalNode,Le)||Le!=null&&Le.hasAttribute(Hc("focus-guard"))||Z&&(Ro(Z.nodesRef.current,Vt).find(ri=>{var Fn,st;return wn((Fn=ri.context)==null?void 0:Fn.elements.floating,Le)||wn((st=ri.context)==null?void 0:st.elements.domReference,Le)})||YS(Z.nodesRef.current,Vt).find(ri=>{var Fn,st,Kl;return[(Fn=ri.context)==null?void 0:Fn.elements.floating,em((st=ri.context)==null?void 0:st.elements.floating)].includes(Le)||((Kl=ri.context)==null?void 0:Kl.elements.domReference)===Le})));if(En===_&&H&&dw(H,we),h&&En!==_&&!(Gt!=null&&Gt.isConnected)&&So(ei(H))===ei(H).body){Dt(H)&&H.focus();const ri=oe.current,Fn=Q(),st=Fn[ri]||Fn[Fn.length-1]||H;Dt(st)&&st.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(J||!m)&&Le&&Hn&&!te.current&&Le!==fw()&&(L.current=!0,T(!1,ht,"focus-out"))})}const ge=!!(!Z&&ne);function Xe(){T2(E),C.current.insideReactTree=!0,E.current=window.setTimeout(()=>{C.current.insideReactTree=!1})}if(R&&Dt(_))return _.addEventListener("focusout",Me),_.addEventListener("pointerdown",xe),R.addEventListener("focusout",Me),ge&&R.addEventListener("focusout",Xe,!0),()=>{_.removeEventListener("focusout",Me),_.removeEventListener("pointerdown",xe),R.removeEventListener("focusout",Me),ge&&R.removeEventListener("focusout",Xe,!0)}},[r,_,R,H,m,Z,ne,T,g,h,Q,J,G,we,C]);const ce=$.useRef(null),Te=$.useRef(null),Ct=cw([ce,ne?.beforeInsideRef]),Je=cw([Te,ne?.afterInsideRef]);$.useEffect(()=>{var xe,Me;if(r||!R)return;const ge=Array.from((ne==null||(xe=ne.portalNode)==null?void 0:xe.querySelectorAll("["+Hc("portal")+"]"))||[]),ht=(Me=(Z?YS(Z.nodesRef.current,G()):[]).find(Gt=>{var Vt;return GS(((Vt=Gt.context)==null?void 0:Vt.elements.domReference)||null)}))==null||(Me=Me.context)==null?void 0:Me.elements.domReference,Le=[R,ht,...ge,...I(),j.current,U.current,ce.current,Te.current,ne?.beforeOutsideRef.current,ne?.afterOutsideRef.current,we.current.includes("reference")||J?_:null].filter(Gt=>Gt!=null),En=m||J?lw(Le,!pe,pe):lw(Le);return()=>{En()}},[r,_,R,m,we,ne,J,he,pe,Z,G,I]),Pi(()=>{if(r||!Dt(H))return;const xe=ei(H),Me=So(xe);queueMicrotask(()=>{const ge=re(H),Xe=je.current,ht=(typeof Xe=="number"?ge[Xe]:Xe.current)||H,Le=wn(H,Me);!ee&&!Le&&x&&yo(ht,{preventScroll:ht===H})})},[r,x,H,ee,re,je]),Pi(()=>{if(r||!H)return;const xe=ei(H),Me=So(xe);M2(Me);function ge(Le){let{reason:En,event:Gt,nested:Vt}=Le;if(["hover","safe-polygon"].includes(En)&&Gt.type==="mouseleave"&&(L.current=!0),En==="outside-press")if(Vt)L.current=!1;else if(OD(Gt)||_D(Gt))L.current=!1;else{let Hn=!1;document.createElement("div").focus({get preventScroll(){return Hn=!0,!1}}),Hn?L.current=!1:L.current=!0}}M.on("openchange",ge);const Xe=xe.createElement("span");Xe.setAttribute("tabindex","-1"),Xe.setAttribute("aria-hidden","true"),Object.assign(Xe.style,vy),q&&_&&_.insertAdjacentElement("afterend",Xe);function ht(){if(typeof ve.current=="boolean"){const Le=_||fw();return Le&&Le.isConnected?Le:Xe}return ve.current.current||Xe}return()=>{M.off("openchange",ge);const Le=So(xe),En=wn(R,Le)||Z&&Ro(Z.nodesRef.current,G(),!1).some(Vt=>{var Hn;return wn((Hn=Vt.context)==null?void 0:Hn.elements.floating,Le)}),Gt=ht();queueMicrotask(()=>{const Vt=D2(Gt);ve.current&&!L.current&&Dt(Vt)&&(!(Vt!==Le&&Le!==xe.body)||En)&&Vt.focus({preventScroll:!0}),Xe.remove()})}},[r,R,H,ve,C,M,Z,q,_,G]),$.useEffect(()=>(queueMicrotask(()=>{L.current=!1}),()=>{queueMicrotask(Sy)}),[r]),Pi(()=>{if(!r&&ne)return ne.setFocusManagerState({modal:m,closeOnFocusOut:g,open:x,onOpenChange:T,domReference:_}),()=>{ne.setFocusManagerState(null)}},[r,ne,m,x,T,g,_]),Pi(()=>{r||H&&dw(H,we)},[r,H,we]);function ii(xe){return r||!y||!m?null:F.jsx(N2,{ref:xe==="start"?j:U,onClick:Me=>T(!1,Me.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const xi=!r&&he&&(m?!J:!0)&&(q||m);return F.jsxs(F.Fragment,{children:[xi&&F.jsx(uw,{"data-type":"inside",ref:Ct,onFocus:xe=>{if(m){const ge=re();yo(a[0]==="reference"?ge[0]:ge[ge.length-1])}else if(ne!=null&&ne.preserveTabOrder&&ne.portalNode)if(L.current=!1,XS(xe,ne.portalNode)){const ge=ND(_);ge?.focus()}else{var Me;(Me=ne.beforeOutsideRef.current)==null||Me.focus()}}}),!J&&ii("start"),n,ii("end"),xi&&F.jsx(uw,{"data-type":"inside",ref:Je,onFocus:xe=>{if(m)yo(re()[0]);else if(ne!=null&&ne.preserveTabOrder&&ne.portalNode)if(g&&(L.current=!0),XS(xe,ne.portalNode)){const ge=$D(_);ge?.focus()}else{var Me;(Me=ne.afterOutsideRef.current)==null||Me.focus()}}})]})}function hw(t){return Dt(t.target)&&t.target.tagName==="BUTTON"}function j2(t){return Dt(t.target)&&t.target.tagName==="A"}function pw(t){return MT(t)}function B2(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:u}}=t,{enabled:c=!0,event:f="click",toggle:h=!0,ignoreMouse:m=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=e,v=$.useRef(),S=$.useRef(!1),x=$.useMemo(()=>({onPointerDown(T){v.current=T.pointerType},onMouseDown(T){const M=v.current;T.button===0&&f!=="click"&&(JS(M)&&m||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="mousedown")?r(!1,T.nativeEvent,"click"):(T.preventDefault(),r(!0,T.nativeEvent,"click"))))},onClick(T){const M=v.current;if(f==="mousedown"&&v.current){v.current=void 0;return}JS(M)&&m||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="click")?r(!1,T.nativeEvent,"click"):r(!0,T.nativeEvent,"click"))},onKeyDown(T){v.current=void 0,!(T.defaultPrevented||!y||hw(T))&&(T.key===" "&&!pw(u)&&(T.preventDefault(),S.current=!0),!j2(T)&&T.key==="Enter"&&r(!(n&&h),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!y||hw(T)||pw(u)||T.key===" "&&S.current&&(S.current=!1,r(!(n&&h),T.nativeEvent,"click"))}}),[a,u,f,m,y,r,n,g,h]);return $.useMemo(()=>c?{reference:x}:{},[c,x])}const z2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},L2={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},mw=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 V2(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:a,dataRef:u}=t,{enabled:c=!0,escapeKey:f=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:x}=e,T=by(),M=fi(typeof h=="function"?h:()=>!1),C=typeof h=="function"?M:h,_=$.useRef(!1),{escapeKey:R,outsidePress:G}=mw(S),{escapeKey:I,outsidePress:ee}=mw(x),J=$.useRef(!1),X=fi(Z=>{var ne;if(!n||!c||!f||Z.key!=="Escape"||J.current)return;const j=(ne=u.current.floatingContext)==null?void 0:ne.nodeId,U=T?Ro(T.nodesRef.current,j):[];if(!R&&(Z.stopPropagation(),U.length>0)){let L=!0;if(U.forEach(te=>{var oe;if((oe=te.context)!=null&&oe.open&&!te.context.dataRef.current.__escapeKeyBubbles){L=!1;return}}),!L)return}r(!1,ED(Z)?Z.nativeEvent:Z,"escape-key")}),he=fi(Z=>{var ne;const j=()=>{var U;X(Z),(U=Cr(Z))==null||U.removeEventListener("keydown",j)};(ne=Cr(Z))==null||ne.addEventListener("keydown",j)}),pe=fi(Z=>{var ne;const j=u.current.insideReactTree;u.current.insideReactTree=!1;const U=_.current;if(_.current=!1,m==="click"&&U||j||typeof C=="function"&&!C(Z))return;const L=Cr(Z),te="["+Hc("inert")+"]",oe=ei(a.floating).querySelectorAll(te);let E=gt(L)?L:null;for(;E&&!Ii(E);){const re=Fi(E);if(Ii(re)||!gt(re))break;E=re}if(oe.length&>(L)&&!AD(L)&&!wn(L,a.floating)&&Array.from(oe).every(re=>!wn(E,re)))return;if(Dt(L)&&ve){const re=Ii(L),ce=In(L),Te=/auto|scroll/,Ct=re||Te.test(ce.overflowX),Je=re||Te.test(ce.overflowY),ii=Ct&&L.clientWidth>0&&L.scrollWidth>L.clientWidth,xi=Je&&L.clientHeight>0&&L.scrollHeight>L.clientHeight,xe=ce.direction==="rtl",Me=xi&&(xe?Z.offsetX<=L.offsetWidth-L.clientWidth:Z.offsetX>L.clientWidth),ge=ii&&Z.offsetY>L.clientHeight;if(Me||ge)return}const q=(ne=u.current.floatingContext)==null?void 0:ne.nodeId,H=T&&Ro(T.nodesRef.current,q).some(re=>{var ce;return ip(Z,(ce=re.context)==null?void 0:ce.elements.floating)});if(ip(Z,a.floating)||ip(Z,a.domReference)||H)return;const Q=T?Ro(T.nodesRef.current,q):[];if(Q.length>0){let re=!0;if(Q.forEach(ce=>{var Te;if((Te=ce.context)!=null&&Te.open&&!ce.context.dataRef.current.__outsidePressBubbles){re=!1;return}}),!re)return}r(!1,Z,"outside-press")}),we=fi(Z=>{var ne;const j=()=>{var U;pe(Z),(U=Cr(Z))==null||U.removeEventListener(m,j)};(ne=Cr(Z))==null||ne.addEventListener(m,j)});$.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=R,u.current.__outsidePressBubbles=G;let Z=-1;function ne(oe){r(!1,oe,"ancestor-scroll")}function j(){window.clearTimeout(Z),J.current=!0}function U(){Z=window.setTimeout(()=>{J.current=!1},pf()?5:0)}const L=ei(a.floating);f&&(L.addEventListener("keydown",I?he:X,I),L.addEventListener("compositionstart",j),L.addEventListener("compositionend",U)),C&&L.addEventListener(m,ee?we:pe,ee);let te=[];return v&&(gt(a.domReference)&&(te=$r(a.domReference)),gt(a.floating)&&(te=te.concat($r(a.floating))),!gt(a.reference)&&a.reference&&a.reference.contextElement&&(te=te.concat($r(a.reference.contextElement)))),te=te.filter(oe=>{var E;return oe!==((E=L.defaultView)==null?void 0:E.visualViewport)}),te.forEach(oe=>{oe.addEventListener("scroll",ne,{passive:!0})}),()=>{f&&(L.removeEventListener("keydown",I?he:X,I),L.removeEventListener("compositionstart",j),L.removeEventListener("compositionend",U)),C&&L.removeEventListener(m,ee?we:pe,ee),te.forEach(oe=>{oe.removeEventListener("scroll",ne)}),window.clearTimeout(Z)}},[u,a,f,C,m,n,r,v,c,R,G,X,I,he,pe,ee,we]),$.useEffect(()=>{u.current.insideReactTree=!1},[u,C,m]);const je=$.useMemo(()=>({onKeyDown:X,...y&&{[z2[g]]:Z=>{r(!1,Z.nativeEvent,"reference-press")},...g!=="click"&&{onClick(Z){r(!1,Z.nativeEvent,"reference-press")}}}}),[X,r,y,g]),ve=$.useMemo(()=>({onKeyDown:X,onMouseDown(){_.current=!0},onMouseUp(){_.current=!0},[L2[m]]:()=>{u.current.insideReactTree=!0}}),[X,m,u]);return $.useMemo(()=>c?{reference:je,floating:ve}:{},[c,je,ve])}function U2(t){const{open:e=!1,onOpenChange:n,elements:r}=t,a=KT(),u=$.useRef({}),[c]=$.useState(()=>S2()),f=qT()!=null,[h,m]=$.useState(r.reference),y=fi((S,x,T)=>{u.current.openEvent=S?x:void 0,c.emit("openchange",{open:S,event:x,reason:T,nested:f}),n?.(S,x,T)}),g=$.useMemo(()=>({setPositionReference:m}),[]),v=$.useMemo(()=>({reference:h||r.reference||null,floating:r.floating||null,domReference:r.reference}),[h,r.reference,r.floating]);return $.useMemo(()=>({dataRef:u,open:e,onOpenChange:y,elements:v,events:c,floatingId:a,refs:g}),[e,y,v,c,a,g])}function K2(t){t===void 0&&(t={});const{nodeId:e}=t,n=U2({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,a=r.elements,[u,c]=$.useState(null),[f,h]=$.useState(null),y=a?.domReference||u,g=$.useRef(null),v=by();Pi(()=>{y&&(g.current=y)},[y]);const S=f2({...t,elements:{...a,...f&&{reference:f}}}),x=$.useCallback(R=>{const G=gt(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;h(G),S.refs.setReference(G)},[S.refs]),T=$.useCallback(R=>{(gt(R)||R===null)&&(g.current=R,c(R)),(gt(S.refs.reference.current)||S.refs.reference.current===null||R!==null&&!gt(R))&&S.refs.setReference(R)},[S.refs]),M=$.useMemo(()=>({...S.refs,setReference:T,setPositionReference:x,domReference:g}),[S.refs,T,x]),C=$.useMemo(()=>({...S.elements,domReference:y}),[S.elements,y]),_=$.useMemo(()=>({...S,...r,refs:M,elements:C,nodeId:e}),[S,M,C,e,r]);return Pi(()=>{r.dataRef.current.floatingContext=_;const R=v?.nodesRef.current.find(G=>G.id===e);R&&(R.context=_)}),$.useMemo(()=>({...S,context:_,refs:M,elements:C}),[S,M,C,_])}function up(t,e,n){const r=new Map,a=n==="item";let u=t;if(a&&t){const{[nw]:c,[iw]:f,...h}=t;u=h}return{...n==="floating"&&{tabIndex:-1,[m2]:""},...u,...e.map(c=>{const f=c?c[n]:null;return typeof f=="function"?t?f(t):null:f}).concat(t).reduce((c,f)=>(f&&Object.entries(f).forEach(h=>{let[m,y]=h;if(!(a&&[nw,iw].includes(m)))if(m.indexOf("on")===0){if(r.has(m)||r.set(m,[]),typeof y=="function"){var g;(g=r.get(m))==null||g.push(y),c[m]=function(){for(var v,S=arguments.length,x=new Array(S),T=0;T<S;T++)x[T]=arguments[T];return(v=r.get(m))==null?void 0:v.map(M=>M(...x)).find(M=>M!==void 0)}}}else c[m]=y}),c),{})}}function q2(t){t===void 0&&(t=[]);const e=t.map(f=>f?.reference),n=t.map(f=>f?.floating),r=t.map(f=>f?.item),a=$.useCallback(f=>up(f,t,"reference"),e),u=$.useCallback(f=>up(f,t,"floating"),n),c=$.useCallback(f=>up(f,t,"item"),r);return $.useMemo(()=>({getReferenceProps:a,getFloatingProps:u,getItemProps:c}),[a,u,c])}const P2=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function I2(t,e){var n,r;e===void 0&&(e={});const{open:a,elements:u,floatingId:c}=t,{enabled:f=!0,role:h="dialog"}=e,m=KT(),y=((n=u.domReference)==null?void 0:n.id)||m,g=$.useMemo(()=>{var _;return((_=em(u.floating))==null?void 0:_.id)||c},[u.floating,c]),v=(r=P2.get(h))!=null?r:h,x=qT()!=null,T=$.useMemo(()=>v==="tooltip"||h==="label"?{["aria-"+(h==="label"?"labelledby":"describedby")]:a?g:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":v==="alertdialog"?"dialog":v,"aria-controls":a?g:void 0,...v==="listbox"&&{role:"combobox"},...v==="menu"&&{id:y},...v==="menu"&&x&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,x,a,y,h]),M=$.useMemo(()=>{const _={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?_:{..._,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),C=$.useCallback(_=>{let{active:R,selected:G}=_;const I={role:"option",...R&&{id:g+"-fui-option"}};switch(h){case"select":case"combobox":return{...I,"aria-selected":G}}return{}},[g,h]);return $.useMemo(()=>f?{reference:T,floating:M,item:C}:{},[f,T,M,C])}const _l=t=>Array.isArray(t)?t:[t],H2=(t,e)=>{const n=[[],[]];for(const r of t)e(r)?n[0].push(r):n[1].push(r);return n},IT=Array,Rr=(t,e)=>t.includes(e),F2=(t,e=0)=>[...new Array(t)].map((n,r)=>r+e),Fe=(t,e,n)=>t===void 0?e===void 0?[]:Array.isArray(e)?e:[e]:(Array.isArray(e)?t.push(...e):t.push(e),t),ys=(t,e)=>e==null?t??[]:t==null?_l(e):t.concat(e),G2=(...t)=>t.reduce(ys,[]),Ss=(t,e,n)=>{if(t===void 0)return Array.isArray(e)?e:[e];const r=n?.isEqual??((a,u)=>a===u);for(const a of _l(e))t.some(u=>r(u,a))||t.push(a);return t},Y2=(t,e)=>t.reduce((n,r)=>{const a=r[e];return n[a]=Fe(n[a],r),n},{}),Lo=(t,e,n)=>t.length===e.length&&t.every(n?.isEqual?(r,a)=>n.isEqual(r,e[a]):(r,a)=>r===e[a]),Cs=(t,e)=>ti(t)===e,ti=t=>{const e=typeof t;return e==="object"?t===null?"null":"object":e==="function"?"object":e},Gi={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},J2={...Gi,function:"a function"};class X2 extends Error{}const Rt=t=>Vo(t,X2),Vo=(t,e=Error)=>{throw new e(t)};class Z2 extends Error{name="ParseError"}const Y=t=>Vo(t,Z2),HT=t=>` ${t}`,Q2="",Ge=(t,e)=>{const n={},r=Array.isArray(t);let a=!1;for(const[u,c]of Object.entries(t).entries()){const f=r?e(u,c[1]):e(...c,u);a||=typeof f[0]=="number";const h=Array.isArray(f[0])||f.length===0?f:[f];for(const[m,y]of h)typeof m=="object"?n[m.group]=Fe(n[m.group],y):n[m]=y}return a?Object.values(n):n},FT=Object.entries,vi=(t,e)=>t in e,wy=(t,e)=>e in t;class W2{constructor(e){Object.assign(this,e)}}const eN=class{};class GT extends eN{}const tN=(t,e)=>{const n={},r={};let a;for(a in t)a in e?n[a]=t[a]:r[a]=t[a];return[n,r]},YT=(t,e)=>tN(t,e)[1],Rl=t=>Object.keys(t).length===0,Fc=t=>[...Object.entries(t),...Object.getOwnPropertySymbols(t).map(e=>[e,t[e]])],nN=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),iN=t=>{const e=Object.keys(t).sort(),n={};for(let r=0;r<e.length;r++)n[e[r]]=t[e[r]];return n},ci=HT(`unset${Q2}`),rN=t=>Object.values(t).filter(e=>typeof e=="number"?!0:typeof t[e]!="number"),JT={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},XT=globalThis.File??Blob,ZT={ArrayBuffer,Blob,File:XT,FormData,Headers,Request,Response,URL},sN={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Uo={...JT,...ZT,...sN,String,Number,Boolean},xy=t=>{let e=Object.getPrototypeOf(t);for(;e?.constructor&&(!vi(e.constructor.name,Uo)||!(t instanceof Uo[e.constructor.name]));)e=Object.getPrototypeOf(e);const n=e?.constructor?.name;if(!(n===void 0||n==="Object"))return n},tm=t=>typeof t=="object"&&t!==null?xy(t)??"object":ti(t),Xt=Array.isArray,oN={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"},aN={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"},lN={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"},uN={...oN,...aN,...lN},Ty=t=>{const e=Object(t).name??null;return e&&vi(e,Uo)&&Uo[e]===t?e:null},yw=(t,e)=>{let n=t.prototype;for(;n!==null;){if(n===e.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},cN=t=>QT(t,new Map),QT=(t,e)=>{if(typeof t!="object"||t===null)return t;if(e?.has(t))return e.get(t);const n=Ty(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)),a=Object.getOwnPropertyDescriptors(t);if(e){e.set(t,r);for(const u in a){const c=a[u];"get"in c||"set"in c||(c.value=QT(c.value,e))}}return Object.defineProperties(r,a),r},fN=t=>{let e=ci;return()=>e===ci?e=t():e},Sf=t=>typeof t=="function"&&t.length===0,dN=class extends Function{constructor(...t){const e=t.slice(0,-1),n=t[t.length-1];try{super(...e,n)}catch(r){return Rt(`Encountered an unexpected error while compiling your definition:
|
|
20
|
+
`+l.stack}}var Ft=Object.prototype.hasOwnProperty,Vt=t.unstable_scheduleCallback,Hn=t.unstable_cancelCallback,ri=t.unstable_shouldYield,Fn=t.unstable_requestPaint,st=t.unstable_now,Kl=t.unstable_getCurrentPriorityLevel,Ag=t.unstable_ImmediatePriority,Eg=t.unstable_UserBlockingPriority,ql=t.unstable_NormalPriority,Z_=t.unstable_LowPriority,Og=t.unstable_IdlePriority,Q_=t.log,W_=t.unstable_setDisableYieldValue,ea=null,dn=null;function tr(i){if(typeof Q_=="function"&&W_(i),dn&&typeof dn.setStrictMode=="function")try{dn.setStrictMode(ea,i)}catch{}}var hn=Math.clz32?Math.clz32:nR,eR=Math.log,tR=Math.LN2;function nR(i){return i>>>=0,i===0?32:31-(eR(i)/tR|0)|0}var Pl=256,Il=262144,Hl=4194304;function Yr(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:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;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 Fl(i,s,o){var l=i.pendingLanes;if(l===0)return 0;var d=0,p=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var w=l&134217727;return w!==0?(l=w&~p,l!==0?d=Yr(l):(b&=w,b!==0?d=Yr(b):o||(o=w&~i,o!==0&&(d=Yr(o))))):(w=l&~p,w!==0?d=Yr(w):b!==0?d=Yr(b):o||(o=l&~i,o!==0&&(d=Yr(o)))),d===0?0:s!==0&&s!==d&&(s&p)===0&&(p=d&-d,o=s&-s,p>=o||p===32&&(o&4194048)!==0)?s:d}function ta(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function iR(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 _g(){var i=Hl;return Hl<<=1,(Hl&62914560)===0&&(Hl=4194304),i}function zf(i){for(var s=[],o=0;31>o;o++)s.push(i);return s}function na(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function rR(i,s,o,l,d,p){var b=i.pendingLanes;i.pendingLanes=o,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=o,i.entangledLanes&=o,i.errorRecoveryDisabledLanes&=o,i.shellSuspendCounter=0;var w=i.entanglements,A=i.expirationTimes,N=i.hiddenUpdates;for(o=b&~o;0<o;){var V=31-hn(o),P=1<<V;w[V]=0,A[V]=-1;var B=N[V];if(B!==null)for(N[V]=null,V=0;V<B.length;V++){var z=B[V];z!==null&&(z.lane&=-536870913)}o&=~P}l!==0&&Rg(i,l,0),p!==0&&d===0&&i.tag!==0&&(i.suspendedLanes|=p&~(b&~s))}function Rg(i,s,o){i.pendingLanes|=s,i.suspendedLanes&=~s;var l=31-hn(s);i.entangledLanes|=s,i.entanglements[l]=i.entanglements[l]|1073741824|o&261930}function Cg(i,s){var o=i.entangledLanes|=s;for(i=i.entanglements;o;){var l=31-hn(o),d=1<<l;d&s|i[l]&s&&(i[l]|=s),o&=~d}}function kg(i,s){var o=s&-s;return o=(o&42)!==0?1:Lf(o),(o&(i.suspendedLanes|s))!==0?0:o}function Lf(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Vf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Mg(){var i=U.p;return i!==0?i:(i=window.event,i===void 0?32:yS(i.type))}function Dg(i,s){var o=U.p;try{return U.p=i,s()}finally{U.p=o}}var nr=Math.random().toString(36).slice(2),Ut="__reactFiber$"+nr,tn="__reactProps$"+nr,Ms="__reactContainer$"+nr,Uf="__reactEvents$"+nr,sR="__reactListeners$"+nr,oR="__reactHandles$"+nr,Ng="__reactResources$"+nr,ia="__reactMarker$"+nr;function Kf(i){delete i[Ut],delete i[tn],delete i[Uf],delete i[sR],delete i[oR]}function Ds(i){var s=i[Ut];if(s)return s;for(var o=i.parentNode;o;){if(s=o[Ms]||o[Ut]){if(o=s.alternate,s.child!==null||o!==null&&o.child!==null)for(i=eS(i);i!==null;){if(o=i[Ut])return o;i=eS(i)}return s}i=o,o=i.parentNode}return null}function Ns(i){if(i=i[Ut]||i[Ms]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function ra(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function $s(i){var s=i[Ng];return s||(s=i[Ng]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Nt(i){i[ia]=!0}var $g=new Set,jg={};function Jr(i,s){js(i,s),js(i+"Capture",s)}function js(i,s){for(jg[i]=s,i=0;i<s.length;i++)$g.add(s[i])}var aR=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]*$"),Bg={},zg={};function lR(i){return Ft.call(zg,i)?!0:Ft.call(Bg,i)?!1:aR.test(i)?zg[i]=!0:(Bg[i]=!0,!1)}function Gl(i,s,o){if(lR(s))if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var l=s.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+o)}}function Yl(i,s,o){if(o===null)i.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+o)}}function Ti(i,s,o,l){if(l===null)i.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(o);return}i.setAttributeNS(s,o,""+l)}}function On(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Lg(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function uR(i,s,o){var l=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var d=l.get,p=l.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return d.call(this)},set:function(b){o=""+b,p.call(this,b)}}),Object.defineProperty(i,s,{enumerable:l.enumerable}),{getValue:function(){return o},setValue:function(b){o=""+b},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function qf(i){if(!i._valueTracker){var s=Lg(i)?"checked":"value";i._valueTracker=uR(i,s,""+i[s])}}function Vg(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var o=s.getValue(),l="";return i&&(l=Lg(i)?i.checked?"true":"false":i.value),i=l,i!==o?(s.setValue(i),!0):!1}function Jl(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 cR=/[\n"\\]/g;function _n(i){return i.replace(cR,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Pf(i,s,o,l,d,p,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=""+On(s)):i.value!==""+On(s)&&(i.value=""+On(s)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),s!=null?If(i,b,On(s)):o!=null?If(i,b,On(o)):l!=null&&i.removeAttribute("value"),d==null&&p!=null&&(i.defaultChecked=!!p),d!=null&&(i.checked=d&&typeof d!="function"&&typeof d!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+On(w):i.removeAttribute("name")}function Ug(i,s,o,l,d,p,b,w){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(i.type=p),s!=null||o!=null){if(!(p!=="submit"&&p!=="reset"||s!=null)){qf(i);return}o=o!=null?""+On(o):"",s=s!=null?""+On(s):o,w||s===i.value||(i.value=s),i.defaultValue=s}l=l??d,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=w?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b),qf(i)}function If(i,s,o){s==="number"&&Jl(i.ownerDocument)===i||i.defaultValue===""+o||(i.defaultValue=""+o)}function Bs(i,s,o,l){if(i=i.options,s){s={};for(var d=0;d<o.length;d++)s["$"+o[d]]=!0;for(o=0;o<i.length;o++)d=s.hasOwnProperty("$"+i[o].value),i[o].selected!==d&&(i[o].selected=d),d&&l&&(i[o].defaultSelected=!0)}else{for(o=""+On(o),s=null,d=0;d<i.length;d++){if(i[d].value===o){i[d].selected=!0,l&&(i[d].defaultSelected=!0);return}s!==null||i[d].disabled||(s=i[d])}s!==null&&(s.selected=!0)}}function Kg(i,s,o){if(s!=null&&(s=""+On(s),s!==i.value&&(i.value=s),o==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=o!=null?""+On(o):""}function qg(i,s,o,l){if(s==null){if(l!=null){if(o!=null)throw Error(r(92));if(ne(l)){if(1<l.length)throw Error(r(93));l=l[0]}o=l}o==null&&(o=""),s=o}o=On(s),i.defaultValue=o,l=i.textContent,l===o&&l!==""&&l!==null&&(i.value=l),qf(i)}function zs(i,s){if(s){var o=i.firstChild;if(o&&o===i.lastChild&&o.nodeType===3){o.nodeValue=s;return}}i.textContent=s}var fR=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 Pg(i,s,o){var l=s.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?l?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":l?i.setProperty(s,o):typeof o!="number"||o===0||fR.has(s)?s==="float"?i.cssFloat=o:i[s]=(""+o).trim():i[s]=o+"px"}function Ig(i,s,o){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,o!=null){for(var l in o)!o.hasOwnProperty(l)||s!=null&&s.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var d in s)l=s[d],s.hasOwnProperty(d)&&o[d]!==l&&Pg(i,d,l)}else for(var p in s)s.hasOwnProperty(p)&&Pg(i,p,s[p])}function Hf(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 dR=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"]]),hR=/^[\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 Xl(i){return hR.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ai(){}var Ff=null;function Gf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Ls=null,Vs=null;function Hg(i){var s=Ns(i);if(s&&(i=s.stateNode)){var o=i[tn]||null;e:switch(i=s.stateNode,s.type){case"input":if(Pf(i,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),s=o.name,o.type==="radio"&&s!=null){for(o=i;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+_n(""+s)+'"][type="radio"]'),s=0;s<o.length;s++){var l=o[s];if(l!==i&&l.form===i.form){var d=l[tn]||null;if(!d)throw Error(r(90));Pf(l,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(s=0;s<o.length;s++)l=o[s],l.form===i.form&&Vg(l)}break e;case"textarea":Kg(i,o.value,o.defaultValue);break e;case"select":s=o.value,s!=null&&Bs(i,!!o.multiple,s,!1)}}}var Yf=!1;function Fg(i,s,o){if(Yf)return i(s,o);Yf=!0;try{var l=i(s);return l}finally{if(Yf=!1,(Ls!==null||Vs!==null)&&(zu(),Ls&&(s=Ls,i=Vs,Vs=Ls=null,Hg(s),i)))for(s=0;s<i.length;s++)Hg(i[s])}}function sa(i,s){var o=i.stateNode;if(o===null)return null;var l=o[tn]||null;if(l===null)return null;o=l[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":(l=!l.disabled)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(o&&typeof o!="function")throw Error(r(231,s,typeof o));return o}var Ei=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jf=!1;if(Ei)try{var oa={};Object.defineProperty(oa,"passive",{get:function(){Jf=!0}}),window.addEventListener("test",oa,oa),window.removeEventListener("test",oa,oa)}catch{Jf=!1}var ir=null,Xf=null,Zl=null;function Gg(){if(Zl)return Zl;var i,s=Xf,o=s.length,l,d="value"in ir?ir.value:ir.textContent,p=d.length;for(i=0;i<o&&s[i]===d[i];i++);var b=o-i;for(l=1;l<=b&&s[o-l]===d[p-l];l++);return Zl=d.slice(i,1<l?1-l:void 0)}function Ql(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 Wl(){return!0}function Yg(){return!1}function nn(i){function s(o,l,d,p,b){this._reactName=o,this._targetInst=d,this.type=l,this.nativeEvent=p,this.target=b,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(o=i[w],this[w]=o?o(p):p[w]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Wl:Yg,this.isPropagationStopped=Yg,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Wl)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),s}var Xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},eu=nn(Xr),aa=g({},Xr,{view:0,detail:0}),pR=nn(aa),Zf,Qf,la,tu=g({},aa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ed,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!==la&&(la&&i.type==="mousemove"?(Zf=i.screenX-la.screenX,Qf=i.screenY-la.screenY):Qf=Zf=0,la=i),Zf)},movementY:function(i){return"movementY"in i?i.movementY:Qf}}),Jg=nn(tu),mR=g({},tu,{dataTransfer:0}),yR=nn(mR),gR=g({},aa,{relatedTarget:0}),Wf=nn(gR),bR=g({},Xr,{animationName:0,elapsedTime:0,pseudoElement:0}),vR=nn(bR),SR=g({},Xr,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),wR=nn(SR),xR=g({},Xr,{data:0}),Xg=nn(xR),TR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},AR={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"},ER={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function OR(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=ER[i])?!!s[i]:!1}function ed(){return OR}var _R=g({},aa,{key:function(i){if(i.key){var s=TR[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Ql(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?AR[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ed,charCode:function(i){return i.type==="keypress"?Ql(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ql(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),RR=nn(_R),CR=g({},tu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zg=nn(CR),kR=g({},aa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ed}),MR=nn(kR),DR=g({},Xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),NR=nn(DR),$R=g({},tu,{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}),jR=nn($R),BR=g({},Xr,{newState:0,oldState:0}),zR=nn(BR),LR=[9,13,27,32],td=Ei&&"CompositionEvent"in window,ua=null;Ei&&"documentMode"in document&&(ua=document.documentMode);var VR=Ei&&"TextEvent"in window&&!ua,Qg=Ei&&(!td||ua&&8<ua&&11>=ua),Wg=" ",eb=!1;function tb(i,s){switch(i){case"keyup":return LR.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function nb(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Us=!1;function UR(i,s){switch(i){case"compositionend":return nb(s);case"keypress":return s.which!==32?null:(eb=!0,Wg);case"textInput":return i=s.data,i===Wg&&eb?null:i;default:return null}}function KR(i,s){if(Us)return i==="compositionend"||!td&&tb(i,s)?(i=Gg(),Zl=Xf=ir=null,Us=!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 Qg&&s.locale!=="ko"?null:s.data;default:return null}}var qR={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 ib(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!qR[i.type]:s==="textarea"}function rb(i,s,o,l){Ls?Vs?Vs.push(l):Vs=[l]:Ls=l,s=Iu(s,"onChange"),0<s.length&&(o=new eu("onChange","change",null,o,l),i.push({event:o,listeners:s}))}var ca=null,fa=null;function PR(i){U0(i,0)}function nu(i){var s=ra(i);if(Vg(s))return i}function sb(i,s){if(i==="change")return s}var ob=!1;if(Ei){var nd;if(Ei){var id="oninput"in document;if(!id){var ab=document.createElement("div");ab.setAttribute("oninput","return;"),id=typeof ab.oninput=="function"}nd=id}else nd=!1;ob=nd&&(!document.documentMode||9<document.documentMode)}function lb(){ca&&(ca.detachEvent("onpropertychange",ub),fa=ca=null)}function ub(i){if(i.propertyName==="value"&&nu(fa)){var s=[];rb(s,fa,i,Gf(i)),Fg(PR,s)}}function IR(i,s,o){i==="focusin"?(lb(),ca=s,fa=o,ca.attachEvent("onpropertychange",ub)):i==="focusout"&&lb()}function HR(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return nu(fa)}function FR(i,s){if(i==="click")return nu(s)}function GR(i,s){if(i==="input"||i==="change")return nu(s)}function YR(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var pn=typeof Object.is=="function"?Object.is:YR;function da(i,s){if(pn(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var o=Object.keys(i),l=Object.keys(s);if(o.length!==l.length)return!1;for(l=0;l<o.length;l++){var d=o[l];if(!Ft.call(s,d)||!pn(i[d],s[d]))return!1}return!0}function cb(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function fb(i,s){var o=cb(i);i=0;for(var l;o;){if(o.nodeType===3){if(l=i+o.textContent.length,i<=s&&l>=s)return{node:o,offset:s-i};i=l}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=cb(o)}}function db(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?db(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function hb(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Jl(i.document);s instanceof i.HTMLIFrameElement;){try{var o=typeof s.contentWindow.location.href=="string"}catch{o=!1}if(o)i=s.contentWindow;else break;s=Jl(i.document)}return s}function rd(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 JR=Ei&&"documentMode"in document&&11>=document.documentMode,Ks=null,sd=null,ha=null,od=!1;function pb(i,s,o){var l=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;od||Ks==null||Ks!==Jl(l)||(l=Ks,"selectionStart"in l&&rd(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ha&&da(ha,l)||(ha=l,l=Iu(sd,"onSelect"),0<l.length&&(s=new eu("onSelect","select",null,s,o),i.push({event:s,listeners:l}),s.target=Ks)))}function Zr(i,s){var o={};return o[i.toLowerCase()]=s.toLowerCase(),o["Webkit"+i]="webkit"+s,o["Moz"+i]="moz"+s,o}var qs={animationend:Zr("Animation","AnimationEnd"),animationiteration:Zr("Animation","AnimationIteration"),animationstart:Zr("Animation","AnimationStart"),transitionrun:Zr("Transition","TransitionRun"),transitionstart:Zr("Transition","TransitionStart"),transitioncancel:Zr("Transition","TransitionCancel"),transitionend:Zr("Transition","TransitionEnd")},ad={},mb={};Ei&&(mb=document.createElement("div").style,"AnimationEvent"in window||(delete qs.animationend.animation,delete qs.animationiteration.animation,delete qs.animationstart.animation),"TransitionEvent"in window||delete qs.transitionend.transition);function Qr(i){if(ad[i])return ad[i];if(!qs[i])return i;var s=qs[i],o;for(o in s)if(s.hasOwnProperty(o)&&o in mb)return ad[i]=s[o];return i}var yb=Qr("animationend"),gb=Qr("animationiteration"),bb=Qr("animationstart"),XR=Qr("transitionrun"),ZR=Qr("transitionstart"),QR=Qr("transitioncancel"),vb=Qr("transitionend"),Sb=new Map,ld="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(" ");ld.push("scrollEnd");function Gn(i,s){Sb.set(i,s),Jr(s,[i])}var iu=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)},Rn=[],Ps=0,ud=0;function ru(){for(var i=Ps,s=ud=Ps=0;s<i;){var o=Rn[s];Rn[s++]=null;var l=Rn[s];Rn[s++]=null;var d=Rn[s];Rn[s++]=null;var p=Rn[s];if(Rn[s++]=null,l!==null&&d!==null){var b=l.pending;b===null?d.next=d:(d.next=b.next,b.next=d),l.pending=d}p!==0&&wb(o,d,p)}}function su(i,s,o,l){Rn[Ps++]=i,Rn[Ps++]=s,Rn[Ps++]=o,Rn[Ps++]=l,ud|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function cd(i,s,o,l){return su(i,s,o,l),ou(i)}function Wr(i,s){return su(i,null,null,s),ou(i)}function wb(i,s,o){i.lanes|=o;var l=i.alternate;l!==null&&(l.lanes|=o);for(var d=!1,p=i.return;p!==null;)p.childLanes|=o,l=p.alternate,l!==null&&(l.childLanes|=o),p.tag===22&&(i=p.stateNode,i===null||i._visibility&1||(d=!0)),i=p,p=p.return;return i.tag===3?(p=i.stateNode,d&&s!==null&&(d=31-hn(o),i=p.hiddenUpdates,l=i[d],l===null?i[d]=[s]:l.push(s),s.lane=o|536870912),p):null}function ou(i){if(50<ja)throw ja=0,vh=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Is={};function WR(i,s,o,l){this.tag=i,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function mn(i,s,o,l){return new WR(i,s,o,l)}function fd(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Oi(i,s){var o=i.alternate;return o===null?(o=mn(i.tag,s,i.key,i.mode),o.elementType=i.elementType,o.type=i.type,o.stateNode=i.stateNode,o.alternate=i,i.alternate=o):(o.pendingProps=s,o.type=i.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=i.flags&65011712,o.childLanes=i.childLanes,o.lanes=i.lanes,o.child=i.child,o.memoizedProps=i.memoizedProps,o.memoizedState=i.memoizedState,o.updateQueue=i.updateQueue,s=i.dependencies,o.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},o.sibling=i.sibling,o.index=i.index,o.ref=i.ref,o.refCleanup=i.refCleanup,o}function xb(i,s){i.flags&=65011714;var o=i.alternate;return o===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=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,s=o.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function au(i,s,o,l,d,p){var b=0;if(l=i,typeof i=="function")fd(i)&&(b=1);else if(typeof i=="string")b=rk(i,o,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case he:return i=mn(31,o,s,d),i.elementType=he,i.lanes=p,i;case T:return es(o.children,d,p,s);case M:b=8,d|=24;break;case C:return i=mn(12,o,s,d|2),i.elementType=C,i.lanes=p,i;case I:return i=mn(13,o,s,d),i.elementType=I,i.lanes=p,i;case ee:return i=mn(19,o,s,d),i.elementType=ee,i.lanes=p,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:b=10;break e;case _:b=9;break e;case G:b=11;break e;case J:b=14;break e;case X:b=16,l=null;break e}b=29,o=Error(r(130,i===null?"null":typeof i,"")),l=null}return s=mn(b,o,s,d),s.elementType=i,s.type=l,s.lanes=p,s}function es(i,s,o,l){return i=mn(7,i,l,s),i.lanes=o,i}function dd(i,s,o){return i=mn(6,i,null,s),i.lanes=o,i}function Tb(i){var s=mn(18,null,null,0);return s.stateNode=i,s}function hd(i,s,o){return s=mn(4,i.children!==null?i.children:[],i.key,s),s.lanes=o,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Ab=new WeakMap;function Cn(i,s){if(typeof i=="object"&&i!==null){var o=Ab.get(i);return o!==void 0?o:(s={value:i,source:s,stack:En(s)},Ab.set(i,s),s)}return{value:i,source:s,stack:En(s)}}var Hs=[],Fs=0,lu=null,pa=0,kn=[],Mn=0,rr=null,si=1,oi="";function _i(i,s){Hs[Fs++]=pa,Hs[Fs++]=lu,lu=i,pa=s}function Eb(i,s,o){kn[Mn++]=si,kn[Mn++]=oi,kn[Mn++]=rr,rr=i;var l=si;i=oi;var d=32-hn(l)-1;l&=~(1<<d),o+=1;var p=32-hn(s)+d;if(30<p){var b=d-d%5;p=(l&(1<<b)-1).toString(32),l>>=b,d-=b,si=1<<32-hn(s)+d|o<<d|l,oi=p+i}else si=1<<p|o<<d|l,oi=i}function pd(i){i.return!==null&&(_i(i,1),Eb(i,1,0))}function md(i){for(;i===lu;)lu=Hs[--Fs],Hs[Fs]=null,pa=Hs[--Fs],Hs[Fs]=null;for(;i===rr;)rr=kn[--Mn],kn[Mn]=null,oi=kn[--Mn],kn[Mn]=null,si=kn[--Mn],kn[Mn]=null}function Ob(i,s){kn[Mn++]=si,kn[Mn++]=oi,kn[Mn++]=rr,si=s.id,oi=s.overflow,rr=i}var Kt=null,Ze=null,Ce=!1,sr=null,Dn=!1,yd=Error(r(519));function or(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ma(Cn(s,i)),yd}function _b(i){var s=i.stateNode,o=i.type,l=i.memoizedProps;switch(s[Ut]=i,s[tn]=l,o){case"dialog":Ee("cancel",s),Ee("close",s);break;case"iframe":case"object":case"embed":Ee("load",s);break;case"video":case"audio":for(o=0;o<za.length;o++)Ee(za[o],s);break;case"source":Ee("error",s);break;case"img":case"image":case"link":Ee("error",s),Ee("load",s);break;case"details":Ee("toggle",s);break;case"input":Ee("invalid",s),Ug(s,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":Ee("invalid",s);break;case"textarea":Ee("invalid",s),qg(s,l.value,l.defaultValue,l.children)}o=l.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||s.textContent===""+o||l.suppressHydrationWarning===!0||I0(s.textContent,o)?(l.popover!=null&&(Ee("beforetoggle",s),Ee("toggle",s)),l.onScroll!=null&&Ee("scroll",s),l.onScrollEnd!=null&&Ee("scrollend",s),l.onClick!=null&&(s.onclick=Ai),s=!0):s=!1,s||or(i,!0)}function Rb(i){for(Kt=i.return;Kt;)switch(Kt.tag){case 5:case 31:case 13:Dn=!1;return;case 27:case 3:Dn=!0;return;default:Kt=Kt.return}}function Gs(i){if(i!==Kt)return!1;if(!Ce)return Rb(i),Ce=!0,!1;var s=i.tag,o;if((o=s!==3&&s!==27)&&((o=s===5)&&(o=i.type,o=!(o!=="form"&&o!=="button")||$h(i.type,i.memoizedProps)),o=!o),o&&Ze&&or(i),Rb(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ze=W0(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Ze=W0(i)}else s===27?(s=Ze,Sr(i.type)?(i=Vh,Vh=null,Ze=i):Ze=s):Ze=Kt?$n(i.stateNode.nextSibling):null;return!0}function ts(){Ze=Kt=null,Ce=!1}function gd(){var i=sr;return i!==null&&(an===null?an=i:an.push.apply(an,i),sr=null),i}function ma(i){sr===null?sr=[i]:sr.push(i)}var bd=E(null),ns=null,Ri=null;function ar(i,s,o){H(bd,s._currentValue),s._currentValue=o}function Ci(i){i._currentValue=bd.current,q(bd)}function vd(i,s,o){for(;i!==null;){var l=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,l!==null&&(l.childLanes|=s)):l!==null&&(l.childLanes&s)!==s&&(l.childLanes|=s),i===o)break;i=i.return}}function Sd(i,s,o,l){var d=i.child;for(d!==null&&(d.return=i);d!==null;){var p=d.dependencies;if(p!==null){var b=d.child;p=p.firstContext;e:for(;p!==null;){var w=p;p=d;for(var A=0;A<s.length;A++)if(w.context===s[A]){p.lanes|=o,w=p.alternate,w!==null&&(w.lanes|=o),vd(p.return,o,i),l||(b=null);break e}p=w.next}}else if(d.tag===18){if(b=d.return,b===null)throw Error(r(341));b.lanes|=o,p=b.alternate,p!==null&&(p.lanes|=o),vd(b,o,i),b=null}else b=d.child;if(b!==null)b.return=d;else for(b=d;b!==null;){if(b===i){b=null;break}if(d=b.sibling,d!==null){d.return=b.return,b=d;break}b=b.return}d=b}}function Ys(i,s,o,l){i=null;for(var d=s,p=!1;d!==null;){if(!p){if((d.flags&524288)!==0)p=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var b=d.alternate;if(b===null)throw Error(r(387));if(b=b.memoizedProps,b!==null){var w=d.type;pn(d.pendingProps.value,b.value)||(i!==null?i.push(w):i=[w])}}else if(d===Te.current){if(b=d.alternate,b===null)throw Error(r(387));b.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(i!==null?i.push(qa):i=[qa])}d=d.return}i!==null&&Sd(s,i,o,l),s.flags|=262144}function uu(i){for(i=i.firstContext;i!==null;){if(!pn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function is(i){ns=i,Ri=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function qt(i){return Cb(ns,i)}function cu(i,s){return ns===null&&is(i),Cb(i,s)}function Cb(i,s){var o=s._currentValue;if(s={context:s,memoizedValue:o,next:null},Ri===null){if(i===null)throw Error(r(308));Ri=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Ri=Ri.next=s;return o}var eC=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(o,l){i.push(l)}};this.abort=function(){s.aborted=!0,i.forEach(function(o){return o()})}},tC=t.unstable_scheduleCallback,nC=t.unstable_NormalPriority,vt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function wd(){return{controller:new eC,data:new Map,refCount:0}}function ya(i){i.refCount--,i.refCount===0&&tC(nC,function(){i.controller.abort()})}var ga=null,xd=0,Js=0,Xs=null;function iC(i,s){if(ga===null){var o=ga=[];xd=0,Js=Eh(),Xs={status:"pending",value:void 0,then:function(l){o.push(l)}}}return xd++,s.then(kb,kb),s}function kb(){if(--xd===0&&ga!==null){Xs!==null&&(Xs.status="fulfilled");var i=ga;ga=null,Js=0,Xs=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function rC(i,s){var o=[],l={status:"pending",value:null,reason:null,then:function(d){o.push(d)}};return i.then(function(){l.status="fulfilled",l.value=s;for(var d=0;d<o.length;d++)(0,o[d])(s)},function(d){for(l.status="rejected",l.reason=d,d=0;d<o.length;d++)(0,o[d])(void 0)}),l}var Mb=j.S;j.S=function(i,s){p0=st(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&iC(i,s),Mb!==null&&Mb(i,s)};var rs=E(null);function Td(){var i=rs.current;return i!==null?i:He.pooledCache}function fu(i,s){s===null?H(rs,rs.current):H(rs,s.pool)}function Db(){var i=Td();return i===null?null:{parent:vt._currentValue,pool:i}}var Zs=Error(r(460)),Ad=Error(r(474)),du=Error(r(542)),hu={then:function(){}};function Nb(i){return i=i.status,i==="fulfilled"||i==="rejected"}function $b(i,s,o){switch(o=i[o],o===void 0?i.push(s):o!==s&&(s.then(Ai,Ai),s=o),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Bb(i),i;default:if(typeof s.status=="string")s.then(Ai,Ai);else{if(i=He,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(l){if(s.status==="pending"){var d=s;d.status="fulfilled",d.value=l}},function(l){if(s.status==="pending"){var d=s;d.status="rejected",d.reason=l}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Bb(i),i}throw os=s,Zs}}function ss(i){try{var s=i._init;return s(i._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(os=o,Zs):o}}var os=null;function jb(){if(os===null)throw Error(r(459));var i=os;return os=null,i}function Bb(i){if(i===Zs||i===du)throw Error(r(483))}var Qs=null,ba=0;function pu(i){var s=ba;return ba+=1,Qs===null&&(Qs=[]),$b(Qs,i,s)}function va(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function mu(i,s){throw s.$$typeof===v?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function zb(i){function s(k,O){if(i){var D=k.deletions;D===null?(k.deletions=[O],k.flags|=16):D.push(O)}}function o(k,O){if(!i)return null;for(;O!==null;)s(k,O),O=O.sibling;return null}function l(k){for(var O=new Map;k!==null;)k.key!==null?O.set(k.key,k):O.set(k.index,k),k=k.sibling;return O}function d(k,O){return k=Oi(k,O),k.index=0,k.sibling=null,k}function p(k,O,D){return k.index=D,i?(D=k.alternate,D!==null?(D=D.index,D<O?(k.flags|=67108866,O):D):(k.flags|=67108866,O)):(k.flags|=1048576,O)}function b(k){return i&&k.alternate===null&&(k.flags|=67108866),k}function w(k,O,D,K){return O===null||O.tag!==6?(O=dd(D,k.mode,K),O.return=k,O):(O=d(O,D),O.return=k,O)}function A(k,O,D,K){var le=D.type;return le===T?V(k,O,D.props.children,K,D.key):O!==null&&(O.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===X&&ss(le)===O.type)?(O=d(O,D.props),va(O,D),O.return=k,O):(O=au(D.type,D.key,D.props,null,k.mode,K),va(O,D),O.return=k,O)}function N(k,O,D,K){return O===null||O.tag!==4||O.stateNode.containerInfo!==D.containerInfo||O.stateNode.implementation!==D.implementation?(O=hd(D,k.mode,K),O.return=k,O):(O=d(O,D.children||[]),O.return=k,O)}function V(k,O,D,K,le){return O===null||O.tag!==7?(O=es(D,k.mode,K,le),O.return=k,O):(O=d(O,D),O.return=k,O)}function P(k,O,D){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=dd(""+O,k.mode,D),O.return=k,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case S:return D=au(O.type,O.key,O.props,null,k.mode,D),va(D,O),D.return=k,D;case x:return O=hd(O,k.mode,D),O.return=k,O;case X:return O=ss(O),P(k,O,D)}if(ne(O)||je(O))return O=es(O,k.mode,D,null),O.return=k,O;if(typeof O.then=="function")return P(k,pu(O),D);if(O.$$typeof===R)return P(k,cu(k,O),D);mu(k,O)}return null}function B(k,O,D,K){var le=O!==null?O.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return le!==null?null:w(k,O,""+D,K);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case S:return D.key===le?A(k,O,D,K):null;case x:return D.key===le?N(k,O,D,K):null;case X:return D=ss(D),B(k,O,D,K)}if(ne(D)||je(D))return le!==null?null:V(k,O,D,K,null);if(typeof D.then=="function")return B(k,O,pu(D),K);if(D.$$typeof===R)return B(k,O,cu(k,D),K);mu(k,D)}return null}function z(k,O,D,K,le){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return k=k.get(D)||null,w(O,k,""+K,le);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return k=k.get(K.key===null?D:K.key)||null,A(O,k,K,le);case x:return k=k.get(K.key===null?D:K.key)||null,N(O,k,K,le);case X:return K=ss(K),z(k,O,D,K,le)}if(ne(K)||je(K))return k=k.get(D)||null,V(O,k,K,le,null);if(typeof K.then=="function")return z(k,O,D,pu(K),le);if(K.$$typeof===R)return z(k,O,D,cu(O,K),le);mu(O,K)}return null}function ie(k,O,D,K){for(var le=null,Ne=null,se=O,Se=O=0,_e=null;se!==null&&Se<D.length;Se++){se.index>Se?(_e=se,se=null):_e=se.sibling;var $e=B(k,se,D[Se],K);if($e===null){se===null&&(se=_e);break}i&&se&&$e.alternate===null&&s(k,se),O=p($e,O,Se),Ne===null?le=$e:Ne.sibling=$e,Ne=$e,se=_e}if(Se===D.length)return o(k,se),Ce&&_i(k,Se),le;if(se===null){for(;Se<D.length;Se++)se=P(k,D[Se],K),se!==null&&(O=p(se,O,Se),Ne===null?le=se:Ne.sibling=se,Ne=se);return Ce&&_i(k,Se),le}for(se=l(se);Se<D.length;Se++)_e=z(se,k,Se,D[Se],K),_e!==null&&(i&&_e.alternate!==null&&se.delete(_e.key===null?Se:_e.key),O=p(_e,O,Se),Ne===null?le=_e:Ne.sibling=_e,Ne=_e);return i&&se.forEach(function(Er){return s(k,Er)}),Ce&&_i(k,Se),le}function ue(k,O,D,K){if(D==null)throw Error(r(151));for(var le=null,Ne=null,se=O,Se=O=0,_e=null,$e=D.next();se!==null&&!$e.done;Se++,$e=D.next()){se.index>Se?(_e=se,se=null):_e=se.sibling;var Er=B(k,se,$e.value,K);if(Er===null){se===null&&(se=_e);break}i&&se&&Er.alternate===null&&s(k,se),O=p(Er,O,Se),Ne===null?le=Er:Ne.sibling=Er,Ne=Er,se=_e}if($e.done)return o(k,se),Ce&&_i(k,Se),le;if(se===null){for(;!$e.done;Se++,$e=D.next())$e=P(k,$e.value,K),$e!==null&&(O=p($e,O,Se),Ne===null?le=$e:Ne.sibling=$e,Ne=$e);return Ce&&_i(k,Se),le}for(se=l(se);!$e.done;Se++,$e=D.next())$e=z(se,k,Se,$e.value,K),$e!==null&&(i&&$e.alternate!==null&&se.delete($e.key===null?Se:$e.key),O=p($e,O,Se),Ne===null?le=$e:Ne.sibling=$e,Ne=$e);return i&&se.forEach(function(mk){return s(k,mk)}),Ce&&_i(k,Se),le}function Pe(k,O,D,K){if(typeof D=="object"&&D!==null&&D.type===T&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case S:e:{for(var le=D.key;O!==null;){if(O.key===le){if(le=D.type,le===T){if(O.tag===7){o(k,O.sibling),K=d(O,D.props.children),K.return=k,k=K;break e}}else if(O.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===X&&ss(le)===O.type){o(k,O.sibling),K=d(O,D.props),va(K,D),K.return=k,k=K;break e}o(k,O);break}else s(k,O);O=O.sibling}D.type===T?(K=es(D.props.children,k.mode,K,D.key),K.return=k,k=K):(K=au(D.type,D.key,D.props,null,k.mode,K),va(K,D),K.return=k,k=K)}return b(k);case x:e:{for(le=D.key;O!==null;){if(O.key===le)if(O.tag===4&&O.stateNode.containerInfo===D.containerInfo&&O.stateNode.implementation===D.implementation){o(k,O.sibling),K=d(O,D.children||[]),K.return=k,k=K;break e}else{o(k,O);break}else s(k,O);O=O.sibling}K=hd(D,k.mode,K),K.return=k,k=K}return b(k);case X:return D=ss(D),Pe(k,O,D,K)}if(ne(D))return ie(k,O,D,K);if(je(D)){if(le=je(D),typeof le!="function")throw Error(r(150));return D=le.call(D),ue(k,O,D,K)}if(typeof D.then=="function")return Pe(k,O,pu(D),K);if(D.$$typeof===R)return Pe(k,O,cu(k,D),K);mu(k,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,O!==null&&O.tag===6?(o(k,O.sibling),K=d(O,D),K.return=k,k=K):(o(k,O),K=dd(D,k.mode,K),K.return=k,k=K),b(k)):o(k,O)}return function(k,O,D,K){try{ba=0;var le=Pe(k,O,D,K);return Qs=null,le}catch(se){if(se===Zs||se===du)throw se;var Ne=mn(29,se,null,k.mode);return Ne.lanes=K,Ne.return=k,Ne}finally{}}}var as=zb(!0),Lb=zb(!1),lr=!1;function Ed(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Od(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 ur(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function cr(i,s,o){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(Be&2)!==0){var d=l.pending;return d===null?s.next=s:(s.next=d.next,d.next=s),l.pending=s,s=ou(i),wb(i,null,o),s}return su(i,l,s,o),ou(i)}function Sa(i,s,o){if(s=s.updateQueue,s!==null&&(s=s.shared,(o&4194048)!==0)){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Cg(i,o)}}function _d(i,s){var o=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,o===l)){var d=null,p=null;if(o=o.firstBaseUpdate,o!==null){do{var b={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};p===null?d=p=b:p=p.next=b,o=o.next}while(o!==null);p===null?d=p=s:p=p.next=s}else d=p=s;o={baseState:l.baseState,firstBaseUpdate:d,lastBaseUpdate:p,shared:l.shared,callbacks:l.callbacks},i.updateQueue=o;return}i=o.lastBaseUpdate,i===null?o.firstBaseUpdate=s:i.next=s,o.lastBaseUpdate=s}var Rd=!1;function wa(){if(Rd){var i=Xs;if(i!==null)throw i}}function xa(i,s,o,l){Rd=!1;var d=i.updateQueue;lr=!1;var p=d.firstBaseUpdate,b=d.lastBaseUpdate,w=d.shared.pending;if(w!==null){d.shared.pending=null;var A=w,N=A.next;A.next=null,b===null?p=N:b.next=N,b=A;var V=i.alternate;V!==null&&(V=V.updateQueue,w=V.lastBaseUpdate,w!==b&&(w===null?V.firstBaseUpdate=N:w.next=N,V.lastBaseUpdate=A))}if(p!==null){var P=d.baseState;b=0,V=N=A=null,w=p;do{var B=w.lane&-536870913,z=B!==w.lane;if(z?(Oe&B)===B:(l&B)===B){B!==0&&B===Js&&(Rd=!0),V!==null&&(V=V.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var ie=i,ue=w;B=s;var Pe=o;switch(ue.tag){case 1:if(ie=ue.payload,typeof ie=="function"){P=ie.call(Pe,P,B);break e}P=ie;break e;case 3:ie.flags=ie.flags&-65537|128;case 0:if(ie=ue.payload,B=typeof ie=="function"?ie.call(Pe,P,B):ie,B==null)break e;P=g({},P,B);break e;case 2:lr=!0}}B=w.callback,B!==null&&(i.flags|=64,z&&(i.flags|=8192),z=d.callbacks,z===null?d.callbacks=[B]:z.push(B))}else z={lane:B,tag:w.tag,payload:w.payload,callback:w.callback,next:null},V===null?(N=V=z,A=P):V=V.next=z,b|=B;if(w=w.next,w===null){if(w=d.shared.pending,w===null)break;z=w,w=z.next,z.next=null,d.lastBaseUpdate=z,d.shared.pending=null}}while(!0);V===null&&(A=P),d.baseState=A,d.firstBaseUpdate=N,d.lastBaseUpdate=V,p===null&&(d.shared.lanes=0),mr|=b,i.lanes=b,i.memoizedState=P}}function Vb(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Ub(i,s){var o=i.callbacks;if(o!==null)for(i.callbacks=null,i=0;i<o.length;i++)Vb(o[i],s)}var Ws=E(null),yu=E(0);function Kb(i,s){i=Li,H(yu,i),H(Ws,s),Li=i|s.baseLanes}function Cd(){H(yu,Li),H(Ws,Ws.current)}function kd(){Li=yu.current,q(Ws),q(yu)}var yn=E(null),Nn=null;function fr(i){var s=i.alternate;H(pt,pt.current&1),H(yn,i),Nn===null&&(s===null||Ws.current!==null||s.memoizedState!==null)&&(Nn=i)}function Md(i){H(pt,pt.current),H(yn,i),Nn===null&&(Nn=i)}function qb(i){i.tag===22?(H(pt,pt.current),H(yn,i),Nn===null&&(Nn=i)):dr()}function dr(){H(pt,pt.current),H(yn,yn.current)}function gn(i){q(yn),Nn===i&&(Nn=null),q(pt)}var pt=E(0);function gu(i){for(var s=i;s!==null;){if(s.tag===13){var o=s.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||zh(o)||Lh(o)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){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}var ki=0,be=null,Ke=null,St=null,bu=!1,eo=!1,ls=!1,vu=0,Ta=0,to=null,sC=0;function ot(){throw Error(r(321))}function Dd(i,s){if(s===null)return!1;for(var o=0;o<s.length&&o<i.length;o++)if(!pn(i[o],s[o]))return!1;return!0}function Nd(i,s,o,l,d,p){return ki=p,be=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=i===null||i.memoizedState===null?Ev:Yd,ls=!1,p=o(l,d),ls=!1,eo&&(p=Ib(s,o,l,d)),Pb(i),p}function Pb(i){j.H=Oa;var s=Ke!==null&&Ke.next!==null;if(ki=0,St=Ke=be=null,bu=!1,Ta=0,to=null,s)throw Error(r(300));i===null||wt||(i=i.dependencies,i!==null&&uu(i)&&(wt=!0))}function Ib(i,s,o,l){be=i;var d=0;do{if(eo&&(to=null),Ta=0,eo=!1,25<=d)throw Error(r(301));if(d+=1,St=Ke=null,i.updateQueue!=null){var p=i.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}j.H=Ov,p=s(o,l)}while(eo);return p}function oC(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?Aa(s):s,i=i.useState()[0],(Ke!==null?Ke.memoizedState:null)!==i&&(be.flags|=1024),s}function $d(){var i=vu!==0;return vu=0,i}function jd(i,s,o){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~o}function Bd(i){if(bu){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}bu=!1}ki=0,St=Ke=be=null,eo=!1,Ta=vu=0,to=null}function Zt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?be.memoizedState=St=i:St=St.next=i,St}function mt(){if(Ke===null){var i=be.alternate;i=i!==null?i.memoizedState:null}else i=Ke.next;var s=St===null?be.memoizedState:St.next;if(s!==null)St=s,Ke=i;else{if(i===null)throw be.alternate===null?Error(r(467)):Error(r(310));Ke=i,i={memoizedState:Ke.memoizedState,baseState:Ke.baseState,baseQueue:Ke.baseQueue,queue:Ke.queue,next:null},St===null?be.memoizedState=St=i:St=St.next=i}return St}function Su(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Aa(i){var s=Ta;return Ta+=1,to===null&&(to=[]),i=$b(to,i,s),s=be,(St===null?s.memoizedState:St.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?Ev:Yd),i}function wu(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Aa(i);if(i.$$typeof===R)return qt(i)}throw Error(r(438,String(i)))}function zd(i){var s=null,o=be.updateQueue;if(o!==null&&(s=o.memoCache),s==null){var l=be.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(s={data:l.data.map(function(d){return d.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),o===null&&(o=Su(),be.updateQueue=o),o.memoCache=s,o=s.data[s.index],o===void 0)for(o=s.data[s.index]=Array(i),l=0;l<i;l++)o[l]=pe;return s.index++,o}function Mi(i,s){return typeof s=="function"?s(i):s}function xu(i){var s=mt();return Ld(s,Ke,i)}function Ld(i,s,o){var l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=o;var d=i.baseQueue,p=l.pending;if(p!==null){if(d!==null){var b=d.next;d.next=p.next,p.next=b}s.baseQueue=d=p,l.pending=null}if(p=i.baseState,d===null)i.memoizedState=p;else{s=d.next;var w=b=null,A=null,N=s,V=!1;do{var P=N.lane&-536870913;if(P!==N.lane?(Oe&P)===P:(ki&P)===P){var B=N.revertLane;if(B===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),P===Js&&(V=!0);else if((ki&B)===B){N=N.next,B===Js&&(V=!0);continue}else P={lane:0,revertLane:N.revertLane,gesture:null,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},A===null?(w=A=P,b=p):A=A.next=P,be.lanes|=B,mr|=B;P=N.action,ls&&o(p,P),p=N.hasEagerState?N.eagerState:o(p,P)}else B={lane:P,revertLane:N.revertLane,gesture:N.gesture,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},A===null?(w=A=B,b=p):A=A.next=B,be.lanes|=P,mr|=P;N=N.next}while(N!==null&&N!==s);if(A===null?b=p:A.next=w,!pn(p,i.memoizedState)&&(wt=!0,V&&(o=Xs,o!==null)))throw o;i.memoizedState=p,i.baseState=b,i.baseQueue=A,l.lastRenderedState=p}return d===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function Vd(i){var s=mt(),o=s.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=i;var l=o.dispatch,d=o.pending,p=s.memoizedState;if(d!==null){o.pending=null;var b=d=d.next;do p=i(p,b.action),b=b.next;while(b!==d);pn(p,s.memoizedState)||(wt=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),o.lastRenderedState=p}return[p,l]}function Hb(i,s,o){var l=be,d=mt(),p=Ce;if(p){if(o===void 0)throw Error(r(407));o=o()}else o=s();var b=!pn((Ke||d).memoizedState,o);if(b&&(d.memoizedState=o,wt=!0),d=d.queue,qd(Yb.bind(null,l,d,i),[i]),d.getSnapshot!==s||b||St!==null&&St.memoizedState.tag&1){if(l.flags|=2048,no(9,{destroy:void 0},Gb.bind(null,l,d,o,s),null),He===null)throw Error(r(349));p||(ki&127)!==0||Fb(l,s,o)}return o}function Fb(i,s,o){i.flags|=16384,i={getSnapshot:s,value:o},s=be.updateQueue,s===null?(s=Su(),be.updateQueue=s,s.stores=[i]):(o=s.stores,o===null?s.stores=[i]:o.push(i))}function Gb(i,s,o,l){s.value=o,s.getSnapshot=l,Jb(s)&&Xb(i)}function Yb(i,s,o){return o(function(){Jb(s)&&Xb(i)})}function Jb(i){var s=i.getSnapshot;i=i.value;try{var o=s();return!pn(i,o)}catch{return!0}}function Xb(i){var s=Wr(i,2);s!==null&&ln(s,i,2)}function Ud(i){var s=Zt();if(typeof i=="function"){var o=i;if(i=o(),ls){tr(!0);try{o()}finally{tr(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:i},s}function Zb(i,s,o,l){return i.baseState=o,Ld(i,Ke,typeof l=="function"?l:Mi)}function aC(i,s,o,l,d){if(Eu(i))throw Error(r(485));if(i=s.action,i!==null){var p={payload:d,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){p.listeners.push(b)}};j.T!==null?o(!0):p.isTransition=!1,l(p),o=s.pending,o===null?(p.next=s.pending=p,Qb(s,p)):(p.next=o.next,s.pending=o.next=p)}}function Qb(i,s){var o=s.action,l=s.payload,d=i.state;if(s.isTransition){var p=j.T,b={};j.T=b;try{var w=o(d,l),A=j.S;A!==null&&A(b,w),Wb(i,s,w)}catch(N){Kd(i,s,N)}finally{p!==null&&b.types!==null&&(p.types=b.types),j.T=p}}else try{p=o(d,l),Wb(i,s,p)}catch(N){Kd(i,s,N)}}function Wb(i,s,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(l){ev(i,s,l)},function(l){return Kd(i,s,l)}):ev(i,s,o)}function ev(i,s,o){s.status="fulfilled",s.value=o,tv(s),i.state=o,s=i.pending,s!==null&&(o=s.next,o===s?i.pending=null:(o=o.next,s.next=o,Qb(i,o)))}function Kd(i,s,o){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do s.status="rejected",s.reason=o,tv(s),s=s.next;while(s!==l)}i.action=null}function tv(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function nv(i,s){return s}function iv(i,s){if(Ce){var o=He.formState;if(o!==null){e:{var l=be;if(Ce){if(Ze){t:{for(var d=Ze,p=Dn;d.nodeType!==8;){if(!p){d=null;break t}if(d=$n(d.nextSibling),d===null){d=null;break t}}p=d.data,d=p==="F!"||p==="F"?d:null}if(d){Ze=$n(d.nextSibling),l=d.data==="F!";break e}}or(l)}l=!1}l&&(s=o[0])}}return o=Zt(),o.memoizedState=o.baseState=s,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:nv,lastRenderedState:s},o.queue=l,o=xv.bind(null,be,l),l.dispatch=o,l=Ud(!1),p=Gd.bind(null,be,!1,l.queue),l=Zt(),d={state:s,dispatch:null,action:i,pending:null},l.queue=d,o=aC.bind(null,be,d,p,o),d.dispatch=o,l.memoizedState=i,[s,o,!1]}function rv(i){var s=mt();return sv(s,Ke,i)}function sv(i,s,o){if(s=Ld(i,s,nv)[0],i=xu(Mi)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var l=Aa(s)}catch(b){throw b===Zs?du:b}else l=s;s=mt();var d=s.queue,p=d.dispatch;return o!==s.memoizedState&&(be.flags|=2048,no(9,{destroy:void 0},lC.bind(null,d,o),null)),[l,p,i]}function lC(i,s){i.action=s}function ov(i){var s=mt(),o=Ke;if(o!==null)return sv(s,o,i);mt(),s=s.memoizedState,o=mt();var l=o.queue.dispatch;return o.memoizedState=i,[s,l,!1]}function no(i,s,o,l){return i={tag:i,create:o,deps:l,inst:s,next:null},s=be.updateQueue,s===null&&(s=Su(),be.updateQueue=s),o=s.lastEffect,o===null?s.lastEffect=i.next=i:(l=o.next,o.next=i,i.next=l,s.lastEffect=i),i}function av(){return mt().memoizedState}function Tu(i,s,o,l){var d=Zt();be.flags|=i,d.memoizedState=no(1|s,{destroy:void 0},o,l===void 0?null:l)}function Au(i,s,o,l){var d=mt();l=l===void 0?null:l;var p=d.memoizedState.inst;Ke!==null&&l!==null&&Dd(l,Ke.memoizedState.deps)?d.memoizedState=no(s,p,o,l):(be.flags|=i,d.memoizedState=no(1|s,p,o,l))}function lv(i,s){Tu(8390656,8,i,s)}function qd(i,s){Au(2048,8,i,s)}function uC(i){be.flags|=4;var s=be.updateQueue;if(s===null)s=Su(),be.updateQueue=s,s.events=[i];else{var o=s.events;o===null?s.events=[i]:o.push(i)}}function uv(i){var s=mt().memoizedState;return uC({ref:s,nextImpl:i}),function(){if((Be&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function cv(i,s){return Au(4,2,i,s)}function fv(i,s){return Au(4,4,i,s)}function dv(i,s){if(typeof s=="function"){i=i();var o=s(i);return function(){typeof o=="function"?o():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function hv(i,s,o){o=o!=null?o.concat([i]):null,Au(4,4,dv.bind(null,s,i),o)}function Pd(){}function pv(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;return s!==null&&Dd(s,l[1])?l[0]:(o.memoizedState=[i,s],i)}function mv(i,s){var o=mt();s=s===void 0?null:s;var l=o.memoizedState;if(s!==null&&Dd(s,l[1]))return l[0];if(l=i(),ls){tr(!0);try{i()}finally{tr(!1)}}return o.memoizedState=[l,s],l}function Id(i,s,o){return o===void 0||(ki&1073741824)!==0&&(Oe&261930)===0?i.memoizedState=s:(i.memoizedState=o,i=y0(),be.lanes|=i,mr|=i,o)}function yv(i,s,o,l){return pn(o,s)?o:Ws.current!==null?(i=Id(i,o,l),pn(i,s)||(wt=!0),i):(ki&42)===0||(ki&1073741824)!==0&&(Oe&261930)===0?(wt=!0,i.memoizedState=o):(i=y0(),be.lanes|=i,mr|=i,s)}function gv(i,s,o,l,d){var p=U.p;U.p=p!==0&&8>p?p:8;var b=j.T,w={};j.T=w,Gd(i,!1,s,o);try{var A=d(),N=j.S;if(N!==null&&N(w,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var V=rC(A,l);Ea(i,s,V,Sn(i))}else Ea(i,s,l,Sn(i))}catch(P){Ea(i,s,{then:function(){},status:"rejected",reason:P},Sn())}finally{U.p=p,b!==null&&w.types!==null&&(b.types=w.types),j.T=b}}function cC(){}function Hd(i,s,o,l){if(i.tag!==5)throw Error(r(476));var d=bv(i).queue;gv(i,d,s,L,o===null?cC:function(){return vv(i),o(l)})}function bv(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:L,baseState:L,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:L},next:null};var o={};return s.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mi,lastRenderedState:o},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function vv(i){var s=bv(i);s.next===null&&(s=i.alternate.memoizedState),Ea(i,s.next.queue,{},Sn())}function Fd(){return qt(qa)}function Sv(){return mt().memoizedState}function wv(){return mt().memoizedState}function fC(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var o=Sn();i=ur(o);var l=cr(s,i,o);l!==null&&(ln(l,s,o),Sa(l,s,o)),s={cache:wd()},i.payload=s;return}s=s.return}}function dC(i,s,o){var l=Sn();o={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Eu(i)?Tv(s,o):(o=cd(i,s,o,l),o!==null&&(ln(o,i,l),Av(o,s,l)))}function xv(i,s,o){var l=Sn();Ea(i,s,o,l)}function Ea(i,s,o,l){var d={lane:l,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(Eu(i))Tv(s,d);else{var p=i.alternate;if(i.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var b=s.lastRenderedState,w=p(b,o);if(d.hasEagerState=!0,d.eagerState=w,pn(w,b))return su(i,s,d,0),He===null&&ru(),!1}catch{}finally{}if(o=cd(i,s,d,l),o!==null)return ln(o,i,l),Av(o,s,l),!0}return!1}function Gd(i,s,o,l){if(l={lane:2,revertLane:Eh(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Eu(i)){if(s)throw Error(r(479))}else s=cd(i,o,l,2),s!==null&&ln(s,i,2)}function Eu(i){var s=i.alternate;return i===be||s!==null&&s===be}function Tv(i,s){eo=bu=!0;var o=i.pending;o===null?s.next=s:(s.next=o.next,o.next=s),i.pending=s}function Av(i,s,o){if((o&4194048)!==0){var l=s.lanes;l&=i.pendingLanes,o|=l,s.lanes=o,Cg(i,o)}}var Oa={readContext:qt,use:wu,useCallback:ot,useContext:ot,useEffect:ot,useImperativeHandle:ot,useLayoutEffect:ot,useInsertionEffect:ot,useMemo:ot,useReducer:ot,useRef:ot,useState:ot,useDebugValue:ot,useDeferredValue:ot,useTransition:ot,useSyncExternalStore:ot,useId:ot,useHostTransitionStatus:ot,useFormState:ot,useActionState:ot,useOptimistic:ot,useMemoCache:ot,useCacheRefresh:ot};Oa.useEffectEvent=ot;var Ev={readContext:qt,use:wu,useCallback:function(i,s){return Zt().memoizedState=[i,s===void 0?null:s],i},useContext:qt,useEffect:lv,useImperativeHandle:function(i,s,o){o=o!=null?o.concat([i]):null,Tu(4194308,4,dv.bind(null,s,i),o)},useLayoutEffect:function(i,s){return Tu(4194308,4,i,s)},useInsertionEffect:function(i,s){Tu(4,2,i,s)},useMemo:function(i,s){var o=Zt();s=s===void 0?null:s;var l=i();if(ls){tr(!0);try{i()}finally{tr(!1)}}return o.memoizedState=[l,s],l},useReducer:function(i,s,o){var l=Zt();if(o!==void 0){var d=o(s);if(ls){tr(!0);try{o(s)}finally{tr(!1)}}}else d=s;return l.memoizedState=l.baseState=d,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:d},l.queue=i,i=i.dispatch=dC.bind(null,be,i),[l.memoizedState,i]},useRef:function(i){var s=Zt();return i={current:i},s.memoizedState=i},useState:function(i){i=Ud(i);var s=i.queue,o=xv.bind(null,be,s);return s.dispatch=o,[i.memoizedState,o]},useDebugValue:Pd,useDeferredValue:function(i,s){var o=Zt();return Id(o,i,s)},useTransition:function(){var i=Ud(!1);return i=gv.bind(null,be,i.queue,!0,!1),Zt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,o){var l=be,d=Zt();if(Ce){if(o===void 0)throw Error(r(407));o=o()}else{if(o=s(),He===null)throw Error(r(349));(Oe&127)!==0||Fb(l,s,o)}d.memoizedState=o;var p={value:o,getSnapshot:s};return d.queue=p,lv(Yb.bind(null,l,p,i),[i]),l.flags|=2048,no(9,{destroy:void 0},Gb.bind(null,l,p,o,s),null),o},useId:function(){var i=Zt(),s=He.identifierPrefix;if(Ce){var o=oi,l=si;o=(l&~(1<<32-hn(l)-1)).toString(32)+o,s="_"+s+"R_"+o,o=vu++,0<o&&(s+="H"+o.toString(32)),s+="_"}else o=sC++,s="_"+s+"r_"+o.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Fd,useFormState:iv,useActionState:iv,useOptimistic:function(i){var s=Zt();s.memoizedState=s.baseState=i;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=o,s=Gd.bind(null,be,!0,o),o.dispatch=s,[i,s]},useMemoCache:zd,useCacheRefresh:function(){return Zt().memoizedState=fC.bind(null,be)},useEffectEvent:function(i){var s=Zt(),o={impl:i};return s.memoizedState=o,function(){if((Be&2)!==0)throw Error(r(440));return o.impl.apply(void 0,arguments)}}},Yd={readContext:qt,use:wu,useCallback:pv,useContext:qt,useEffect:qd,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:fv,useMemo:mv,useReducer:xu,useRef:av,useState:function(){return xu(Mi)},useDebugValue:Pd,useDeferredValue:function(i,s){var o=mt();return yv(o,Ke.memoizedState,i,s)},useTransition:function(){var i=xu(Mi)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:Aa(i),s]},useSyncExternalStore:Hb,useId:Sv,useHostTransitionStatus:Fd,useFormState:rv,useActionState:rv,useOptimistic:function(i,s){var o=mt();return Zb(o,Ke,i,s)},useMemoCache:zd,useCacheRefresh:wv};Yd.useEffectEvent=uv;var Ov={readContext:qt,use:wu,useCallback:pv,useContext:qt,useEffect:qd,useImperativeHandle:hv,useInsertionEffect:cv,useLayoutEffect:fv,useMemo:mv,useReducer:Vd,useRef:av,useState:function(){return Vd(Mi)},useDebugValue:Pd,useDeferredValue:function(i,s){var o=mt();return Ke===null?Id(o,i,s):yv(o,Ke.memoizedState,i,s)},useTransition:function(){var i=Vd(Mi)[0],s=mt().memoizedState;return[typeof i=="boolean"?i:Aa(i),s]},useSyncExternalStore:Hb,useId:Sv,useHostTransitionStatus:Fd,useFormState:ov,useActionState:ov,useOptimistic:function(i,s){var o=mt();return Ke!==null?Zb(o,Ke,i,s):(o.baseState=i,[i,o.queue.dispatch])},useMemoCache:zd,useCacheRefresh:wv};Ov.useEffectEvent=uv;function Jd(i,s,o,l){s=i.memoizedState,o=o(l,s),o=o==null?s:g({},s,o),i.memoizedState=o,i.lanes===0&&(i.updateQueue.baseState=o)}var Xd={enqueueSetState:function(i,s,o){i=i._reactInternals;var l=Sn(),d=ur(l);d.payload=s,o!=null&&(d.callback=o),s=cr(i,d,l),s!==null&&(ln(s,i,l),Sa(s,i,l))},enqueueReplaceState:function(i,s,o){i=i._reactInternals;var l=Sn(),d=ur(l);d.tag=1,d.payload=s,o!=null&&(d.callback=o),s=cr(i,d,l),s!==null&&(ln(s,i,l),Sa(s,i,l))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var o=Sn(),l=ur(o);l.tag=2,s!=null&&(l.callback=s),s=cr(i,l,o),s!==null&&(ln(s,i,o),Sa(s,i,o))}};function _v(i,s,o,l,d,p,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,p,b):s.prototype&&s.prototype.isPureReactComponent?!da(o,l)||!da(d,p):!0}function Rv(i,s,o,l){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(o,l),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(o,l),s.state!==i&&Xd.enqueueReplaceState(s,s.state,null)}function us(i,s){var o=s;if("ref"in s){o={};for(var l in s)l!=="ref"&&(o[l]=s[l])}if(i=i.defaultProps){o===s&&(o=g({},o));for(var d in i)o[d]===void 0&&(o[d]=i[d])}return o}function Cv(i){iu(i)}function kv(i){console.error(i)}function Mv(i){iu(i)}function Ou(i,s){try{var o=i.onUncaughtError;o(s.value,{componentStack:s.stack})}catch(l){setTimeout(function(){throw l})}}function Dv(i,s,o){try{var l=i.onCaughtError;l(o.value,{componentStack:o.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function Zd(i,s,o){return o=ur(o),o.tag=3,o.payload={element:null},o.callback=function(){Ou(i,s)},o}function Nv(i){return i=ur(i),i.tag=3,i}function $v(i,s,o,l){var d=o.type.getDerivedStateFromError;if(typeof d=="function"){var p=l.value;i.payload=function(){return d(p)},i.callback=function(){Dv(s,o,l)}}var b=o.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){Dv(s,o,l),typeof d!="function"&&(yr===null?yr=new Set([this]):yr.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function hC(i,s,o,l,d){if(o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(s=o.alternate,s!==null&&Ys(s,o,d,!0),o=yn.current,o!==null){switch(o.tag){case 31:case 13:return Nn===null?Lu():o.alternate===null&&at===0&&(at=3),o.flags&=-257,o.flags|=65536,o.lanes=d,l===hu?o.flags|=16384:(s=o.updateQueue,s===null?o.updateQueue=new Set([l]):s.add(l),xh(i,l,d)),!1;case 22:return o.flags|=65536,l===hu?o.flags|=16384:(s=o.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([l])},o.updateQueue=s):(o=s.retryQueue,o===null?s.retryQueue=new Set([l]):o.add(l)),xh(i,l,d)),!1}throw Error(r(435,o.tag))}return xh(i,l,d),Lu(),!1}if(Ce)return s=yn.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=d,l!==yd&&(i=Error(r(422),{cause:l}),ma(Cn(i,o)))):(l!==yd&&(s=Error(r(423),{cause:l}),ma(Cn(s,o))),i=i.current.alternate,i.flags|=65536,d&=-d,i.lanes|=d,l=Cn(l,o),d=Zd(i.stateNode,l,d),_d(i,d),at!==4&&(at=2)),!1;var p=Error(r(520),{cause:l});if(p=Cn(p,o),$a===null?$a=[p]:$a.push(p),at!==4&&(at=2),s===null)return!0;l=Cn(l,o),o=s;do{switch(o.tag){case 3:return o.flags|=65536,i=d&-d,o.lanes|=i,i=Zd(o.stateNode,l,i),_d(o,i),!1;case 1:if(s=o.type,p=o.stateNode,(o.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(yr===null||!yr.has(p))))return o.flags|=65536,d&=-d,o.lanes|=d,d=Nv(d),$v(d,i,o,l),_d(o,d),!1}o=o.return}while(o!==null);return!1}var Qd=Error(r(461)),wt=!1;function Pt(i,s,o,l){s.child=i===null?Lb(s,null,o,l):as(s,i.child,o,l)}function jv(i,s,o,l,d){o=o.render;var p=s.ref;if("ref"in l){var b={};for(var w in l)w!=="ref"&&(b[w]=l[w])}else b=l;return is(s),l=Nd(i,s,o,b,p,d),w=$d(),i!==null&&!wt?(jd(i,s,d),Di(i,s,d)):(Ce&&w&&pd(s),s.flags|=1,Pt(i,s,l,d),s.child)}function Bv(i,s,o,l,d){if(i===null){var p=o.type;return typeof p=="function"&&!fd(p)&&p.defaultProps===void 0&&o.compare===null?(s.tag=15,s.type=p,zv(i,s,p,l,d)):(i=au(o.type,null,l,s,s.mode,d),i.ref=s.ref,i.return=s,s.child=i)}if(p=i.child,!oh(i,d)){var b=p.memoizedProps;if(o=o.compare,o=o!==null?o:da,o(b,l)&&i.ref===s.ref)return Di(i,s,d)}return s.flags|=1,i=Oi(p,l),i.ref=s.ref,i.return=s,s.child=i}function zv(i,s,o,l,d){if(i!==null){var p=i.memoizedProps;if(da(p,l)&&i.ref===s.ref)if(wt=!1,s.pendingProps=l=p,oh(i,d))(i.flags&131072)!==0&&(wt=!0);else return s.lanes=i.lanes,Di(i,s,d)}return Wd(i,s,o,l,d)}function Lv(i,s,o,l){var d=l.children,p=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((s.flags&128)!==0){if(p=p!==null?p.baseLanes|o:o,i!==null){for(l=s.child=i.child,d=0;l!==null;)d=d|l.lanes|l.childLanes,l=l.sibling;l=d&~p}else l=0,s.child=null;return Vv(i,s,p,o,l)}if((o&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&fu(s,p!==null?p.cachePool:null),p!==null?Kb(s,p):Cd(),qb(s);else return l=s.lanes=536870912,Vv(i,s,p!==null?p.baseLanes|o:o,o,l)}else p!==null?(fu(s,p.cachePool),Kb(s,p),dr(),s.memoizedState=null):(i!==null&&fu(s,null),Cd(),dr());return Pt(i,s,d,o),s.child}function _a(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Vv(i,s,o,l,d){var p=Td();return p=p===null?null:{parent:vt._currentValue,pool:p},s.memoizedState={baseLanes:o,cachePool:p},i!==null&&fu(s,null),Cd(),qb(s),i!==null&&Ys(i,s,l,!0),s.childLanes=d,null}function _u(i,s){return s=Cu({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Uv(i,s,o){return as(s,i.child,null,o),i=_u(s,s.pendingProps),i.flags|=2,gn(s),s.memoizedState=null,i}function pC(i,s,o){var l=s.pendingProps,d=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Ce){if(l.mode==="hidden")return i=_u(s,l),s.lanes=536870912,_a(null,i);if(Md(s),(i=Ze)?(i=Q0(i,Dn),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:rr!==null?{id:si,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},o=Tb(i),o.return=s,s.child=o,Kt=s,Ze=null)):i=null,i===null)throw or(s);return s.lanes=536870912,null}return _u(s,l)}var p=i.memoizedState;if(p!==null){var b=p.dehydrated;if(Md(s),d)if(s.flags&256)s.flags&=-257,s=Uv(i,s,o);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(wt||Ys(i,s,o,!1),d=(o&i.childLanes)!==0,wt||d){if(l=He,l!==null&&(b=kg(l,o),b!==0&&b!==p.retryLane))throw p.retryLane=b,Wr(i,b),ln(l,i,b),Qd;Lu(),s=Uv(i,s,o)}else i=p.treeContext,Ze=$n(b.nextSibling),Kt=s,Ce=!0,sr=null,Dn=!1,i!==null&&Ob(s,i),s=_u(s,l),s.flags|=4096;return s}return i=Oi(i.child,{mode:l.mode,children:l.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Ru(i,s){var o=s.ref;if(o===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(r(284));(i===null||i.ref!==o)&&(s.flags|=4194816)}}function Wd(i,s,o,l,d){return is(s),o=Nd(i,s,o,l,void 0,d),l=$d(),i!==null&&!wt?(jd(i,s,d),Di(i,s,d)):(Ce&&l&&pd(s),s.flags|=1,Pt(i,s,o,d),s.child)}function Kv(i,s,o,l,d,p){return is(s),s.updateQueue=null,o=Ib(s,l,o,d),Pb(i),l=$d(),i!==null&&!wt?(jd(i,s,p),Di(i,s,p)):(Ce&&l&&pd(s),s.flags|=1,Pt(i,s,o,p),s.child)}function qv(i,s,o,l,d){if(is(s),s.stateNode===null){var p=Is,b=o.contextType;typeof b=="object"&&b!==null&&(p=qt(b)),p=new o(l,p),s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Xd,s.stateNode=p,p._reactInternals=s,p=s.stateNode,p.props=l,p.state=s.memoizedState,p.refs={},Ed(s),b=o.contextType,p.context=typeof b=="object"&&b!==null?qt(b):Is,p.state=s.memoizedState,b=o.getDerivedStateFromProps,typeof b=="function"&&(Jd(s,o,b,l),p.state=s.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(b=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),b!==p.state&&Xd.enqueueReplaceState(p,p.state,null),xa(s,l,p,d),wa(),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308),l=!0}else if(i===null){p=s.stateNode;var w=s.memoizedProps,A=us(o,w);p.props=A;var N=p.context,V=o.contextType;b=Is,typeof V=="object"&&V!==null&&(b=qt(V));var P=o.getDerivedStateFromProps;V=typeof P=="function"||typeof p.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,V||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w||N!==b)&&Rv(s,p,l,b),lr=!1;var B=s.memoizedState;p.state=B,xa(s,l,p,d),wa(),N=s.memoizedState,w||B!==N||lr?(typeof P=="function"&&(Jd(s,o,P,l),N=s.memoizedState),(A=lr||_v(s,o,A,l,B,N,b))?(V||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(s.flags|=4194308)):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=l,s.memoizedState=N),p.props=l,p.state=N,p.context=b,l=A):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),l=!1)}else{p=s.stateNode,Od(i,s),b=s.memoizedProps,V=us(o,b),p.props=V,P=s.pendingProps,B=p.context,N=o.contextType,A=Is,typeof N=="object"&&N!==null&&(A=qt(N)),w=o.getDerivedStateFromProps,(N=typeof w=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(b!==P||B!==A)&&Rv(s,p,l,A),lr=!1,B=s.memoizedState,p.state=B,xa(s,l,p,d),wa();var z=s.memoizedState;b!==P||B!==z||lr||i!==null&&i.dependencies!==null&&uu(i.dependencies)?(typeof w=="function"&&(Jd(s,o,w,l),z=s.memoizedState),(V=lr||_v(s,o,V,l,B,z,A)||i!==null&&i.dependencies!==null&&uu(i.dependencies))?(N||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(l,z,A),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(l,z,A)),typeof p.componentDidUpdate=="function"&&(s.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof p.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),s.memoizedProps=l,s.memoizedState=z),p.props=l,p.state=z,p.context=A,l=V):(typeof p.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(s.flags|=1024),l=!1)}return p=l,Ru(i,s),l=(s.flags&128)!==0,p||l?(p=s.stateNode,o=l&&typeof o.getDerivedStateFromError!="function"?null:p.render(),s.flags|=1,i!==null&&l?(s.child=as(s,i.child,null,d),s.child=as(s,null,o,d)):Pt(i,s,o,d),s.memoizedState=p.state,i=s.child):i=Di(i,s,d),i}function Pv(i,s,o,l){return ts(),s.flags|=256,Pt(i,s,o,l),s.child}var eh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function th(i){return{baseLanes:i,cachePool:Db()}}function nh(i,s,o){return i=i!==null?i.childLanes&~o:0,s&&(i|=vn),i}function Iv(i,s,o){var l=s.pendingProps,d=!1,p=(s.flags&128)!==0,b;if((b=p)||(b=i!==null&&i.memoizedState===null?!1:(pt.current&2)!==0),b&&(d=!0,s.flags&=-129),b=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ce){if(d?fr(s):dr(),(i=Ze)?(i=Q0(i,Dn),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:rr!==null?{id:si,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},o=Tb(i),o.return=s,s.child=o,Kt=s,Ze=null)):i=null,i===null)throw or(s);return Lh(i)?s.lanes=32:s.lanes=536870912,null}var w=l.children;return l=l.fallback,d?(dr(),d=s.mode,w=Cu({mode:"hidden",children:w},d),l=es(l,d,o,null),w.return=s,l.return=s,w.sibling=l,s.child=w,l=s.child,l.memoizedState=th(o),l.childLanes=nh(i,b,o),s.memoizedState=eh,_a(null,l)):(fr(s),ih(s,w))}var A=i.memoizedState;if(A!==null&&(w=A.dehydrated,w!==null)){if(p)s.flags&256?(fr(s),s.flags&=-257,s=rh(i,s,o)):s.memoizedState!==null?(dr(),s.child=i.child,s.flags|=128,s=null):(dr(),w=l.fallback,d=s.mode,l=Cu({mode:"visible",children:l.children},d),w=es(w,d,o,null),w.flags|=2,l.return=s,w.return=s,l.sibling=w,s.child=l,as(s,i.child,null,o),l=s.child,l.memoizedState=th(o),l.childLanes=nh(i,b,o),s.memoizedState=eh,s=_a(null,l));else if(fr(s),Lh(w)){if(b=w.nextSibling&&w.nextSibling.dataset,b)var N=b.dgst;b=N,l=Error(r(419)),l.stack="",l.digest=b,ma({value:l,source:null,stack:null}),s=rh(i,s,o)}else if(wt||Ys(i,s,o,!1),b=(o&i.childLanes)!==0,wt||b){if(b=He,b!==null&&(l=kg(b,o),l!==0&&l!==A.retryLane))throw A.retryLane=l,Wr(i,l),ln(b,i,l),Qd;zh(w)||Lu(),s=rh(i,s,o)}else zh(w)?(s.flags|=192,s.child=i.child,s=null):(i=A.treeContext,Ze=$n(w.nextSibling),Kt=s,Ce=!0,sr=null,Dn=!1,i!==null&&Ob(s,i),s=ih(s,l.children),s.flags|=4096);return s}return d?(dr(),w=l.fallback,d=s.mode,A=i.child,N=A.sibling,l=Oi(A,{mode:"hidden",children:l.children}),l.subtreeFlags=A.subtreeFlags&65011712,N!==null?w=Oi(N,w):(w=es(w,d,o,null),w.flags|=2),w.return=s,l.return=s,l.sibling=w,s.child=l,_a(null,l),l=s.child,w=i.child.memoizedState,w===null?w=th(o):(d=w.cachePool,d!==null?(A=vt._currentValue,d=d.parent!==A?{parent:A,pool:A}:d):d=Db(),w={baseLanes:w.baseLanes|o,cachePool:d}),l.memoizedState=w,l.childLanes=nh(i,b,o),s.memoizedState=eh,_a(i.child,l)):(fr(s),o=i.child,i=o.sibling,o=Oi(o,{mode:"visible",children:l.children}),o.return=s,o.sibling=null,i!==null&&(b=s.deletions,b===null?(s.deletions=[i],s.flags|=16):b.push(i)),s.child=o,s.memoizedState=null,o)}function ih(i,s){return s=Cu({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Cu(i,s){return i=mn(22,i,null,s),i.lanes=0,i}function rh(i,s,o){return as(s,i.child,null,o),i=ih(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Hv(i,s,o){i.lanes|=s;var l=i.alternate;l!==null&&(l.lanes|=s),vd(i.return,s,o)}function sh(i,s,o,l,d,p){var b=i.memoizedState;b===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:l,tail:o,tailMode:d,treeForkCount:p}:(b.isBackwards=s,b.rendering=null,b.renderingStartTime=0,b.last=l,b.tail=o,b.tailMode=d,b.treeForkCount=p)}function Fv(i,s,o){var l=s.pendingProps,d=l.revealOrder,p=l.tail;l=l.children;var b=pt.current,w=(b&2)!==0;if(w?(b=b&1|2,s.flags|=128):b&=1,H(pt,b),Pt(i,s,l,o),l=Ce?pa:0,!w&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Hv(i,o,s);else if(i.tag===19)Hv(i,o,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}switch(d){case"forwards":for(o=s.child,d=null;o!==null;)i=o.alternate,i!==null&&gu(i)===null&&(d=o),o=o.sibling;o=d,o===null?(d=s.child,s.child=null):(d=o.sibling,o.sibling=null),sh(s,!1,d,o,p,l);break;case"backwards":case"unstable_legacy-backwards":for(o=null,d=s.child,s.child=null;d!==null;){if(i=d.alternate,i!==null&&gu(i)===null){s.child=d;break}i=d.sibling,d.sibling=o,o=d,d=i}sh(s,!0,o,null,p,l);break;case"together":sh(s,!1,null,null,void 0,l);break;default:s.memoizedState=null}return s.child}function Di(i,s,o){if(i!==null&&(s.dependencies=i.dependencies),mr|=s.lanes,(o&s.childLanes)===0)if(i!==null){if(Ys(i,s,o,!1),(o&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,o=Oi(i,i.pendingProps),s.child=o,o.return=s;i.sibling!==null;)i=i.sibling,o=o.sibling=Oi(i,i.pendingProps),o.return=s;o.sibling=null}return s.child}function oh(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&uu(i)))}function mC(i,s,o){switch(s.tag){case 3:Ct(s,s.stateNode.containerInfo),ar(s,vt,i.memoizedState.cache),ts();break;case 27:case 5:ii(s);break;case 4:Ct(s,s.stateNode.containerInfo);break;case 10:ar(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Md(s),null;break;case 13:var l=s.memoizedState;if(l!==null)return l.dehydrated!==null?(fr(s),s.flags|=128,null):(o&s.child.childLanes)!==0?Iv(i,s,o):(fr(s),i=Di(i,s,o),i!==null?i.sibling:null);fr(s);break;case 19:var d=(i.flags&128)!==0;if(l=(o&s.childLanes)!==0,l||(Ys(i,s,o,!1),l=(o&s.childLanes)!==0),d){if(l)return Fv(i,s,o);s.flags|=128}if(d=s.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),H(pt,pt.current),l)break;return null;case 22:return s.lanes=0,Lv(i,s,o,s.pendingProps);case 24:ar(s,vt,i.memoizedState.cache)}return Di(i,s,o)}function Gv(i,s,o){if(i!==null)if(i.memoizedProps!==s.pendingProps)wt=!0;else{if(!oh(i,o)&&(s.flags&128)===0)return wt=!1,mC(i,s,o);wt=(i.flags&131072)!==0}else wt=!1,Ce&&(s.flags&1048576)!==0&&Eb(s,pa,s.index);switch(s.lanes=0,s.tag){case 16:e:{var l=s.pendingProps;if(i=ss(s.elementType),s.type=i,typeof i=="function")fd(i)?(l=us(i,l),s.tag=1,s=qv(null,s,i,l,o)):(s.tag=0,s=Wd(null,s,i,l,o));else{if(i!=null){var d=i.$$typeof;if(d===G){s.tag=11,s=jv(null,s,i,l,o);break e}else if(d===J){s.tag=14,s=Bv(null,s,i,l,o);break e}}throw s=Z(i)||i,Error(r(306,s,""))}}return s;case 0:return Wd(i,s,s.type,s.pendingProps,o);case 1:return l=s.type,d=us(l,s.pendingProps),qv(i,s,l,d,o);case 3:e:{if(Ct(s,s.stateNode.containerInfo),i===null)throw Error(r(387));l=s.pendingProps;var p=s.memoizedState;d=p.element,Od(i,s),xa(s,l,null,o);var b=s.memoizedState;if(l=b.cache,ar(s,vt,l),l!==p.cache&&Sd(s,[vt],o,!0),wa(),l=b.element,p.isDehydrated)if(p={element:l,isDehydrated:!1,cache:b.cache},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){s=Pv(i,s,l,o);break e}else if(l!==d){d=Cn(Error(r(424)),s),ma(d),s=Pv(i,s,l,o);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(Ze=$n(i.firstChild),Kt=s,Ce=!0,sr=null,Dn=!0,o=Lb(s,null,l,o),s.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(ts(),l===d){s=Di(i,s,o);break e}Pt(i,s,l,o)}s=s.child}return s;case 26:return Ru(i,s),i===null?(o=rS(s.type,null,s.pendingProps,null))?s.memoizedState=o:Ce||(o=s.type,i=s.pendingProps,l=Hu(ce.current).createElement(o),l[Ut]=s,l[tn]=i,It(l,o,i),Nt(l),s.stateNode=l):s.memoizedState=rS(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ii(s),i===null&&Ce&&(l=s.stateNode=tS(s.type,s.pendingProps,ce.current),Kt=s,Dn=!0,d=Ze,Sr(s.type)?(Vh=d,Ze=$n(l.firstChild)):Ze=d),Pt(i,s,s.pendingProps.children,o),Ru(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ce&&((d=l=Ze)&&(l=HC(l,s.type,s.pendingProps,Dn),l!==null?(s.stateNode=l,Kt=s,Ze=$n(l.firstChild),Dn=!1,d=!0):d=!1),d||or(s)),ii(s),d=s.type,p=s.pendingProps,b=i!==null?i.memoizedProps:null,l=p.children,$h(d,p)?l=null:b!==null&&$h(d,b)&&(s.flags|=32),s.memoizedState!==null&&(d=Nd(i,s,oC,null,null,o),qa._currentValue=d),Ru(i,s),Pt(i,s,l,o),s.child;case 6:return i===null&&Ce&&((i=o=Ze)&&(o=FC(o,s.pendingProps,Dn),o!==null?(s.stateNode=o,Kt=s,Ze=null,i=!0):i=!1),i||or(s)),null;case 13:return Iv(i,s,o);case 4:return Ct(s,s.stateNode.containerInfo),l=s.pendingProps,i===null?s.child=as(s,null,l,o):Pt(i,s,l,o),s.child;case 11:return jv(i,s,s.type,s.pendingProps,o);case 7:return Pt(i,s,s.pendingProps,o),s.child;case 8:return Pt(i,s,s.pendingProps.children,o),s.child;case 12:return Pt(i,s,s.pendingProps.children,o),s.child;case 10:return l=s.pendingProps,ar(s,s.type,l.value),Pt(i,s,l.children,o),s.child;case 9:return d=s.type._context,l=s.pendingProps.children,is(s),d=qt(d),l=l(d),s.flags|=1,Pt(i,s,l,o),s.child;case 14:return Bv(i,s,s.type,s.pendingProps,o);case 15:return zv(i,s,s.type,s.pendingProps,o);case 19:return Fv(i,s,o);case 31:return pC(i,s,o);case 22:return Lv(i,s,o,s.pendingProps);case 24:return is(s),l=qt(vt),i===null?(d=Td(),d===null&&(d=He,p=wd(),d.pooledCache=p,p.refCount++,p!==null&&(d.pooledCacheLanes|=o),d=p),s.memoizedState={parent:l,cache:d},Ed(s),ar(s,vt,d)):((i.lanes&o)!==0&&(Od(i,s),xa(s,null,null,o),wa()),d=i.memoizedState,p=s.memoizedState,d.parent!==l?(d={parent:l,cache:l},s.memoizedState=d,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=d),ar(s,vt,l)):(l=p.cache,ar(s,vt,l),l!==d.cache&&Sd(s,[vt],o,!0))),Pt(i,s,s.pendingProps.children,o),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ni(i){i.flags|=4}function ah(i,s,o,l,d){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(d&335544128)===d)if(i.stateNode.complete)i.flags|=8192;else if(S0())i.flags|=8192;else throw os=hu,Ad}else i.flags&=-16777217}function Yv(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!uS(s))if(S0())i.flags|=8192;else throw os=hu,Ad}function ku(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?_g():536870912,i.lanes|=s,oo|=s)}function Ra(i,s){if(!Ce)switch(i.tailMode){case"hidden":s=i.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?i.tail=null:o.sibling=null;break;case"collapsed":o=i.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function Qe(i){var s=i.alternate!==null&&i.alternate.child===i.child,o=0,l=0;if(s)for(var d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags&65011712,l|=d.flags&65011712,d.return=i,d=d.sibling;else for(d=i.child;d!==null;)o|=d.lanes|d.childLanes,l|=d.subtreeFlags,l|=d.flags,d.return=i,d=d.sibling;return i.subtreeFlags|=l,i.childLanes=o,s}function yC(i,s,o){var l=s.pendingProps;switch(md(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Qe(s),null;case 1:return Qe(s),null;case 3:return o=s.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),s.memoizedState.cache!==l&&(s.flags|=2048),Ci(vt),Je(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(i===null||i.child===null)&&(Gs(s)?Ni(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,gd())),Qe(s),null;case 26:var d=s.type,p=s.memoizedState;return i===null?(Ni(s),p!==null?(Qe(s),Yv(s,p)):(Qe(s),ah(s,d,null,l,o))):p?p!==i.memoizedState?(Ni(s),Qe(s),Yv(s,p)):(Qe(s),s.flags&=-16777217):(i=i.memoizedProps,i!==l&&Ni(s),Qe(s),ah(s,d,i,l,o)),null;case 27:if(xi(s),o=ce.current,d=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Ni(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return Qe(s),null}i=Q.current,Gs(s)?_b(s):(i=tS(d,l,o),s.stateNode=i,Ni(s))}return Qe(s),null;case 5:if(xi(s),d=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==l&&Ni(s);else{if(!l){if(s.stateNode===null)throw Error(r(166));return Qe(s),null}if(p=Q.current,Gs(s))_b(s);else{var b=Hu(ce.current);switch(p){case 1:p=b.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:p=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":p=b.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":p=b.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":p=b.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof l.is=="string"?b.createElement("select",{is:l.is}):b.createElement("select"),l.multiple?p.multiple=!0:l.size&&(p.size=l.size);break;default:p=typeof l.is=="string"?b.createElement(d,{is:l.is}):b.createElement(d)}}p[Ut]=s,p[tn]=l;e:for(b=s.child;b!==null;){if(b.tag===5||b.tag===6)p.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===s)break e;for(;b.sibling===null;){if(b.return===null||b.return===s)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}s.stateNode=p;e:switch(It(p,d,l),d){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Ni(s)}}return Qe(s),ah(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,o),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==l&&Ni(s);else{if(typeof l!="string"&&s.stateNode===null)throw Error(r(166));if(i=ce.current,Gs(s)){if(i=s.stateNode,o=s.memoizedProps,l=null,d=Kt,d!==null)switch(d.tag){case 27:case 5:l=d.memoizedProps}i[Ut]=s,i=!!(i.nodeValue===o||l!==null&&l.suppressHydrationWarning===!0||I0(i.nodeValue,o)),i||or(s,!0)}else i=Hu(i).createTextNode(l),i[Ut]=s,s.stateNode=i}return Qe(s),null;case 31:if(o=s.memoizedState,i===null||i.memoizedState!==null){if(l=Gs(s),o!==null){if(i===null){if(!l)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ut]=s}else ts(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Qe(s),i=!1}else o=gd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=o),i=!0;if(!i)return s.flags&256?(gn(s),s):(gn(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Qe(s),null;case 13:if(l=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(d=Gs(s),l!==null&&l.dehydrated!==null){if(i===null){if(!d)throw Error(r(318));if(d=s.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(r(317));d[Ut]=s}else ts(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Qe(s),d=!1}else d=gd(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=d),d=!0;if(!d)return s.flags&256?(gn(s),s):(gn(s),null)}return gn(s),(s.flags&128)!==0?(s.lanes=o,s):(o=l!==null,i=i!==null&&i.memoizedState!==null,o&&(l=s.child,d=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(d=l.alternate.memoizedState.cachePool.pool),p=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(p=l.memoizedState.cachePool.pool),p!==d&&(l.flags|=2048)),o!==i&&o&&(s.child.flags|=8192),ku(s,s.updateQueue),Qe(s),null);case 4:return Je(),i===null&&Ch(s.stateNode.containerInfo),Qe(s),null;case 10:return Ci(s.type),Qe(s),null;case 19:if(q(pt),l=s.memoizedState,l===null)return Qe(s),null;if(d=(s.flags&128)!==0,p=l.rendering,p===null)if(d)Ra(l,!1);else{if(at!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(p=gu(i),p!==null){for(s.flags|=128,Ra(l,!1),i=p.updateQueue,s.updateQueue=i,ku(s,i),s.subtreeFlags=0,i=o,o=s.child;o!==null;)xb(o,i),o=o.sibling;return H(pt,pt.current&1|2),Ce&&_i(s,l.treeForkCount),s.child}i=i.sibling}l.tail!==null&&st()>ju&&(s.flags|=128,d=!0,Ra(l,!1),s.lanes=4194304)}else{if(!d)if(i=gu(p),i!==null){if(s.flags|=128,d=!0,i=i.updateQueue,s.updateQueue=i,ku(s,i),Ra(l,!0),l.tail===null&&l.tailMode==="hidden"&&!p.alternate&&!Ce)return Qe(s),null}else 2*st()-l.renderingStartTime>ju&&o!==536870912&&(s.flags|=128,d=!0,Ra(l,!1),s.lanes=4194304);l.isBackwards?(p.sibling=s.child,s.child=p):(i=l.last,i!==null?i.sibling=p:s.child=p,l.last=p)}return l.tail!==null?(i=l.tail,l.rendering=i,l.tail=i.sibling,l.renderingStartTime=st(),i.sibling=null,o=pt.current,H(pt,d?o&1|2:o&1),Ce&&_i(s,l.treeForkCount),i):(Qe(s),null);case 22:case 23:return gn(s),kd(),l=s.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(s.flags|=8192):l&&(s.flags|=8192),l?(o&536870912)!==0&&(s.flags&128)===0&&(Qe(s),s.subtreeFlags&6&&(s.flags|=8192)):Qe(s),o=s.updateQueue,o!==null&&ku(s,o.retryQueue),o=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),l=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(l=s.memoizedState.cachePool.pool),l!==o&&(s.flags|=2048),i!==null&&q(rs),null;case 24:return o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),Ci(vt),Qe(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function gC(i,s){switch(md(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ci(vt),Je(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return xi(s),null;case 31:if(s.memoizedState!==null){if(gn(s),s.alternate===null)throw Error(r(340));ts()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(gn(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ts()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return q(pt),null;case 4:return Je(),null;case 10:return Ci(s.type),null;case 22:case 23:return gn(s),kd(),i!==null&&q(rs),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ci(vt),null;case 25:return null;default:return null}}function Jv(i,s){switch(md(s),s.tag){case 3:Ci(vt),Je();break;case 26:case 27:case 5:xi(s);break;case 4:Je();break;case 31:s.memoizedState!==null&&gn(s);break;case 13:gn(s);break;case 19:q(pt);break;case 10:Ci(s.type);break;case 22:case 23:gn(s),kd(),i!==null&&q(rs);break;case 24:Ci(vt)}}function Ca(i,s){try{var o=s.updateQueue,l=o!==null?o.lastEffect:null;if(l!==null){var d=l.next;o=d;do{if((o.tag&i)===i){l=void 0;var p=o.create,b=o.inst;l=p(),b.destroy=l}o=o.next}while(o!==d)}}catch(w){Ue(s,s.return,w)}}function hr(i,s,o){try{var l=s.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var p=d.next;l=p;do{if((l.tag&i)===i){var b=l.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,d=s;var A=o,N=w;try{N()}catch(V){Ue(d,A,V)}}}l=l.next}while(l!==p)}}catch(V){Ue(s,s.return,V)}}function Xv(i){var s=i.updateQueue;if(s!==null){var o=i.stateNode;try{Ub(s,o)}catch(l){Ue(i,i.return,l)}}}function Zv(i,s,o){o.props=us(i.type,i.memoizedProps),o.state=i.memoizedState;try{o.componentWillUnmount()}catch(l){Ue(i,s,l)}}function ka(i,s){try{var o=i.ref;if(o!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof o=="function"?i.refCleanup=o(l):o.current=l}}catch(d){Ue(i,s,d)}}function ai(i,s){var o=i.ref,l=i.refCleanup;if(o!==null)if(typeof l=="function")try{l()}catch(d){Ue(i,s,d)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(d){Ue(i,s,d)}else o.current=null}function Qv(i){var s=i.type,o=i.memoizedProps,l=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":o.autoFocus&&l.focus();break e;case"img":o.src?l.src=o.src:o.srcSet&&(l.srcset=o.srcSet)}}catch(d){Ue(i,i.return,d)}}function lh(i,s,o){try{var l=i.stateNode;VC(l,i.type,o,s),l[tn]=s}catch(d){Ue(i,i.return,d)}}function Wv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Sr(i.type)||i.tag===4}function uh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Wv(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&&Sr(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 ch(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(i,s):(s=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,s.appendChild(i),o=o._reactRootContainer,o!=null||s.onclick!==null||(s.onclick=Ai));else if(l!==4&&(l===27&&Sr(i.type)&&(o=i.stateNode,s=null),i=i.child,i!==null))for(ch(i,s,o),i=i.sibling;i!==null;)ch(i,s,o),i=i.sibling}function Mu(i,s,o){var l=i.tag;if(l===5||l===6)i=i.stateNode,s?o.insertBefore(i,s):o.appendChild(i);else if(l!==4&&(l===27&&Sr(i.type)&&(o=i.stateNode),i=i.child,i!==null))for(Mu(i,s,o),i=i.sibling;i!==null;)Mu(i,s,o),i=i.sibling}function e0(i){var s=i.stateNode,o=i.memoizedProps;try{for(var l=i.type,d=s.attributes;d.length;)s.removeAttributeNode(d[0]);It(s,l,o),s[Ut]=i,s[tn]=o}catch(p){Ue(i,i.return,p)}}var $i=!1,xt=!1,fh=!1,t0=typeof WeakSet=="function"?WeakSet:Set,$t=null;function bC(i,s){if(i=i.containerInfo,Dh=Qu,i=hb(i),rd(i)){if("selectionStart"in i)var o={start:i.selectionStart,end:i.selectionEnd};else e:{o=(o=i.ownerDocument)&&o.defaultView||window;var l=o.getSelection&&o.getSelection();if(l&&l.rangeCount!==0){o=l.anchorNode;var d=l.anchorOffset,p=l.focusNode;l=l.focusOffset;try{o.nodeType,p.nodeType}catch{o=null;break e}var b=0,w=-1,A=-1,N=0,V=0,P=i,B=null;t:for(;;){for(var z;P!==o||d!==0&&P.nodeType!==3||(w=b+d),P!==p||l!==0&&P.nodeType!==3||(A=b+l),P.nodeType===3&&(b+=P.nodeValue.length),(z=P.firstChild)!==null;)B=P,P=z;for(;;){if(P===i)break t;if(B===o&&++N===d&&(w=b),B===p&&++V===l&&(A=b),(z=P.nextSibling)!==null)break;P=B,B=P.parentNode}P=z}o=w===-1||A===-1?null:{start:w,end:A}}else o=null}o=o||{start:0,end:0}}else o=null;for(Nh={focusedElem:i,selectionRange:o},Qu=!1,$t=s;$t!==null;)if(s=$t,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,$t=i;else for(;$t!==null;){switch(s=$t,p=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(o=0;o<i.length;o++)d=i[o],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&p!==null){i=void 0,o=s,d=p.memoizedProps,p=p.memoizedState,l=o.stateNode;try{var ie=us(o.type,d);i=l.getSnapshotBeforeUpdate(ie,p),l.__reactInternalSnapshotBeforeUpdate=i}catch(ue){Ue(o,o.return,ue)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,o=i.nodeType,o===9)Bh(i);else if(o===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bh(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,$t=i;break}$t=s.return}}function n0(i,s,o){var l=o.flags;switch(o.tag){case 0:case 11:case 15:Bi(i,o),l&4&&Ca(5,o);break;case 1:if(Bi(i,o),l&4)if(i=o.stateNode,s===null)try{i.componentDidMount()}catch(b){Ue(o,o.return,b)}else{var d=us(o.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(d,s,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ue(o,o.return,b)}}l&64&&Xv(o),l&512&&ka(o,o.return);break;case 3:if(Bi(i,o),l&64&&(i=o.updateQueue,i!==null)){if(s=null,o.child!==null)switch(o.child.tag){case 27:case 5:s=o.child.stateNode;break;case 1:s=o.child.stateNode}try{Ub(i,s)}catch(b){Ue(o,o.return,b)}}break;case 27:s===null&&l&4&&e0(o);case 26:case 5:Bi(i,o),s===null&&l&4&&Qv(o),l&512&&ka(o,o.return);break;case 12:Bi(i,o);break;case 31:Bi(i,o),l&4&&s0(i,o);break;case 13:Bi(i,o),l&4&&o0(i,o),l&64&&(i=o.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(o=_C.bind(null,o),GC(i,o))));break;case 22:if(l=o.memoizedState!==null||$i,!l){s=s!==null&&s.memoizedState!==null||xt,d=$i;var p=xt;$i=l,(xt=s)&&!p?zi(i,o,(o.subtreeFlags&8772)!==0):Bi(i,o),$i=d,xt=p}break;case 30:break;default:Bi(i,o)}}function i0(i){var s=i.alternate;s!==null&&(i.alternate=null,i0(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Kf(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 tt=null,rn=!1;function ji(i,s,o){for(o=o.child;o!==null;)r0(i,s,o),o=o.sibling}function r0(i,s,o){if(dn&&typeof dn.onCommitFiberUnmount=="function")try{dn.onCommitFiberUnmount(ea,o)}catch{}switch(o.tag){case 26:xt||ai(o,s),ji(i,s,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:xt||ai(o,s);var l=tt,d=rn;Sr(o.type)&&(tt=o.stateNode,rn=!1),ji(i,s,o),Va(o.stateNode),tt=l,rn=d;break;case 5:xt||ai(o,s);case 6:if(l=tt,d=rn,tt=null,ji(i,s,o),tt=l,rn=d,tt!==null)if(rn)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(o.stateNode)}catch(p){Ue(o,s,p)}else try{tt.removeChild(o.stateNode)}catch(p){Ue(o,s,p)}break;case 18:tt!==null&&(rn?(i=tt,X0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,o.stateNode),mo(i)):X0(tt,o.stateNode));break;case 4:l=tt,d=rn,tt=o.stateNode.containerInfo,rn=!0,ji(i,s,o),tt=l,rn=d;break;case 0:case 11:case 14:case 15:hr(2,o,s),xt||hr(4,o,s),ji(i,s,o);break;case 1:xt||(ai(o,s),l=o.stateNode,typeof l.componentWillUnmount=="function"&&Zv(o,s,l)),ji(i,s,o);break;case 21:ji(i,s,o);break;case 22:xt=(l=xt)||o.memoizedState!==null,ji(i,s,o),xt=l;break;default:ji(i,s,o)}}function s0(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{mo(i)}catch(o){Ue(s,s.return,o)}}}function o0(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{mo(i)}catch(o){Ue(s,s.return,o)}}function vC(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new t0),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new t0),s;default:throw Error(r(435,i.tag))}}function Du(i,s){var o=vC(i);s.forEach(function(l){if(!o.has(l)){o.add(l);var d=RC.bind(null,i,l);l.then(d,d)}})}function sn(i,s){var o=s.deletions;if(o!==null)for(var l=0;l<o.length;l++){var d=o[l],p=i,b=s,w=b;e:for(;w!==null;){switch(w.tag){case 27:if(Sr(w.type)){tt=w.stateNode,rn=!1;break e}break;case 5:tt=w.stateNode,rn=!1;break e;case 3:case 4:tt=w.stateNode.containerInfo,rn=!0;break e}w=w.return}if(tt===null)throw Error(r(160));r0(p,b,d),tt=null,rn=!1,p=d.alternate,p!==null&&(p.return=null),d.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)a0(s,i),s=s.sibling}var Yn=null;function a0(i,s){var o=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:sn(s,i),on(i),l&4&&(hr(3,i,i.return),Ca(3,i),hr(5,i,i.return));break;case 1:sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),l&64&&$i&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(o=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=o===null?l:o.concat(l))));break;case 26:var d=Yn;if(sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),l&4){var p=o!==null?o.memoizedState:null;if(l=i.memoizedState,o===null)if(l===null)if(i.stateNode===null){e:{l=i.type,o=i.memoizedProps,d=d.ownerDocument||d;t:switch(l){case"title":p=d.getElementsByTagName("title")[0],(!p||p[ia]||p[Ut]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=d.createElement(l),d.head.insertBefore(p,d.querySelector("head > title"))),It(p,l,o),p[Ut]=i,Nt(p),l=p;break e;case"link":var b=aS("link","href",d).get(l+(o.href||""));if(b){for(var w=0;w<b.length;w++)if(p=b[w],p.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&p.getAttribute("rel")===(o.rel==null?null:o.rel)&&p.getAttribute("title")===(o.title==null?null:o.title)&&p.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){b.splice(w,1);break t}}p=d.createElement(l),It(p,l,o),d.head.appendChild(p);break;case"meta":if(b=aS("meta","content",d).get(l+(o.content||""))){for(w=0;w<b.length;w++)if(p=b[w],p.getAttribute("content")===(o.content==null?null:""+o.content)&&p.getAttribute("name")===(o.name==null?null:o.name)&&p.getAttribute("property")===(o.property==null?null:o.property)&&p.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&p.getAttribute("charset")===(o.charSet==null?null:o.charSet)){b.splice(w,1);break t}}p=d.createElement(l),It(p,l,o),d.head.appendChild(p);break;default:throw Error(r(468,l))}p[Ut]=i,Nt(p),l=p}i.stateNode=l}else lS(d,i.type,i.stateNode);else i.stateNode=oS(d,l,i.memoizedProps);else p!==l?(p===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):p.count--,l===null?lS(d,i.type,i.stateNode):oS(d,l,i.memoizedProps)):l===null&&i.stateNode!==null&&lh(i,i.memoizedProps,o.memoizedProps)}break;case 27:sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),o!==null&&l&4&&lh(i,i.memoizedProps,o.memoizedProps);break;case 5:if(sn(s,i),on(i),l&512&&(xt||o===null||ai(o,o.return)),i.flags&32){d=i.stateNode;try{zs(d,"")}catch(ie){Ue(i,i.return,ie)}}l&4&&i.stateNode!=null&&(d=i.memoizedProps,lh(i,d,o!==null?o.memoizedProps:d)),l&1024&&(fh=!0);break;case 6:if(sn(s,i),on(i),l&4){if(i.stateNode===null)throw Error(r(162));l=i.memoizedProps,o=i.stateNode;try{o.nodeValue=l}catch(ie){Ue(i,i.return,ie)}}break;case 3:if(Yu=null,d=Yn,Yn=Fu(s.containerInfo),sn(s,i),Yn=d,on(i),l&4&&o!==null&&o.memoizedState.isDehydrated)try{mo(s.containerInfo)}catch(ie){Ue(i,i.return,ie)}fh&&(fh=!1,l0(i));break;case 4:l=Yn,Yn=Fu(i.stateNode.containerInfo),sn(s,i),on(i),Yn=l;break;case 12:sn(s,i),on(i);break;case 31:sn(s,i),on(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Du(i,l)));break;case 13:sn(s,i),on(i),i.child.flags&8192&&i.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&($u=st()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Du(i,l)));break;case 22:d=i.memoizedState!==null;var A=o!==null&&o.memoizedState!==null,N=$i,V=xt;if($i=N||d,xt=V||A,sn(s,i),xt=V,$i=N,on(i),l&8192)e:for(s=i.stateNode,s._visibility=d?s._visibility&-2:s._visibility|1,d&&(o===null||A||$i||xt||cs(i)),o=null,s=i;;){if(s.tag===5||s.tag===26){if(o===null){A=o=s;try{if(p=A.stateNode,d)b=p.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{w=A.stateNode;var P=A.memoizedProps.style,B=P!=null&&P.hasOwnProperty("display")?P.display:null;w.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(ie){Ue(A,A.return,ie)}}}else if(s.tag===6){if(o===null){A=s;try{A.stateNode.nodeValue=d?"":A.memoizedProps}catch(ie){Ue(A,A.return,ie)}}}else if(s.tag===18){if(o===null){A=s;try{var z=A.stateNode;d?Z0(z,!0):Z0(A.stateNode,!1)}catch(ie){Ue(A,A.return,ie)}}}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;o===s&&(o=null),s=s.return}o===s&&(o=null),s.sibling.return=s.return,s=s.sibling}l&4&&(l=i.updateQueue,l!==null&&(o=l.retryQueue,o!==null&&(l.retryQueue=null,Du(i,o))));break;case 19:sn(s,i),on(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,Du(i,l)));break;case 30:break;case 21:break;default:sn(s,i),on(i)}}function on(i){var s=i.flags;if(s&2){try{for(var o,l=i.return;l!==null;){if(Wv(l)){o=l;break}l=l.return}if(o==null)throw Error(r(160));switch(o.tag){case 27:var d=o.stateNode,p=uh(i);Mu(i,p,d);break;case 5:var b=o.stateNode;o.flags&32&&(zs(b,""),o.flags&=-33);var w=uh(i);Mu(i,w,b);break;case 3:case 4:var A=o.stateNode.containerInfo,N=uh(i);ch(i,N,A);break;default:throw Error(r(161))}}catch(V){Ue(i,i.return,V)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function l0(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;l0(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Bi(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)n0(i,s.alternate,s),s=s.sibling}function cs(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:hr(4,s,s.return),cs(s);break;case 1:ai(s,s.return);var o=s.stateNode;typeof o.componentWillUnmount=="function"&&Zv(s,s.return,o),cs(s);break;case 27:Va(s.stateNode);case 26:case 5:ai(s,s.return),cs(s);break;case 22:s.memoizedState===null&&cs(s);break;case 30:cs(s);break;default:cs(s)}i=i.sibling}}function zi(i,s,o){for(o=o&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var l=s.alternate,d=i,p=s,b=p.flags;switch(p.tag){case 0:case 11:case 15:zi(d,p,o),Ca(4,p);break;case 1:if(zi(d,p,o),l=p,d=l.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(N){Ue(l,l.return,N)}if(l=p,d=l.updateQueue,d!==null){var w=l.stateNode;try{var A=d.shared.hiddenCallbacks;if(A!==null)for(d.shared.hiddenCallbacks=null,d=0;d<A.length;d++)Vb(A[d],w)}catch(N){Ue(l,l.return,N)}}o&&b&64&&Xv(p),ka(p,p.return);break;case 27:e0(p);case 26:case 5:zi(d,p,o),o&&l===null&&b&4&&Qv(p),ka(p,p.return);break;case 12:zi(d,p,o);break;case 31:zi(d,p,o),o&&b&4&&s0(d,p);break;case 13:zi(d,p,o),o&&b&4&&o0(d,p);break;case 22:p.memoizedState===null&&zi(d,p,o),ka(p,p.return);break;case 30:break;default:zi(d,p,o)}s=s.sibling}}function dh(i,s){var o=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(o=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==o&&(i!=null&&i.refCount++,o!=null&&ya(o))}function hh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ya(i))}function Jn(i,s,o,l){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)u0(i,s,o,l),s=s.sibling}function u0(i,s,o,l){var d=s.flags;switch(s.tag){case 0:case 11:case 15:Jn(i,s,o,l),d&2048&&Ca(9,s);break;case 1:Jn(i,s,o,l);break;case 3:Jn(i,s,o,l),d&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ya(i)));break;case 12:if(d&2048){Jn(i,s,o,l),i=s.stateNode;try{var p=s.memoizedProps,b=p.id,w=p.onPostCommit;typeof w=="function"&&w(b,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(A){Ue(s,s.return,A)}}else Jn(i,s,o,l);break;case 31:Jn(i,s,o,l);break;case 13:Jn(i,s,o,l);break;case 23:break;case 22:p=s.stateNode,b=s.alternate,s.memoizedState!==null?p._visibility&2?Jn(i,s,o,l):Ma(i,s):p._visibility&2?Jn(i,s,o,l):(p._visibility|=2,io(i,s,o,l,(s.subtreeFlags&10256)!==0||!1)),d&2048&&dh(b,s);break;case 24:Jn(i,s,o,l),d&2048&&hh(s.alternate,s);break;default:Jn(i,s,o,l)}}function io(i,s,o,l,d){for(d=d&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var p=i,b=s,w=o,A=l,N=b.flags;switch(b.tag){case 0:case 11:case 15:io(p,b,w,A,d),Ca(8,b);break;case 23:break;case 22:var V=b.stateNode;b.memoizedState!==null?V._visibility&2?io(p,b,w,A,d):Ma(p,b):(V._visibility|=2,io(p,b,w,A,d)),d&&N&2048&&dh(b.alternate,b);break;case 24:io(p,b,w,A,d),d&&N&2048&&hh(b.alternate,b);break;default:io(p,b,w,A,d)}s=s.sibling}}function Ma(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var o=i,l=s,d=l.flags;switch(l.tag){case 22:Ma(o,l),d&2048&&dh(l.alternate,l);break;case 24:Ma(o,l),d&2048&&hh(l.alternate,l);break;default:Ma(o,l)}s=s.sibling}}var Da=8192;function ro(i,s,o){if(i.subtreeFlags&Da)for(i=i.child;i!==null;)c0(i,s,o),i=i.sibling}function c0(i,s,o){switch(i.tag){case 26:ro(i,s,o),i.flags&Da&&i.memoizedState!==null&&sk(o,Yn,i.memoizedState,i.memoizedProps);break;case 5:ro(i,s,o);break;case 3:case 4:var l=Yn;Yn=Fu(i.stateNode.containerInfo),ro(i,s,o),Yn=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=Da,Da=16777216,ro(i,s,o),Da=l):ro(i,s,o));break;default:ro(i,s,o)}}function f0(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 Na(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];$t=l,h0(l,i)}f0(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)d0(i),i=i.sibling}function d0(i){switch(i.tag){case 0:case 11:case 15:Na(i),i.flags&2048&&hr(9,i,i.return);break;case 3:Na(i);break;case 12:Na(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Nu(i)):Na(i);break;default:Na(i)}}function Nu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var o=0;o<s.length;o++){var l=s[o];$t=l,h0(l,i)}f0(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:hr(8,s,s.return),Nu(s);break;case 22:o=s.stateNode,o._visibility&2&&(o._visibility&=-3,Nu(s));break;default:Nu(s)}i=i.sibling}}function h0(i,s){for(;$t!==null;){var o=$t;switch(o.tag){case 0:case 11:case 15:hr(8,o,s);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var l=o.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ya(o.memoizedState.cache)}if(l=o.child,l!==null)l.return=o,$t=l;else e:for(o=i;$t!==null;){l=$t;var d=l.sibling,p=l.return;if(i0(l),l===o){$t=null;break e}if(d!==null){d.return=p,$t=d;break e}$t=p}}}var SC={getCacheForType:function(i){var s=qt(vt),o=s.data.get(i);return o===void 0&&(o=i(),s.data.set(i,o)),o},cacheSignal:function(){return qt(vt).controller.signal}},wC=typeof WeakMap=="function"?WeakMap:Map,Be=0,He=null,Ae=null,Oe=0,Ve=0,bn=null,pr=!1,so=!1,ph=!1,Li=0,at=0,mr=0,fs=0,mh=0,vn=0,oo=0,$a=null,an=null,yh=!1,$u=0,p0=0,ju=1/0,Bu=null,yr=null,kt=0,gr=null,ao=null,Vi=0,gh=0,bh=null,m0=null,ja=0,vh=null;function Sn(){return(Be&2)!==0&&Oe!==0?Oe&-Oe:j.T!==null?Eh():Mg()}function y0(){if(vn===0)if((Oe&536870912)===0||Ce){var i=Il;Il<<=1,(Il&3932160)===0&&(Il=262144),vn=i}else vn=536870912;return i=yn.current,i!==null&&(i.flags|=32),vn}function ln(i,s,o){(i===He&&(Ve===2||Ve===9)||i.cancelPendingCommit!==null)&&(lo(i,0),br(i,Oe,vn,!1)),na(i,o),((Be&2)===0||i!==He)&&(i===He&&((Be&2)===0&&(fs|=o),at===4&&br(i,Oe,vn,!1)),li(i))}function g0(i,s,o){if((Be&6)!==0)throw Error(r(327));var l=!o&&(s&127)===0&&(s&i.expiredLanes)===0||ta(i,s),d=l?AC(i,s):wh(i,s,!0),p=l;do{if(d===0){so&&!l&&br(i,s,0,!1);break}else{if(o=i.current.alternate,p&&!xC(o)){d=wh(i,s,!1),p=!1;continue}if(d===2){if(p=s,i.errorRecoveryDisabledLanes&p)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;d=$a;var A=w.current.memoizedState.isDehydrated;if(A&&(lo(w,b).flags|=256),b=wh(w,b,!1),b!==2){if(ph&&!A){w.errorRecoveryDisabledLanes|=p,fs|=p,d=4;break e}p=an,an=d,p!==null&&(an===null?an=p:an.push.apply(an,p))}d=b}if(p=!1,d!==2)continue}}if(d===1){lo(i,0),br(i,s,0,!0);break}e:{switch(l=i,p=d,p){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:br(l,s,vn,!pr);break e;case 2:an=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(d=$u+300-st(),10<d)){if(br(l,s,vn,!pr),Fl(l,0,!0)!==0)break e;Vi=s,l.timeoutHandle=Y0(b0.bind(null,l,o,an,Bu,yh,s,vn,fs,oo,pr,p,"Throttled",-0,0),d);break e}b0(l,o,an,Bu,yh,s,vn,fs,oo,pr,p,null,-0,0)}}break}while(!0);li(i)}function b0(i,s,o,l,d,p,b,w,A,N,V,P,B,z){if(i.timeoutHandle=-1,P=s.subtreeFlags,P&8192||(P&16785408)===16785408){P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ai},c0(s,p,P);var ie=(p&62914560)===p?$u-st():(p&4194048)===p?p0-st():0;if(ie=ok(P,ie),ie!==null){Vi=p,i.cancelPendingCommit=ie(O0.bind(null,i,s,p,o,l,d,b,w,A,V,P,null,B,z)),br(i,p,b,!N);return}}O0(i,s,p,o,l,d,b,w,A)}function xC(i){for(var s=i;;){var o=s.tag;if((o===0||o===11||o===15)&&s.flags&16384&&(o=s.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var l=0;l<o.length;l++){var d=o[l],p=d.getSnapshot;d=d.value;try{if(!pn(p(),d))return!1}catch{return!1}}if(o=s.child,s.subtreeFlags&16384&&o!==null)o.return=s,s=o;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 br(i,s,o,l){s&=~mh,s&=~fs,i.suspendedLanes|=s,i.pingedLanes&=~s,l&&(i.warmLanes|=s),l=i.expirationTimes;for(var d=s;0<d;){var p=31-hn(d),b=1<<p;l[p]=-1,d&=~b}o!==0&&Rg(i,o,s)}function zu(){return(Be&6)===0?(Ba(0),!1):!0}function Sh(){if(Ae!==null){if(Ve===0)var i=Ae.return;else i=Ae,Ri=ns=null,Bd(i),Qs=null,ba=0,i=Ae;for(;i!==null;)Jv(i.alternate,i),i=i.return;Ae=null}}function lo(i,s){var o=i.timeoutHandle;o!==-1&&(i.timeoutHandle=-1,qC(o)),o=i.cancelPendingCommit,o!==null&&(i.cancelPendingCommit=null,o()),Vi=0,Sh(),He=i,Ae=o=Oi(i.current,null),Oe=s,Ve=0,bn=null,pr=!1,so=ta(i,s),ph=!1,oo=vn=mh=fs=mr=at=0,an=$a=null,yh=!1,(s&8)!==0&&(s|=s&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=s;0<l;){var d=31-hn(l),p=1<<d;s|=i[d],l&=~p}return Li=s,ru(),o}function v0(i,s){be=null,j.H=Oa,s===Zs||s===du?(s=jb(),Ve=3):s===Ad?(s=jb(),Ve=4):Ve=s===Qd?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,bn=s,Ae===null&&(at=1,Ou(i,Cn(s,i.current)))}function S0(){var i=yn.current;return i===null?!0:(Oe&4194048)===Oe?Nn===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?i===Nn:!1}function w0(){var i=j.H;return j.H=Oa,i===null?Oa:i}function x0(){var i=j.A;return j.A=SC,i}function Lu(){at=4,pr||(Oe&4194048)!==Oe&&yn.current!==null||(so=!0),(mr&134217727)===0&&(fs&134217727)===0||He===null||br(He,Oe,vn,!1)}function wh(i,s,o){var l=Be;Be|=2;var d=w0(),p=x0();(He!==i||Oe!==s)&&(Bu=null,lo(i,s)),s=!1;var b=at;e:do try{if(Ve!==0&&Ae!==null){var w=Ae,A=bn;switch(Ve){case 8:Sh(),b=6;break e;case 3:case 2:case 9:case 6:yn.current===null&&(s=!0);var N=Ve;if(Ve=0,bn=null,uo(i,w,A,N),o&&so){b=0;break e}break;default:N=Ve,Ve=0,bn=null,uo(i,w,A,N)}}TC(),b=at;break}catch(V){v0(i,V)}while(!0);return s&&i.shellSuspendCounter++,Ri=ns=null,Be=l,j.H=d,j.A=p,Ae===null&&(He=null,Oe=0,ru()),b}function TC(){for(;Ae!==null;)T0(Ae)}function AC(i,s){var o=Be;Be|=2;var l=w0(),d=x0();He!==i||Oe!==s?(Bu=null,ju=st()+500,lo(i,s)):so=ta(i,s);e:do try{if(Ve!==0&&Ae!==null){s=Ae;var p=bn;t:switch(Ve){case 1:Ve=0,bn=null,uo(i,s,p,1);break;case 2:case 9:if(Nb(p)){Ve=0,bn=null,A0(s);break}s=function(){Ve!==2&&Ve!==9||He!==i||(Ve=7),li(i)},p.then(s,s);break e;case 3:Ve=7;break e;case 4:Ve=5;break e;case 7:Nb(p)?(Ve=0,bn=null,A0(s)):(Ve=0,bn=null,uo(i,s,p,7));break;case 5:var b=null;switch(Ae.tag){case 26:b=Ae.memoizedState;case 5:case 27:var w=Ae;if(b?uS(b):w.stateNode.complete){Ve=0,bn=null;var A=w.sibling;if(A!==null)Ae=A;else{var N=w.return;N!==null?(Ae=N,Vu(N)):Ae=null}break t}}Ve=0,bn=null,uo(i,s,p,5);break;case 6:Ve=0,bn=null,uo(i,s,p,6);break;case 8:Sh(),at=6;break e;default:throw Error(r(462))}}EC();break}catch(V){v0(i,V)}while(!0);return Ri=ns=null,j.H=l,j.A=d,Be=o,Ae!==null?0:(He=null,Oe=0,ru(),at)}function EC(){for(;Ae!==null&&!ri();)T0(Ae)}function T0(i){var s=Gv(i.alternate,i,Li);i.memoizedProps=i.pendingProps,s===null?Vu(i):Ae=s}function A0(i){var s=i,o=s.alternate;switch(s.tag){case 15:case 0:s=Kv(o,s,s.pendingProps,s.type,void 0,Oe);break;case 11:s=Kv(o,s,s.pendingProps,s.type.render,s.ref,Oe);break;case 5:Bd(s);default:Jv(o,s),s=Ae=xb(s,Li),s=Gv(o,s,Li)}i.memoizedProps=i.pendingProps,s===null?Vu(i):Ae=s}function uo(i,s,o,l){Ri=ns=null,Bd(s),Qs=null,ba=0;var d=s.return;try{if(hC(i,d,s,o,Oe)){at=1,Ou(i,Cn(o,i.current)),Ae=null;return}}catch(p){if(d!==null)throw Ae=d,p;at=1,Ou(i,Cn(o,i.current)),Ae=null;return}s.flags&32768?(Ce||l===1?i=!0:so||(Oe&536870912)!==0?i=!1:(pr=i=!0,(l===2||l===9||l===3||l===6)&&(l=yn.current,l!==null&&l.tag===13&&(l.flags|=16384))),E0(s,i)):Vu(s)}function Vu(i){var s=i;do{if((s.flags&32768)!==0){E0(s,pr);return}i=s.return;var o=yC(s.alternate,s,Li);if(o!==null){Ae=o;return}if(s=s.sibling,s!==null){Ae=s;return}Ae=s=i}while(s!==null);at===0&&(at=5)}function E0(i,s){do{var o=gC(i.alternate,i);if(o!==null){o.flags&=32767,Ae=o;return}if(o=i.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!s&&(i=i.sibling,i!==null)){Ae=i;return}Ae=i=o}while(i!==null);at=6,Ae=null}function O0(i,s,o,l,d,p,b,w,A){i.cancelPendingCommit=null;do Uu();while(kt!==0);if((Be&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(p=s.lanes|s.childLanes,p|=ud,rR(i,o,p,b,w,A),i===He&&(Ae=He=null,Oe=0),ao=s,gr=i,Vi=o,gh=p,bh=d,m0=l,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,CC(ql,function(){return M0(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||l){l=j.T,j.T=null,d=U.p,U.p=2,b=Be,Be|=4;try{bC(i,s,o)}finally{Be=b,U.p=d,j.T=l}}kt=1,_0(),R0(),C0()}}function _0(){if(kt===1){kt=0;var i=gr,s=ao,o=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||o){o=j.T,j.T=null;var l=U.p;U.p=2;var d=Be;Be|=4;try{a0(s,i);var p=Nh,b=hb(i.containerInfo),w=p.focusedElem,A=p.selectionRange;if(b!==w&&w&&w.ownerDocument&&db(w.ownerDocument.documentElement,w)){if(A!==null&&rd(w)){var N=A.start,V=A.end;if(V===void 0&&(V=N),"selectionStart"in w)w.selectionStart=N,w.selectionEnd=Math.min(V,w.value.length);else{var P=w.ownerDocument||document,B=P&&P.defaultView||window;if(B.getSelection){var z=B.getSelection(),ie=w.textContent.length,ue=Math.min(A.start,ie),Pe=A.end===void 0?ue:Math.min(A.end,ie);!z.extend&&ue>Pe&&(b=Pe,Pe=ue,ue=b);var k=fb(w,ue),O=fb(w,Pe);if(k&&O&&(z.rangeCount!==1||z.anchorNode!==k.node||z.anchorOffset!==k.offset||z.focusNode!==O.node||z.focusOffset!==O.offset)){var D=P.createRange();D.setStart(k.node,k.offset),z.removeAllRanges(),ue>Pe?(z.addRange(D),z.extend(O.node,O.offset)):(D.setEnd(O.node,O.offset),z.addRange(D))}}}}for(P=[],z=w;z=z.parentNode;)z.nodeType===1&&P.push({element:z,left:z.scrollLeft,top:z.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<P.length;w++){var K=P[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Qu=!!Dh,Nh=Dh=null}finally{Be=d,U.p=l,j.T=o}}i.current=s,kt=2}}function R0(){if(kt===2){kt=0;var i=gr,s=ao,o=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||o){o=j.T,j.T=null;var l=U.p;U.p=2;var d=Be;Be|=4;try{n0(i,s.alternate,s)}finally{Be=d,U.p=l,j.T=o}}kt=3}}function C0(){if(kt===4||kt===3){kt=0,Fn();var i=gr,s=ao,o=Vi,l=m0;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?kt=5:(kt=0,ao=gr=null,k0(i,i.pendingLanes));var d=i.pendingLanes;if(d===0&&(yr=null),Vf(o),s=s.stateNode,dn&&typeof dn.onCommitFiberRoot=="function")try{dn.onCommitFiberRoot(ea,s,void 0,(s.current.flags&128)===128)}catch{}if(l!==null){s=j.T,d=U.p,U.p=2,j.T=null;try{for(var p=i.onRecoverableError,b=0;b<l.length;b++){var w=l[b];p(w.value,{componentStack:w.stack})}}finally{j.T=s,U.p=d}}(Vi&3)!==0&&Uu(),li(i),d=i.pendingLanes,(o&261930)!==0&&(d&42)!==0?i===vh?ja++:(ja=0,vh=i):ja=0,Ba(0)}}function k0(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,ya(s)))}function Uu(){return _0(),R0(),C0(),M0()}function M0(){if(kt!==5)return!1;var i=gr,s=gh;gh=0;var o=Vf(Vi),l=j.T,d=U.p;try{U.p=32>o?32:o,j.T=null,o=bh,bh=null;var p=gr,b=Vi;if(kt=0,ao=gr=null,Vi=0,(Be&6)!==0)throw Error(r(331));var w=Be;if(Be|=4,d0(p.current),u0(p,p.current,b,o),Be=w,Ba(0,!1),dn&&typeof dn.onPostCommitFiberRoot=="function")try{dn.onPostCommitFiberRoot(ea,p)}catch{}return!0}finally{U.p=d,j.T=l,k0(i,s)}}function D0(i,s,o){s=Cn(o,s),s=Zd(i.stateNode,s,2),i=cr(i,s,2),i!==null&&(na(i,2),li(i))}function Ue(i,s,o){if(i.tag===3)D0(i,i,o);else for(;s!==null;){if(s.tag===3){D0(s,i,o);break}else if(s.tag===1){var l=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(yr===null||!yr.has(l))){i=Cn(o,i),o=Nv(2),l=cr(s,o,2),l!==null&&($v(o,l,s,i),na(l,2),li(l));break}}s=s.return}}function xh(i,s,o){var l=i.pingCache;if(l===null){l=i.pingCache=new wC;var d=new Set;l.set(s,d)}else d=l.get(s),d===void 0&&(d=new Set,l.set(s,d));d.has(o)||(ph=!0,d.add(o),i=OC.bind(null,i,s,o),s.then(i,i))}function OC(i,s,o){var l=i.pingCache;l!==null&&l.delete(s),i.pingedLanes|=i.suspendedLanes&o,i.warmLanes&=~o,He===i&&(Oe&o)===o&&(at===4||at===3&&(Oe&62914560)===Oe&&300>st()-$u?(Be&2)===0&&lo(i,0):mh|=o,oo===Oe&&(oo=0)),li(i)}function N0(i,s){s===0&&(s=_g()),i=Wr(i,s),i!==null&&(na(i,s),li(i))}function _C(i){var s=i.memoizedState,o=0;s!==null&&(o=s.retryLane),N0(i,o)}function RC(i,s){var o=0;switch(i.tag){case 31:case 13:var l=i.stateNode,d=i.memoizedState;d!==null&&(o=d.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(s),N0(i,o)}function CC(i,s){return Vt(i,s)}var Ku=null,co=null,Th=!1,qu=!1,Ah=!1,vr=0;function li(i){i!==co&&i.next===null&&(co===null?Ku=co=i:co=co.next=i),qu=!0,Th||(Th=!0,MC())}function Ba(i,s){if(!Ah&&qu){Ah=!0;do for(var o=!1,l=Ku;l!==null;){if(i!==0){var d=l.pendingLanes;if(d===0)var p=0;else{var b=l.suspendedLanes,w=l.pingedLanes;p=(1<<31-hn(42|i)+1)-1,p&=d&~(b&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(o=!0,z0(l,p))}else p=Oe,p=Fl(l,l===He?p:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(p&3)===0||ta(l,p)||(o=!0,z0(l,p));l=l.next}while(o);Ah=!1}}function kC(){$0()}function $0(){qu=Th=!1;var i=0;vr!==0&&KC()&&(i=vr);for(var s=st(),o=null,l=Ku;l!==null;){var d=l.next,p=j0(l,s);p===0?(l.next=null,o===null?Ku=d:o.next=d,d===null&&(co=o)):(o=l,(i!==0||(p&3)!==0)&&(qu=!0)),l=d}kt!==0&&kt!==5||Ba(i),vr!==0&&(vr=0)}function j0(i,s){for(var o=i.suspendedLanes,l=i.pingedLanes,d=i.expirationTimes,p=i.pendingLanes&-62914561;0<p;){var b=31-hn(p),w=1<<b,A=d[b];A===-1?((w&o)===0||(w&l)!==0)&&(d[b]=iR(w,s)):A<=s&&(i.expiredLanes|=w),p&=~w}if(s=He,o=Oe,o=Fl(i,i===s?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,o===0||i===s&&(Ve===2||Ve===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&Hn(l),i.callbackNode=null,i.callbackPriority=0;if((o&3)===0||ta(i,o)){if(s=o&-o,s===i.callbackPriority)return s;switch(l!==null&&Hn(l),Vf(o)){case 2:case 8:o=Eg;break;case 32:o=ql;break;case 268435456:o=Og;break;default:o=ql}return l=B0.bind(null,i),o=Vt(o,l),i.callbackPriority=s,i.callbackNode=o,s}return l!==null&&l!==null&&Hn(l),i.callbackPriority=2,i.callbackNode=null,2}function B0(i,s){if(kt!==0&&kt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var o=i.callbackNode;if(Uu()&&i.callbackNode!==o)return null;var l=Oe;return l=Fl(i,i===He?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(g0(i,l,s),j0(i,st()),i.callbackNode!=null&&i.callbackNode===o?B0.bind(null,i):null)}function z0(i,s){if(Uu())return null;g0(i,s,!0)}function MC(){PC(function(){(Be&6)!==0?Vt(Ag,kC):$0()})}function Eh(){if(vr===0){var i=Js;i===0&&(i=Pl,Pl<<=1,(Pl&261888)===0&&(Pl=256)),vr=i}return vr}function L0(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Xl(""+i)}function V0(i,s){var o=s.ownerDocument.createElement("input");return o.name=s.name,o.value=s.value,i.id&&o.setAttribute("form",i.id),s.parentNode.insertBefore(o,s),i=new FormData(i),o.parentNode.removeChild(o),i}function DC(i,s,o,l,d){if(s==="submit"&&o&&o.stateNode===d){var p=L0((d[tn]||null).action),b=l.submitter;b&&(s=(s=b[tn]||null)?L0(s.formAction):b.getAttribute("formAction"),s!==null&&(p=s,b=null));var w=new eu("action","action",null,l,d);i.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(vr!==0){var A=b?V0(d,b):new FormData(d);Hd(o,{pending:!0,data:A,method:d.method,action:p},null,A)}}else typeof p=="function"&&(w.preventDefault(),A=b?V0(d,b):new FormData(d),Hd(o,{pending:!0,data:A,method:d.method,action:p},p,A))},currentTarget:d}]})}}for(var Oh=0;Oh<ld.length;Oh++){var _h=ld[Oh],NC=_h.toLowerCase(),$C=_h[0].toUpperCase()+_h.slice(1);Gn(NC,"on"+$C)}Gn(yb,"onAnimationEnd"),Gn(gb,"onAnimationIteration"),Gn(bb,"onAnimationStart"),Gn("dblclick","onDoubleClick"),Gn("focusin","onFocus"),Gn("focusout","onBlur"),Gn(XR,"onTransitionRun"),Gn(ZR,"onTransitionStart"),Gn(QR,"onTransitionCancel"),Gn(vb,"onTransitionEnd"),js("onMouseEnter",["mouseout","mouseover"]),js("onMouseLeave",["mouseout","mouseover"]),js("onPointerEnter",["pointerout","pointerover"]),js("onPointerLeave",["pointerout","pointerover"]),Jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var za="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(" "),jC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(za));function U0(i,s){s=(s&4)!==0;for(var o=0;o<i.length;o++){var l=i[o],d=l.event;l=l.listeners;e:{var p=void 0;if(s)for(var b=l.length-1;0<=b;b--){var w=l[b],A=w.instance,N=w.currentTarget;if(w=w.listener,A!==p&&d.isPropagationStopped())break e;p=w,d.currentTarget=N;try{p(d)}catch(V){iu(V)}d.currentTarget=null,p=A}else for(b=0;b<l.length;b++){if(w=l[b],A=w.instance,N=w.currentTarget,w=w.listener,A!==p&&d.isPropagationStopped())break e;p=w,d.currentTarget=N;try{p(d)}catch(V){iu(V)}d.currentTarget=null,p=A}}}}function Ee(i,s){var o=s[Uf];o===void 0&&(o=s[Uf]=new Set);var l=i+"__bubble";o.has(l)||(K0(s,i,2,!1),o.add(l))}function Rh(i,s,o){var l=0;s&&(l|=4),K0(o,i,l,s)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function Ch(i){if(!i[Pu]){i[Pu]=!0,$g.forEach(function(o){o!=="selectionchange"&&(jC.has(o)||Rh(o,!1,i),Rh(o,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Pu]||(s[Pu]=!0,Rh("selectionchange",!1,s))}}function K0(i,s,o,l){switch(yS(s)){case 2:var d=uk;break;case 8:d=ck;break;default:d=Ih}o=d.bind(null,s,o,i),d=void 0,!Jf||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(d=!0),l?d!==void 0?i.addEventListener(s,o,{capture:!0,passive:d}):i.addEventListener(s,o,!0):d!==void 0?i.addEventListener(s,o,{passive:d}):i.addEventListener(s,o,!1)}function kh(i,s,o,l,d){var p=l;if((s&1)===0&&(s&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var w=l.stateNode.containerInfo;if(w===d)break;if(b===4)for(b=l.return;b!==null;){var A=b.tag;if((A===3||A===4)&&b.stateNode.containerInfo===d)return;b=b.return}for(;w!==null;){if(b=Ds(w),b===null)return;if(A=b.tag,A===5||A===6||A===26||A===27){l=p=b;continue e}w=w.parentNode}}l=l.return}Fg(function(){var N=p,V=Gf(o),P=[];e:{var B=Sb.get(i);if(B!==void 0){var z=eu,ie=i;switch(i){case"keypress":if(Ql(o)===0)break e;case"keydown":case"keyup":z=RR;break;case"focusin":ie="focus",z=Wf;break;case"focusout":ie="blur",z=Wf;break;case"beforeblur":case"afterblur":z=Wf;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":z=Jg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":z=yR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":z=MR;break;case yb:case gb:case bb:z=vR;break;case vb:z=NR;break;case"scroll":case"scrollend":z=pR;break;case"wheel":z=jR;break;case"copy":case"cut":case"paste":z=wR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":z=Zg;break;case"toggle":case"beforetoggle":z=zR}var ue=(s&4)!==0,Pe=!ue&&(i==="scroll"||i==="scrollend"),k=ue?B!==null?B+"Capture":null:B;ue=[];for(var O=N,D;O!==null;){var K=O;if(D=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||D===null||k===null||(K=sa(O,k),K!=null&&ue.push(La(O,K,D))),Pe)break;O=O.return}0<ue.length&&(B=new z(B,ie,null,o,V),P.push({event:B,listeners:ue}))}}if((s&7)===0){e:{if(B=i==="mouseover"||i==="pointerover",z=i==="mouseout"||i==="pointerout",B&&o!==Ff&&(ie=o.relatedTarget||o.fromElement)&&(Ds(ie)||ie[Ms]))break e;if((z||B)&&(B=V.window===V?V:(B=V.ownerDocument)?B.defaultView||B.parentWindow:window,z?(ie=o.relatedTarget||o.toElement,z=N,ie=ie?Ds(ie):null,ie!==null&&(Pe=u(ie),ue=ie.tag,ie!==Pe||ue!==5&&ue!==27&&ue!==6)&&(ie=null)):(z=null,ie=N),z!==ie)){if(ue=Jg,K="onMouseLeave",k="onMouseEnter",O="mouse",(i==="pointerout"||i==="pointerover")&&(ue=Zg,K="onPointerLeave",k="onPointerEnter",O="pointer"),Pe=z==null?B:ra(z),D=ie==null?B:ra(ie),B=new ue(K,O+"leave",z,o,V),B.target=Pe,B.relatedTarget=D,K=null,Ds(V)===N&&(ue=new ue(k,O+"enter",ie,o,V),ue.target=D,ue.relatedTarget=Pe,K=ue),Pe=K,z&&ie)t:{for(ue=BC,k=z,O=ie,D=0,K=k;K;K=ue(K))D++;K=0;for(var le=O;le;le=ue(le))K++;for(;0<D-K;)k=ue(k),D--;for(;0<K-D;)O=ue(O),K--;for(;D--;){if(k===O||O!==null&&k===O.alternate){ue=k;break t}k=ue(k),O=ue(O)}ue=null}else ue=null;z!==null&&q0(P,B,z,ue,!1),ie!==null&&Pe!==null&&q0(P,Pe,ie,ue,!0)}}e:{if(B=N?ra(N):window,z=B.nodeName&&B.nodeName.toLowerCase(),z==="select"||z==="input"&&B.type==="file")var Ne=sb;else if(ib(B))if(ob)Ne=GR;else{Ne=HR;var se=IR}else z=B.nodeName,!z||z.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?N&&Hf(N.elementType)&&(Ne=sb):Ne=FR;if(Ne&&(Ne=Ne(i,N))){rb(P,Ne,o,V);break e}se&&se(i,B,N),i==="focusout"&&N&&B.type==="number"&&N.memoizedProps.value!=null&&If(B,"number",B.value)}switch(se=N?ra(N):window,i){case"focusin":(ib(se)||se.contentEditable==="true")&&(Ks=se,sd=N,ha=null);break;case"focusout":ha=sd=Ks=null;break;case"mousedown":od=!0;break;case"contextmenu":case"mouseup":case"dragend":od=!1,pb(P,o,V);break;case"selectionchange":if(JR)break;case"keydown":case"keyup":pb(P,o,V)}var Se;if(td)e:{switch(i){case"compositionstart":var _e="onCompositionStart";break e;case"compositionend":_e="onCompositionEnd";break e;case"compositionupdate":_e="onCompositionUpdate";break e}_e=void 0}else Us?tb(i,o)&&(_e="onCompositionEnd"):i==="keydown"&&o.keyCode===229&&(_e="onCompositionStart");_e&&(Qg&&o.locale!=="ko"&&(Us||_e!=="onCompositionStart"?_e==="onCompositionEnd"&&Us&&(Se=Gg()):(ir=V,Xf="value"in ir?ir.value:ir.textContent,Us=!0)),se=Iu(N,_e),0<se.length&&(_e=new Xg(_e,i,null,o,V),P.push({event:_e,listeners:se}),Se?_e.data=Se:(Se=nb(o),Se!==null&&(_e.data=Se)))),(Se=VR?UR(i,o):KR(i,o))&&(_e=Iu(N,"onBeforeInput"),0<_e.length&&(se=new Xg("onBeforeInput","beforeinput",null,o,V),P.push({event:se,listeners:_e}),se.data=Se)),DC(P,i,N,o,V)}U0(P,s)})}function La(i,s,o){return{instance:i,listener:s,currentTarget:o}}function Iu(i,s){for(var o=s+"Capture",l=[];i!==null;){var d=i,p=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||p===null||(d=sa(i,o),d!=null&&l.unshift(La(i,d,p)),d=sa(i,s),d!=null&&l.push(La(i,d,p))),i.tag===3)return l;i=i.return}return[]}function BC(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function q0(i,s,o,l,d){for(var p=s._reactName,b=[];o!==null&&o!==l;){var w=o,A=w.alternate,N=w.stateNode;if(w=w.tag,A!==null&&A===l)break;w!==5&&w!==26&&w!==27||N===null||(A=N,d?(N=sa(o,p),N!=null&&b.unshift(La(o,N,A))):d||(N=sa(o,p),N!=null&&b.push(La(o,N,A)))),o=o.return}b.length!==0&&i.push({event:s,listeners:b})}var zC=/\r\n?/g,LC=/\u0000|\uFFFD/g;function P0(i){return(typeof i=="string"?i:""+i).replace(zC,`
|
|
21
|
+
`).replace(LC,"")}function I0(i,s){return s=P0(s),P0(i)===s}function qe(i,s,o,l,d,p){switch(o){case"children":typeof l=="string"?s==="body"||s==="textarea"&&l===""||zs(i,l):(typeof l=="number"||typeof l=="bigint")&&s!=="body"&&zs(i,""+l);break;case"className":Yl(i,"class",l);break;case"tabIndex":Yl(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Yl(i,o,l);break;case"style":Ig(i,l,p);break;case"data":if(s!=="object"){Yl(i,"data",l);break}case"src":case"href":if(l===""&&(s!=="a"||o!=="href")){i.removeAttribute(o);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Xl(""+l),i.setAttribute(o,l);break;case"action":case"formAction":if(typeof l=="function"){i.setAttribute(o,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof p=="function"&&(o==="formAction"?(s!=="input"&&qe(i,s,"name",d.name,d,null),qe(i,s,"formEncType",d.formEncType,d,null),qe(i,s,"formMethod",d.formMethod,d,null),qe(i,s,"formTarget",d.formTarget,d,null)):(qe(i,s,"encType",d.encType,d,null),qe(i,s,"method",d.method,d,null),qe(i,s,"target",d.target,d,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(o);break}l=Xl(""+l),i.setAttribute(o,l);break;case"onClick":l!=null&&(i.onclick=Ai);break;case"onScroll":l!=null&&Ee("scroll",i);break;case"onScrollEnd":l!=null&&Ee("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){i.removeAttribute("xlink:href");break}o=Xl(""+l),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""+l):i.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,""):i.removeAttribute(o);break;case"capture":case"download":l===!0?i.setAttribute(o,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(o,l):i.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(o,l):i.removeAttribute(o);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(o):i.setAttribute(o,l);break;case"popover":Ee("beforetoggle",i),Ee("toggle",i),Gl(i,"popover",l);break;case"xlinkActuate":Ti(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Ti(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Ti(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Ti(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Ti(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Ti(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Ti(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Gl(i,"is",l);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=dR.get(o)||o,Gl(i,o,l))}}function Mh(i,s,o,l,d,p){switch(o){case"style":Ig(i,l,p);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(o=l.__html,o!=null){if(d.children!=null)throw Error(r(60));i.innerHTML=o}}break;case"children":typeof l=="string"?zs(i,l):(typeof l=="number"||typeof l=="bigint")&&zs(i,""+l);break;case"onScroll":l!=null&&Ee("scroll",i);break;case"onScrollEnd":l!=null&&Ee("scrollend",i);break;case"onClick":l!=null&&(i.onclick=Ai);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!jg.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(d=o.endsWith("Capture"),s=o.slice(2,d?o.length-7:void 0),p=i[tn]||null,p=p!=null?p[o]:null,typeof p=="function"&&i.removeEventListener(s,p,d),typeof l=="function")){typeof p!="function"&&p!==null&&(o in i?i[o]=null:i.hasAttribute(o)&&i.removeAttribute(o)),i.addEventListener(s,l,d);break e}o in i?i[o]=l:l===!0?i.setAttribute(o,""):Gl(i,o,l)}}}function It(i,s,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ee("error",i),Ee("load",i);var l=!1,d=!1,p;for(p in o)if(o.hasOwnProperty(p)){var b=o[p];if(b!=null)switch(p){case"src":l=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:qe(i,s,p,b,o,null)}}d&&qe(i,s,"srcSet",o.srcSet,o,null),l&&qe(i,s,"src",o.src,o,null);return;case"input":Ee("invalid",i);var w=p=b=d=null,A=null,N=null;for(l in o)if(o.hasOwnProperty(l)){var V=o[l];if(V!=null)switch(l){case"name":d=V;break;case"type":b=V;break;case"checked":A=V;break;case"defaultChecked":N=V;break;case"value":p=V;break;case"defaultValue":w=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(r(137,s));break;default:qe(i,s,l,V,o,null)}}Ug(i,p,w,A,N,b,d,!1);return;case"select":Ee("invalid",i),l=b=p=null;for(d in o)if(o.hasOwnProperty(d)&&(w=o[d],w!=null))switch(d){case"value":p=w;break;case"defaultValue":b=w;break;case"multiple":l=w;default:qe(i,s,d,w,o,null)}s=p,o=b,i.multiple=!!l,s!=null?Bs(i,!!l,s,!1):o!=null&&Bs(i,!!l,o,!0);return;case"textarea":Ee("invalid",i),p=d=l=null;for(b in o)if(o.hasOwnProperty(b)&&(w=o[b],w!=null))switch(b){case"value":l=w;break;case"defaultValue":d=w;break;case"children":p=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(r(91));break;default:qe(i,s,b,w,o,null)}qg(i,l,d,p);return;case"option":for(A in o)if(o.hasOwnProperty(A)&&(l=o[A],l!=null))switch(A){case"selected":i.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:qe(i,s,A,l,o,null)}return;case"dialog":Ee("beforetoggle",i),Ee("toggle",i),Ee("cancel",i),Ee("close",i);break;case"iframe":case"object":Ee("load",i);break;case"video":case"audio":for(l=0;l<za.length;l++)Ee(za[l],i);break;case"image":Ee("error",i),Ee("load",i);break;case"details":Ee("toggle",i);break;case"embed":case"source":case"link":Ee("error",i),Ee("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(N in o)if(o.hasOwnProperty(N)&&(l=o[N],l!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:qe(i,s,N,l,o,null)}return;default:if(Hf(s)){for(V in o)o.hasOwnProperty(V)&&(l=o[V],l!==void 0&&Mh(i,s,V,l,o,void 0));return}}for(w in o)o.hasOwnProperty(w)&&(l=o[w],l!=null&&qe(i,s,w,l,o,null))}function VC(i,s,o,l){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,p=null,b=null,w=null,A=null,N=null,V=null;for(z in o){var P=o[z];if(o.hasOwnProperty(z)&&P!=null)switch(z){case"checked":break;case"value":break;case"defaultValue":A=P;default:l.hasOwnProperty(z)||qe(i,s,z,null,l,P)}}for(var B in l){var z=l[B];if(P=o[B],l.hasOwnProperty(B)&&(z!=null||P!=null))switch(B){case"type":p=z;break;case"name":d=z;break;case"checked":N=z;break;case"defaultChecked":V=z;break;case"value":b=z;break;case"defaultValue":w=z;break;case"children":case"dangerouslySetInnerHTML":if(z!=null)throw Error(r(137,s));break;default:z!==P&&qe(i,s,B,z,l,P)}}Pf(i,b,w,A,N,V,p,d);return;case"select":z=b=w=B=null;for(p in o)if(A=o[p],o.hasOwnProperty(p)&&A!=null)switch(p){case"value":break;case"multiple":z=A;default:l.hasOwnProperty(p)||qe(i,s,p,null,l,A)}for(d in l)if(p=l[d],A=o[d],l.hasOwnProperty(d)&&(p!=null||A!=null))switch(d){case"value":B=p;break;case"defaultValue":w=p;break;case"multiple":b=p;default:p!==A&&qe(i,s,d,p,l,A)}s=w,o=b,l=z,B!=null?Bs(i,!!o,B,!1):!!l!=!!o&&(s!=null?Bs(i,!!o,s,!0):Bs(i,!!o,o?[]:"",!1));return;case"textarea":z=B=null;for(w in o)if(d=o[w],o.hasOwnProperty(w)&&d!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:qe(i,s,w,null,l,d)}for(b in l)if(d=l[b],p=o[b],l.hasOwnProperty(b)&&(d!=null||p!=null))switch(b){case"value":B=d;break;case"defaultValue":z=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(r(91));break;default:d!==p&&qe(i,s,b,d,l,p)}Kg(i,B,z);return;case"option":for(var ie in o)if(B=o[ie],o.hasOwnProperty(ie)&&B!=null&&!l.hasOwnProperty(ie))switch(ie){case"selected":i.selected=!1;break;default:qe(i,s,ie,null,l,B)}for(A in l)if(B=l[A],z=o[A],l.hasOwnProperty(A)&&B!==z&&(B!=null||z!=null))switch(A){case"selected":i.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:qe(i,s,A,B,l,z)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ue in o)B=o[ue],o.hasOwnProperty(ue)&&B!=null&&!l.hasOwnProperty(ue)&&qe(i,s,ue,null,l,B);for(N in l)if(B=l[N],z=o[N],l.hasOwnProperty(N)&&B!==z&&(B!=null||z!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(r(137,s));break;default:qe(i,s,N,B,l,z)}return;default:if(Hf(s)){for(var Pe in o)B=o[Pe],o.hasOwnProperty(Pe)&&B!==void 0&&!l.hasOwnProperty(Pe)&&Mh(i,s,Pe,void 0,l,B);for(V in l)B=l[V],z=o[V],!l.hasOwnProperty(V)||B===z||B===void 0&&z===void 0||Mh(i,s,V,B,l,z);return}}for(var k in o)B=o[k],o.hasOwnProperty(k)&&B!=null&&!l.hasOwnProperty(k)&&qe(i,s,k,null,l,B);for(P in l)B=l[P],z=o[P],!l.hasOwnProperty(P)||B===z||B==null&&z==null||qe(i,s,P,B,l,z)}function H0(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function UC(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,o=performance.getEntriesByType("resource"),l=0;l<o.length;l++){var d=o[l],p=d.transferSize,b=d.initiatorType,w=d.duration;if(p&&w&&H0(b)){for(b=0,w=d.responseEnd,l+=1;l<o.length;l++){var A=o[l],N=A.startTime;if(N>w)break;var V=A.transferSize,P=A.initiatorType;V&&H0(P)&&(A=A.responseEnd,b+=V*(A<w?1:(w-N)/(A-N)))}if(--l,s+=8*(p+b)/(d.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Dh=null,Nh=null;function Hu(i){return i.nodeType===9?i:i.ownerDocument}function F0(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 G0(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 $h(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 jh=null;function KC(){var i=window.event;return i&&i.type==="popstate"?i===jh?!1:(jh=i,!0):(jh=null,!1)}var Y0=typeof setTimeout=="function"?setTimeout:void 0,qC=typeof clearTimeout=="function"?clearTimeout:void 0,J0=typeof Promise=="function"?Promise:void 0,PC=typeof queueMicrotask=="function"?queueMicrotask:typeof J0<"u"?function(i){return J0.resolve(null).then(i).catch(IC)}:Y0;function IC(i){setTimeout(function(){throw i})}function Sr(i){return i==="head"}function X0(i,s){var o=s,l=0;do{var d=o.nextSibling;if(i.removeChild(o),d&&d.nodeType===8)if(o=d.data,o==="/$"||o==="/&"){if(l===0){i.removeChild(d),mo(s);return}l--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")l++;else if(o==="html")Va(i.ownerDocument.documentElement);else if(o==="head"){o=i.ownerDocument.head,Va(o);for(var p=o.firstChild;p;){var b=p.nextSibling,w=p.nodeName;p[ia]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&p.rel.toLowerCase()==="stylesheet"||o.removeChild(p),p=b}}else o==="body"&&Va(i.ownerDocument.body);o=d}while(o);mo(s)}function Z0(i,s){var o=i;i=0;do{var l=o.nextSibling;if(o.nodeType===1?s?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(s?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),l&&l.nodeType===8)if(o=l.data,o==="/$"){if(i===0)break;i--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||i++;o=l}while(o)}function Bh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var o=s;switch(s=s.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":Bh(o),Kf(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}i.removeChild(o)}}function HC(i,s,o,l){for(;i.nodeType===1;){var d=o;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[ia])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(p=i.getAttribute("rel"),p==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(p!==d.rel||i.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||i.getAttribute("title")!==(d.title==null?null:d.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(p=i.getAttribute("src"),(p!==(d.src==null?null:d.src)||i.getAttribute("type")!==(d.type==null?null:d.type)||i.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&p&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var p=d.name==null?null:""+d.name;if(d.type==="hidden"&&i.getAttribute("name")===p)return i}else return i;if(i=$n(i.nextSibling),i===null)break}return null}function FC(i,s,o){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!o||(i=$n(i.nextSibling),i===null))return null;return i}function Q0(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=$n(i.nextSibling),i===null))return null;return i}function zh(i){return i.data==="$?"||i.data==="$~"}function Lh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function GC(i,s){var o=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||o.readyState!=="loading")s();else{var l=function(){s(),o.removeEventListener("DOMContentLoaded",l)};o.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function $n(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==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Vh=null;function W0(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="/$"||o==="/&"){if(s===0)return $n(i.nextSibling);s--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||s++}i=i.nextSibling}return null}function eS(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var o=i.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(s===0)return i;s--}else o!=="/$"&&o!=="/&"||s++}i=i.previousSibling}return null}function tS(i,s,o){switch(s=Hu(o),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 Va(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Kf(i)}var jn=new Map,nS=new Set;function Fu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ui=U.d;U.d={f:YC,r:JC,D:XC,C:ZC,L:QC,m:WC,X:tk,S:ek,M:nk};function YC(){var i=Ui.f(),s=zu();return i||s}function JC(i){var s=Ns(i);s!==null&&s.tag===5&&s.type==="form"?vv(s):Ui.r(i)}var fo=typeof document>"u"?null:document;function iS(i,s,o){var l=fo;if(l&&typeof s=="string"&&s){var d=_n(s);d='link[rel="'+i+'"][href="'+d+'"]',typeof o=="string"&&(d+='[crossorigin="'+o+'"]'),nS.has(d)||(nS.add(d),i={rel:i,crossOrigin:o,href:s},l.querySelector(d)===null&&(s=l.createElement("link"),It(s,"link",i),Nt(s),l.head.appendChild(s)))}}function XC(i){Ui.D(i),iS("dns-prefetch",i,null)}function ZC(i,s){Ui.C(i,s),iS("preconnect",i,s)}function QC(i,s,o){Ui.L(i,s,o);var l=fo;if(l&&i&&s){var d='link[rel="preload"][as="'+_n(s)+'"]';s==="image"&&o&&o.imageSrcSet?(d+='[imagesrcset="'+_n(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(d+='[imagesizes="'+_n(o.imageSizes)+'"]')):d+='[href="'+_n(i)+'"]';var p=d;switch(s){case"style":p=ho(i);break;case"script":p=po(i)}jn.has(p)||(i=g({rel:"preload",href:s==="image"&&o&&o.imageSrcSet?void 0:i,as:s},o),jn.set(p,i),l.querySelector(d)!==null||s==="style"&&l.querySelector(Ua(p))||s==="script"&&l.querySelector(Ka(p))||(s=l.createElement("link"),It(s,"link",i),Nt(s),l.head.appendChild(s)))}}function WC(i,s){Ui.m(i,s);var o=fo;if(o&&i){var l=s&&typeof s.as=="string"?s.as:"script",d='link[rel="modulepreload"][as="'+_n(l)+'"][href="'+_n(i)+'"]',p=d;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=po(i)}if(!jn.has(p)&&(i=g({rel:"modulepreload",href:i},s),jn.set(p,i),o.querySelector(d)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Ka(p)))return}l=o.createElement("link"),It(l,"link",i),Nt(l),o.head.appendChild(l)}}}function ek(i,s,o){Ui.S(i,s,o);var l=fo;if(l&&i){var d=$s(l).hoistableStyles,p=ho(i);s=s||"default";var b=d.get(p);if(!b){var w={loading:0,preload:null};if(b=l.querySelector(Ua(p)))w.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},o),(o=jn.get(p))&&Uh(i,o);var A=b=l.createElement("link");Nt(A),It(A,"link",i),A._p=new Promise(function(N,V){A.onload=N,A.onerror=V}),A.addEventListener("load",function(){w.loading|=1}),A.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Gu(b,s,l)}b={type:"stylesheet",instance:b,count:1,state:w},d.set(p,b)}}}function tk(i,s){Ui.X(i,s);var o=fo;if(o&&i){var l=$s(o).hoistableScripts,d=po(i),p=l.get(d);p||(p=o.querySelector(Ka(d)),p||(i=g({src:i,async:!0},s),(s=jn.get(d))&&Kh(i,s),p=o.createElement("script"),Nt(p),It(p,"link",i),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(d,p))}}function nk(i,s){Ui.M(i,s);var o=fo;if(o&&i){var l=$s(o).hoistableScripts,d=po(i),p=l.get(d);p||(p=o.querySelector(Ka(d)),p||(i=g({src:i,async:!0,type:"module"},s),(s=jn.get(d))&&Kh(i,s),p=o.createElement("script"),Nt(p),It(p,"link",i),o.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},l.set(d,p))}}function rS(i,s,o,l){var d=(d=ce.current)?Fu(d):null;if(!d)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(s=ho(o.href),o=$s(d).hoistableStyles,l=o.get(s),l||(l={type:"style",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){i=ho(o.href);var p=$s(d).hoistableStyles,b=p.get(i);if(b||(d=d.ownerDocument||d,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(i,b),(p=d.querySelector(Ua(i)))&&!p._p&&(b.instance=p,b.state.loading=5),jn.has(i)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},jn.set(i,o),p||ik(d,i,o,b.state))),s&&l===null)throw Error(r(528,""));return b}if(s&&l!==null)throw Error(r(529,""));return null;case"script":return s=o.async,o=o.src,typeof o=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=po(o),o=$s(d).hoistableScripts,l=o.get(s),l||(l={type:"script",instance:null,count:0,state:null},o.set(s,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function ho(i){return'href="'+_n(i)+'"'}function Ua(i){return'link[rel="stylesheet"]['+i+"]"}function sS(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function ik(i,s,o,l){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?l.loading=1:(s=i.createElement("link"),l.preload=s,s.addEventListener("load",function(){return l.loading|=1}),s.addEventListener("error",function(){return l.loading|=2}),It(s,"link",o),Nt(s),i.head.appendChild(s))}function po(i){return'[src="'+_n(i)+'"]'}function Ka(i){return"script[async]"+i}function oS(i,s,o){if(s.count++,s.instance===null)switch(s.type){case"style":var l=i.querySelector('style[data-href~="'+_n(o.href)+'"]');if(l)return s.instance=l,Nt(l),l;var d=g({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),Nt(l),It(l,"style",d),Gu(l,o.precedence,i),s.instance=l;case"stylesheet":d=ho(o.href);var p=i.querySelector(Ua(d));if(p)return s.state.loading|=4,s.instance=p,Nt(p),p;l=sS(o),(d=jn.get(d))&&Uh(l,d),p=(i.ownerDocument||i).createElement("link"),Nt(p);var b=p;return b._p=new Promise(function(w,A){b.onload=w,b.onerror=A}),It(p,"link",l),s.state.loading|=4,Gu(p,o.precedence,i),s.instance=p;case"script":return p=po(o.src),(d=i.querySelector(Ka(p)))?(s.instance=d,Nt(d),d):(l=o,(d=jn.get(p))&&(l=g({},o),Kh(l,d)),i=i.ownerDocument||i,d=i.createElement("script"),Nt(d),It(d,"link",l),i.head.appendChild(d),s.instance=d);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(l=s.instance,s.state.loading|=4,Gu(l,o.precedence,i));return s.instance}function Gu(i,s,o){for(var l=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=l.length?l[l.length-1]:null,p=d,b=0;b<l.length;b++){var w=l[b];if(w.dataset.precedence===s)p=w;else if(p!==d)break}p?p.parentNode.insertBefore(i,p.nextSibling):(s=o.nodeType===9?o.head:o,s.insertBefore(i,s.firstChild))}function Uh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Kh(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Yu=null;function aS(i,s,o){if(Yu===null){var l=new Map,d=Yu=new Map;d.set(o,l)}else d=Yu,l=d.get(o),l||(l=new Map,d.set(o,l));if(l.has(i))return l;for(l.set(i,null),o=o.getElementsByTagName(i),d=0;d<o.length;d++){var p=o[d];if(!(p[ia]||p[Ut]||i==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var b=p.getAttribute(s)||"";b=i+b;var w=l.get(b);w?w.push(p):l.set(b,[p])}}return l}function lS(i,s,o){i=i.ownerDocument||i,i.head.insertBefore(o,s==="title"?i.querySelector("head > title"):null)}function rk(i,s,o){if(o===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 uS(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function sk(i,s,o,l){if(o.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var d=ho(l.href),p=s.querySelector(Ua(d));if(p){s=p._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Ju.bind(i),s.then(i,i)),o.state.loading|=4,o.instance=p,Nt(p);return}p=s.ownerDocument||s,l=sS(l),(d=jn.get(d))&&Uh(l,d),p=p.createElement("link"),Nt(p);var b=p;b._p=new Promise(function(w,A){b.onload=w,b.onerror=A}),It(p,"link",l),o.instance=p}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(o,s),(s=o.state.preload)&&(o.state.loading&3)===0&&(i.count++,o=Ju.bind(i),s.addEventListener("load",o),s.addEventListener("error",o))}}var qh=0;function ok(i,s){return i.stylesheets&&i.count===0&&Zu(i,i.stylesheets),0<i.count||0<i.imgCount?function(o){var l=setTimeout(function(){if(i.stylesheets&&Zu(i,i.stylesheets),i.unsuspend){var p=i.unsuspend;i.unsuspend=null,p()}},6e4+s);0<i.imgBytes&&qh===0&&(qh=62500*UC());var d=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Zu(i,i.stylesheets),i.unsuspend)){var p=i.unsuspend;i.unsuspend=null,p()}},(i.imgBytes>qh?50:800)+s);return i.unsuspend=o,function(){i.unsuspend=null,clearTimeout(l),clearTimeout(d)}}:null}function Ju(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zu(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Xu=null;function Zu(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Xu=new Map,s.forEach(ak,i),Xu=null,Ju.call(i))}function ak(i,s){if(!(s.state.loading&4)){var o=Xu.get(i);if(o)var l=o.get(null);else{o=new Map,Xu.set(i,o);for(var d=i.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<d.length;p++){var b=d[p];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(o.set(b.dataset.precedence,b),l=b)}l&&o.set(null,l)}d=s.instance,b=d.getAttribute("data-precedence"),p=o.get(b)||l,p===l&&o.set(null,d),o.set(b,d),this.count++,l=Ju.bind(this),d.addEventListener("load",l),d.addEventListener("error",l),p?p.parentNode.insertBefore(d,p.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(d,i.firstChild)),s.state.loading|=4}}var qa={$$typeof:R,Provider:null,Consumer:null,_currentValue:L,_currentValue2:L,_threadCount:0};function lk(i,s,o,l,d,p,b,w,A){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=zf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zf(0),this.hiddenUpdates=zf(null),this.identifierPrefix=l,this.onUncaughtError=d,this.onCaughtError=p,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function cS(i,s,o,l,d,p,b,w,A,N,V,P){return i=new lk(i,s,o,b,A,N,V,P,w),s=1,p===!0&&(s|=24),p=mn(3,null,null,s),i.current=p,p.stateNode=i,s=wd(),s.refCount++,i.pooledCache=s,s.refCount++,p.memoizedState={element:l,isDehydrated:o,cache:s},Ed(p),i}function fS(i){return i?(i=Is,i):Is}function dS(i,s,o,l,d,p){d=fS(d),l.context===null?l.context=d:l.pendingContext=d,l=ur(s),l.payload={element:o},p=p===void 0?null:p,p!==null&&(l.callback=p),o=cr(i,l,s),o!==null&&(ln(o,i,s),Sa(o,i,s))}function hS(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var o=i.retryLane;i.retryLane=o!==0&&o<s?o:s}}function Ph(i,s){hS(i,s),(i=i.alternate)&&hS(i,s)}function pS(i){if(i.tag===13||i.tag===31){var s=Wr(i,67108864);s!==null&&ln(s,i,67108864),Ph(i,67108864)}}function mS(i){if(i.tag===13||i.tag===31){var s=Sn();s=Lf(s);var o=Wr(i,s);o!==null&&ln(o,i,s),Ph(i,s)}}var Qu=!0;function uk(i,s,o,l){var d=j.T;j.T=null;var p=U.p;try{U.p=2,Ih(i,s,o,l)}finally{U.p=p,j.T=d}}function ck(i,s,o,l){var d=j.T;j.T=null;var p=U.p;try{U.p=8,Ih(i,s,o,l)}finally{U.p=p,j.T=d}}function Ih(i,s,o,l){if(Qu){var d=Hh(l);if(d===null)kh(i,s,l,Wu,o),gS(i,l);else if(dk(d,i,s,o,l))l.stopPropagation();else if(gS(i,l),s&4&&-1<fk.indexOf(i)){for(;d!==null;){var p=Ns(d);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var b=Yr(p.pendingLanes);if(b!==0){var w=p;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var A=1<<31-hn(b);w.entanglements[1]|=A,b&=~A}li(p),(Be&6)===0&&(ju=st()+500,Ba(0))}}break;case 31:case 13:w=Wr(p,2),w!==null&&ln(w,p,2),zu(),Ph(p,2)}if(p=Hh(l),p===null&&kh(i,s,l,Wu,o),p===d)break;d=p}d!==null&&l.stopPropagation()}else kh(i,s,l,null,o)}}function Hh(i){return i=Gf(i),Fh(i)}var Wu=null;function Fh(i){if(Wu=null,i=Ds(i),i!==null){var s=u(i);if(s===null)i=null;else{var o=s.tag;if(o===13){if(i=c(s),i!==null)return i;i=null}else if(o===31){if(i=f(s),i!==null)return i;i=null}else if(o===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Wu=i,null}function yS(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(Kl()){case Ag:return 2;case Eg:return 8;case ql:case Z_:return 32;case Og:return 268435456;default:return 32}default:return 32}}var Gh=!1,wr=null,xr=null,Tr=null,Pa=new Map,Ia=new Map,Ar=[],fk="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 gS(i,s){switch(i){case"focusin":case"focusout":wr=null;break;case"dragenter":case"dragleave":xr=null;break;case"mouseover":case"mouseout":Tr=null;break;case"pointerover":case"pointerout":Pa.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ia.delete(s.pointerId)}}function Ha(i,s,o,l,d,p){return i===null||i.nativeEvent!==p?(i={blockedOn:s,domEventName:o,eventSystemFlags:l,nativeEvent:p,targetContainers:[d]},s!==null&&(s=Ns(s),s!==null&&pS(s)),i):(i.eventSystemFlags|=l,s=i.targetContainers,d!==null&&s.indexOf(d)===-1&&s.push(d),i)}function dk(i,s,o,l,d){switch(s){case"focusin":return wr=Ha(wr,i,s,o,l,d),!0;case"dragenter":return xr=Ha(xr,i,s,o,l,d),!0;case"mouseover":return Tr=Ha(Tr,i,s,o,l,d),!0;case"pointerover":var p=d.pointerId;return Pa.set(p,Ha(Pa.get(p)||null,i,s,o,l,d)),!0;case"gotpointercapture":return p=d.pointerId,Ia.set(p,Ha(Ia.get(p)||null,i,s,o,l,d)),!0}return!1}function bS(i){var s=Ds(i.target);if(s!==null){var o=u(s);if(o!==null){if(s=o.tag,s===13){if(s=c(o),s!==null){i.blockedOn=s,Dg(i.priority,function(){mS(o)});return}}else if(s===31){if(s=f(o),s!==null){i.blockedOn=s,Dg(i.priority,function(){mS(o)});return}}else if(s===3&&o.stateNode.current.memoizedState.isDehydrated){i.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}i.blockedOn=null}function ec(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var o=Hh(i.nativeEvent);if(o===null){o=i.nativeEvent;var l=new o.constructor(o.type,o);Ff=l,o.target.dispatchEvent(l),Ff=null}else return s=Ns(o),s!==null&&pS(s),i.blockedOn=o,!1;s.shift()}return!0}function vS(i,s,o){ec(i)&&o.delete(s)}function hk(){Gh=!1,wr!==null&&ec(wr)&&(wr=null),xr!==null&&ec(xr)&&(xr=null),Tr!==null&&ec(Tr)&&(Tr=null),Pa.forEach(vS),Ia.forEach(vS)}function tc(i,s){i.blockedOn===s&&(i.blockedOn=null,Gh||(Gh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,hk)))}var nc=null;function SS(i){nc!==i&&(nc=i,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){nc===i&&(nc=null);for(var s=0;s<i.length;s+=3){var o=i[s],l=i[s+1],d=i[s+2];if(typeof l!="function"){if(Fh(l||o)===null)continue;break}var p=Ns(o);p!==null&&(i.splice(s,3),s-=3,Hd(p,{pending:!0,data:d,method:o.method,action:l},l,d))}}))}function mo(i){function s(A){return tc(A,i)}wr!==null&&tc(wr,i),xr!==null&&tc(xr,i),Tr!==null&&tc(Tr,i),Pa.forEach(s),Ia.forEach(s);for(var o=0;o<Ar.length;o++){var l=Ar[o];l.blockedOn===i&&(l.blockedOn=null)}for(;0<Ar.length&&(o=Ar[0],o.blockedOn===null);)bS(o),o.blockedOn===null&&Ar.shift();if(o=(i.ownerDocument||i).$$reactFormReplay,o!=null)for(l=0;l<o.length;l+=3){var d=o[l],p=o[l+1],b=d[tn]||null;if(typeof p=="function")b||SS(o);else if(b){var w=null;if(p&&p.hasAttribute("formAction")){if(d=p,b=p[tn]||null)w=b.formAction;else if(Fh(d)!==null)continue}else w=b.action;typeof w=="function"?o[l+1]=w:(o.splice(l,3),l-=3),SS(o)}}}function wS(){function i(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(b){return d=b})},focusReset:"manual",scroll:"manual"})}function s(){d!==null&&(d(),d=null),l||setTimeout(o,20)}function o(){if(!l&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,d=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(o,100),function(){l=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),d!==null&&(d(),d=null)}}}function Yh(i){this._internalRoot=i}ic.prototype.render=Yh.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var o=s.current,l=Sn();dS(o,l,i,s,null,null)},ic.prototype.unmount=Yh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;dS(i.current,2,null,i,null,null),zu(),s[Ms]=null}};function ic(i){this._internalRoot=i}ic.prototype.unstable_scheduleHydration=function(i){if(i){var s=Mg();i={blockedOn:null,target:i,priority:s};for(var o=0;o<Ar.length&&s!==0&&s<Ar[o].priority;o++);Ar.splice(o,0,i),o===0&&bS(i)}};var xS=e.version;if(xS!=="19.2.0")throw Error(r(527,xS,"19.2.0"));U.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=m(s),i=i!==null?y(i):null,i=i===null?null:i.stateNode,i};var pk={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{ea=rc.inject(pk),dn=rc}catch{}}return Ga.createRoot=function(i,s){if(!a(i))throw Error(r(299));var o=!1,l="",d=Cv,p=kv,b=Mv;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(l=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(b=s.onRecoverableError)),s=cS(i,1,!1,null,null,o,l,null,d,p,b,wS),i[Ms]=s.current,Ch(i),new Yh(s)},Ga.hydrateRoot=function(i,s,o){if(!a(i))throw Error(r(299));var l=!1,d="",p=Cv,b=kv,w=Mv,A=null;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(d=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(b=o.onCaughtError),o.onRecoverableError!==void 0&&(w=o.onRecoverableError),o.formState!==void 0&&(A=o.formState)),s=cS(i,1,!0,s,o??null,l,d,A,p,b,w,wS),s.context=fS(null),o=s.current,l=Sn(),l=Lf(l),d=ur(l),d.callback=null,cr(o,d,l),o=l,s.current.lanes=o,na(s,o),li(s),i[Ms]=s.current,Ch(i),new ic(s)},Ga.version="19.2.0",Ga}var KS;function zM(){if(KS)return Wh.exports;KS=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(),Wh.exports=BM(),Wh.exports}var LM=zM();function df(){return typeof window<"u"}function Ir(t){return bT(t)?(t.nodeName||"").toLowerCase():"#document"}function xn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function bi(t){var e;return(e=(bT(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function bT(t){return df()?t instanceof Node||t instanceof xn(t).Node:!1}function gt(t){return df()?t instanceof Element||t instanceof xn(t).Element:!1}function Dt(t){return df()?t instanceof HTMLElement||t instanceof xn(t).HTMLElement:!1}function Yp(t){return!df()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof xn(t).ShadowRoot}const VM=new Set(["inline","contents"]);function Ol(t){const{overflow:e,overflowX:n,overflowY:r,display:a}=In(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!VM.has(a)}const UM=new Set(["table","td","th"]);function KM(t){return UM.has(Ir(t))}const qM=[":popover-open",":modal"];function hf(t){return qM.some(e=>{try{return t.matches(e)}catch{return!1}})}const PM=["transform","translate","scale","rotate","perspective"],IM=["transform","translate","scale","rotate","perspective","filter"],HM=["paint","layout","strict","content"];function my(t){const e=pf(),n=gt(t)?In(t):t;return PM.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)||IM.some(r=>(n.willChange||"").includes(r))||HM.some(r=>(n.contain||"").includes(r))}function FM(t){let e=Fi(t);for(;Dt(e)&&!Ii(e);){if(my(e))return e;if(hf(e))return null;e=Fi(e)}return null}function pf(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const GM=new Set(["html","body","#document"]);function Ii(t){return GM.has(Ir(t))}function In(t){return xn(t).getComputedStyle(t)}function mf(t){return gt(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Fi(t){if(Ir(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Yp(t)&&t.host||bi(t);return Yp(e)?e.host:e}function vT(t){const e=Fi(t);return Ii(e)?t.ownerDocument?t.ownerDocument.body:t.body:Dt(e)&&Ol(e)?e:vT(e)}function $r(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const a=vT(t),u=a===((r=t.ownerDocument)==null?void 0:r.body),c=xn(a);if(u){const f=Jp(c);return e.concat(c,c.visualViewport||[],Ol(a)?a:[],f&&n?$r(f):[])}return e.concat(a,$r(a,[],n))}function Jp(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const zc=Math.min,vs=Math.max,Lc=Math.round,oc=Math.floor,hi=t=>({x:t,y:t}),YM={left:"right",right:"left",bottom:"top",top:"bottom"},JM={start:"end",end:"start"};function qS(t,e,n){return vs(t,zc(e,n))}function yf(t,e){return typeof t=="function"?t(e):t}function Ts(t){return t.split("-")[0]}function gf(t){return t.split("-")[1]}function ST(t){return t==="x"?"y":"x"}function wT(t){return t==="y"?"height":"width"}const XM=new Set(["top","bottom"]);function Mr(t){return XM.has(Ts(t))?"y":"x"}function xT(t){return ST(Mr(t))}function ZM(t,e,n){n===void 0&&(n=!1);const r=gf(t),a=xT(t),u=wT(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[u]>e.floating[u]&&(c=Vc(c)),[c,Vc(c)]}function QM(t){const e=Vc(t);return[Xp(t),e,Xp(e)]}function Xp(t){return t.replace(/start|end/g,e=>JM[e])}const PS=["left","right"],IS=["right","left"],WM=["top","bottom"],eD=["bottom","top"];function tD(t,e,n){switch(t){case"top":case"bottom":return n?e?IS:PS:e?PS:IS;case"left":case"right":return e?WM:eD;default:return[]}}function nD(t,e,n,r){const a=gf(t);let u=tD(Ts(t),n==="start",r);return a&&(u=u.map(c=>c+"-"+a),e&&(u=u.concat(u.map(Xp)))),u}function Vc(t){return t.replace(/left|right|bottom|top/g,e=>YM[e])}function iD(t){return{top:0,right:0,bottom:0,left:0,...t}}function rD(t){return typeof t!="number"?iD(t):{top:t,right:t,bottom:t,left:t}}function Uc(t){const{x:e,y:n,width:r,height:a}=t;return{width:r,height:a,top:n,left:e,right:e+r,bottom:n+a,x:e,y:n}}var sD=["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])"],Kc=sD.join(","),TT=typeof Element>"u",zo=TT?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,qc=!TT&&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},pl=function(e,n){var r;n===void 0&&(n=!0);var a=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),u=a===""||a==="true",c=u||n&&e&&pl(e.parentNode);return c},oD=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},AT=function(e,n,r){if(pl(e))return[];var a=Array.prototype.slice.apply(e.querySelectorAll(Kc));return n&&zo.call(e,Kc)&&a.unshift(e),a=a.filter(r),a},Pc=function(e,n,r){for(var a=[],u=Array.from(e);u.length;){var c=u.shift();if(!pl(c,!1))if(c.tagName==="SLOT"){var f=c.assignedElements(),h=f.length?f:c.children,m=Pc(h,!0,r);r.flatten?a.push.apply(a,m):a.push({scopeParent:c,candidates:m})}else{var y=zo.call(c,Kc);y&&r.filter(c)&&(n||!e.includes(c))&&a.push(c);var g=c.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(c),v=!pl(g,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(c));if(g&&v){var S=Pc(g===!0?c.children:g.children,!0,r);r.flatten?a.push.apply(a,S):a.push({scopeParent:c,candidates:S})}else u.unshift.apply(u,c.children)}}return a},ET=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},OT=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||oD(e))&&!ET(e)?0:e.tabIndex},aD=function(e,n){var r=OT(e);return r<0&&n&&!ET(e)?0:r},lD=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},_T=function(e){return e.tagName==="INPUT"},uD=function(e){return _T(e)&&e.type==="hidden"},cD=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},fD=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},dD=function(e){if(!e.name)return!0;var n=e.form||qc(e),r=function(f){return n.querySelectorAll('input[type="radio"][name="'+f+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(e.name));else try{a=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 u=fD(a,e.form);return!u||u===e},hD=function(e){return _T(e)&&e.type==="radio"},pD=function(e){return hD(e)&&!dD(e)},mD=function(e){var n,r=e&&qc(e),a=(n=r)===null||n===void 0?void 0:n.host,u=!1;if(r&&r!==e){var c,f,h;for(u=!!((c=a)!==null&&c!==void 0&&(f=c.ownerDocument)!==null&&f!==void 0&&f.contains(a)||e!=null&&(h=e.ownerDocument)!==null&&h!==void 0&&h.contains(e));!u&&a;){var m,y,g;r=qc(a),a=(m=r)===null||m===void 0?void 0:m.host,u=!!((y=a)!==null&&y!==void 0&&(g=y.ownerDocument)!==null&&g!==void 0&&g.contains(a))}}return u},HS=function(e){var n=e.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},yD=function(e,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var u=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!u}if(getComputedStyle(e).visibility==="hidden")return!0;var c=zo.call(e,"details>summary:first-of-type"),f=c?e.parentElement:e;if(zo.call(f,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var h=e;e;){var m=e.parentElement,y=qc(e);if(m&&!m.shadowRoot&&a(m)===!0)return HS(e);e.assignedSlot?e=e.assignedSlot:!m&&y!==e.ownerDocument?e=y.host:e=m}e=h}if(mD(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return HS(e);return!1},gD=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 a=n.children.item(r);if(a.tagName==="LEGEND")return zo.call(n,"fieldset[disabled] *")?!0:!a.contains(e)}return!0}n=n.parentElement}return!1},Zp=function(e,n){return!(n.disabled||pl(n)||uD(n)||yD(n,e)||cD(n)||gD(n))},Qp=function(e,n){return!(pD(n)||OT(n)<0||!Zp(e,n))},bD=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},RT=function(e){var n=[],r=[];return e.forEach(function(a,u){var c=!!a.scopeParent,f=c?a.scopeParent:a,h=aD(f,c),m=c?RT(a.candidates):f;h===0?c?n.push.apply(n,m):n.push(f):r.push({documentOrder:u,tabIndex:h,item:a,isScope:c,content:m})}),r.sort(lD).reduce(function(a,u){return u.isScope?a.push.apply(a,u.content):a.push(u.content),a},[]).concat(n)},yy=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Pc([e],n.includeContainer,{filter:Qp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:bD}):r=AT(e,n.includeContainer,Qp.bind(null,n)),RT(r)},vD=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Pc([e],n.includeContainer,{filter:Zp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=AT(e,n.includeContainer,Zp.bind(null,n)),r},CT=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return zo.call(e,Kc)===!1?!1:Qp(n,e)};function SD(){const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform}function kT(){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 wD(){return/apple/i.test(navigator.vendor)}function Wp(){const t=/android/i;return t.test(SD())||t.test(kT())}function xD(){return kT().includes("jsdom/")}const FS="data-floating-ui-focusable",TD="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function So(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 wn(t,e){if(!t||!e)return!1;const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&Yp(n)){let r=e;for(;r;){if(t===r)return!0;r=r.parentNode||r.host}}return!1}function Cr(t){return"composedPath"in t?t.composedPath()[0]:t.target}function ip(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 AD(t){return t.matches("html,body")}function ei(t){return t?.ownerDocument||document}function MT(t){return Dt(t)&&t.matches(TD)}function GS(t){return t?t.getAttribute("role")==="combobox"&&MT(t):!1}function em(t){return t?t.hasAttribute(FS)?t:t.querySelector("["+FS+"]")||t:null}function Ro(t,e,n){return n===void 0&&(n=!0),t.filter(a=>{var u;return a.parentId===e&&(!n||((u=a.context)==null?void 0:u.open))}).flatMap(a=>[a,...Ro(t,a.id,n)])}function YS(t,e){var n;let r=[],a=(n=t.find(u=>u.id===e))==null?void 0:n.parentId;for(;a;){const u=t.find(c=>c.id===a);a=u?.parentId,u&&(r=r.concat(u))}return r}function rp(t){t.preventDefault(),t.stopPropagation()}function ED(t){return"nativeEvent"in t}function OD(t){return t.mozInputSource===0&&t.isTrusted?!0:Wp()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function _D(t){return xD()?!1:!Wp()&&t.width===0&&t.height===0||Wp()&&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 JS(t,e){return["mouse","pen"].includes(t)}var RD=typeof document<"u",CD=function(){},Pi=RD?$.useLayoutEffect:CD;const kD={...hT};function sp(t){const e=$.useRef(t);return Pi(()=>{e.current=t}),e}const MD=kD.useInsertionEffect,DD=MD||(t=>t());function fi(t){const e=$.useRef(()=>{});return DD(()=>{e.current=t}),$.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.current==null?void 0:e.current(...r)},[])}const bf=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function DT(t,e){const n=yy(t,bf()),r=n.length;if(r===0)return;const a=So(ei(t)),u=n.indexOf(a),c=u===-1?e===1?0:r-1:u+e;return n[c]}function ND(t){return DT(ei(t).body,1)||t}function $D(t){return DT(ei(t).body,-1)||t}function XS(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!wn(n,r)}var jD=gT();function ZS(t,e,n){let{reference:r,floating:a}=t;const u=Mr(e),c=xT(e),f=wT(c),h=Ts(e),m=u==="y",y=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[f]/2-a[f]/2;let S;switch(h){case"top":S={x:y,y:r.y-a.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-a.width,y:g};break;default:S={x:r.x,y:r.y}}switch(gf(e)){case"start":S[c]-=v*(n&&m?-1:1);break;case"end":S[c]+=v*(n&&m?-1:1);break}return S}const BD=async(t,e,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:u=[],platform:c}=n,f=u.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(e));let m=await c.getElementRects({reference:t,floating:e,strategy:a}),{x:y,y:g}=ZS(m,r,h),v=r,S={},x=0;for(let T=0;T<f.length;T++){const{name:M,fn:C}=f[T],{x:_,y:R,data:G,reset:I}=await C({x:y,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:S,rects:m,platform:c,elements:{reference:t,floating:e}});y=_??y,g=R??g,S={...S,[M]:{...S[M],...G}},I&&x<=50&&(x++,typeof I=="object"&&(I.placement&&(v=I.placement),I.rects&&(m=I.rects===!0?await c.getElementRects({reference:t,floating:e,strategy:a}):I.rects),{x:y,y:g}=ZS(m,v,h)),T=-1)}return{x:y,y:g,placement:v,strategy:a,middlewareData:S}};async function NT(t,e){var n;e===void 0&&(e={});const{x:r,y:a,platform:u,rects:c,elements:f,strategy:h}=t,{boundary:m="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=yf(e,t),x=rD(S),M=f[v?g==="floating"?"reference":"floating":g],C=Uc(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(M)))==null||n?M:M.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(f.floating)),boundary:m,rootBoundary:y,strategy:h})),_=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,R=await(u.getOffsetParent==null?void 0:u.getOffsetParent(f.floating)),G=await(u.isElement==null?void 0:u.isElement(R))?await(u.getScale==null?void 0:u.getScale(R))||{x:1,y:1}:{x:1,y:1},I=Uc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:f,rect:_,offsetParent:R,strategy:h}):_);return{top:(C.top-I.top+x.top)/G.y,bottom:(I.bottom-C.bottom+x.bottom)/G.y,left:(C.left-I.left+x.left)/G.x,right:(I.right-C.right+x.right)/G.x}}const zD=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:a,middlewareData:u,rects:c,initialPlacement:f,platform:h,elements:m}=e,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:T=!0,...M}=yf(t,e);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const C=Ts(a),_=Mr(f),R=Ts(f)===f,G=await(h.isRTL==null?void 0:h.isRTL(m.floating)),I=v||(R||!T?[Vc(f)]:QM(f)),ee=x!=="none";!v&&ee&&I.push(...nD(f,T,x,G));const J=[f,...I],X=await NT(e,M),he=[];let pe=((r=u.flip)==null?void 0:r.overflows)||[];if(y&&he.push(X[C]),g){const Z=ZM(a,c,G);he.push(X[Z[0]],X[Z[1]])}if(pe=[...pe,{placement:a,overflows:he}],!he.every(Z=>Z<=0)){var we,je;const Z=(((we=u.flip)==null?void 0:we.index)||0)+1,ne=J[Z];if(ne&&(!(g==="alignment"?_!==Mr(ne):!1)||pe.every(L=>Mr(L.placement)===_?L.overflows[0]>0:!0)))return{data:{index:Z,overflows:pe},reset:{placement:ne}};let j=(je=pe.filter(U=>U.overflows[0]<=0).sort((U,L)=>U.overflows[1]-L.overflows[1])[0])==null?void 0:je.placement;if(!j)switch(S){case"bestFit":{var ve;const U=(ve=pe.filter(L=>{if(ee){const te=Mr(L.placement);return te===_||te==="y"}return!0}).map(L=>[L.placement,L.overflows.filter(te=>te>0).reduce((te,oe)=>te+oe,0)]).sort((L,te)=>L[1]-te[1])[0])==null?void 0:ve[0];U&&(j=U);break}case"initialPlacement":j=f;break}if(a!==j)return{reset:{placement:j}}}return{}}}},LD=new Set(["left","top"]);async function VD(t,e){const{placement:n,platform:r,elements:a}=t,u=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Ts(n),f=gf(n),h=Mr(n)==="y",m=LD.has(c)?-1:1,y=u&&h?-1:1,g=yf(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 f&&typeof x=="number"&&(S=f==="end"?x*-1:x),h?{x:S*y,y:v*m}:{x:v*m,y:S*y}}const UD=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:a,y:u,placement:c,middlewareData:f}=e,h=await VD(e,t);return c===((n=f.offset)==null?void 0:n.placement)&&(r=f.arrow)!=null&&r.alignmentOffset?{}:{x:a+h.x,y:u+h.y,data:{...h,placement:c}}}}},KD=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:a}=e,{mainAxis:u=!0,crossAxis:c=!1,limiter:f={fn:M=>{let{x:C,y:_}=M;return{x:C,y:_}}},...h}=yf(t,e),m={x:n,y:r},y=await NT(e,h),g=Mr(Ts(a)),v=ST(g);let S=m[v],x=m[g];if(u){const M=v==="y"?"top":"left",C=v==="y"?"bottom":"right",_=S+y[M],R=S-y[C];S=qS(_,S,R)}if(c){const M=g==="y"?"top":"left",C=g==="y"?"bottom":"right",_=x+y[M],R=x-y[C];x=qS(_,x,R)}const T=f.fn({...e,[v]:S,[g]:x});return{...T,data:{x:T.x-n,y:T.y-r,enabled:{[v]:u,[g]:c}}}}}};function $T(t){const e=In(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const a=Dt(t),u=a?t.offsetWidth:n,c=a?t.offsetHeight:r,f=Lc(n)!==u||Lc(r)!==c;return f&&(n=u,r=c),{width:n,height:r,$:f}}function gy(t){return gt(t)?t:t.contextElement}function Co(t){const e=gy(t);if(!Dt(e))return hi(1);const n=e.getBoundingClientRect(),{width:r,height:a,$:u}=$T(e);let c=(u?Lc(n.width):n.width)/r,f=(u?Lc(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!f||!Number.isFinite(f))&&(f=1),{x:c,y:f}}const qD=hi(0);function jT(t){const e=xn(t);return!pf()||!e.visualViewport?qD:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function PD(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==xn(t)?!1:e}function As(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const a=t.getBoundingClientRect(),u=gy(t);let c=hi(1);e&&(r?gt(r)&&(c=Co(r)):c=Co(t));const f=PD(u,n,r)?jT(u):hi(0);let h=(a.left+f.x)/c.x,m=(a.top+f.y)/c.y,y=a.width/c.x,g=a.height/c.y;if(u){const v=xn(u),S=r&>(r)?xn(r):r;let x=v,T=Jp(x);for(;T&&r&&S!==x;){const M=Co(T),C=T.getBoundingClientRect(),_=In(T),R=C.left+(T.clientLeft+parseFloat(_.paddingLeft))*M.x,G=C.top+(T.clientTop+parseFloat(_.paddingTop))*M.y;h*=M.x,m*=M.y,y*=M.x,g*=M.y,h+=R,m+=G,x=xn(T),T=Jp(x)}}return Uc({width:y,height:g,x:h,y:m})}function vf(t,e){const n=mf(t).scrollLeft;return e?e.left+n:As(bi(t)).left+n}function BT(t,e){const n=t.getBoundingClientRect(),r=n.left+e.scrollLeft-vf(t,n),a=n.top+e.scrollTop;return{x:r,y:a}}function ID(t){let{elements:e,rect:n,offsetParent:r,strategy:a}=t;const u=a==="fixed",c=bi(r),f=e?hf(e.floating):!1;if(r===c||f&&u)return n;let h={scrollLeft:0,scrollTop:0},m=hi(1);const y=hi(0),g=Dt(r);if((g||!g&&!u)&&((Ir(r)!=="body"||Ol(c))&&(h=mf(r)),Dt(r))){const S=As(r);m=Co(r),y.x=S.x+r.clientLeft,y.y=S.y+r.clientTop}const v=c&&!g&&!u?BT(c,h):hi(0);return{width:n.width*m.x,height:n.height*m.y,x:n.x*m.x-h.scrollLeft*m.x+y.x+v.x,y:n.y*m.y-h.scrollTop*m.y+y.y+v.y}}function HD(t){return Array.from(t.getClientRects())}function FD(t){const e=bi(t),n=mf(t),r=t.ownerDocument.body,a=vs(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),u=vs(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+vf(t);const f=-n.scrollTop;return In(r).direction==="rtl"&&(c+=vs(e.clientWidth,r.clientWidth)-a),{width:a,height:u,x:c,y:f}}const QS=25;function GD(t,e){const n=xn(t),r=bi(t),a=n.visualViewport;let u=r.clientWidth,c=r.clientHeight,f=0,h=0;if(a){u=a.width,c=a.height;const y=pf();(!y||y&&e==="fixed")&&(f=a.offsetLeft,h=a.offsetTop)}const m=vf(r);if(m<=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<=QS&&(u-=x)}else m<=QS&&(u+=m);return{width:u,height:c,x:f,y:h}}const YD=new Set(["absolute","fixed"]);function JD(t,e){const n=As(t,!0,e==="fixed"),r=n.top+t.clientTop,a=n.left+t.clientLeft,u=Dt(t)?Co(t):hi(1),c=t.clientWidth*u.x,f=t.clientHeight*u.y,h=a*u.x,m=r*u.y;return{width:c,height:f,x:h,y:m}}function WS(t,e,n){let r;if(e==="viewport")r=GD(t,n);else if(e==="document")r=FD(bi(t));else if(gt(e))r=JD(e,n);else{const a=jT(t);r={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Uc(r)}function zT(t,e){const n=Fi(t);return n===e||!gt(n)||Ii(n)?!1:In(n).position==="fixed"||zT(n,e)}function XD(t,e){const n=e.get(t);if(n)return n;let r=$r(t,[],!1).filter(f=>gt(f)&&Ir(f)!=="body"),a=null;const u=In(t).position==="fixed";let c=u?Fi(t):t;for(;gt(c)&&!Ii(c);){const f=In(c),h=my(c);!h&&f.position==="fixed"&&(a=null),(u?!h&&!a:!h&&f.position==="static"&&!!a&&YD.has(a.position)||Ol(c)&&!h&&zT(t,c))?r=r.filter(y=>y!==c):a=f,c=Fi(c)}return e.set(t,r),r}function ZD(t){let{element:e,boundary:n,rootBoundary:r,strategy:a}=t;const c=[...n==="clippingAncestors"?hf(e)?[]:XD(e,this._c):[].concat(n),r],f=c[0],h=c.reduce((m,y)=>{const g=WS(e,y,a);return m.top=vs(g.top,m.top),m.right=zc(g.right,m.right),m.bottom=zc(g.bottom,m.bottom),m.left=vs(g.left,m.left),m},WS(e,f,a));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function QD(t){const{width:e,height:n}=$T(t);return{width:e,height:n}}function WD(t,e,n){const r=Dt(e),a=bi(e),u=n==="fixed",c=As(t,!0,u,e);let f={scrollLeft:0,scrollTop:0};const h=hi(0);function m(){h.x=vf(a)}if(r||!r&&!u)if((Ir(e)!=="body"||Ol(a))&&(f=mf(e)),r){const S=As(e,!0,u,e);h.x=S.x+e.clientLeft,h.y=S.y+e.clientTop}else a&&m();u&&!r&&a&&m();const y=a&&!r&&!u?BT(a,f):hi(0),g=c.left+f.scrollLeft-h.x-y.x,v=c.top+f.scrollTop-h.y-y.y;return{x:g,y:v,width:c.width,height:c.height}}function op(t){return In(t).position==="static"}function ew(t,e){if(!Dt(t)||In(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return bi(t)===n&&(n=n.ownerDocument.body),n}function LT(t,e){const n=xn(t);if(hf(t))return n;if(!Dt(t)){let a=Fi(t);for(;a&&!Ii(a);){if(gt(a)&&!op(a))return a;a=Fi(a)}return n}let r=ew(t,e);for(;r&&KM(r)&&op(r);)r=ew(r,e);return r&&Ii(r)&&op(r)&&!my(r)?n:r||FM(t)||n}const e2=async function(t){const e=this.getOffsetParent||LT,n=this.getDimensions,r=await n(t.floating);return{reference:WD(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function t2(t){return In(t).direction==="rtl"}const n2={convertOffsetParentRelativeRectToViewportRelativeRect:ID,getDocumentElement:bi,getClippingRect:ZD,getOffsetParent:LT,getElementRects:e2,getClientRects:HD,getDimensions:QD,getScale:Co,isElement:gt,isRTL:t2};function VT(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function i2(t,e){let n=null,r;const a=bi(t);function u(){var f;clearTimeout(r),(f=n)==null||f.disconnect(),n=null}function c(f,h){f===void 0&&(f=!1),h===void 0&&(h=1),u();const m=t.getBoundingClientRect(),{left:y,top:g,width:v,height:S}=m;if(f||e(),!v||!S)return;const x=oc(g),T=oc(a.clientWidth-(y+v)),M=oc(a.clientHeight-(g+S)),C=oc(y),R={rootMargin:-x+"px "+-T+"px "+-M+"px "+-C+"px",threshold:vs(0,zc(1,h))||1};let G=!0;function I(ee){const J=ee[0].intersectionRatio;if(J!==h){if(!G)return c();J?c(!1,J):r=setTimeout(()=>{c(!1,1e-7)},1e3)}J===1&&!VT(m,t.getBoundingClientRect())&&c(),G=!1}try{n=new IntersectionObserver(I,{...R,root:a.ownerDocument})}catch{n=new IntersectionObserver(I,R)}n.observe(t)}return c(!0),u}function r2(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:u=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:f=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,m=gy(t),y=a||u?[...m?$r(m):[],...$r(e)]:[];y.forEach(C=>{a&&C.addEventListener("scroll",n,{passive:!0}),u&&C.addEventListener("resize",n)});const g=m&&f?i2(m,n):null;let v=-1,S=null;c&&(S=new ResizeObserver(C=>{let[_]=C;_&&_.target===m&&S&&(S.unobserve(e),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var R;(R=S)==null||R.observe(e)})),n()}),m&&!h&&S.observe(m),S.observe(e));let x,T=h?As(t):null;h&&M();function M(){const C=As(t);T&&!VT(T,C)&&n(),T=C,x=requestAnimationFrame(M)}return n(),()=>{var C;y.forEach(_=>{a&&_.removeEventListener("scroll",n),u&&_.removeEventListener("resize",n)}),g?.(),(C=S)==null||C.disconnect(),S=null,h&&cancelAnimationFrame(x)}}const s2=UD,o2=KD,a2=zD,l2=(t,e,n)=>{const r=new Map,a={platform:n2,...n},u={...a.platform,_c:r};return BD(t,e,{...a,platform:u})};var u2=typeof document<"u",c2=function(){},xc=u2?$.useLayoutEffect:c2;function Ic(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,a;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(!Ic(t[r],e[r]))return!1;return!0}if(a=Object.keys(t),n=a.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,a[r]))return!1;for(r=n;r--!==0;){const u=a[r];if(!(u==="_owner"&&t.$$typeof)&&!Ic(t[u],e[u]))return!1}return!0}return t!==t&&e!==e}function UT(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function tw(t,e){const n=UT(t);return Math.round(e*n)/n}function ap(t){const e=$.useRef(t);return xc(()=>{e.current=t}),e}function f2(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:u,floating:c}={},transform:f=!0,whileElementsMounted:h,open:m}=t,[y,g]=$.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[v,S]=$.useState(r);Ic(v,r)||S(r);const[x,T]=$.useState(null),[M,C]=$.useState(null),_=$.useCallback(L=>{L!==ee.current&&(ee.current=L,T(L))},[]),R=$.useCallback(L=>{L!==J.current&&(J.current=L,C(L))},[]),G=u||x,I=c||M,ee=$.useRef(null),J=$.useRef(null),X=$.useRef(y),he=h!=null,pe=ap(h),we=ap(a),je=ap(m),ve=$.useCallback(()=>{if(!ee.current||!J.current)return;const L={placement:e,strategy:n,middleware:v};we.current&&(L.platform=we.current),l2(ee.current,J.current,L).then(te=>{const oe={...te,isPositioned:je.current!==!1};Z.current&&!Ic(X.current,oe)&&(X.current=oe,jD.flushSync(()=>{g(oe)}))})},[v,e,n,we,je]);xc(()=>{m===!1&&X.current.isPositioned&&(X.current.isPositioned=!1,g(L=>({...L,isPositioned:!1})))},[m]);const Z=$.useRef(!1);xc(()=>(Z.current=!0,()=>{Z.current=!1}),[]),xc(()=>{if(G&&(ee.current=G),I&&(J.current=I),G&&I){if(pe.current)return pe.current(G,I,ve);ve()}},[G,I,ve,pe,he]);const ne=$.useMemo(()=>({reference:ee,floating:J,setReference:_,setFloating:R}),[_,R]),j=$.useMemo(()=>({reference:G,floating:I}),[G,I]),U=$.useMemo(()=>{const L={position:n,left:0,top:0};if(!j.floating)return L;const te=tw(j.floating,y.x),oe=tw(j.floating,y.y);return f?{...L,transform:"translate("+te+"px, "+oe+"px)",...UT(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:te,top:oe}},[n,f,j.floating,y.x,y.y]);return $.useMemo(()=>({...y,update:ve,refs:ne,elements:j,floatingStyles:U}),[y,ve,ne,j,U])}const d2=(t,e)=>({...s2(t),options:[t,e]}),h2=(t,e)=>({...o2(t),options:[t,e]}),p2=(t,e)=>({...a2(t),options:[t,e]}),m2="data-floating-ui-focusable",nw="active",iw="selected",y2={...hT};let rw=!1,g2=0;const sw=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+g2++;function b2(){const[t,e]=$.useState(()=>rw?sw():void 0);return Pi(()=>{t==null&&e(sw())},[]),$.useEffect(()=>{rw=!0},[]),t}const v2=y2.useId,KT=v2||b2;function S2(){const t=new Map;return{emit(e,n){var r;(r=t.get(e))==null||r.forEach(a=>a(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 w2=$.createContext(null),x2=$.createContext(null),qT=()=>{var t;return((t=$.useContext(w2))==null?void 0:t.id)||null},by=()=>$.useContext(x2);function Hc(t){return"data-floating-ui-"+t}function T2(t){t.current!==-1&&(clearTimeout(t.current),t.current=-1)}let ow=0;function yo(t,e){e===void 0&&(e={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=e;r&&cancelAnimationFrame(ow);const u=()=>t?.focus({preventScroll:n});a?u():ow=requestAnimationFrame(u)}function A2(t){return t?.ownerDocument||document}const ko={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function aw(t){return t==="inert"?ko.inert:t==="aria-hidden"?ko["aria-hidden"]:ko.none}let ac=new WeakSet,lc={},lp=0;const E2=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,PT=t=>t&&(t.host||PT(t.parentNode)),O2=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=PT(n);return t.contains(r)?r:null}).filter(n=>n!=null);function _2(t,e,n,r){const a="data-floating-ui-inert",u=r?"inert":n?"aria-hidden":null,c=O2(e,t),f=new Set,h=new Set(c),m=[];lc[a]||(lc[a]=new WeakMap);const y=lc[a];c.forEach(g),v(e),f.clear();function g(S){!S||f.has(S)||(f.add(S),S.parentNode&&g(S.parentNode))}function v(S){!S||h.has(S)||[].forEach.call(S.children,x=>{if(Ir(x)!=="script")if(f.has(x))v(x);else{const T=u?x.getAttribute(u):null,M=T!==null&&T!=="false",C=aw(u),_=(C.get(x)||0)+1,R=(y.get(x)||0)+1;C.set(x,_),y.set(x,R),m.push(x),_===1&&M&&ac.add(x),R===1&&x.setAttribute(a,""),!M&&u&&x.setAttribute(u,u==="inert"?"":"true")}})}return lp++,()=>{m.forEach(S=>{const x=aw(u),M=(x.get(S)||0)-1,C=(y.get(S)||0)-1;x.set(S,M),y.set(S,C),M||(!ac.has(S)&&u&&S.removeAttribute(u),ac.delete(S)),C||S.removeAttribute(a)}),lp--,lp||(ko.inert=new WeakMap,ko["aria-hidden"]=new WeakMap,ko.none=new WeakMap,ac=new WeakSet,lc={})}}function lw(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=A2(t[0]).body;return _2(t.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,e,n)}const vy={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},uw=$.forwardRef(function(e,n){const[r,a]=$.useState();Pi(()=>{wD()&&a("button")},[]);const u={ref:n,tabIndex:0,role:r,"aria-hidden":r?void 0:!0,[Hc("focus-guard")]:"",style:vy};return F.jsx("span",{...e,...u})}),R2=$.createContext(null),C2=()=>$.useContext(R2);function cw(t){return $.useMemo(()=>e=>{t.forEach(n=>{n&&(n.current=e)})},t)}const k2=20;let Dr=[];function Sy(){Dr=Dr.filter(t=>t.isConnected)}function M2(t){Sy(),t&&Ir(t)!=="body"&&(Dr.push(t),Dr.length>k2&&(Dr=Dr.slice(-20)))}function fw(){return Sy(),Dr[Dr.length-1]}function D2(t){const e=bf();return CT(t,e)?t:yy(t,e)[0]||t}function dw(t,e){var n;if(!e.current.includes("floating")&&!((n=t.getAttribute("role"))!=null&&n.includes("dialog")))return;const r=bf(),u=vD(t,r).filter(f=>{const h=f.getAttribute("data-tabindex")||"";return CT(f,r)||f.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=t.getAttribute("tabindex");e.current.includes("floating")||u.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 N2=$.forwardRef(function(e,n){return F.jsx("button",{...e,type:"button",ref:n,tabIndex:-1,style:vy})});function $2(t){const{context:e,children:n,disabled:r=!1,order:a=["content"],guards:u=!0,initialFocus:c=0,returnFocus:f=!0,restoreFocus:h=!1,modal:m=!0,visuallyHiddenDismiss:y=!1,closeOnFocusOut:g=!0,outsideElementsInert:v=!1,getInsideElements:S=()=>[]}=t,{open:x,onOpenChange:T,events:M,dataRef:C,elements:{domReference:_,floating:R}}=e,G=fi(()=>{var xe;return(xe=C.current.floatingContext)==null?void 0:xe.nodeId}),I=fi(S),ee=typeof c=="number"&&c<0,J=GS(_)&&ee,X=E2(),he=X?u:!0,pe=!he||X&&v,we=sp(a),je=sp(c),ve=sp(f),Z=by(),ne=C2(),j=$.useRef(null),U=$.useRef(null),L=$.useRef(!1),te=$.useRef(!1),oe=$.useRef(-1),E=$.useRef(-1),q=ne!=null,H=em(R),Q=fi(function(xe){return xe===void 0&&(xe=H),xe?yy(xe,bf()):[]}),re=fi(xe=>{const Me=Q(xe);return we.current.map(ge=>_&&ge==="reference"?_:H&&ge==="floating"?H:Me).filter(Boolean).flat()});$.useEffect(()=>{if(r||!m)return;function xe(ge){if(ge.key==="Tab"){wn(H,So(ei(H)))&&Q().length===0&&!J&&rp(ge);const Xe=re(),ht=Cr(ge);we.current[0]==="reference"&&ht===_&&(rp(ge),ge.shiftKey?yo(Xe[Xe.length-1]):yo(Xe[1])),we.current[1]==="floating"&&ht===H&&ge.shiftKey&&(rp(ge),yo(Xe[0]))}}const Me=ei(H);return Me.addEventListener("keydown",xe),()=>{Me.removeEventListener("keydown",xe)}},[r,_,H,m,we,J,Q,re]),$.useEffect(()=>{if(r||!R)return;function xe(Me){const ge=Cr(Me),ht=Q().indexOf(ge);ht!==-1&&(oe.current=ht)}return R.addEventListener("focusin",xe),()=>{R.removeEventListener("focusin",xe)}},[r,R,Q]),$.useEffect(()=>{if(r||!g)return;function xe(){te.current=!0,setTimeout(()=>{te.current=!1})}function Me(ht){const Le=ht.relatedTarget,En=ht.currentTarget,Ft=Cr(ht);queueMicrotask(()=>{const Vt=G(),Hn=!(wn(_,Le)||wn(R,Le)||wn(Le,R)||wn(ne?.portalNode,Le)||Le!=null&&Le.hasAttribute(Hc("focus-guard"))||Z&&(Ro(Z.nodesRef.current,Vt).find(ri=>{var Fn,st;return wn((Fn=ri.context)==null?void 0:Fn.elements.floating,Le)||wn((st=ri.context)==null?void 0:st.elements.domReference,Le)})||YS(Z.nodesRef.current,Vt).find(ri=>{var Fn,st,Kl;return[(Fn=ri.context)==null?void 0:Fn.elements.floating,em((st=ri.context)==null?void 0:st.elements.floating)].includes(Le)||((Kl=ri.context)==null?void 0:Kl.elements.domReference)===Le})));if(En===_&&H&&dw(H,we),h&&En!==_&&!(Ft!=null&&Ft.isConnected)&&So(ei(H))===ei(H).body){Dt(H)&&H.focus();const ri=oe.current,Fn=Q(),st=Fn[ri]||Fn[Fn.length-1]||H;Dt(st)&&st.focus()}if(C.current.insideReactTree){C.current.insideReactTree=!1;return}(J||!m)&&Le&&Hn&&!te.current&&Le!==fw()&&(L.current=!0,T(!1,ht,"focus-out"))})}const ge=!!(!Z&&ne);function Xe(){T2(E),C.current.insideReactTree=!0,E.current=window.setTimeout(()=>{C.current.insideReactTree=!1})}if(R&&Dt(_))return _.addEventListener("focusout",Me),_.addEventListener("pointerdown",xe),R.addEventListener("focusout",Me),ge&&R.addEventListener("focusout",Xe,!0),()=>{_.removeEventListener("focusout",Me),_.removeEventListener("pointerdown",xe),R.removeEventListener("focusout",Me),ge&&R.removeEventListener("focusout",Xe,!0)}},[r,_,R,H,m,Z,ne,T,g,h,Q,J,G,we,C]);const ce=$.useRef(null),Te=$.useRef(null),Ct=cw([ce,ne?.beforeInsideRef]),Je=cw([Te,ne?.afterInsideRef]);$.useEffect(()=>{var xe,Me;if(r||!R)return;const ge=Array.from((ne==null||(xe=ne.portalNode)==null?void 0:xe.querySelectorAll("["+Hc("portal")+"]"))||[]),ht=(Me=(Z?YS(Z.nodesRef.current,G()):[]).find(Ft=>{var Vt;return GS(((Vt=Ft.context)==null?void 0:Vt.elements.domReference)||null)}))==null||(Me=Me.context)==null?void 0:Me.elements.domReference,Le=[R,ht,...ge,...I(),j.current,U.current,ce.current,Te.current,ne?.beforeOutsideRef.current,ne?.afterOutsideRef.current,we.current.includes("reference")||J?_:null].filter(Ft=>Ft!=null),En=m||J?lw(Le,!pe,pe):lw(Le);return()=>{En()}},[r,_,R,m,we,ne,J,he,pe,Z,G,I]),Pi(()=>{if(r||!Dt(H))return;const xe=ei(H),Me=So(xe);queueMicrotask(()=>{const ge=re(H),Xe=je.current,ht=(typeof Xe=="number"?ge[Xe]:Xe.current)||H,Le=wn(H,Me);!ee&&!Le&&x&&yo(ht,{preventScroll:ht===H})})},[r,x,H,ee,re,je]),Pi(()=>{if(r||!H)return;const xe=ei(H),Me=So(xe);M2(Me);function ge(Le){let{reason:En,event:Ft,nested:Vt}=Le;if(["hover","safe-polygon"].includes(En)&&Ft.type==="mouseleave"&&(L.current=!0),En==="outside-press")if(Vt)L.current=!1;else if(OD(Ft)||_D(Ft))L.current=!1;else{let Hn=!1;document.createElement("div").focus({get preventScroll(){return Hn=!0,!1}}),Hn?L.current=!1:L.current=!0}}M.on("openchange",ge);const Xe=xe.createElement("span");Xe.setAttribute("tabindex","-1"),Xe.setAttribute("aria-hidden","true"),Object.assign(Xe.style,vy),q&&_&&_.insertAdjacentElement("afterend",Xe);function ht(){if(typeof ve.current=="boolean"){const Le=_||fw();return Le&&Le.isConnected?Le:Xe}return ve.current.current||Xe}return()=>{M.off("openchange",ge);const Le=So(xe),En=wn(R,Le)||Z&&Ro(Z.nodesRef.current,G(),!1).some(Vt=>{var Hn;return wn((Hn=Vt.context)==null?void 0:Hn.elements.floating,Le)}),Ft=ht();queueMicrotask(()=>{const Vt=D2(Ft);ve.current&&!L.current&&Dt(Vt)&&(!(Vt!==Le&&Le!==xe.body)||En)&&Vt.focus({preventScroll:!0}),Xe.remove()})}},[r,R,H,ve,C,M,Z,q,_,G]),$.useEffect(()=>(queueMicrotask(()=>{L.current=!1}),()=>{queueMicrotask(Sy)}),[r]),Pi(()=>{if(!r&&ne)return ne.setFocusManagerState({modal:m,closeOnFocusOut:g,open:x,onOpenChange:T,domReference:_}),()=>{ne.setFocusManagerState(null)}},[r,ne,m,x,T,g,_]),Pi(()=>{r||H&&dw(H,we)},[r,H,we]);function ii(xe){return r||!y||!m?null:F.jsx(N2,{ref:xe==="start"?j:U,onClick:Me=>T(!1,Me.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const xi=!r&&he&&(m?!J:!0)&&(q||m);return F.jsxs(F.Fragment,{children:[xi&&F.jsx(uw,{"data-type":"inside",ref:Ct,onFocus:xe=>{if(m){const ge=re();yo(a[0]==="reference"?ge[0]:ge[ge.length-1])}else if(ne!=null&&ne.preserveTabOrder&&ne.portalNode)if(L.current=!1,XS(xe,ne.portalNode)){const ge=ND(_);ge?.focus()}else{var Me;(Me=ne.beforeOutsideRef.current)==null||Me.focus()}}}),!J&&ii("start"),n,ii("end"),xi&&F.jsx(uw,{"data-type":"inside",ref:Je,onFocus:xe=>{if(m)yo(re()[0]);else if(ne!=null&&ne.preserveTabOrder&&ne.portalNode)if(g&&(L.current=!0),XS(xe,ne.portalNode)){const ge=$D(_);ge?.focus()}else{var Me;(Me=ne.afterOutsideRef.current)==null||Me.focus()}}})]})}function hw(t){return Dt(t.target)&&t.target.tagName==="BUTTON"}function j2(t){return Dt(t.target)&&t.target.tagName==="A"}function pw(t){return MT(t)}function B2(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,dataRef:a,elements:{domReference:u}}=t,{enabled:c=!0,event:f="click",toggle:h=!0,ignoreMouse:m=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=e,v=$.useRef(),S=$.useRef(!1),x=$.useMemo(()=>({onPointerDown(T){v.current=T.pointerType},onMouseDown(T){const M=v.current;T.button===0&&f!=="click"&&(JS(M)&&m||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="mousedown")?r(!1,T.nativeEvent,"click"):(T.preventDefault(),r(!0,T.nativeEvent,"click"))))},onClick(T){const M=v.current;if(f==="mousedown"&&v.current){v.current=void 0;return}JS(M)&&m||(n&&h&&(!(a.current.openEvent&&g)||a.current.openEvent.type==="click")?r(!1,T.nativeEvent,"click"):r(!0,T.nativeEvent,"click"))},onKeyDown(T){v.current=void 0,!(T.defaultPrevented||!y||hw(T))&&(T.key===" "&&!pw(u)&&(T.preventDefault(),S.current=!0),!j2(T)&&T.key==="Enter"&&r(!(n&&h),T.nativeEvent,"click"))},onKeyUp(T){T.defaultPrevented||!y||hw(T)||pw(u)||T.key===" "&&S.current&&(S.current=!1,r(!(n&&h),T.nativeEvent,"click"))}}),[a,u,f,m,y,r,n,g,h]);return $.useMemo(()=>c?{reference:x}:{},[c,x])}const z2={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},L2={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},mw=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 V2(t,e){e===void 0&&(e={});const{open:n,onOpenChange:r,elements:a,dataRef:u}=t,{enabled:c=!0,escapeKey:f=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:x}=e,T=by(),M=fi(typeof h=="function"?h:()=>!1),C=typeof h=="function"?M:h,_=$.useRef(!1),{escapeKey:R,outsidePress:G}=mw(S),{escapeKey:I,outsidePress:ee}=mw(x),J=$.useRef(!1),X=fi(Z=>{var ne;if(!n||!c||!f||Z.key!=="Escape"||J.current)return;const j=(ne=u.current.floatingContext)==null?void 0:ne.nodeId,U=T?Ro(T.nodesRef.current,j):[];if(!R&&(Z.stopPropagation(),U.length>0)){let L=!0;if(U.forEach(te=>{var oe;if((oe=te.context)!=null&&oe.open&&!te.context.dataRef.current.__escapeKeyBubbles){L=!1;return}}),!L)return}r(!1,ED(Z)?Z.nativeEvent:Z,"escape-key")}),he=fi(Z=>{var ne;const j=()=>{var U;X(Z),(U=Cr(Z))==null||U.removeEventListener("keydown",j)};(ne=Cr(Z))==null||ne.addEventListener("keydown",j)}),pe=fi(Z=>{var ne;const j=u.current.insideReactTree;u.current.insideReactTree=!1;const U=_.current;if(_.current=!1,m==="click"&&U||j||typeof C=="function"&&!C(Z))return;const L=Cr(Z),te="["+Hc("inert")+"]",oe=ei(a.floating).querySelectorAll(te);let E=gt(L)?L:null;for(;E&&!Ii(E);){const re=Fi(E);if(Ii(re)||!gt(re))break;E=re}if(oe.length&>(L)&&!AD(L)&&!wn(L,a.floating)&&Array.from(oe).every(re=>!wn(E,re)))return;if(Dt(L)&&ve){const re=Ii(L),ce=In(L),Te=/auto|scroll/,Ct=re||Te.test(ce.overflowX),Je=re||Te.test(ce.overflowY),ii=Ct&&L.clientWidth>0&&L.scrollWidth>L.clientWidth,xi=Je&&L.clientHeight>0&&L.scrollHeight>L.clientHeight,xe=ce.direction==="rtl",Me=xi&&(xe?Z.offsetX<=L.offsetWidth-L.clientWidth:Z.offsetX>L.clientWidth),ge=ii&&Z.offsetY>L.clientHeight;if(Me||ge)return}const q=(ne=u.current.floatingContext)==null?void 0:ne.nodeId,H=T&&Ro(T.nodesRef.current,q).some(re=>{var ce;return ip(Z,(ce=re.context)==null?void 0:ce.elements.floating)});if(ip(Z,a.floating)||ip(Z,a.domReference)||H)return;const Q=T?Ro(T.nodesRef.current,q):[];if(Q.length>0){let re=!0;if(Q.forEach(ce=>{var Te;if((Te=ce.context)!=null&&Te.open&&!ce.context.dataRef.current.__outsidePressBubbles){re=!1;return}}),!re)return}r(!1,Z,"outside-press")}),we=fi(Z=>{var ne;const j=()=>{var U;pe(Z),(U=Cr(Z))==null||U.removeEventListener(m,j)};(ne=Cr(Z))==null||ne.addEventListener(m,j)});$.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=R,u.current.__outsidePressBubbles=G;let Z=-1;function ne(oe){r(!1,oe,"ancestor-scroll")}function j(){window.clearTimeout(Z),J.current=!0}function U(){Z=window.setTimeout(()=>{J.current=!1},pf()?5:0)}const L=ei(a.floating);f&&(L.addEventListener("keydown",I?he:X,I),L.addEventListener("compositionstart",j),L.addEventListener("compositionend",U)),C&&L.addEventListener(m,ee?we:pe,ee);let te=[];return v&&(gt(a.domReference)&&(te=$r(a.domReference)),gt(a.floating)&&(te=te.concat($r(a.floating))),!gt(a.reference)&&a.reference&&a.reference.contextElement&&(te=te.concat($r(a.reference.contextElement)))),te=te.filter(oe=>{var E;return oe!==((E=L.defaultView)==null?void 0:E.visualViewport)}),te.forEach(oe=>{oe.addEventListener("scroll",ne,{passive:!0})}),()=>{f&&(L.removeEventListener("keydown",I?he:X,I),L.removeEventListener("compositionstart",j),L.removeEventListener("compositionend",U)),C&&L.removeEventListener(m,ee?we:pe,ee),te.forEach(oe=>{oe.removeEventListener("scroll",ne)}),window.clearTimeout(Z)}},[u,a,f,C,m,n,r,v,c,R,G,X,I,he,pe,ee,we]),$.useEffect(()=>{u.current.insideReactTree=!1},[u,C,m]);const je=$.useMemo(()=>({onKeyDown:X,...y&&{[z2[g]]:Z=>{r(!1,Z.nativeEvent,"reference-press")},...g!=="click"&&{onClick(Z){r(!1,Z.nativeEvent,"reference-press")}}}}),[X,r,y,g]),ve=$.useMemo(()=>({onKeyDown:X,onMouseDown(){_.current=!0},onMouseUp(){_.current=!0},[L2[m]]:()=>{u.current.insideReactTree=!0}}),[X,m,u]);return $.useMemo(()=>c?{reference:je,floating:ve}:{},[c,je,ve])}function U2(t){const{open:e=!1,onOpenChange:n,elements:r}=t,a=KT(),u=$.useRef({}),[c]=$.useState(()=>S2()),f=qT()!=null,[h,m]=$.useState(r.reference),y=fi((S,x,T)=>{u.current.openEvent=S?x:void 0,c.emit("openchange",{open:S,event:x,reason:T,nested:f}),n?.(S,x,T)}),g=$.useMemo(()=>({setPositionReference:m}),[]),v=$.useMemo(()=>({reference:h||r.reference||null,floating:r.floating||null,domReference:r.reference}),[h,r.reference,r.floating]);return $.useMemo(()=>({dataRef:u,open:e,onOpenChange:y,elements:v,events:c,floatingId:a,refs:g}),[e,y,v,c,a,g])}function K2(t){t===void 0&&(t={});const{nodeId:e}=t,n=U2({...t,elements:{reference:null,floating:null,...t.elements}}),r=t.rootContext||n,a=r.elements,[u,c]=$.useState(null),[f,h]=$.useState(null),y=a?.domReference||u,g=$.useRef(null),v=by();Pi(()=>{y&&(g.current=y)},[y]);const S=f2({...t,elements:{...a,...f&&{reference:f}}}),x=$.useCallback(R=>{const G=gt(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;h(G),S.refs.setReference(G)},[S.refs]),T=$.useCallback(R=>{(gt(R)||R===null)&&(g.current=R,c(R)),(gt(S.refs.reference.current)||S.refs.reference.current===null||R!==null&&!gt(R))&&S.refs.setReference(R)},[S.refs]),M=$.useMemo(()=>({...S.refs,setReference:T,setPositionReference:x,domReference:g}),[S.refs,T,x]),C=$.useMemo(()=>({...S.elements,domReference:y}),[S.elements,y]),_=$.useMemo(()=>({...S,...r,refs:M,elements:C,nodeId:e}),[S,M,C,e,r]);return Pi(()=>{r.dataRef.current.floatingContext=_;const R=v?.nodesRef.current.find(G=>G.id===e);R&&(R.context=_)}),$.useMemo(()=>({...S,context:_,refs:M,elements:C}),[S,M,C,_])}function up(t,e,n){const r=new Map,a=n==="item";let u=t;if(a&&t){const{[nw]:c,[iw]:f,...h}=t;u=h}return{...n==="floating"&&{tabIndex:-1,[m2]:""},...u,...e.map(c=>{const f=c?c[n]:null;return typeof f=="function"?t?f(t):null:f}).concat(t).reduce((c,f)=>(f&&Object.entries(f).forEach(h=>{let[m,y]=h;if(!(a&&[nw,iw].includes(m)))if(m.indexOf("on")===0){if(r.has(m)||r.set(m,[]),typeof y=="function"){var g;(g=r.get(m))==null||g.push(y),c[m]=function(){for(var v,S=arguments.length,x=new Array(S),T=0;T<S;T++)x[T]=arguments[T];return(v=r.get(m))==null?void 0:v.map(M=>M(...x)).find(M=>M!==void 0)}}}else c[m]=y}),c),{})}}function q2(t){t===void 0&&(t=[]);const e=t.map(f=>f?.reference),n=t.map(f=>f?.floating),r=t.map(f=>f?.item),a=$.useCallback(f=>up(f,t,"reference"),e),u=$.useCallback(f=>up(f,t,"floating"),n),c=$.useCallback(f=>up(f,t,"item"),r);return $.useMemo(()=>({getReferenceProps:a,getFloatingProps:u,getItemProps:c}),[a,u,c])}const P2=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function I2(t,e){var n,r;e===void 0&&(e={});const{open:a,elements:u,floatingId:c}=t,{enabled:f=!0,role:h="dialog"}=e,m=KT(),y=((n=u.domReference)==null?void 0:n.id)||m,g=$.useMemo(()=>{var _;return((_=em(u.floating))==null?void 0:_.id)||c},[u.floating,c]),v=(r=P2.get(h))!=null?r:h,x=qT()!=null,T=$.useMemo(()=>v==="tooltip"||h==="label"?{["aria-"+(h==="label"?"labelledby":"describedby")]:a?g:void 0}:{"aria-expanded":a?"true":"false","aria-haspopup":v==="alertdialog"?"dialog":v,"aria-controls":a?g:void 0,...v==="listbox"&&{role:"combobox"},...v==="menu"&&{id:y},...v==="menu"&&x&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,x,a,y,h]),M=$.useMemo(()=>{const _={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?_:{..._,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),C=$.useCallback(_=>{let{active:R,selected:G}=_;const I={role:"option",...R&&{id:g+"-fui-option"}};switch(h){case"select":case"combobox":return{...I,"aria-selected":G}}return{}},[g,h]);return $.useMemo(()=>f?{reference:T,floating:M,item:C}:{},[f,T,M,C])}const _l=t=>Array.isArray(t)?t:[t],H2=(t,e)=>{const n=[[],[]];for(const r of t)e(r)?n[0].push(r):n[1].push(r);return n},IT=Array,Rr=(t,e)=>t.includes(e),F2=(t,e=0)=>[...new Array(t)].map((n,r)=>r+e),Fe=(t,e,n)=>t===void 0?e===void 0?[]:Array.isArray(e)?e:[e]:(Array.isArray(e)?t.push(...e):t.push(e),t),ys=(t,e)=>e==null?t??[]:t==null?_l(e):t.concat(e),G2=(...t)=>t.reduce(ys,[]),Ss=(t,e,n)=>{if(t===void 0)return Array.isArray(e)?e:[e];const r=n?.isEqual??((a,u)=>a===u);for(const a of _l(e))t.some(u=>r(u,a))||t.push(a);return t},Y2=(t,e)=>t.reduce((n,r)=>{const a=r[e];return n[a]=Fe(n[a],r),n},{}),Lo=(t,e,n)=>t.length===e.length&&t.every(n?.isEqual?(r,a)=>n.isEqual(r,e[a]):(r,a)=>r===e[a]),Cs=(t,e)=>ti(t)===e,ti=t=>{const e=typeof t;return e==="object"?t===null?"null":"object":e==="function"?"object":e},Gi={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},J2={...Gi,function:"a function"};class X2 extends Error{}const Rt=t=>Vo(t,X2),Vo=(t,e=Error)=>{throw new e(t)};class Z2 extends Error{name="ParseError"}const Y=t=>Vo(t,Z2),HT=t=>` ${t}`,Q2="",Ge=(t,e)=>{const n={},r=Array.isArray(t);let a=!1;for(const[u,c]of Object.entries(t).entries()){const f=r?e(u,c[1]):e(...c,u);a||=typeof f[0]=="number";const h=Array.isArray(f[0])||f.length===0?f:[f];for(const[m,y]of h)typeof m=="object"?n[m.group]=Fe(n[m.group],y):n[m]=y}return a?Object.values(n):n},FT=Object.entries,vi=(t,e)=>t in e,wy=(t,e)=>e in t;class W2{constructor(e){Object.assign(this,e)}}const eN=class{};class GT extends eN{}const tN=(t,e)=>{const n={},r={};let a;for(a in t)a in e?n[a]=t[a]:r[a]=t[a];return[n,r]},YT=(t,e)=>tN(t,e)[1],Rl=t=>Object.keys(t).length===0,Fc=t=>[...Object.entries(t),...Object.getOwnPropertySymbols(t).map(e=>[e,t[e]])],nN=(t,e)=>Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),iN=t=>{const e=Object.keys(t).sort(),n={};for(let r=0;r<e.length;r++)n[e[r]]=t[e[r]];return n},ci=HT(`unset${Q2}`),rN=t=>Object.values(t).filter(e=>typeof e=="number"?!0:typeof t[e]!="number"),JT={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},XT=globalThis.File??Blob,ZT={ArrayBuffer,Blob,File:XT,FormData,Headers,Request,Response,URL},sN={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},Uo={...JT,...ZT,...sN,String,Number,Boolean},xy=t=>{let e=Object.getPrototypeOf(t);for(;e?.constructor&&(!vi(e.constructor.name,Uo)||!(t instanceof Uo[e.constructor.name]));)e=Object.getPrototypeOf(e);const n=e?.constructor?.name;if(!(n===void 0||n==="Object"))return n},tm=t=>typeof t=="object"&&t!==null?xy(t)??"object":ti(t),Xt=Array.isArray,oN={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"},aN={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"},lN={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"},uN={...oN,...aN,...lN},Ty=t=>{const e=Object(t).name??null;return e&&vi(e,Uo)&&Uo[e]===t?e:null},yw=(t,e)=>{let n=t.prototype;for(;n!==null;){if(n===e.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},cN=t=>QT(t,new Map),QT=(t,e)=>{if(typeof t!="object"||t===null)return t;if(e?.has(t))return e.get(t);const n=Ty(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)),a=Object.getOwnPropertyDescriptors(t);if(e){e.set(t,r);for(const u in a){const c=a[u];"get"in c||"set"in c||(c.value=QT(c.value,e))}}return Object.defineProperties(r,a),r},fN=t=>{let e=ci;return()=>e===ci?e=t():e},Sf=t=>typeof t=="function"&&t.length===0,dN=class extends Function{constructor(...t){const e=t.slice(0,-1),n=t[t.length-1];try{super(...e,n)}catch(r){return Rt(`Encountered an unexpected error while compiling your definition:
|
|
22
22
|
Message: ${r}
|
|
23
23
|
Source: (${t.slice(0,-1)}) => {
|
|
24
24
|
${t[t.length-1]}
|
|
25
25
|
}`)}}};class Hr{constructor(e,...[n]){return Object.assign(Object.setPrototypeOf(e.bind(n?.bind??this),this.constructor.prototype),n?.attach)}}const hN=fN(()=>{try{return new Function("return false")()}catch{return!0}});class Si{constructor(){}}var pN={};const mN=()=>{try{return((new Error().stack?.split(`
|
|
26
|
-
`)[2]?.trim()||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1]||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}},yN=pN??{},gN={fileName:mN,env:yN},bN=t=>t[0].toUpperCase()+t.slice(1),WT=t=>new RegExp(vN(t),typeof t=="string"?"":t.flags),vN=t=>`^(?:${typeof t=="string"?t:t.source})$`,kr={negativeLookahead:t=>`(?!${t})`,nonCapturingGroup:t=>`(?:${t})`},tl="\\",wf={" ":1,"\n":1," ":1},SN=/^-0\.?0*$/.source,eA=/[1-9]\d*/.source,wN=/\.\d+/.source,xN=/\.\d*[1-9]/.source,tA=t=>WT(kr.negativeLookahead(SN)+kr.nonCapturingGroup("-?"+kr.nonCapturingGroup(kr.nonCapturingGroup("0|"+eA)+kr.nonCapturingGroup(t.decimalPattern)+"?")+(t.allowDecimalOnly?"|"+t.decimalPattern:"")+"?")),gw=tA({decimalPattern:xN,allowDecimalOnly:!1}),TN=gw.test.bind(gw),nm=tA({decimalPattern:wN,allowDecimalOnly:!0});nm.test.bind(nm);const AN=/^-?\d*\.?\d*$/,EN=t=>t.length!==0&&AN.test(t),Gc=WT(kr.negativeLookahead("^-0$")+"-?"+kr.nonCapturingGroup(kr.nonCapturingGroup("0|"+eA))),ON=Gc.test.bind(Gc),im=/^-?\d+$/,_N=im.test.bind(im),nA={number:"a number",bigint:"a bigint",integer:"an integer"},iA=(t,e)=>`'${t}' was parsed as ${nA[e]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,RN=(t,e)=>e==="number"?TN(t):ON(t),CN=(t,e)=>e==="number"?Number(t):Number.parseInt(t),kN=(t,e)=>e==="number"?EN(t):_N(t),MN=(t,e)=>Ay(t,"number",e),DN=(t,e)=>Ay(t,"number",{...e,strict:!0}),NN=(t,e)=>Ay(t,"integer",e),Ay=(t,e,n)=>{const r=CN(t,e);return!Number.isNaN(r)&&kN(t,e)?n?.strict?RN(t,e)?r:Y(iA(t,e)):r:n?.errorOnFail?Y(n?.errorOnFail===!0?`Failed to parse ${nA[e]} from '${t}'`:n?.errorOnFail):void 0},$N=t=>{if(t[t.length-1]!=="n")return;const e=t.slice(0,-1);let n;try{n=BigInt(e)}catch{return}if(Gc.test(e))return n;if(im.test(e))return Y(iA(t,"bigint"))},jN="0.
|
|
26
|
+
`)[2]?.trim()||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/)?.[1]||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}},yN=pN??{},gN={fileName:mN,env:yN},bN=t=>t[0].toUpperCase()+t.slice(1),WT=t=>new RegExp(vN(t),typeof t=="string"?"":t.flags),vN=t=>`^(?:${typeof t=="string"?t:t.source})$`,kr={negativeLookahead:t=>`(?!${t})`,nonCapturingGroup:t=>`(?:${t})`},tl="\\",wf={" ":1,"\n":1," ":1},SN=/^-0\.?0*$/.source,eA=/[1-9]\d*/.source,wN=/\.\d+/.source,xN=/\.\d*[1-9]/.source,tA=t=>WT(kr.negativeLookahead(SN)+kr.nonCapturingGroup("-?"+kr.nonCapturingGroup(kr.nonCapturingGroup("0|"+eA)+kr.nonCapturingGroup(t.decimalPattern)+"?")+(t.allowDecimalOnly?"|"+t.decimalPattern:"")+"?")),gw=tA({decimalPattern:xN,allowDecimalOnly:!1}),TN=gw.test.bind(gw),nm=tA({decimalPattern:wN,allowDecimalOnly:!0});nm.test.bind(nm);const AN=/^-?\d*\.?\d*$/,EN=t=>t.length!==0&&AN.test(t),Gc=WT(kr.negativeLookahead("^-0$")+"-?"+kr.nonCapturingGroup(kr.nonCapturingGroup("0|"+eA))),ON=Gc.test.bind(Gc),im=/^-?\d+$/,_N=im.test.bind(im),nA={number:"a number",bigint:"a bigint",integer:"an integer"},iA=(t,e)=>`'${t}' was parsed as ${nA[e]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,RN=(t,e)=>e==="number"?TN(t):ON(t),CN=(t,e)=>e==="number"?Number(t):Number.parseInt(t),kN=(t,e)=>e==="number"?EN(t):_N(t),MN=(t,e)=>Ay(t,"number",e),DN=(t,e)=>Ay(t,"number",{...e,strict:!0}),NN=(t,e)=>Ay(t,"integer",e),Ay=(t,e,n)=>{const r=CN(t,e);return!Number.isNaN(r)&&kN(t,e)?n?.strict?RN(t,e)?r:Y(iA(t,e)):r:n?.errorOnFail?Y(n?.errorOnFail===!0?`Failed to parse ${nA[e]} from '${t}'`:n?.errorOnFail):void 0},$N=t=>{if(t[t.length-1]!=="n")return;const e=t.slice(0,-1);let n;try{n=BigInt(e)}catch{return}if(Gc.test(e))return n;if(im.test(e))return Y(iA(t,"bigint"))},jN="0.55.0",BN={version:jN,filename:gN.fileName(),FileConstructor:XT},Cl=BN,bw=new Map,cp=Object.create(null),rm=t=>{const e=bw.get(t);if(e)return e;let n=zN(t);return cp[n]?n=`${n}${cp[n]++}`:cp[n]=1,Cl[n]=t,bw.set(t,n),n},ml=t=>/^[$A-Z_a-z][\w$]*$/.test(t),zN=t=>{switch(typeof t){case"object":{if(t===null)break;const e=xy(t)??"object";return e[0].toLowerCase()+e.slice(1)}case"function":return ml(t.name)?t.name:"fn";case"symbol":return t.description&&ml(t.description)?t.description:"symbol"}return Rt(`Unexpected attempt to register serializable value of type ${ti(t)}`)},Ey=t=>typeof t=="string"?JSON.stringify(t):typeof t=="bigint"?`${t}n`:`${t}`,LN=(t,e={})=>nl(t,{onUndefined:"$ark.undefined",onBigInt:n=>`$ark.bigint-${n}`,...e},[]),Ie=(t,e)=>{switch(ti(t)){case"object":const n=t,r=n.constructor.name;return r==="Object"||r==="Array"?e?.quoteKeys===!1?Yc(n,e?.indent??0,""):JSON.stringify(nl(n,Ko,[]),null,e?.indent):Yc(n,e?.indent??0,"");case"symbol":return Ko.onSymbol(t);default:return Ey(t)}},Yc=(t,e,n)=>{if(typeof t=="function")return Ko.onFunction(t);if(typeof t!="object"||t===null)return Ey(t);const r=n+" ".repeat(e);if(Array.isArray(t)){if(t.length===0)return"[]";const u=t.map(c=>Yc(c,e,r)).join(`,
|
|
27
27
|
`+r);return e?`[
|
|
28
28
|
${r}${u}
|
|
29
29
|
${n}]`:`[${u}]`}const a=t.constructor.name;if(a==="Object"){const u=Fc(t).map(([c,f])=>{const h=typeof c=="symbol"?Ko.onSymbol(c):ml(c)?c:JSON.stringify(c),m=Yc(f,e,r);return`${r}${h}: ${m}`});return u.length===0?"{}":e?`{
|
|
@@ -63,4 +63,4 @@ ${c},
|
|
|
63
63
|
`;if(!n.hasKind("union"))return f;const h=new fp({kind:"Allows",optimistic:!0}).indent();n.compile(h);const m=h.write(`${n.id}Optimistic`);return`${f}${m},
|
|
64
64
|
`},`{
|
|
65
65
|
`)+"}");class nE{config;resolvedConfig;name;get[Yi](){return"scope"}referencesById={};references=[];resolutions={};exportedNames=[];aliases={};resolved=!1;nodesByHash={};intrinsic;constructor(e,n){this.config=om(W.config,n),this.resolvedConfig=om(W.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(pp).length}`,this.name in pp&&Y(`A Scope already named ${this.name} already exists`),pp[this.name]=this;const r=Object.entries(e).map(a=>this.preparseOwnAliasEntry(...a));for(const[a,u]of r){let c=a;if(a[0]==="#"?(c=a.slice(1),c in this.aliases&&Y(Lw(c)),this.aliases[c]=u):(c in this.aliases&&Y(Lw(a)),this.aliases[c]=u,this.exportedNames.push(c)),!fe(u,"module")&&!fe(u,"generic")&&!Sf(u)){const f=this.preparseOwnDefinitionFormat(u,{alias:c});this.resolutions[c]=fe(f,"root")?this.bindReference(f):this.createParseContext(f).id}}Vw??=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0}),this.nodesByHash[Vw.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=W.intrinsic?Ge(W.intrinsic,(a,u)=>a.startsWith("json")?[]:[a,this.bindReference(u)]):{}}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,a)=>new Qc(e,a?new wA(r):r,n,n,a??null)};units=(e,n)=>{const r=[];for(const u of e)r.includes(u)||r.push(u);const a=r.map(u=>this.node("unit",{unit:u},n));return this.node("union",a,{...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(Ac(e),e,n);preparseNode(e,n,r){let a=typeof e=="string"?e:Ac(n,e);if(Qt(n)&&n.kind===a)return n;if(a==="alias"&&!r?.prereduced){const{reference:f}=Dy.implementation.normalize(n,this);if(f.startsWith("$")){const h=this.resolveRoot(f.slice(1));n=h,a=h.kind}}else if(a==="union"&&Cs(n,"object")){const f=Qj(n);f?.length===1&&(n=f[0],a=Ac(n))}if(Qt(n)&&n.kind===a)return n;const c=Of[a].normalize?.(n,this)??n;return Qt(c)?c.kind===a?c:Wj(a,c.kind):{...r,$:this,kind:a,def:c,prefix:r.alias??a}}bindReference(e){let n;return Qt(e)?n=e.$===this?e:new e.constructor(e.attachments,this):n=e.$===this?e:new Qc(e.params,e.bodyDef,e.$,this,e.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(e){return this.maybeResolveRoot(e)??Y(oE(e))}maybeResolveRoot(e){const n=this.maybeResolve(e);if(!fe(n,"generic"))return n}maybeResolveSubalias(e){return hm(this.aliases,e)??hm(this.ambient,e)}get ambient(){return W.ambient}maybeResolve(e){const n=this.resolutions[e];if(n){if(typeof n!="string")return this.bindReference(n);const a=Vn[n];if(fe(a,"root"))return this.resolutions[e]=a;if(fe(a,"context")){if(a.phase==="resolving")return this.node("alias",{reference:`$${e}`},{prereduced:!0});if(a.phase==="resolved")return Rt(`Unexpected resolved context for was uncached by its scope: ${Ie(a)}`);a.phase="resolving";const u=this.bindReference(this.parseOwnDefinitionFormat(a.def,a));return a.phase="resolved",Vn[u.id]=u,Vn[a.id]=u,this.resolutions[e]=u}return Rt(`Unexpected nodesById entry for ${n}: ${Ie(a)}`)}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(aE(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??BA(e.prefix);return Vn[n]=Object.assign(e,{[Yi]:"context",$:this,id:n,phase:"unresolved"})}traversal(e){return new xo(e,this.resolvedConfig)}import(...e){return new dm(Ge(this.export(...e),(n,r)=>[`#${n}`,r]))}precompilation;_exportedResolutions;_exports;export(...e){if(!this._exports){this._exports={};for(const r of this.exportedNames){const a=this.aliases[r];this._exports[r]=fe(a,"module")?QA(a,this):Uw(this.maybeResolve(r))}for(const r of this.lazyResolutions)r.resolution;if(this._exportedResolutions=sE(this,this._exports),this._json=rE(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const r=tE(this.references);this.precompilation=r.write(WA,4),eE(this.references,r)}this.resolved=!0}const n=e.length?e:this.exportedNames;return new dm(Ge(n,(r,a)=>[a,this._exports[a]]))}resolve(e){return this.export()[e]}node=(e,n,r={})=>{const a=this.preparseNode(e,n,r);if(Qt(a))return this.bindReference(a);const u=this.createParseContext(a),c=zA(u),f=this.bindReference(c);return Vn[u.id]=f};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 a=this.createParseContext(r);Vn[a.id]=a;let u=this.bindReference(this.parseOwnDefinitionFormat(e,a));return u.isCyclic&&(u=I$(u,a.id)),Vn[a.id]=u,u}finalize(e){return Uw(e),!e.precompilation&&!this.resolvedConfig.jitless&&e3(e.references),e}}class iE extends nE{parseOwnDefinitionFormat(e,n){return zA(n)}preparseOwnDefinitionFormat(e,n){return this.preparseNode(Ac(e),e,n)}preparseOwnAliasEntry(e,n){return[e,n]}normalizeRootScopeValue(e){return e}}const Uw=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},rE=t=>Ge(t,(e,n)=>[e,fe(n,"root")||fe(n,"generic")?n.json:fe(n,"module")?rE(n):Rt(`Unexpected resolution ${Ie(n)}`)]),hm=(t,e)=>{const n=e.indexOf(".");if(n===-1)return;const r=e.slice(0,n),a=t[r];if(a===void 0)return;if(!fe(a,"module"))return Y(t3(r));const u=e.slice(n+1),c=a[u];if(c===void 0)return hm(a,u);if(fe(c,"root")||fe(c,"generic"))return c;if(fe(c,"module"))return c.root??Y(aE(e));Rt(`Unexpected resolution for alias '${e}': ${Ie(c)}`)},jy=(t,e)=>new iE(t,e),$l=new iE({}),sE=(t,e)=>{const n={};for(const r in e){const a=e[r];if(fe(a,"module")){const u=sE(t,a),c=Ge(u,(f,h)=>[`${r}.${f}`,h]);Object.assign(n,c)}else fe(a,"root")||fe(a,"generic")?n[r]=a:Rt(`Unexpected scope resolution ${Ie(a)}`)}return n},oE=t=>`'${t}' is unresolvable`,t3=t=>`'${t}' must reference a module to be accessed using dot syntax`,aE=t=>`Reference to submodule '${t}' must specify an alias`;$l.export();const Ye=$l.schema,By=$l.node;$l.defineSchema;const er=$l.generic,lE="^(?:0|[1-9]\\d*)$",n3=new RegExp(lE);en(n3);const uE=jy({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();W.intrinsic={...uE};const cE=jy({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:lE}},{prereducedAliases:!0}).export();Object.assign(W.intrinsic,cE);const i3=jy({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),me={...uE,...cE,...i3,emptyStructure:By("structure",{},{prereduced:!0})};W.intrinsic={...me};const Kw=((t,e)=>new RegExp(t,e));Object.assign(Kw,{as:Kw});const r3=t=>typeof t=="string"&&t[0]==="d"&&(t[1]==="'"||t[1]==='"')&&t[t.length-1]===t[1],qw=t=>t.toString()!=="Invalid Date",s3=t=>t.slice(2,-1),fE=t=>`'${t}' could not be parsed by the Date constructor`,o3=(t,e)=>a3(t,e),a3=(t,e)=>{const n=new Date(t);if(qw(n))return n;const r=MN(t);if(r!==void 0){const a=new Date(r);if(qw(a))return a}return e?Y(e===!0?fE(t):e):void 0},Pw=(t,e)=>{const n=t.scanner.shiftUntilEscapable(c3[hE[e]]);if(t.scanner.lookahead==="")return t.error(d3(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(vi(e,dE))t.root=t.ctx.$.node("unit",{unit:n});else{const r=o3(n,fE(n));t.root=t.ctx.$.node("unit",{meta:n,unit:r})}},dE={"'":1,'"':1},l3={"/":1,"'":1,'"':1},u3={"d'":"'",'d"':'"',"'":"'",'"':'"'},hE={...u3,"/":"/"},c3={"'":t=>t.lookahead==="'",'"':t=>t.lookahead==='"',"/":t=>t.lookahead==="/"},f3={'"':"double-quote","'":"single-quote","/":"forward slash"},d3=(t,e)=>`${e}${t} requires a closing ${f3[hE[e]]}`,h3=t=>`Private type references should not include '#'. Use '${t}' instead.`,pE="Optional definitions like 'string?' are only valid as properties in an object or tuple",mE="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",Jo={"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...wf},p3=(t,e)=>t===">"?e[0]==="="?e[1]==="=":e.trimStart()===""||vi(e.trimStart()[0],Jo):t==="="?e[0]!=="=":t===","||t==="?",m3=(t,e,n)=>yE(t,e,n,[]),yE=(t,e,n,r)=>{const a=n.parseUntilFinalizer();return r.push(a.root),a.finalizer===">"?r.length!==e.params.length?n.error(gE(t,e.names,r.map(u=>u.expression))):r:a.finalizer===","?yE(t,e,n,r):a.error(aA(">"))},gE=(t,e,n)=>`${t}<${e.join(", ")}> requires exactly ${e.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,Iw=t=>{const e=t.scanner.shiftUntilLookahead(Jo);e==="keyof"?t.addPrefix("keyof"):t.root=g3(t,e)},y3=(t,e,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(gE(t,e.names,[]));const a=m3(t,e,n);return e(...a)},g3=(t,e)=>b3(t,e)??v3(t,e)??t.error(e===""?t.scanner.lookahead==="#"?h3(t.shiftedByOne().scanner.shiftUntilLookahead(Jo)):bE(t):oE(e)),b3=(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")?y3(e,n,t):Y(`Unexpected resolution ${Ie(n)}`)},v3=(t,e)=>{const n=DN(e);if(n!==void 0)return t.ctx.$.node("unit",{unit:n});const r=$N(e);if(r!==void 0)return t.ctx.$.node("unit",{unit:r})},bE=t=>{const e=t.previousOperator();return e?vE(e,t.scanner.unscanned):S3(t.scanner.unscanned)},vE=(t,e="")=>`Token '${t}' requires a right operand${e?` before '${e}'`:""}`,S3=t=>`Expected an expression${t?` before '${t}'`:""}`,SE=t=>t.scanner.lookahead===""?t.error(bE(t)):t.scanner.lookahead==="("?t.shiftedByOne().reduceGroupOpen():t.scanner.lookaheadIsIn(l3)?Pw(t,t.scanner.shift()):t.scanner.lookaheadIsIn(wf)?SE(t.shiftedByOne()):t.scanner.lookahead==="d"&&t.scanner.nextLookahead in dE?Pw(t,`${t.scanner.shift()}${t.scanner.shift()}`):Iw(t),w3={">":!0,">=":!0},x3={"<":!0,"<=":!0},ef={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},T3=(t,e)=>`Left bounds are only valid when paired with right bounds (try ...${e}${t})`,wE=t=>`Left-bounded expressions must specify their limits using < or <= (was ${t})`,A3=(t,e,n,r)=>`An expression may have at most one left bound (parsed ${t}${ef[e]}, ${n}${ef[r]})`,E3=(t,e)=>{const n=_3(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 C3(t,n)},O3={"<":1,">":1,"=":1},_3=(t,e)=>t.scanner.lookaheadIs("=")?`${e}${t.scanner.shift()}`:e,Hw=(t,e,n,r)=>n.extends(W.intrinsic.number)?typeof e!="number"?Y(pm(t,e,r)):t==="=="?["min","max"]:t[0]===">"?["min"]:["max"]:n.extends(W.intrinsic.lengthBoundable)?typeof e!="number"?Y(pm(t,e,r)):t==="=="?["exactLength"]:t[0]===">"?["minLength"]:["maxLength"]:n.extends(W.intrinsic.Date)?t==="=="?["after","before"]:t[0]===">"?["after"]:["before"]:Y(T$(n.expression)),R3=t=>({rule:r3(t.limit)?s3(t.limit):t.limit,exclusive:t.comparator.length===1}),C3=(t,e)=>{const n=t.unsetRoot(),r=t.scanner.location;t.parseOperand();const a=t.unsetRoot(),u=t.scanner.sliceChars(r,t.scanner.location);if(t.root=n,!a.hasKind("unit")||typeof a.unit!="number"&&!(a.unit instanceof Date))return t.error(pm(e,u,"right"));const c=a.unit,f=e.length===1,h=Hw(e,typeof c=="number"?c:u,n,"right");for(const y of h)t.constrainRoot(y,e==="=="?{rule:c}:{rule:c,exclusive:f});if(!t.branches.leftBound)return;if(!vi(e,x3))return t.error(wE(e));const m=Hw(t.branches.leftBound.comparator,t.branches.leftBound.limit,n,"left");t.constrainRoot(m[0],R3(t.branches.leftBound)),t.branches.leftBound=null},pm=(t,e,n)=>`Comparator ${n==="left"?ef[t]:t} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${e})`,k3=t=>{t.scanner.shiftUntilNonWhitespace();const e=t.scanner.shiftUntilLookahead(Jo);t.root=t.root.brand(e)},M3=t=>{t.scanner.shiftUntilNonWhitespace();const e=t.scanner.shiftUntilLookahead(Jo),n=NN(e,{errorOnFail:Fw(e)});n===0&&t.error(Fw(0)),t.root=t.root.constrain("divisor",n)},Fw=t=>`% operator must be followed by a non-zero integer literal (was ${t})`,xE=t=>{const e=t.scanner.shift();return e===""?t.finalize(""):e==="["?t.scanner.shift()==="]"?t.setRoot(t.root.array()):t.error(D3):e==="|"?t.scanner.lookahead===">"?t.shiftedByOne().pushRootToBranch("|>"):t.pushRootToBranch(e):e==="&"?t.pushRootToBranch(e):e===")"?t.finalizeGroup():p3(e,t.scanner.unscanned)?t.finalize(e):vi(e,O3)?E3(t,e):e==="%"?M3(t):e==="#"?k3(t):e in wf?xE(t):t.error(zy(e))},zy=(t,e="")=>`'${t}' is not allowed here${e&&` (should be ${e})`}`,D3="Missing expected ']'",N3=t=>{const e=t.unsetRoot();t.parseOperand();const n=t.unsetRoot();if(!n.hasKind("unit"))return t.error($3(n.expression));const r=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[e,"=",r]},$3=t=>`Default value '${t}' must be a literal value`,Gw=(t,e)=>{const n=e.$.maybeResolveRoot(t);if(n)return n;if(t.endsWith("[]")){const u=e.$.maybeResolveRoot(t.slice(0,-2));if(u)return u.array()}const r=new _f(new oA(t),e),a=j3(r);return r.finalizer===">"&&Y(zy(">")),a},j3=t=>{t.parseOperand();let e=Ly(t).root;return e?(t.finalizer==="="?e=N3(t):t.finalizer==="?"&&(e=[e,"?"]),t.scanner.shiftUntilNonWhitespace(),t.scanner.lookahead&&Y(zy(t.scanner.lookahead)),e):Rt(`Root was unexpectedly unset after parsing string '${t.scanner.scanned}'`)},Ly=t=>{for(;t.finalizer===void 0;)B3(t);return t},B3=t=>t.hasRoot()?t.parseOperator():t.parseOperand();class _f{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(aA(")"));this.finalizeBranches(),this.finalizer=e}reduceLeftBound(e,n){const r=ef[n];if(!vi(r,w3))return this.error(wE(n));if(this.branches.leftBound)return this.error(A3(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(qN(")",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():Rt(`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 Ly(new _f(this.scanner,this.ctx))}parseOperator(){return xE(this)}parseOperand(){return SE(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(T3(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[this.branches.prefixes.length-1]??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const z3="An empty string is not a valid generic parameter name",mm=(t,e,n)=>{t.shiftUntilNonWhitespace();const r=t.shiftUntilLookahead(Jo);return r===""?t.lookahead===""&&e.length?e:Y(z3):(t.shiftUntilNonWhitespace(),L3(t,r,e,n))},Yw="extends ",L3=(t,e,n,r)=>{if(t.shiftUntilNonWhitespace(),t.unscanned.startsWith(Yw))t.jumpForward(Yw.length);else return t.lookahead===","&&t.shift(),n.push(e),mm(t,n,r);const a=Ly(new _f(t,r));return n.push([e,a.root]),mm(t,n,r)};class V3 extends Hr{constructor(e){const n={$:e,raw:e.fn};super((...r)=>{const a=r.indexOf(":"),u=a===-1?r.length-1:a-1,c=r.slice(0,u+1),f=e.parse(c).assertHasKind("intersection");let h=e.intrinsic.unknown;if(a!==-1){if(a!==r.length-2)return Y(K3);h=e.parse(r[a+1])}return m=>new U3(m,f,h)},{attach:n})}}class U3 extends Hr{raw;params;returns;expression;constructor(e,n,r){const a=`typed ${e.name}`,u={[a]:(...f)=>{const h=n.assert(f),m=e(...h);return r.assert(m)}}[a];super(u),this.raw=e,this.params=n,this.returns=r;let c=n.expression;c[0]==="["&&c[c.length-1]==="]"?c=c.slice(1,-1):c.endsWith("[]")&&(c=`...${c}`),this.expression=`(${c}) => ${r?.expression??"unknown"}`}}const K3=`":" must be followed by exactly one return type e.g:
|
|
66
|
-
fn("string", ":", "number")(s => s.length)`;class q3 extends Hr{$;constructor(e){super((...n)=>new fc(e)(...n),{bind:e}),this.$=e}in(e){return new fc(this.$,e===void 0?void 0:this.$.parse(e))}at(e,n){return new fc(this.$).at(e,n)}case(e,n){return new fc(this.$).case(e,n)}}class fc extends Hr{$;in;key;branches=[];constructor(e,n){super(r=>this.caseEntries(Object.entries(r).map(([a,u])=>a==="default"?[a,u]:[this.$.parse(a),u]))),this.$=e,this.in=n}at(e,n){return this.key&&Y(I3),this.branches.length&&Y(P3),this.key=e,n?this.match(n):this}case(e,n){return this.caseEntry(this.$.parse(e),n)}caseEntry(e,n){const a=(this.key?this.$.parse({[this.key]:e}):e).pipe(n);return this.branches.push(a),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,a]=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(a);if(typeof a!="function")return Y(`Value for case "${r}" must be a function (was ${ti(a)})`);this.caseEntry(r,a)}return this}default(e){typeof e=="function"&&this.case(me.unknown,e);const n={branches:this.branches,ordered:!0};(e==="never"||e==="assert")&&(n.meta={onFail:Jw});const r=this.$.node("union",n);if(!this.in)return this.$.finalize(r);let a=this.in.pipe(r);return(e==="never"||e==="assert")&&(a=a.configureReferences({onFail:Jw},"self")),this.$.finalize(a)}}const Jw=t=>t.throw(),P3="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",I3="At most one key matcher may be specified per expression",TE=(t,e)=>{if(Xt(t)){if(t[1]==="=")return[e.$.parseOwnDefinitionFormat(t[0],e),"=",t[2]];if(t[1]==="?")return[e.$.parseOwnDefinitionFormat(t[0],e),"?"]}return kE(t,e)},H3="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",F3="Only required keys may specify default values, e.g. { value: 'number = 0' }",G3=(t,e)=>{let n;const r={},a=Fc(t);for(const[c,f]of a){const h=X3(c);if(h.kind==="spread"){if(!Rl(r))return Y(J3);const S=e.$.parseOwnDefinitionFormat(f,e);if(S.equals(me.object))continue;if(!S.hasKind("intersection")||!S.basis?.equals(me.object))return Y(Z3(S.expression));n=S.structure;continue}if(h.kind==="undeclared"){f!=="reject"&&f!=="delete"&&f!=="ignore"&&Y(Y3(f)),r.undeclared=f;continue}const m=TE(f,e),y=h;if(h.kind==="required"){Xt(m)?mp(r,"optional",m[1]==="="?{key:h.normalized,value:m[0],default:m[2]}:{key:h.normalized,value:m[0]},e):mp(r,"required",{key:h.normalized,value:m},e);continue}if(Xt(m)&&(m[1]==="?"&&Y(H3),m[1]==="="&&Y(F3)),h.kind==="optional"){mp(r,"optional",{key:h.normalized,value:m},e);continue}const g=e.$.parseOwnDefinitionFormat(y.normalized,e),v=fm(g,m,e.$);v.index&&(r.index=Fe(r.index,v.index)),v.required&&(r.required=Fe(r.required,v.required))}const u=e.$.node("structure",r);return e.$.parseSchema({domain:"object",structure:n?.merge(u)??u})},mp=(t,e,n,r)=>{t[e]=Fe(t[e],r.$.node(e,n))},Y3=t=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${Ie(t)})`,J3="Spread operator may only be used as the first key in an object",X3=t=>typeof t=="symbol"?{kind:"required",normalized:t}:t[t.length-1]==="?"?t[t.length-2]===tl?{kind:"required",normalized:`${t.slice(0,-2)}?`}:{kind:"optional",normalized:t.slice(0,-1)}:t[0]==="["&&t[t.length-1]==="]"?{kind:"index",normalized:t.slice(1,-1)}:t[0]===tl&&t[1]==="["&&t[t.length-1]==="]"?{kind:"required",normalized:t.slice(1)}:t==="..."?{kind:"spread"}:t==="+"?{kind:"undeclared"}:{kind:"required",normalized:t==="\\..."?"...":t==="\\+"?"+":t},Z3=t=>`Spread operand must resolve to an object literal type (was ${t})`,Q3=(t,e)=>lB(t)?_E[t[0]](t,e):oB(t)?OE[t[1]](t,e):null,W3=(t,e)=>e.$.parseOwnDefinitionFormat(t[1],e).keyof(),yp=(t,e)=>{if(t[2]===void 0)return Y(vE(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 a=t[1]==="&"?Xi(n,r,e.$):lm(n,r,e.$);return a instanceof ae?a.throw():a},eB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).array(),tB=(t,e)=>typeof t[2]!="function"?Y(AE("=>",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).pipe(t[2]),AE=(t,e)=>`${t===":"?"Narrow":"Morph"} expression requires a function following '${t}' (was ${typeof e})`,nB=(t,e)=>typeof t[2]!="function"?Y(AE(":",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).constrain("predicate",t[2]),iB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).configure(t[2],t[3]),EE=t=>t,rB=EE({"[]":eB,"?":()=>Y(pE)}),sB=EE({"|":yp,"&":yp,":":nB,"=>":tB,"|>":yp,"@":iB,"=":()=>Y(mE)}),OE={...rB,...sB},oB=t=>OE[t[1]]!==void 0,aB=t=>t,_E=aB({keyof:W3,instanceof:(t,e)=>{if(typeof t[1]!="function")return Y(Xw(tm(t[1])));const n=t.slice(1).map(r=>typeof r=="function"?e.$.node("proto",{proto:r}):Y(Xw(tm(r))));return n.length===1?n[0]:e.$.node("union",{branches:n})},"===":(t,e)=>e.$.units(t.slice(1))}),lB=t=>_E[t[0]]!==void 0,Xw=t=>`Expected a constructor following 'instanceof' operator (was ${t})`,uB=(t,e)=>{let n=[{}],r=0;for(;r<t.length;){let a=!1;t[r]==="..."&&r<t.length-1&&(a=!0,r++);const u=TE(t[r],e),[c,f,h]=Xt(u)?u:[u];if(r++,a){if(!c.extends(W.intrinsic.Array))return Y(dB(c.expression));n=n.flatMap(m=>c.distribute(y=>fB(dA(m),y)))}else n=n.map(m=>f==="?"?RE(m,c):f==="="?cB(m,c,h):ym(m,c))}return e.$.parseSchema(n.map(a=>Rl(a)?{proto:Array,exactLength:0}:{proto:Array,sequence:a}))},ym=(t,e)=>t.defaultables||t.optionals?Y(t.variadic?JA:hB):(t.variadic?t.postfix=Fe(t.postfix,e):t.prefix=Fe(t.prefix,e),t),RE=(t,e)=>t.variadic?Y(CE):(t.optionals=Fe(t.optionals,e),t),cB=(t,e,n)=>t.variadic?Y(CE):t.optionals?Y(pB):(t.defaultables=Fe(t.defaultables,[[e,n]]),t),Zw=(t,e)=>(t.postfix&&Y(Qw),t.variadic?t.variadic.equals(e)||Y(Qw):t.variadic=e.internal,t),fB=(t,e)=>{const n=e.select({method:"find",kind:"sequence"});if(!n)return Zw(t,W.intrinsic.unknown);if(n.prefix)for(const r of n.prefix)ym(t,r);if(n.optionals)for(const r of n.optionals)RE(t,r);if(n.variadic&&Zw(t,n.variadic),n.postfix)for(const r of n.postfix)ym(t,r);return t},dB=t=>`Spread element must be an array (was ${t})`,Qw="A tuple may have at most one variadic element",hB="A required element may not follow an optional element",CE="An optional element may not follow a variadic element",pB="A defaultable element may not follow an optional element without a default",mB={},kE=(t,e)=>{if(typeof t=="string"){if(e.args&&Object.keys(e.args).some(r=>t.includes(r)))return Gw(t,e);const n=mB[e.$.name]??={};return n[t]??=Gw(t,e)}return Cs(t,"object")?yB(t,e):Y(gm(ti(t)))},yB=(t,e)=>{const n=xy(t);switch(n){case void 0:return fe(t,"root")?t:G3(t,e);case"Array":return gB(t,e);case"RegExp":return e.$.node("intersection",{domain:"string",pattern:t},{prereduced:!0});case"Function":{const r=Sf(t)?t():t;return fe(r,"root")?r:Y(gm("Function"))}default:return Y(gm(n??Ie(t)))}},gB=(t,e)=>Q3(t,e)??uB(t,e),gm=t=>`Type definitions must be strings or objects (was ${t})`;class bB extends Hr{constructor(e){const n=Object.assign({errors:Lr,hkt:Si,$:e,raw:e.parse,module:e.constructor.module,scope:e.constructor.scope,declare:e.declare,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,fn:e.fn},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][r[0].length-1]===">"){const a=r[0].slice(1,-1),u=e.parseGenericParams(a,{});return new Qc(u,r[1],e,e,null)}return e.parse(r)},{attach:n})}}const yl=W;class Rf extends nE{get ambientAttachments(){if(yl.typeAttachments)return this.cacheGetter("ambientAttachments",Ge(yl.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}`,f=this.resolvedConfig.keywords?.[c];return f&&(n=[n,"@",f]),[e,n]}e[e.length-1]!==">"&&Y("'>' must be the last character of a generic declaration in a scope");const a=e.slice(0,r),u=e.slice(r+1,-1);return[a,()=>{const c=this.parseGenericParams(u,{alias:a});return u$(c,n,this)}]}parseGenericParams(e,n){return mm(new oA(e),[],this.createParseContext({...n,def:e,prefix:"generic"}))}normalizeRootScopeValue(e){return Sf(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 a=kE(e,n);if(Xt(a)){if(a[1]==="=")return Y(mE);if(a[1]==="?")return Y(pE)}return a}unit=e=>this.units([e]);valueOf=e=>this.units(rN(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);fn=new V3(this);match=new q3(this);declare=()=>({type:this.type});define(e){return e}type=new bB(this);static scope=((e,n={})=>new Rf(e,n));static module=((e,n={})=>this.scope(e,n).export())}const vB=Object.assign(Rf.scope,{define:t=>t}),ze=Rf;class SB extends Si{description='merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'}const wB=er(["base",me.object],["props",me.object])(t=>t.base.merge(t.props),SB),xB=ze.module({Key:me.key,Merge:wB});class TB extends Si{}const AB=er("element")(t=>{const e=t.element.exclude(me.Array),n=e.array();return e.rawOr(n).pipe(_l).distribute(r=>r.assertHasKind("morph").declareOut(n),Ye)},TB),EB=ze.module({root:me.Array,readonly:"root",index:me.nonNegativeIntegerString,liftFrom:AB},{name:"Array"}),bm=Ye(["string",Cl.FileConstructor]),OB=bm.rawOr(bm.array()),Ww=Ye({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:OB}}),_B=ze.module({root:["instanceof",FormData],value:bm,parsed:Ww,parse:Ye({in:FormData,morphs:t=>{const e={};for(const[n,r]of t)if(n in e){const a=e[n];typeof a=="string"||a instanceof Cl.FileConstructor?e[n]=[a,r]:a.push(r)}else e[n]=r;return e},declaredOut:Ww})},{name:"FormData"}),RB=ze.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"}),CB={Boolean:1,Number:1,String:1},kB=ze.module({...Ge({...JT,...ZT},(t,e)=>t in CB?[]:[t,["instanceof",e]]),Array:EB,TypedArray:RB,FormData:_B}),MB=Ye({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),DB=Ye({domain:"number",divisor:1}),ME=ze.module({root:me.number,integer:DB,epoch:MB,safe:Ye({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"}),et=(t,e,n)=>{const r={domain:"string",pattern:{rule:t.source,flags:t.flags,meta:e}};return n&&(r.meta={format:n}),By("intersection",r)},e1=et(Gc,"a well-formed integer string"),DE=ze.module({root:e1,parse:Ye({in:e1,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:me.integer})},{name:"string.integer"}),NB=et(/^[\dA-Fa-f]+$/,"hex characters only"),$B=ze.module({root:et(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:et(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),t1=et(/^[A-Z].*$/,"capitalized"),jB=ze.module({root:Ye({in:"string",morphs:t=>t.charAt(0).toUpperCase()+t.slice(1),declaredOut:t1}),preformatted:t1},{name:"string.capitalize"}),BB=t=>{const e=t.replace(/[ -]+/g,"");let n=0,r,a,u=!1;for(let c=e.length-1;c>=0;c--)r=e.substring(c,c+1),a=Number.parseInt(r,10),u?(a*=2,n+=a>=10?a%10+1:a):n+=a,u=!u;return!!(n%10===0&&e)},zB=/^(?: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}))$/,LB=Ye({domain:"string",pattern:{meta:"a credit card number",rule:zB.source},predicate:{meta:"a credit card number",predicate:BB}}),VB=/^([+-]?\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)?)?)?)?$/,UB=t=>!Number.isNaN(new Date(t).valueOf()),n1=Ye({domain:"string",predicate:{meta:"a parsable date",predicate:UB}}).assertHasKind("intersection"),i1=DE.root.internal.narrow((t,e)=>{const n=Number.parseInt(t),r=ME.epoch(n);return r instanceof Lr?(e.errors.merge(r),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),KB=ze.module({root:i1,parse:Ye({in:i1,morphs:t=>new Date(t),declaredOut:me.Date})},{name:"string.date.epoch"}),r1=et(VB,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),qB=ze.module({root:r1,parse:Ye({in:r1,morphs:t=>new Date(t),declaredOut:me.Date})},{name:"string.date.iso"}),PB=ze.module({root:n1,parse:Ye({declaredIn:n1,in:"string",morphs:(t,e)=>{const n=new Date(t);return Number.isNaN(n.valueOf())?e.error("a parsable date"):n},declaredOut:me.Date}),iso:qB,epoch:KB},{name:"string.date"}),IB=et(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),s1="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Or=`(${s1}[.]){3}${s1}`,HB=new RegExp(`^${Or}$`),Tt="(?:[0-9a-fA-F]{1,4})",FB=new RegExp(`^((?:${Tt}:){7}(?:${Tt}|:)|(?:${Tt}:){6}(?:${Or}|:${Tt}|:)|(?:${Tt}:){5}(?::${Or}|(:${Tt}){1,2}|:)|(?:${Tt}:){4}(?:(:${Tt}){0,1}:${Or}|(:${Tt}){1,3}|:)|(?:${Tt}:){3}(?:(:${Tt}){0,2}:${Or}|(:${Tt}){1,4}|:)|(?:${Tt}:){2}(?:(:${Tt}){0,3}:${Or}|(:${Tt}){1,5}|:)|(?:${Tt}:){1}(?:(:${Tt}){0,4}:${Or}|(:${Tt}){1,6}|:)|(?::((?::${Tt}){0,5}:${Or}|(?::${Tt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),GB=ze.module({root:["v4 | v6","@","an IP address"],v4:et(HB,"an IPv4 address","ipv4"),v6:et(FB,"an IPv6 address","ipv6")},{name:"string.ip"}),Do="a JSON string",NE=t=>{if(!(t instanceof SyntaxError))throw t;return`must be ${Do} (${t})`},YB=Ye({meta:Do,domain:"string",predicate:{meta:Do,predicate:(t,e)=>{try{return JSON.parse(t),!0}catch(n){return e.reject({code:"predicate",expected:Do,problem:NE(n)})}}}}),JB=(t,e)=>{if(t.length===0)return e.error({code:"predicate",expected:Do,actual:"empty"});try{return JSON.parse(t)}catch(n){return e.error({code:"predicate",expected:Do,problem:NE(n)})}},XB=ze.module({root:YB,parse:Ye({meta:"safe JSON string parser",in:"string",morphs:JB,declaredOut:me.jsonObject})},{name:"string.json"}),o1=et(/^[a-z]*$/,"only lowercase letters"),ZB=ze.module({root:Ye({in:"string",morphs:t=>t.toLowerCase(),declaredOut:o1}),preformatted:o1},{name:"string.lower"}),$E=["NFC","NFD","NFKC","NFKD"],jl=Ge($E,(t,e)=>[e,Ye({domain:"string",predicate:n=>n.normalize(e)===n,meta:`${e}-normalized unicode`})]),Cf=Ge($E,(t,e)=>[e,Ye({in:"string",morphs:n=>n.normalize(e),declaredOut:jl[e]})]),QB=ze.module({root:Cf.NFC,preformatted:jl.NFC},{name:"string.normalize.NFC"}),WB=ze.module({root:Cf.NFD,preformatted:jl.NFD},{name:"string.normalize.NFD"}),ez=ze.module({root:Cf.NFKC,preformatted:jl.NFKC},{name:"string.normalize.NFKC"}),tz=ze.module({root:Cf.NFKD,preformatted:jl.NFKD},{name:"string.normalize.NFKD"}),nz=ze.module({root:"NFC",NFC:QB,NFD:WB,NFKC:ez,NFKD:tz},{name:"string.normalize"}),a1=et(nm,"a well-formed numeric string"),iz=ze.module({root:a1,parse:Ye({in:a1,morphs:t=>Number.parseFloat(t),declaredOut:me.number})},{name:"string.numeric"}),l1="a regex pattern",rz=Ye({domain:"string",predicate:{meta:l1,predicate:(t,e)=>{try{return new RegExp(t),!0}catch(n){return e.reject({code:"predicate",expected:l1,problem:String(n)})}}},meta:{format:"regex"}}),sz=/^(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-]+)*))?$/,oz=et(sz,"a semantic version (see https://semver.org/)"),u1=et(/^\S.*\S$|^\S?$/,"trimmed"),az=ze.module({root:Ye({in:"string",morphs:t=>t.trim(),declaredOut:u1}),preformatted:u1},{name:"string.trim"}),c1=et(/^[A-Z]*$/,"only uppercase letters"),lz=ze.module({root:Ye({in:"string",morphs:t=>t.toUpperCase(),declaredOut:c1}),preformatted:c1},{name:"string.upper"}),uz=t=>URL.canParse(t),f1=Ye({domain:"string",predicate:{meta:"a URL string",predicate:uz},meta:{format:"uri"}}),cz=ze.module({root:f1,parse:Ye({declaredIn:f1,in:"string",morphs:(t,e)=>{try{return new URL(t)}catch{return e.error("a URL string")}},declaredOut:Ye(URL)})},{name:"string.url"}),fz=ze.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:et(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:et(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:et(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:et(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:et(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:et(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:et(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:et(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),dz=ze.module({root:me.string,alpha:et(/^[A-Za-z]*$/,"only letters"),alphanumeric:et(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:NB,base64:$B,capitalize:jB,creditCard:LB,date:PB,digits:et(/^\d*$/,"only digits 0-9"),email:IB,integer:DE,ip:GB,json:XB,lower:ZB,normalize:nz,numeric:iz,regex:rz,semver:oz,trim:az,upper:lz,url:cz,uuid:fz},{name:"string"}),hz=ze.module({bigint:me.bigint,boolean:me.boolean,false:me.false,never:me.never,null:me.null,number:me.number,object:me.object,string:me.string,symbol:me.symbol,true:me.true,unknown:me.unknown,undefined:me.undefined}),pz=ze.module({root:me.unknown,any:me.unknown},{name:"unknown"}),mz=ze.module({root:me.jsonObject,stringify:By("morph",{in:me.jsonObject,morphs:t=>JSON.stringify(t),declaredOut:me.string})},{name:"object.json"}),yz=ze.module({root:me.object,json:mz},{name:"object"});class gz extends Si{description='instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'}const bz=er(["K",me.key],"V")(t=>({domain:"object",index:{signature:t.K,value:t.V}}),gz);class vz extends Si{description='pick a set of properties from an object like `Pick(User, "name | age")`'}const Sz=er(["T",me.object],["K",me.key])(t=>t.T.pick(t.K),vz);class wz extends Si{description='omit a set of properties from an object like `Omit(User, "age")`'}const xz=er(["T",me.object],["K",me.key])(t=>t.T.omit(t.K),wz);class Tz extends Si{description="make all named properties of an object optional like `Partial(User)`"}const Az=er(["T",me.object])(t=>t.T.partial(),Tz);class Ez extends Si{description="make all named properties of an object required like `Required(User)`"}const Oz=er(["T",me.object])(t=>t.T.required(),Ez);class _z extends Si{description='exclude branches of a union like `Exclude("boolean", "true")`'}const Rz=er("T","U")(t=>t.T.exclude(t.U),_z);class Cz extends Si{description='extract branches of a union like `Extract("0 | false | 1", "number")`'}const kz=er("T","U")(t=>t.T.extract(t.U),Cz),Mz=ze.module({Exclude:Rz,Extract:kz,Omit:xz,Partial:Az,Pick:Sz,Record:bz,Required:Oz}),Fr=vB({...hz,...Mz,...kB,...xB,string:dz,number:ME,object:yz,unknown:pz},{prereducedAliases:!0,name:"ark"}),jt=Fr.export();Object.assign(yl.ambient,jt);yl.typeAttachments={string:jt.string.root,number:jt.number.root,bigint:jt.bigint,boolean:jt.boolean,symbol:jt.symbol,undefined:jt.undefined,null:jt.null,object:jt.object.root,unknown:jt.unknown.root,false:jt.false,true:jt.true,never:jt.never,arrayIndex:jt.Array.index,Key:jt.Key,Record:jt.Record,Array:jt.Array.root,Date:jt.Date};const Ot=Object.assign(Fr.type,yl.typeAttachments);Fr.match;Fr.fn;Fr.generic;Fr.schema;Fr.define;Fr.declare;const jE={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 Dz(t){return Number.parseInt(t,10)}const Nz=Ot(jE),$z=Nz.keyof().pipe(t=>Dz(t));Ot([$z,"string"]);function jz(t){return F.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...t,children:[F.jsx("title",{children:"Tempest Games Logo"}),F.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),F.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}}),F.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}}),F.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}}),F.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}}),F.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}}),F.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),F.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}}),F.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}}),F.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}}),F.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}}),F.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}}),F.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 BE(t){return F.jsx("a",{...t})}const Bz={class:"_class_1riwg_1"},gp=["⠋","⠙","⠸","⠴","⠦","⠇"];function zz({input:t}){const e=$.useRef(null),[n,r]=$.useState(typeof t=="string"?t:null);return $.useEffect(()=>{let a=!0,u;if(typeof t=="string")r(t);else{let c=0;u=setInterval(()=>{e.current&&(e.current.textContent=gp[c],c=(c+1)%gp.length)},100),t.then(f=>{a&&(clearInterval(u),r(f))})}return()=>{a=!1,u&&clearInterval(u)}},[t]),F.jsx("span",{ref:e,children:n??gp[0]})}var Lz=Object.create,zE=Object.defineProperty,Vz=Object.getOwnPropertyDescriptor,LE=Object.getOwnPropertyNames,Uz=Object.getPrototypeOf,Kz=Object.prototype.hasOwnProperty,wi=(t,e)=>function(){return e||(0,t[LE(t)[0]])((e={exports:{}}).exports,e),e.exports},qz=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=LE(e),u=0,c=a.length,f;u<c;u++)f=a[u],!Kz.call(t,f)&&f!==n&&zE(t,f,{get:(h=>e[h]).bind(null,f),enumerable:!(r=Vz(e,f))||r.enumerable});return t},bt=(t,e,n)=>(n=t!=null?Lz(Uz(t)):{},qz(zE(n,"default",{value:t,enumerable:!0}),t)),VE=wi({"../../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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Pz=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=VE().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var f=c.call(a,u||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),Iz=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=VE().default,r=Pz();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),ks=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=Iz();function r(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),ni=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ks();function r(u,c){var f=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(m){return Object.getOwnPropertyDescriptor(u,m).enumerable})),f.push.apply(f,h)}return f}function a(u){for(var c=1;c<arguments.length;c++){var f=arguments[c]!=null?arguments[c]:{};c%2?r(Object(f),!0).forEach(function(h){n(u,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(f)):r(Object(f)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(f,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});function kf(t){const e={subscribe(n){let r=null,a=!1,u=!1,c=!1;function f(){if(r===null){c=!0;return}u||(u=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=t({next(h){var m;a||(m=n.next)===null||m===void 0||m.call(n,h)},error(h){var m;a||(a=!0,(m=n.error)===null||m===void 0||m.call(n,h),f())},complete(){var h;a||(a=!0,(h=n.complete)===null||h===void 0||h.call(n),f())}}),c&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(Hz,e)}};return e}function Hz(t,e){return e(t)}function Fz(t){const e=new AbortController;return new Promise((r,a)=>{let u=!1;function c(){u||(u=!0,f.unsubscribe())}e.signal.addEventListener("abort",()=>{a(e.signal.reason)});const f=t.subscribe({next(h){u=!0,r(h),c()},error(h){a(h)},complete(){e.abort(),c()}})})}function Gz(t){return e=>{let n=0,r=null;const a=[];function u(){r||(r=e.subscribe({next(f){for(const m of a){var h;(h=m.next)===null||h===void 0||h.call(m,f)}},error(f){for(const m of a){var h;(h=m.error)===null||h===void 0||h.call(m,f)}},complete(){for(const h of a){var f;(f=h.complete)===null||f===void 0||f.call(h)}}}))}function c(){if(n===0&&r){const f=r;r=null,f.unsubscribe()}}return kf(f=>(n++,a.push(f),u(),{unsubscribe(){n--,c();const h=a.findIndex(m=>m===f);h>-1&&a.splice(h,1)}}))}}function Yz(t){let e=t;const n=[],r=c=>{e!==void 0&&c.next(e),n.push(c)},a=c=>{n.splice(n.indexOf(c),1)},u=kf(c=>(r(c),()=>{a(c)}));return u.next=c=>{if(e!==c){e=c;for(const f of n)f.next(c)}},u.get=()=>e,u}function Jz(t){return kf(e=>{function n(a=0,u=t.op){const c=t.links[a];if(!c)throw new Error("No more links to execute - did you forget to add an ending link?");return c({op:u,next(h){return n(a+1,h)}})}return n().subscribe(e)})}function gl(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}var Xz=Object.create,UE=Object.defineProperty,Zz=Object.getOwnPropertyDescriptor,KE=Object.getOwnPropertyNames,Qz=Object.getPrototypeOf,Wz=Object.prototype.hasOwnProperty,Bl=(t,e)=>function(){return e||(0,t[KE(t)[0]])((e={exports:{}}).exports,e),e.exports},eL=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=KE(e),u=0,c=a.length,f;u<c;u++)f=a[u],!Wz.call(t,f)&&f!==n&&UE(t,f,{get:(h=>e[h]).bind(null,f),enumerable:!(r=Zz(e,f))||r.enumerable});return t},Mf=(t,e,n)=>(n=t!=null?Xz(Qz(t)):{},eL(UE(n,"default",{value:t,enumerable:!0}),t));const qE=()=>{},d1=t=>{Object.freeze&&Object.freeze(t)};function PE(t,e,n){var r;const a=e.join(".");return(r=n[a])!==null&&r!==void 0||(n[a]=new Proxy(qE,{get(u,c){if(!(typeof c!="string"||c==="then"))return PE(t,[...e,c],n)},apply(u,c,f){const h=e[e.length-1];let m={args:f,path:e};return h==="call"?m={args:f.length>=2?[f[1]]:[],path:e.slice(0,-1)}:h==="apply"&&(m={args:f.length>=2?f[1]:[],path:e.slice(0,-1)}),d1(m.args),d1(m.path),t(m)}})),n[a]}const tL=t=>PE(t,[],Object.create(null)),nL=t=>new Proxy(qE,{get(e,n){if(n!=="then")return t(n)}});var IE=Bl({"../../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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),iL=Bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=IE().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var f=c.call(a,u||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),rL=Bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=IE().default,r=iL();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),HE=Bl({"../../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(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),Vy=Bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=HE();function r(u,c){var f=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(m){return Object.getOwnPropertyDescriptor(u,m).enumerable})),f.push.apply(f,h)}return f}function a(u){for(var c=1;c<arguments.length;c++){var f=arguments[c]!=null?arguments[c]:{};c%2?r(Object(f),!0).forEach(function(h){n(u,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(f)):r(Object(f)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(f,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});Mf(Vy());Mf(HE());var dc=Mf(Vy());function sL(t,e){if("error"in t){const r=e.deserialize(t.error);return{ok:!1,error:(0,dc.default)((0,dc.default)({},t),{},{error:r})}}return{ok:!0,result:(0,dc.default)((0,dc.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var bp=class extends Error{constructor(){super("Unable to transform response from server")}};function oL(t,e){let n;try{n=sL(t,e)}catch{throw new bp}if(!n.ok&&(!gl(n.error.error)||typeof n.error.error.code!="number"))throw new bp;if(n.ok&&!gl(n.result))throw new bp;return n}Mf(Vy());var hc=bt(ks()),vo=bt(ni());function aL(t){return t instanceof bl}function lL(t){return gl(t)&&gl(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function uL(t,e){return typeof t=="string"?t:gl(t)&&typeof t.message=="string"?t.message:e}var bl=class Ec extends Error{constructor(e,n){var r,a;const u=n?.cause;super(e,{cause:u}),(0,hc.default)(this,"cause",void 0),(0,hc.default)(this,"shape",void 0),(0,hc.default)(this,"data",void 0),(0,hc.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=u,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(a=n.result)===null||a===void 0?void 0:a.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ec.prototype)}static from(e,n={}){const r=e;return aL(r)?(n.meta&&(r.meta=(0,vo.default)((0,vo.default)({},r.meta),n.meta)),r):lL(r)?new Ec(r.error.message,(0,vo.default)((0,vo.default)({},n),{},{result:r})):new Ec(uL(r,"Unknown error"),(0,vo.default)((0,vo.default)({},n),{},{cause:r}))}};function cL(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 h1=t=>typeof t=="function";function fL(t){if(t)return t;if(typeof window<"u"&&h1(window.fetch))return window.fetch;if(typeof globalThis<"u"&&h1(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var il=bt(ni());function dL(t){return{url:t.url.toString(),fetch:t.fetch,transformer:cL(t.transformer),methodOverride:t.methodOverride}}function hL(t){const e={};for(let n=0;n<t.length;n++){const r=t[n];e[n]=r}return e}const pL={query:"GET",mutation:"POST",subscription:"PATCH"};function FE(t){return"input"in t?t.transformer.input.serialize(t.input):hL(t.inputs.map(e=>t.transformer.input.serialize(e)))}const GE=t=>{const e=t.url.split("?");let r=e[0].replace(/\/$/,"")+"/"+t.path;const a=[];if(e[1]&&a.push(e[1]),"inputs"in t&&a.push("batch=1"),t.type==="query"||t.type==="subscription"){const u=FE(t);u!==void 0&&t.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(u))}`)}return a.length&&(r+="?"+a.join("&")),r},mL=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=FE(t);return e!==void 0?JSON.stringify(e):void 0},yL=t=>SL((0,il.default)((0,il.default)({},t),{},{contentTypeHeader:"application/json",getUrl:GE,getBody:mL}));var gL=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const bL=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 gL};async function vL(t){var e;bL(t.signal);const n=t.getUrl(t),r=t.getBody(t),a=(e=t.methodOverride)!==null&&e!==void 0?e:pL[t.type],u=await(async()=>{const f=await t.headers();return Symbol.iterator in f?Object.fromEntries(f):f})(),c=(0,il.default)((0,il.default)((0,il.default)({},t.contentTypeHeader&&a!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{"trpc-accept":t.trpcAcceptHeader}:void 0),u);return fL(t.fetch)(n,{method:a,signal:t.signal,body:r,headers:c})}async function SL(t){const e={},n=await vL(t);e.response=n;const r=await n.json();return e.responseJSON=r,{json:r,meta:e}}bt(ni());const p1=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function m1(t){let e=null,n=null;const r=()=>{clearTimeout(n),n=null,e=null};function a(f){const h=[[]];let m=0;for(;;){const v=f[m];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")),m++;continue}if(t.validate(S.concat(v).map(T=>T.key))){S.push(v),m++;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")),m++;continue}h.push([])}return h}function u(){const f=a(e);r();for(const h of f){if(!h.length)continue;const m={items:h};for(const g of h)g.batch=m;t.fetch(m.items.map(g=>g.key)).then(async g=>{await Promise.all(g.map(async(S,x)=>{const T=m.items[x];try{var M;const _=await Promise.resolve(S);(M=T.resolve)===null||M===void 0||M.call(T,_)}catch(_){var C;(C=T.reject)===null||C===void 0||C.call(T,_)}T.batch=null,T.reject=null,T.resolve=null}));for(const S of m.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 m.items){var v;(v=S.reject)===null||v===void 0||v.call(S,g),S.batch=null}})}}function c(f){var h;const m={aborted:!1,key:f,batch:null,resolve:p1,reject:p1},y=new Promise((g,v)=>{var S;m.reject=v,m.resolve=g,(S=e)!==null&&S!==void 0||(e=[]),e.push(m)});return(h=n)!==null&&h!==void 0||(n=setTimeout(u)),y}return{load:c}}function wL(...t){const e=new AbortController,n=t.length;let r=0;const a=()=>{++r===n&&e.abort()};for(const u of t)u?.aborted?a():u?.addEventListener("abort",a,{once:!0});return e.signal}var pc=bt(ni());function xL(t){var e,n;const r=dL(t),a=(e=t.maxURLLength)!==null&&e!==void 0?e:1/0,u=(n=t.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const c=y=>({validate(g){if(a===1/0&&u===1/0)return!0;if(g.length>u)return!1;const v=g.map(T=>T.path).join(","),S=g.map(T=>T.input);return GE((0,pc.default)((0,pc.default)({},r),{},{type:y,path:v,inputs:S,signal:null})).length<=a},async fetch(g){const v=g.map(_=>_.path).join(","),S=g.map(_=>_.input),x=wL(...g.map(_=>_.signal)),T=await yL((0,pc.default)((0,pc.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(_=>({meta:T.meta,json:_}))}}),f=m1(c("query")),h=m1(c("mutation")),m={query:f,mutation:h};return({op:y})=>kf(g=>{if(y.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const S=m[y.type].load(y);let x;return S.then(T=>{x=T;const M=oL(T.json,r.transformer.output);if(!M.ok){g.error(bl.from(M.error,{meta:T.meta}));return}g.next({context:T.meta,result:M.result}),g.complete()}).catch(T=>{g.error(bl.from(T,{meta:x?.meta}))}),()=>{}})}}bt(ni());const YE=(t,...e)=>typeof t=="function"?t(...e):t;bt(ks());function TL(){let t,e;return{promise:new Promise((r,a)=>{t=r,e=a}),resolve:t,reject:e}}async function AL(t){const e=await YE(t.url);if(!t.connectionParams)return e;const r=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+r}async function EL(t){const e={method:"connectionParams",data:await YE(t)};return JSON.stringify(e)}bt(ks());var ps=bt(ks());function OL(t){const{promise:e,resolve:n,reject:r}=TL();return t.addEventListener("open",()=>{t.removeEventListener("error",r),n()}),t.addEventListener("error",r),e}function _L(t,{intervalMs:e,pongTimeoutMs:n}){let r,a;function u(){r=setTimeout(()=>{t.send("PING"),a=setTimeout(()=>{t.close()},n)},e)}function c(){clearTimeout(r),u()}function f(){clearTimeout(a),c()}t.addEventListener("open",u),t.addEventListener("message",({data:h})=>{clearTimeout(r),u(),h==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(r),clearTimeout(a)})}var RL=class vm{constructor(e){var n;if((0,ps.default)(this,"id",++vm.connectCount),(0,ps.default)(this,"WebSocketPonyfill",void 0),(0,ps.default)(this,"urlOptions",void 0),(0,ps.default)(this,"keepAliveOpts",void 0),(0,ps.default)(this,"wsObservable",Yz(null)),(0,ps.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=++vm.connectCount;const n=AL(e.urlOptions).then(r=>new e.WebSocketPonyfill(r));e.openPromise=n.then(async r=>{e.ws=r,r.addEventListener("message",function({data:a}){a==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&_L(r,e.keepAliveOpts),r.addEventListener("close",()=>{e.ws===r&&(e.ws=null)}),await OL(r),e.urlOptions.connectionParams&&r.send(await EL(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,ps.default)(RL,"connectCount",0);bt(ks());bt(ni());var vp=bt(ks()),y1=bt(ni()),CL=class{constructor(t){(0,vp.default)(this,"links",void 0),(0,vp.default)(this,"runtime",void 0),(0,vp.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return Jz({links:this.links,op:(0,y1.default)((0,y1.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(Gz())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await Fz(n)).result.data}catch(n){throw bl.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(a){switch(a.result.type){case"state":{var u;(u=n.onConnectionStateChange)===null||u===void 0||u.call(n,a.result);break}case"started":{var c;(c=n.onStarted)===null||c===void 0||c.call(n,{context:a.context});break}case"stopped":{var f;(f=n.onStopped)===null||f===void 0||f.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,a.result.data);break}}},error(a){var u;(u=n.onError)===null||u===void 0||u.call(n,a)},complete(){var a;(a=n.onComplete)===null||a===void 0||a.call(n)}})}};const kL=Symbol.for("trpc_untypedClient"),ML={query:"query",mutate:"mutation",subscribe:"subscription"},DL=t=>ML[t];function NL(t){const e=tL(({path:n,args:r})=>{const a=[...n],u=DL(a.pop()),c=a.join(".");return t[u](c,...r)});return nL(n=>n===kL?t:e[n])}function $L(t){const e=new CL(t);return NL(e)}bt(ni());bt(ni());var jL=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(a){var u,c,f,h=2;for(typeof Symbol<"u"&&(c=Symbol.asyncIterator,f=Symbol.iterator);h--;){if(c&&(u=a[c])!=null)return u.call(a);if(f&&(u=a[f])!=null)return new r(u.call(a));c="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function r(a){function u(c){if(Object(c)!==c)return Promise.reject(new TypeError(c+" is not an object."));var f=c.done;return Promise.resolve(c.value).then(function(h){return{value:h,done:f}})}return r=function(f){this.s=f,this.n=f.next},r.prototype={s:null,n:null,next:function(){return u(this.n.apply(this.s,arguments))},return:function(f){var h=this.s.return;return h===void 0?Promise.resolve({value:f,done:!0}):u(h.apply(this.s,arguments))},throw:function(f){var h=this.s.return;return h===void 0?Promise.reject(f):u(h.apply(this.s,arguments))}},new r(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});bt(jL());bt(ni());var BL=wi({"../../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(f,h){var m=Error();return m.name="SuppressedError",m.error=f,m.suppressed=h,m},a={},u=[];function c(f,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var m=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(m===void 0&&(m=h[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var y=m;if(typeof m!="function")throw new TypeError("Object is not disposable.");y&&(m=function(){try{y.call(h)}catch(v){return Promise.reject(v)}}),u.push({v:h,d:m,a:f})}else f&&u.push({d:h,a:f});return h}return{e:a,u:c.bind(null,!1),a:c.bind(null,!0),d:function(){var h,m=this.e,y=0;function g(){for(;h=u.pop();)try{if(!h.a&&y===1)return y=0,u.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 m!==a?Promise.reject(m):Promise.resolve();if(m!==a)throw m}function v(S){return m=m!==a?new r(S,m):S,g()}return g()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),JE=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(r,a){this.v=r,this.k=a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),zL=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=JE();function r(a){return new n(a,0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),LL=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=JE();function r(u){return function(){return new a(u.apply(this,arguments))}}function a(u){var c,f;function h(y,g){try{var v=u[y](g),S=v.value,x=S instanceof n;Promise.resolve(x?S.v:S).then(function(T){if(x){var M=y==="return"?"return":"next";if(!S.k||T.done)return h(M,T);T=u[M](T).value}m(v.done?"return":"normal",T)},function(T){h("throw",T)})}catch(T){m("throw",T)}}function m(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):f=null}this._invoke=function(y,g){return new Promise(function(v,S){var x={key:y,arg:g,resolve:v,reject:S,next:null};f?f=f.next=x:(c=f=x,h(y,g))})},typeof u.return!="function"&&(this.return=void 0)}a.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(u){return this._invoke("next",u)},a.prototype.throw=function(u){return this._invoke("throw",u)},a.prototype.return=function(u){return this._invoke("return",u)},e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}});bt(BL());bt(zL());bt(LL());bt(ni());var VL={};function XE(t,e){if(t instanceof Promise)throw new Error(e)}function UL(t,e){const n={},r=[];for(const a in t){const u=t[a]["~standard"].validate(e[a]);if(XE(u,`Validation must be synchronous, but ${a} returned a Promise.`),u.issues){r.push(...u.issues.map(c=>({...c,message:c.message,path:[a,...c.path??[]]})));continue}n[a]=u.value}return r.length?{issues:r}:{value:n}}function KL(t){const e=t.runtimeEnvStrict??t.runtimeEnv??VL;if(t.emptyStringAsUndefined??!1)for(const[_,R]of Object.entries(e))R===""&&delete e[_];if(!!t.skipValidation)return e;const a=typeof t.client=="object"?t.client:{},u=typeof t.server=="object"?t.server:{},c=typeof t.shared=="object"?t.shared:{},f=t.isServer??(typeof window>"u"||"Deno"in window),h=f?{...u,...c,...a}:{...a,...c},m=t.createFinalSchema?.(h,f)["~standard"].validate(e)??UL(h,e);XE(m,"Validation must be synchronous");const y=t.onValidationError??(_=>{throw console.error("❌ Invalid environment variables:",_),new Error("Invalid environment variables")}),g=t.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(m.issues)return y(m.issues);const v=_=>t.clientPrefix?!_.startsWith(t.clientPrefix)&&!(_ in c):!0,S=_=>f||!v(_),x=_=>_==="__esModule"||_==="$$typeof",T=(t.extends??[]).reduce((_,R)=>Object.assign(_,R),{}),M=Object.assign(T,m.value);return new Proxy(M,{get(_,R){if(typeof R=="string"&&!x(R))return S(R)?Reflect.get(_,R):g(R)}})}const qL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},PL="__vite_start_time"in globalThis,IL=typeof window<"u",Ki=Ot("string"),g1=Ot('"true" | "false" | undefined'),ZE=KL({isServer:!PL&&!IL,server:{CI:Ot("string | undefined").pipe(Boolean),POSTGRES_USER:Ki,POSTGRES_PASSWORD:Ki,POSTGRES_DATABASE:Ki,POSTGRES_HOST:Ki,POSTGRES_PORT:Ki.pipe(t=>Number.parseInt(t,10)),BACKEND_PORT:Ki.pipe(t=>Number.parseInt(t,10)),RUN_WORKERS_FROM_SOURCE:g1.pipe(t=>t==="true"),FRONTEND_PORT:Ki.pipe(t=>Number.parseInt(t,10)),FRONTEND_ORIGINS:Ki.pipe.try(t=>JSON.parse(t),Ot("string[]")),API_KEY_OPENAI:Ot("string | undefined"),API_KEY_RESEND:Ot("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Ki,VITE_DEV_FRONTEND_HOST:Ot("string | undefined"),VITE_DEV_HTTPS:g1.pipe(t=>t==="true")},runtimeEnv:qL,emptyStringAsUndefined:!0}),cn=$L({links:[xL({url:ZE.VITE_BACKEND_ORIGIN,fetch(t,e){return e?(Object.assign(e,{credentials:"include"}),fetch(t,e)):fetch(t)}})]}),HL=ft({key:"appVersionQuery",default:cn.version.query});ft({key:"lastKnownVersion",default:null,effects:[mT(localStorage,JSON,"lastKnownVersion")]});const FL=Wi({key:"appVersion",get:async({get:t})=>{const e=t(HL),{version:n}=await e;return n}});function Sp(t){return["optional",t]}function GL(t,e){let n=[t];for(const r of e){if(typeof r!="string")return!1;n=n.flatMap(a=>{if(a===null)return[];const u=[],c=a[1],f=c[r];f!==void 0&&u.push(f);const h=Object.keys(c).find(m=>m.startsWith("$"));if(h){const m=c[h];m&&u.push(m)}return u})}for(const r of n)if(r===null||r[0]==="optional")return!0;return!1}const yi=Object.create(null);yi.open="0";yi.close="1";yi.ping="2";yi.pong="3";yi.message="4";yi.upgrade="5";yi.noop="6";const Oc=Object.create(null);Object.keys(yi).forEach(t=>{Oc[yi[t]]=t});const Sm={type:"error",data:"parser error"},QE=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",WE=typeof ArrayBuffer=="function",eO=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Uy=({type:t,data:e},n,r)=>QE&&e instanceof Blob?n?r(e):b1(e,r):WE&&(e instanceof ArrayBuffer||eO(e))?n?r(e):b1(new Blob([e]),r):r(yi[t]+(e||"")),b1=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function v1(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let wp;function YL(t,e){if(QE&&t.data instanceof Blob)return t.data.arrayBuffer().then(v1).then(e);if(WE&&(t.data instanceof ArrayBuffer||eO(t.data)))return e(v1(t.data));Uy(t,!1,n=>{wp||(wp=new TextEncoder),e(wp.encode(n))})}const S1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<S1.length;t++)Wa[S1.charCodeAt(t)]=t;const JL=t=>{let e=t.length*.75,n=t.length,r,a=0,u,c,f,h;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const m=new ArrayBuffer(e),y=new Uint8Array(m);for(r=0;r<n;r+=4)u=Wa[t.charCodeAt(r)],c=Wa[t.charCodeAt(r+1)],f=Wa[t.charCodeAt(r+2)],h=Wa[t.charCodeAt(r+3)],y[a++]=u<<2|c>>4,y[a++]=(c&15)<<4|f>>2,y[a++]=(f&3)<<6|h&63;return m},XL=typeof ArrayBuffer=="function",Ky=(t,e)=>{if(typeof t!="string")return{type:"message",data:tO(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:ZL(t.substring(1),e)}:Oc[n]?t.length>1?{type:Oc[n],data:t.substring(1)}:{type:Oc[n]}:Sm},ZL=(t,e)=>{if(XL){const n=JL(t);return tO(n,e)}else return{base64:!0,data:t}},tO=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},nO="",QL=(t,e)=>{const n=t.length,r=new Array(n);let a=0;t.forEach((u,c)=>{Uy(u,!1,f=>{r[c]=f,++a===n&&e(r.join(nO))})})},WL=(t,e)=>{const n=t.split(nO),r=[];for(let a=0;a<n.length;a++){const u=Ky(n[a],e);if(r.push(u),u.type==="error")break}return r};function eV(){return new TransformStream({transform(t,e){YL(t,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const u=new DataView(a.buffer);u.setUint8(0,126),u.setUint16(1,r)}else{a=new Uint8Array(9);const u=new DataView(a.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(a[0]|=128),e.enqueue(a),e.enqueue(n)})}})}let xp;function mc(t){return t.reduce((e,n)=>e+n.length,0)}function yc(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let a=0;a<e;a++)n[a]=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){xp||(xp=new TextDecoder);const n=[];let r=0,a=-1,u=!1;return new TransformStream({transform(c,f){for(n.push(c);;){if(r===0){if(mc(n)<1)break;const h=yc(n,1);u=(h[0]&128)===128,a=h[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(mc(n)<2)break;const h=yc(n,2);a=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),r=3}else if(r===2){if(mc(n)<8)break;const h=yc(n,8),m=new DataView(h.buffer,h.byteOffset,h.length),y=m.getUint32(0);if(y>Math.pow(2,21)-1){f.enqueue(Sm);break}a=y*Math.pow(2,32)+m.getUint32(4),r=3}else{if(mc(n)<a)break;const h=yc(n,a);f.enqueue(Ky(u?h:xp.decode(h),e)),r=0}if(a===0||a>t){f.enqueue(Sm);break}}}})}const iO=4;function _t(t){if(t)return nV(t)}function nV(t){for(var e in _t.prototype)t[e]=_t.prototype[e];return t}_t.prototype.on=_t.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};_t.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};_t.prototype.off=_t.prototype.removeListener=_t.prototype.removeAllListeners=_t.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,a=0;a<n.length;a++)if(r=n[a],r===e||r.fn===e){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+t],this};_t.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,a=n.length;r<a;++r)n[r].apply(this,e)}return this};_t.prototype.emitReserved=_t.prototype.emit;_t.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};_t.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Df=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Un=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iV="arraybuffer";function rO(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const rV=Un.setTimeout,sV=Un.clearTimeout;function Nf(t,e){e.useNativeTimers?(t.setTimeoutFn=rV.bind(Un),t.clearTimeoutFn=sV.bind(Un)):(t.setTimeoutFn=Un.setTimeout.bind(Un),t.clearTimeoutFn=Un.clearTimeout.bind(Un))}const oV=1.33;function aV(t){return typeof t=="string"?lV(t):Math.ceil((t.byteLength||t.size)*oV)}function lV(t){let e=0,n=0;for(let r=0,a=t.length;r<a;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 sO(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uV(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function cV(t){let e={},n=t.split("&");for(let r=0,a=n.length;r<a;r++){let u=n[r].split("=");e[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return e}class fV extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class qy extends _t{constructor(e){super(),this.writable=!1,Nf(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 fV(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=Ky(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=uV(e);return n.length?"?"+n:""}}class dV extends qy{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)};WL(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,QL(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]=sO()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let oO=!1;try{oO=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hV=oO;function pV(){}class mV extends dV{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",(a,u)=>{this.onError("xhr post error",a,u)})}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 No=class _c extends _t{constructor(e,n,r){super(),this.createRequest=e,Nf(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=rO(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 a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}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 a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.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(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=_c.requestsCount++,_c.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=pV,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete _c.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()}};No.requestsCount=0;No.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",w1);else if(typeof addEventListener=="function"){const t="onpagehide"in Un?"pagehide":"unload";addEventListener(t,w1,!1)}}function w1(){for(let t in No.requests)No.requests.hasOwnProperty(t)&&No.requests[t].abort()}const yV=(function(){const t=aO({xdomain:!1});return t&&t.responseType!==null})();class gV extends mV{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=yV&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new No(aO,this.uri(),e)}}function aO(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||hV))return new XMLHttpRequest}catch{}if(!e)try{return new Un[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const lO=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bV extends qy{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=lO?{}:rO(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(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=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],a=n===e.length-1;Uy(r,this.supportsBinary,u=>{try{this.doWrite(r,u)}catch{}a&&Df(()=>{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]=sO()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Tp=Un.WebSocket||Un.MozWebSocket;class vV extends bV{createSocket(e,n,r){return lO?new Tp(e,n,r):n?new Tp(e,n):new Tp(e)}doWrite(e,n){this.ws.send(n)}}class SV extends qy{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(),a=eV();a.readable.pipeTo(e.writable),this._writer=a.writable.getWriter();const u=()=>{r.read().then(({done:f,value:h})=>{f||(this.onPacket(h),u())}).catch(f=>{})};u();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],a=n===e.length-1;this._writer.write(r).then(()=>{a&&Df(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const wV={websocket:vV,webtransport:SV,polling:gV},xV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,TV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function wm(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 a=xV.exec(t||""),u={},c=14;for(;c--;)u[TV[c]]=a[c]||"";return n!=-1&&r!=-1&&(u.source=e,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=AV(u,u.path),u.queryKey=EV(u,u.query),u}function AV(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 EV(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,u){a&&(n[a]=u)}),n}const xm=typeof addEventListener=="function"&&typeof removeEventListener=="function",Rc=[];xm&&addEventListener("offline",()=>{Rc.forEach(t=>t())},!1);class jr extends _t{constructor(e,n){if(super(),this.binaryType=iV,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=wm(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=wm(n.host).host);Nf(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=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=cV(this.opts.query)),xm&&(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"})},Rc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=iO,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&&jr.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",jr.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 a=this.writeBuffer[r].data;if(a&&(n+=aV(a)),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,Df(()=>{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,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const u={type:e,data:n,options:r};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),a&&this.once("flush",a),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(jr.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(),xm&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Rc.indexOf(this._offlineEventListener);r!==-1&&Rc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}jr.protocol=iO;class OV extends jr{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;jr.priorWebsocketSuccess=!1;const a=()=>{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;jr.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 u(){r||(r=!0,y(),n.close(),n=null)}const c=g=>{const v=new Error("probe error: "+g);v.transport=n.name,u(),this.emitReserved("upgradeError",v)};function f(){c("transport closed")}function h(){c("socket closed")}function m(g){n&&g.name!==n.name&&u()}const y=()=>{n.removeListener("open",a),n.removeListener("error",c),n.removeListener("close",f),this.off("close",h),this.off("upgrading",m)};n.once("open",a),n.once("error",c),n.once("close",f),this.once("close",h),this.once("upgrading",m),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 _V=class extends OV{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(a=>wV[a]).filter(a=>!!a)),super(e,r)}};function RV(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=wm(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 u=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+u+":"+r.port+e,r.href=r.protocol+"://"+u+(n&&n.port===r.port?"":":"+r.port),r}const CV=typeof ArrayBuffer=="function",kV=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,uO=Object.prototype.toString,MV=typeof Blob=="function"||typeof Blob<"u"&&uO.call(Blob)==="[object BlobConstructor]",DV=typeof File=="function"||typeof File<"u"&&uO.call(File)==="[object FileConstructor]";function Py(t){return CV&&(t instanceof ArrayBuffer||kV(t))||MV&&t instanceof Blob||DV&&t instanceof File}function Cc(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(Cc(t[n]))return!0;return!1}if(Py(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Cc(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Cc(t[n]))return!0;return!1}function NV(t){const e=[],n=t.data,r=t;return r.data=Tm(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Tm(t,e){if(!t)return t;if(Py(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]=Tm(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]=Tm(t[r],e));return n}return t}function $V(t,e){return t.data=Am(t.data,e),delete t.attachments,t}function Am(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]=Am(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Am(t[n],e));return t}const jV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],BV=5;var ke;(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"})(ke||(ke={}));class zV{constructor(e){this.replacer=e}encode(e){return(e.type===ke.EVENT||e.type===ke.ACK)&&Cc(e)?this.encodeAsBinary({type:e.type===ke.EVENT?ke.BINARY_EVENT:ke.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ke.BINARY_EVENT||e.type===ke.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=NV(e),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}function x1(t){return Object.prototype.toString.call(t)==="[object Object]"}class Iy extends _t{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===ke.BINARY_EVENT;r||n.type===ke.BINARY_ACK?(n.type=r?ke.EVENT:ke.ACK,this.reconstructor=new LV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Py(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(ke[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ke.BINARY_EVENT||r.type===ke.BINARY_ACK){const u=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const c=e.substring(u,n);if(c!=Number(c)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(c)}if(e.charAt(n+1)==="/"){const u=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(u,n)}else r.nsp="/";const a=e.charAt(n+1);if(a!==""&&Number(a)==a){const u=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(u,n+1))}if(e.charAt(++n)){const u=this.tryParse(e.substr(n));if(Iy.isPayloadValid(r.type,u))r.data=u;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 ke.CONNECT:return x1(n);case ke.DISCONNECT:return n===void 0;case ke.CONNECT_ERROR:return typeof n=="string"||x1(n);case ke.EVENT:case ke.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&jV.indexOf(n[0])===-1);case ke.ACK:case ke.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class LV{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=$V(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const VV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Iy,Encoder:zV,get PacketType(){return ke},protocol:BV},Symbol.toStringTag,{value:"Module"}));function Qn(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const UV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class cO extends _t{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=[Qn(e,"open",this.onopen.bind(this)),Qn(e,"packet",this.onpacket.bind(this)),Qn(e,"error",this.onerror.bind(this)),Qn(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,a,u;if(UV.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:ke.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 f=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,h=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!f||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(e,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[e]=n;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===e&&this.sendBuffer.splice(f,1);n.call(this,new Error("operation has timed out"))},a),c=(...f)=>{this.io.clearTimeoutFn(u),n.apply(this,f)};c.withError=!0,this.acks[e]=c}emitWithAck(e,...n){return new Promise((r,a)=>{const u=(c,f)=>c?a(c):r(f);u.withError=!0,n.push(u),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((a,...u)=>r!==this._queue[0]?void 0:(a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...u)),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:ke.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 ke.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 ke.EVENT:case ke.BINARY_EVENT:this.onevent(e);break;case ke.ACK:case ke.BINARY_ACK:this.onack(e);break;case ke.DISCONNECT:this.ondisconnect();break;case ke.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(...a){r||(r=!0,n.packet({type:ke.ACK,id:e,data:a}))}}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:ke.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 Xo(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}Xo.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};Xo.prototype.reset=function(){this.attempts=0};Xo.prototype.setMin=function(t){this.ms=t};Xo.prototype.setMax=function(t){this.max=t};Xo.prototype.setJitter=function(t){this.jitter=t};class Em extends _t{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,Nf(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Xo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const a=n.parser||VV;this.encoder=new a.Encoder,this.decoder=new a.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 _V(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=Qn(n,"open",function(){r.onopen(),e&&e()}),u=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),e?e(f):this.maybeReconnectOnOpen()},c=Qn(n,"error",u);if(this._timeout!==!1){const f=this._timeout,h=this.setTimeoutFn(()=>{a(),u(new Error("timeout")),n.close()},f);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(a),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(Qn(e,"ping",this.onping.bind(this)),Qn(e,"data",this.ondata.bind(this)),Qn(e,"error",this.onerror.bind(this)),Qn(e,"close",this.onclose.bind(this)),Qn(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){Df(()=>{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 cO(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(a=>{a?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",a)):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 Ya={};function kc(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=RV(t,e.path||"/socket.io"),r=n.source,a=n.id,u=n.path,c=Ya[a]&&u in Ya[a].nsps,f=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let h;return f?h=new Em(r,e):(Ya[a]||(Ya[a]=new Em(r,e)),h=Ya[a]),n.query&&!e.query&&(e.query=n.queryKey),h.socket(n.path,e)}Object.assign(kc,{Manager:Em,Socket:cO,io:kc,connect:kc});const KV=["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"],qV=3,PV=15,IV=/^[a-zA-Z0-9_-]+$/,HV=Ot(IV).pipe(Ot(`string > ${qV} & string < ${PV}`)).brand("username"),T1=20,A1={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function FV(t){let e="";for(const n of t)n in A1?e+=A1[n]:e+=n;return e}function GV(t){const e=t.toLocaleLowerCase(),n=FV(e);for(const r of KV)if(n.includes(r)||e.includes(r))return!0;return!1}function YV(t){const e=new Set(t).size;return t.length*Math.log2(e)}function JV(t){let e=0;return GV(t)&&(e-=100),e+=YV(t)*.5,Math.max(e,0)}const XV=Ot("string").narrow((t,e)=>{const n=JV(t);return n>=T1?!0:e.mustBe(`Of complexity ${T1} or more. Was ${n.toFixed(2)}.`)}).brand("password");Ot({"+":"delete",email:"string",password:"string"});const ZV=Ot("string").brand("email");Ot({"+":"delete",username:"string",password:"string",email:"string"});const QV=Ot({email:"string",userId:"string",username:"string",password:"boolean",verification:"'unverified' | 'verified'"}),gi=kc(ZE.VITE_BACKEND_ORIGIN,{auth:t=>{const e=nt(ut);e&&t(e)},withCredentials:!0,autoConnect:!1});gi.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),De(ut,null)}).on("usernameChanged",t=>{De(ut,e=>e===null?null:{...e,username:t})});const ut=ft({key:"auth",default:function(){const e=localStorage.getItem("auth");if(e)try{const n=qr(e),r=QV(n);return r instanceof Ot.errors?(console.error("failed to parse auth data",r),null):(r.verification==="verified"&&(console.log("connecting..."),gi.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($o,n.username),localStorage.setItem("auth",zt(n)),n.verification==="verified"?(console.log("connecting..."),gi.connect()):Os("/verify")):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]}),$o=ft({key:"username",default:nt(ut)?.username??""}),Ap=ft({key:"usernameDebounce",default:!0}),WV=ft({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:t})=>{Rk($o,()=>{nt(Ap)&&(t(nt($o)),De(Ap,!1),setTimeout(()=>{De(Ap,!0),t(nt($o))},2e3))})}]}),e4=Wi({key:"isUsernameTakenQuery",get:({get:t})=>{const e=t(WV);if(!e)return!1;const n=nt(ut);return e===n?.username?!1:cn.isUsernameTaken.query({username:e})}}),fO=Wi({key:"usernameIssues",get:({get:t})=>{const e=t($o),n=HV(e);return n instanceof Ot.errors?n:null}}),di=ft({key:"password0",default:""}),dO=Wi({key:"password0Issues",get:({get:t})=>{const e=t(di),n=XV(e);return n instanceof Ot.errors?n:null}}),Po=ft({key:"email",default:""}),hO=Wi({key:"emailIssues",get:({get:t})=>{const e=t(Po),n=ZV(e);return n instanceof Ot.errors?n:null}});Wi({key:"signupReady",get:({get:t})=>{const e=t(fO),n=t(dO),r=t(hO);return!(e??n??r)}});const Hi=ft({key:"oneTimeCode",default:""}),Om=ft({key:"oneTimeCodeNewEmail",default:""}),ui=ft({key:"authTarget",default:null}),pO=Sp({verify:Sp({$token:null}),game:Sp({clicker:null}),account:null,admin:null});function t4(t){return GL(pO,t)}const n4=[[]];function i4(t){return n4.some(e=>e.join("/")===t.join("/"))}function Os(t){history.pushState(null,"",t),De(mO,t)}const mO=ft({key:"pathName",default:window.location.pathname,effects:[({onSet:t,setSelf:e})=>{const n=a=>{history.replaceState(null,"",a),e(a)},r=a=>{switch(a){case"/":{const u=nt(ut);switch(console.log("/","auth",u),u?.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{nt(ut)?.verification==="verified"&&n("/game");break}case"/game":case"/game/clicker":{nt(ut)?.verification==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const u=nt(ut);if(!u){n("/");break}u.verification==="unverified"&&n("/verify");break}}};r(window.location.pathname),t(({newValue:a})=>{r(a)})},({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=Wi({key:"route",get:({get:t})=>{const n=t(mO).split("/").slice(1).filter(Boolean);return t4(n)?i4(n)||t(ut)?n:401:404}}),E1=ft({key:"buttonBlockActive",default:!1}),zn=ft({key:"editing",default:[],effects:[({onSet:t})=>{t(({newValue:e})=>{switch(e[0]){case"email":{nt(yO)?.focus();break}case"new-password":{nt(gO)?.focus();break}case"username":{nt(bO)?.focus();break}}})}]}),yO=ft({key:"emailInputElement",default:null}),gO=ft({key:"password0InputElement",default:null}),bO=ft({key:"usernameInputElement",default:null});function s4(t){const e=$.useRef(null);return $.useEffect(()=>{De(t,e.current)},[t]),e}const o4=Wi({key:"otcLoginFieldLabel",get:({get:t})=>{const e=t(ut);return e?`Code sent to ${e.email}`:""}}),a4=Wi({key:"otcVerifyFieldLabel",get:({get:t})=>{const e=t(Po);return e?`Code sent to ${e}`:""}});function Ep({label:t,inputToken:e,issuesToken:n,inputElementToken:r,initialState:a,onSubmit:u,onOpen:c,onCancel:f,extraIssues:h}){const m=Et(e),y=Wn(e),g=Et(Hi),v=Wn(Hi),S=Et(Om),x=Wn(Om),T=Et(di),M=Wn(di),C=Et(E1),_=Wn(E1),R=Et(zn),G=Wn(zn),I=Et(n),ee=Et(o4),J=Et(a4),X=s4(r),he=R[0]===t,pe=R.at(-1),[we,...je]=R;return F.jsxs("form",{onSubmit:async ve=>{if(ve.preventDefault(),C){_(!1);return}console.log(`submitted! changing ${t} to`,m);const Z=await u(m);Error.isError(Z)&&console.error(Z)},children:[he?F.jsx("button",{type:"button",onClick:async()=>{await f?.(),G([])},children:"x"}):null,F.jsxs("main",{children:[F.jsxs("label",{htmlFor:t,children:[I||h?F.jsxs("aside",{children:[h,I?.map(ve=>F.jsx("span",{children:ve.message},ve.path.join(".")))]}):null,F.jsx("span",{children:t==="new-password"?"Password":hs(t)}),F.jsx("input",{id:t,type:t==="new-password"?"password":"text",ref:X,value:m,onChange:ve=>{y(ve.target.value)},autoComplete:t,autoCapitalize:"none",disabled:pe!==t})]}),he?je.map(ve=>F.jsxs("label",{htmlFor:`${t}-${ve}`,children:[F.jsx("span",{children:(()=>{switch(ve){case"otcLogin":return ee;case"otcVerify":return J;case"passwordLogin":return"Password"}})()}),F.jsx("input",{id:`${t}-otc`,type:"text",ref:X,value:(()=>{switch(ve){case"otcLogin":return g;case"otcVerify":return t==="email"?S:g;case"passwordLogin":return T}})(),onChange:Z=>{switch(ve){case"otcLogin":v(Z.target.value);break;case"otcVerify":if(t==="email"){x(Z.target.value);break}v(Z.target.value);break;case"passwordLogin":M(Z.target.value)}},autoComplete:t.includes("otc")?"one-time-code":t.includes("password")?"password":"",autoCapitalize:"none",disabled:ve!==pe})]},`${t}-${ve}`)):null]}),R[0]===t?F.jsx("button",{type:"submit",children:"->"}):F.jsx("button",{type:"button",onMouseDown:async()=>{_(!0),await c?.(),G(a)},onMouseUp:()=>{_(!1)},children:"/"})]})}function l4(){const t=Et(ut),e=Et(e4);return $.useEffect(()=>{t&&De(Po,t.email),t?.password&&De(di,"••••••••••••")},[]),t?F.jsxs("article",{"data-css":"editor",children:[F.jsx(Ep,{label:"username",inputToken:$o,issuesToken:fO,inputElementToken:bO,initialState:["username"],onSubmit:async n=>(await new Promise(r=>{gi.once("usernameChanged",r),gi.emit("changeUsername",n)}),De(zn,[]),n),extraIssues:e?F.jsx("span",{children:"This username is taken."}):null}),F.jsx(Ep,{label:"email",inputToken:Po,issuesToken:hO,inputElementToken:yO,initialState:["email"],onSubmit:async n=>{const r=nt(zn);if(r[0]!=="email")return new Error("field not email");switch(r.length){case 1:{const{userKey:a,nextStep:u}=await cn.offerNewEmail.mutate({emailOffered:n});switch(console.log({authTarget:a,nextStep:u}),u){case"otc_login":{De(ui,a),De(zn,["email","otcLogin"]);break}case"password_login":{De(ui,a),De(zn,["email","passwordLogin"]);break}case"otc_verify":{De(ui,a),De(Hi,"not needed"),De(zn,["email","otcLogin","otcVerify"]);break}}return a}case 2:switch(console.log("case 2"),r[1]){case"otcLogin":{console.log("case 2.1");const a=nt(ui);if(!a)return new Error("No auth target");const u=nt(Hi),c=await cn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return De(ut,c),De(zn,["email","otcLogin","otcVerify"]),a}case"passwordLogin":return new Error("not implemented")}break;case 3:{const a=nt(ui);if(!a)return new Error("No auth target");const u=nt(Om),c=await cn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return De(ut,c),De(zn,[]),c.email}}}}),F.jsx(Ep,{label:"new-password",inputToken:di,issuesToken:dO,inputElementToken:gO,initialState:t.password?["new-password","otcVerify"]:["new-password"],onSubmit:async n=>{const r=nt(zn);if(r[0]!=="new-password")return new Error("field not new-password");switch(r.length){case 1:return await cn.setPassword.mutate({password:n}),De(di,"••••••••••••"),De(ut,a=>a&&{...a,password:!0}),De(zn,[]),"done";case 2:{const a=nt(ui);return a?(await cn.verifyAccountAction.mutate({oneTimeCode:nt(Hi),userKey:a}),De(ut,u=>u&&{...u,password:!1}),De(di,""),De(zn,["new-password"]),"done"):new Error("No userKey")}}},onCancel:()=>{t.password&&De(di,"••••••••••••")},onOpen:async()=>{if(t.password){const n=nt(ui);if(!n)return new Error("No userKey");await cn.startPasswordReset.mutate({userKey:n})}}})]}):F.jsx("p",{children:"You must be logged in to verify your account."})}function u4(){return F.jsx("article",{children:F.jsx("h1",{children:"admin"})})}const Hy=ft({key:"count",default:0}),vO=Ck({key:"incrementTX",do:({set:t})=>{t(Hy,e=>e+1)}}),c4=SM({key:"countContinuity",config:t=>t.add(Hy).add(vO)});function f4({route:[,t]}){return F.jsx("article",{children:t?F.jsx(h4,{gameId:t}):F.jsx(d4,{})})}function d4(){return F.jsx("nav",{children:F.jsx(BE,{href:"/game/clicker",children:"Clicker"})})}Mk(pO[1].game[1]);function h4({gameId:t}){console.log(t);const e=Et(Hy),n=kk(vO);return DM(c4),F.jsxs("article",{children:[F.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",e]}),F.jsx("p",{children:"Let's see how high we can count!"})]})}const SO=$.createContext({});function p4(t){const e=$.useRef(null);return e.current===null&&(e.current=t()),e.current}const Fy=typeof window<"u",m4=Fy?$.useLayoutEffect:$.useEffect,Gy=$.createContext(null);function Yy(t,e){t.indexOf(e)===-1&&t.push(e)}function Jy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Zi=(t,e,n)=>n>e?e:n<t?t:n;let Xy=()=>{};const Qi={},wO=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function xO(t){return typeof t=="object"&&t!==null}const TO=t=>/^0[^.\s]+$/u.test(t);function Zy(t){let e;return()=>(e===void 0&&(e=t()),e)}const Pn=t=>t,y4=(t,e)=>n=>e(t(n)),zl=(...t)=>t.reduce(y4),vl=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Qy{constructor(){this.subscriptions=[]}add(e){return Yy(this.subscriptions,e),()=>Jy(this.subscriptions,e)}notify(e,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,n,r);else for(let u=0;u<a;u++){const c=this.subscriptions[u];c&&c(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const pi=t=>t*1e3,qn=t=>t/1e3;function AO(t,e){return e?t*(1e3/e):0}const EO=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,g4=1e-7,b4=12;function v4(t,e,n,r,a){let u,c,f=0;do c=e+(n-e)/2,u=EO(c,r,a)-t,u>0?n=c:e=c;while(Math.abs(u)>g4&&++f<b4);return c}function Ll(t,e,n,r){if(t===e&&n===r)return Pn;const a=u=>v4(u,0,1,t,n);return u=>u===0||u===1?u:EO(a(u),e,r)}const OO=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,_O=t=>e=>1-t(1-e),RO=Ll(.33,1.53,.69,.99),Wy=_O(RO),CO=OO(Wy),kO=t=>(t*=2)<1?.5*Wy(t):.5*(2-Math.pow(2,-10*(t-1))),eg=t=>1-Math.sin(Math.acos(t)),MO=_O(eg),DO=OO(eg),S4=Ll(.42,0,1,1),w4=Ll(0,0,.58,1),NO=Ll(.42,0,.58,1),x4=t=>Array.isArray(t)&&typeof t[0]!="number",$O=t=>Array.isArray(t)&&typeof t[0]=="number",T4={linear:Pn,easeIn:S4,easeInOut:NO,easeOut:w4,circIn:eg,circInOut:DO,circOut:MO,backIn:Wy,backInOut:CO,backOut:RO,anticipate:kO},A4=t=>typeof t=="string",O1=t=>{if($O(t)){Xy(t.length===4);const[e,n,r,a]=t;return Ll(e,n,r,a)}else if(A4(t))return T4[t];return t},gc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function E4(t,e){let n=new Set,r=new Set,a=!1,u=!1;const c=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function h(y){c.has(y)&&(m.schedule(y),t()),y(f)}const m={schedule:(y,g=!1,v=!1)=>{const x=v&&a?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(f=y,a){u=!0;return}a=!0,[n,r]=[r,n],n.forEach(h),n.clear(),a=!1,u&&(u=!1,m.process(y))}};return m}const O4=40;function jO(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,c=gc.reduce((R,G)=>(R[G]=E4(u),R),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:y,update:g,preRender:v,render:S,postRender:x}=c,T=()=>{const R=Qi.useManualTiming?a.timestamp:performance.now();n=!1,Qi.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(R-a.timestamp,O4),1)),a.timestamp=R,a.isProcessing=!0,f.process(a),h.process(a),m.process(a),y.process(a),g.process(a),v.process(a),S.process(a),x.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(T))},M=()=>{n=!0,r=!0,a.isProcessing||t(T)};return{schedule:gc.reduce((R,G)=>{const I=c[G];return R[G]=(ee,J=!1,X=!1)=>(n||M(),I.schedule(ee,J,X)),R},{}),cancel:R=>{for(let G=0;G<gc.length;G++)c[gc[G]].cancel(R)},state:a,steps:c}}const{schedule:it,cancel:Vr,state:Ht,steps:Op}=jO(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pn,!0);let Mc;function _4(){Mc=void 0}const fn={now:()=>(Mc===void 0&&fn.set(Ht.isProcessing||Qi.useManualTiming?Ht.timestamp:performance.now()),Mc),set:t=>{Mc=t,queueMicrotask(_4)}},BO=t=>e=>typeof e=="string"&&e.startsWith(t),tg=BO("--"),R4=BO("var(--"),ng=t=>R4(t)?C4.test(t.split("/*")[0].trim()):!1,C4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Zo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Sl={...Zo,transform:t=>Zi(0,1,t)},bc={...Zo,default:1},rl=t=>Math.round(t*1e5)/1e5,ig=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function k4(t){return t==null}const M4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rg=(t,e)=>n=>!!(typeof n=="string"&&M4.test(n)&&n.startsWith(t)||e&&!k4(n)&&Object.prototype.hasOwnProperty.call(n,e)),zO=(t,e,n)=>r=>{if(typeof r!="string")return r;const[a,u,c,f]=r.match(ig);return{[t]:parseFloat(a),[e]:parseFloat(u),[n]:parseFloat(c),alpha:f!==void 0?parseFloat(f):1}},D4=t=>Zi(0,255,t),_p={...Zo,transform:t=>Math.round(D4(t))},gs={test:rg("rgb","red"),parse:zO("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+_p.transform(t)+", "+_p.transform(e)+", "+_p.transform(n)+", "+rl(Sl.transform(r))+")"};function N4(t){let e="",n="",r="",a="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),a=t.substring(4,5),e+=e,n+=n,r+=r,a+=a),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const _m={test:rg("#"),parse:N4,transform:gs.transform},Vl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),_r=Vl("deg"),mi=Vl("%"),de=Vl("px"),$4=Vl("vh"),j4=Vl("vw"),_1={...mi,parse:t=>mi.parse(t)/100,transform:t=>mi.transform(t*100)},To={test:rg("hsl","hue"),parse:zO("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+mi.transform(rl(e))+", "+mi.transform(rl(n))+", "+rl(Sl.transform(r))+")"},At={test:t=>gs.test(t)||_m.test(t)||To.test(t),parse:t=>gs.test(t)?gs.parse(t):To.test(t)?To.parse(t):_m.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?gs.transform(t):To.transform(t),getAnimatableNone:t=>{const e=At.parse(t);return e.alpha=0,At.transform(e)}},B4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function z4(t){return isNaN(t)&&typeof t=="string"&&(t.match(ig)?.length||0)+(t.match(B4)?.length||0)>0}const LO="number",VO="color",L4="var",V4="var(",R1="${}",U4=/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 wl(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},a=[];let u=0;const f=e.replace(U4,h=>(At.test(h)?(r.color.push(u),a.push(VO),n.push(At.parse(h))):h.startsWith(V4)?(r.var.push(u),a.push(L4),n.push(h)):(r.number.push(u),a.push(LO),n.push(parseFloat(h))),++u,R1)).split(R1);return{values:n,split:f,indexes:r,types:a}}function UO(t){return wl(t).values}function KO(t){const{split:e,types:n}=wl(t),r=e.length;return a=>{let u="";for(let c=0;c<r;c++)if(u+=e[c],a[c]!==void 0){const f=n[c];f===LO?u+=rl(a[c]):f===VO?u+=At.transform(a[c]):u+=a[c]}return u}}const K4=t=>typeof t=="number"?0:At.test(t)?At.getAnimatableNone(t):t;function q4(t){const e=UO(t);return KO(t)(e.map(K4))}const Ur={test:z4,parse:UO,createTransformer:KO,getAnimatableNone:q4};function Rp(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 P4({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let a=0,u=0,c=0;if(!e)a=u=c=n;else{const f=n<.5?n*(1+e):n+e-n*e,h=2*n-f;a=Rp(h,f,t+1/3),u=Rp(h,f,t),c=Rp(h,f,t-1/3)}return{red:Math.round(a*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:r}}function tf(t,e){return n=>n>0?e:t}const rt=(t,e,n)=>t+(e-t)*n,Cp=(t,e,n)=>{const r=t*t,a=n*(e*e-r)+r;return a<0?0:Math.sqrt(a)},I4=[_m,gs,To],H4=t=>I4.find(e=>e.test(t));function C1(t){const e=H4(t);if(!e)return!1;let n=e.parse(t);return e===To&&(n=P4(n)),n}const k1=(t,e)=>{const n=C1(t),r=C1(e);if(!n||!r)return tf(t,e);const a={...n};return u=>(a.red=Cp(n.red,r.red,u),a.green=Cp(n.green,r.green,u),a.blue=Cp(n.blue,r.blue,u),a.alpha=rt(n.alpha,r.alpha,u),gs.transform(a))},Rm=new Set(["none","hidden"]);function F4(t,e){return Rm.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function G4(t,e){return n=>rt(t,e,n)}function sg(t){return typeof t=="number"?G4:typeof t=="string"?ng(t)?tf:At.test(t)?k1:X4:Array.isArray(t)?qO:typeof t=="object"?At.test(t)?k1:Y4:tf}function qO(t,e){const n=[...t],r=n.length,a=t.map((u,c)=>sg(u)(u,e[c]));return u=>{for(let c=0;c<r;c++)n[c]=a[c](u);return n}}function Y4(t,e){const n={...t,...e},r={};for(const a in n)t[a]!==void 0&&e[a]!==void 0&&(r[a]=sg(t[a])(t[a],e[a]));return a=>{for(const u in r)n[u]=r[u](a);return n}}function J4(t,e){const n=[],r={color:0,var:0,number:0};for(let a=0;a<e.values.length;a++){const u=e.types[a],c=t.indexes[u][r[u]],f=t.values[c]??0;n[a]=f,r[u]++}return n}const X4=(t,e)=>{const n=Ur.createTransformer(e),r=wl(t),a=wl(e);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?Rm.has(t)&&!a.values.length||Rm.has(e)&&!r.values.length?F4(t,e):zl(qO(J4(r,a),a.values),n):tf(t,e)};function PO(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?rt(t,e,n):sg(t)(t,e)}const Z4=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>it.update(e,n),stop:()=>Vr(e),now:()=>Ht.isProcessing?Ht.timestamp:fn.now()}},IO=(t,e,n=10)=>{let r="";const a=Math.max(Math.round(e/n),2);for(let u=0;u<a;u++)r+=Math.round(t(u/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},nf=2e4;function og(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<nf;)e+=n,r=t.next(e);return e>=nf?1/0:e}function Q4(t,e=100,n){const r=n({...t,keyframes:[0,e]}),a=Math.min(og(r),nf);return{type:"keyframes",ease:u=>r.next(a*u).value/e,duration:qn(a)}}const W4=5;function HO(t,e,n){const r=Math.max(e-W4,0);return AO(n-t(r),e-r)}const lt={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},kp=.001;function eU({duration:t=lt.duration,bounce:e=lt.bounce,velocity:n=lt.velocity,mass:r=lt.mass}){let a,u,c=1-e;c=Zi(lt.minDamping,lt.maxDamping,c),t=Zi(lt.minDuration,lt.maxDuration,qn(t)),c<1?(a=m=>{const y=m*c,g=y*t,v=y-n,S=Cm(m,c),x=Math.exp(-g);return kp-v/S*x},u=m=>{const g=m*c*t,v=g*n+n,S=Math.pow(c,2)*Math.pow(m,2)*t,x=Math.exp(-g),T=Cm(Math.pow(m,2),c);return(-a(m)+kp>0?-1:1)*((v-S)*x)/T}):(a=m=>{const y=Math.exp(-m*t),g=(m-n)*t+1;return-kp+y*g},u=m=>{const y=Math.exp(-m*t),g=(n-m)*(t*t);return y*g});const f=5/t,h=nU(a,u,f);if(t=pi(t),isNaN(h))return{stiffness:lt.stiffness,damping:lt.damping,duration:t};{const m=Math.pow(h,2)*r;return{stiffness:m,damping:c*2*Math.sqrt(r*m),duration:t}}}const tU=12;function nU(t,e,n){let r=n;for(let a=1;a<tU;a++)r=r-t(r)/e(r);return r}function Cm(t,e){return t*Math.sqrt(1-e*e)}const iU=["duration","bounce"],rU=["stiffness","damping","mass"];function M1(t,e){return e.some(n=>t[n]!==void 0)}function sU(t){let e={velocity:lt.velocity,stiffness:lt.stiffness,damping:lt.damping,mass:lt.mass,isResolvedFromDuration:!1,...t};if(!M1(t,rU)&&M1(t,iU))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,u=2*Zi(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:lt.mass,stiffness:a,damping:u}}else{const n=eU(t);e={...e,...n,mass:lt.mass},e.isResolvedFromDuration=!0}return e}function rf(t=lt.visualDuration,e=lt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:a}=n;const u=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],f={done:!1,value:u},{stiffness:h,damping:m,mass:y,duration:g,velocity:v,isResolvedFromDuration:S}=sU({...n,velocity:-qn(n.velocity||0)}),x=v||0,T=m/(2*Math.sqrt(h*y)),M=c-u,C=qn(Math.sqrt(h/y)),_=Math.abs(M)<5;r||(r=_?lt.restSpeed.granular:lt.restSpeed.default),a||(a=_?lt.restDelta.granular:lt.restDelta.default);let R;if(T<1){const I=Cm(C,T);R=ee=>{const J=Math.exp(-T*C*ee);return c-J*((x+T*C*M)/I*Math.sin(I*ee)+M*Math.cos(I*ee))}}else if(T===1)R=I=>c-Math.exp(-C*I)*(M+(x+C*M)*I);else{const I=C*Math.sqrt(T*T-1);R=ee=>{const J=Math.exp(-T*C*ee),X=Math.min(I*ee,300);return c-J*((x+T*C*M)*Math.sinh(X)+I*M*Math.cosh(X))/I}}const G={calculatedDuration:S&&g||null,next:I=>{const ee=R(I);if(S)f.done=I>=g;else{let J=I===0?x:0;T<1&&(J=I===0?pi(x):HO(R,I,ee));const X=Math.abs(J)<=r,he=Math.abs(c-ee)<=a;f.done=X&&he}return f.value=f.done?c:ee,f},toString:()=>{const I=Math.min(og(G),nf),ee=IO(J=>G.next(I*J).value,I,30);return I+"ms "+ee},toTransition:()=>{}};return G}rf.applyToOptions=t=>{const e=Q4(t,100,rf);return t.ease=e.ease,t.duration=pi(e.duration),t.type="keyframes",t};function km({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:u=500,modifyTarget:c,min:f,max:h,restDelta:m=.5,restSpeed:y}){const g=t[0],v={done:!1,value:g},S=X=>f!==void 0&&X<f||h!==void 0&&X>h,x=X=>f===void 0?h:h===void 0||Math.abs(f-X)<Math.abs(h-X)?f:h;let T=n*e;const M=g+T,C=c===void 0?M:c(M);C!==M&&(T=C-g);const _=X=>-T*Math.exp(-X/r),R=X=>C+_(X),G=X=>{const he=_(X),pe=R(X);v.done=Math.abs(he)<=m,v.value=v.done?C:pe};let I,ee;const J=X=>{S(v.value)&&(I=X,ee=rf({keyframes:[v.value,x(v.value)],velocity:HO(R,X,v.value),damping:a,stiffness:u,restDelta:m,restSpeed:y}))};return J(0),{calculatedDuration:null,next:X=>{let he=!1;return!ee&&I===void 0&&(he=!0,G(X),J(X)),I!==void 0&&X>=I?ee.next(X-I):(!he&&G(X),v)}}}function oU(t,e,n){const r=[],a=n||Qi.mix||PO,u=t.length-1;for(let c=0;c<u;c++){let f=a(t[c],t[c+1]);if(e){const h=Array.isArray(e)?e[c]||Pn:e;f=zl(h,f)}r.push(f)}return r}function aU(t,e,{clamp:n=!0,ease:r,mixer:a}={}){const u=t.length;if(Xy(u===e.length),u===1)return()=>e[0];if(u===2&&e[0]===e[1])return()=>e[1];const c=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),e=[...e].reverse());const f=oU(e,r,a),h=f.length,m=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=vl(t[g],t[g+1],y);return f[g](v)};return n?y=>m(Zi(t[0],t[u-1],y)):m}function lU(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const a=vl(0,e,r);t.push(rt(n,1,a))}}function uU(t){const e=[0];return lU(e,t.length-1),e}function cU(t,e){return t.map(n=>n*e)}function fU(t,e){return t.map(()=>e||NO).splice(0,t.length-1)}function sl({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const a=x4(r)?r.map(O1):O1(r),u={done:!1,value:e[0]},c=cU(n&&n.length===e.length?n:uU(e),t),f=aU(c,e,{ease:Array.isArray(a)?a:fU(e,a)});return{calculatedDuration:t,next:h=>(u.value=f(h),u.done=h>=t,u)}}const dU=t=>t!==null;function ag(t,{repeat:e,repeatType:n="loop"},r,a=1){const u=t.filter(dU),f=a<0||e&&n!=="loop"&&e%2===1?0:u.length-1;return!f||r===void 0?u[f]:r}const hU={decay:km,inertia:km,tween:sl,keyframes:sl,spring:rf};function FO(t){typeof t.type=="string"&&(t.type=hU[t.type])}class lg{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 pU=t=>t/100;class ug extends lg{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!==fn.now()&&this.tick(fn.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;FO(e);const{type:n=sl,repeat:r=0,repeatDelay:a=0,repeatType:u,velocity:c=0}=e;let{keyframes:f}=e;const h=n||sl;h!==sl&&typeof f[0]!="number"&&(this.mixKeyframes=zl(pU,PO(f[0],f[1])),f=[0,100]);const m=h({...e,keyframes:f});u==="mirror"&&(this.mirroredGenerator=h({...e,keyframes:[...f].reverse(),velocity:-c})),m.calculatedDuration===null&&(m.calculatedDuration=og(m));const{calculatedDuration:y}=m;this.calculatedDuration=y,this.resolvedDuration=y+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=m}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:a,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:m=0,keyframes:y,repeat:g,repeatType:v,repeatDelay:S,type:x,onUpdate:T,finalKeyframe:M}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const C=this.currentTime-m*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?C<0:C>a;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let R=this.currentTime,G=r;if(g){const X=Math.min(this.currentTime,a)/f;let he=Math.floor(X),pe=X%1;!pe&&X>=1&&(pe=1),pe===1&&he--,he=Math.min(he,g+1),!!(he%2)&&(v==="reverse"?(pe=1-pe,S&&(pe-=S/f)):v==="mirror"&&(G=c)),R=Zi(0,1,pe)*f}const I=_?{done:!1,value:y[0]}:G.next(R);u&&(I.value=u(I.value));let{done:ee}=I;!_&&h!==null&&(ee=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const J=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ee);return J&&x!==km&&(I.value=ag(y,this.options,M,this.speed)),T&&T(I.value),J&&this.finish(),I}then(e,n){return this.finished.then(e,n)}get duration(){return qn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qn(e)}get time(){return qn(this.currentTime)}set time(e){e=pi(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(fn.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=qn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Z4,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),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(fn.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 mU(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const bs=t=>t*180/Math.PI,Mm=t=>{const e=bs(Math.atan2(t[1],t[0]));return Dm(e)},yU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Mm,rotateZ:Mm,skewX:t=>bs(Math.atan(t[1])),skewY:t=>bs(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Dm=t=>(t=t%360,t<0&&(t+=360),t),D1=Mm,N1=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$1=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),gU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:N1,scaleY:$1,scale:t=>(N1(t)+$1(t))/2,rotateX:t=>Dm(bs(Math.atan2(t[6],t[5]))),rotateY:t=>Dm(bs(Math.atan2(-t[2],t[0]))),rotateZ:D1,rotate:D1,skewX:t=>bs(Math.atan(t[4])),skewY:t=>bs(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Nm(t){return t.includes("scale")?1:0}function $m(t,e){if(!t||t==="none")return Nm(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=gU,a=n;else{const f=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=yU,a=f}if(!a)return Nm(e);const u=r[e],c=a[1].split(",").map(vU);return typeof u=="function"?u(c):c[u]}const bU=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $m(n,e)};function vU(t){return parseFloat(t.trim())}const Qo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wo=new Set(Qo),j1=t=>t===Zo||t===de,SU=new Set(["x","y","z"]),wU=Qo.filter(t=>!SU.has(t));function xU(t){const e=[];return wU.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const ws={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")};ws.translateX=ws.x;ws.translateY=ws.y;const xs=new Set;let jm=!1,Bm=!1,zm=!1;function GO(){if(Bm){const t=Array.from(xs).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const a=xU(r);a.length&&(n.set(r,a),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([u,c])=>{r.getValue(u)?.set(c)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Bm=!1,jm=!1,xs.forEach(t=>t.complete(zm)),xs.clear()}function YO(){xs.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Bm=!0)})}function TU(){zm=!0,YO(),GO(),zm=!1}class cg{constructor(e,n,r,a,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=a,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(xs.add(this),jm||(jm=!0,it.read(YO),it.resolveKeyframes(GO))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:a}=this;if(e[0]===null){const u=a?.get(),c=e[e.length-1];if(u!==void 0)e[0]=u;else if(r&&n){const f=r.readValue(n,c);f!=null&&(e[0]=f)}e[0]===void 0&&(e[0]=c),a&&u===void 0&&a.set(e[0])}mU(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),xs.delete(this)}cancel(){this.state==="scheduled"&&(xs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const AU=t=>t.startsWith("--");function EU(t,e,n){AU(e)?t.style.setProperty(e,n):t.style[e]=n}const OU=Zy(()=>window.ScrollTimeline!==void 0),_U={};function RU(t,e){const n=Zy(t);return()=>_U[e]??n()}const JO=RU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),el=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,B1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:el([0,.65,.55,1]),circOut:el([.55,0,1,.45]),backIn:el([.31,.01,.66,-.59]),backOut:el([.33,1.53,.69,.99])};function XO(t,e){if(t)return typeof t=="function"?JO()?IO(t,e):"ease-out":$O(t)?el(t):Array.isArray(t)?t.map(n=>XO(n,e)||B1.easeOut):B1[t]}function CU(t,e,n,{delay:r=0,duration:a=300,repeat:u=0,repeatType:c="loop",ease:f="easeOut",times:h}={},m=void 0){const y={[e]:n};h&&(y.offset=h);const g=XO(f,a);Array.isArray(g)&&(y.easing=g);const v={delay:r,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),t.animate(y,v)}function ZO(t){return typeof t=="function"&&"applyToOptions"in t}function kU({type:t,...e}){return ZO(t)&&JO()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class MU extends lg{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:a,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:f,onComplete:h}=e;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=e,Xy(typeof e.type!="string");const m=kU(e);this.animation=CU(n,r,a,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const y=ag(a,this.options,f,this.speed);this.updateMotionValue?this.updateMotionValue(y):EU(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 qn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qn(e)}get time(){return qn(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=pi(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&&OU()?(this.animation.timeline=e,Pn):n(this)}}const QO={anticipate:kO,backInOut:CO,circInOut:DO};function DU(t){return t in QO}function NU(t){typeof t.ease=="string"&&DU(t.ease)&&(t.ease=QO[t.ease])}const z1=10;class $U extends MU{constructor(e){NU(e),FO(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:a,element:u,...c}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const f=new ug({...c,autoplay:!1}),h=pi(this.finishedTime??this.time);n.setWithVelocity(f.sample(h-z1).value,f.sample(h).value,z1),f.stop()}}const L1=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ur.test(t)||t==="0")&&!t.startsWith("url("));function jU(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 BU(t,e,n,r){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const u=t[t.length-1],c=L1(a,e),f=L1(u,e);return!c||!f?!1:jU(t)||(n==="spring"||ZO(n))&&r}function Lm(t){t.duration=0,t.type="keyframes"}const zU=new Set(["opacity","clipPath","filter","transform"]),LU=Zy(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function VU(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:a,damping:u,type:c}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=e.owner.getProps();return LU()&&n&&zU.has(n)&&(n!=="transform"||!m)&&!h&&!r&&a!=="mirror"&&u!==0&&c!=="inertia"}const UU=40;class KU extends lg{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:u=0,repeatType:c="loop",keyframes:f,name:h,motionValue:m,element:y,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=fn.now();const v={autoplay:e,delay:n,type:r,repeat:a,repeatDelay:u,repeatType:c,name:h,motionValue:m,element:y,...g},S=y?.KeyframeResolver||cg;this.keyframeResolver=new S(f,(x,T,M)=>this.onKeyframesResolved(x,T,v,!M),h,m,y),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,r,a){this.keyframeResolver=void 0;const{name:u,type:c,velocity:f,delay:h,isHandoff:m,onUpdate:y}=r;this.resolvedAt=fn.now(),BU(e,u,c,f)||((Qi.instantAnimations||!h)&&y?.(ag(e,r,n)),e[0]=e[e.length-1],Lm(r),r.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>UU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},S=!m&&VU(v)?new $U({...v,element:v.motionValue.owner.current}):new ug(v);S.finished.then(()=>this.notifyFinished()).catch(Pn),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(),TU()),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 qU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PU(t){const e=qU.exec(t);if(!e)return[,];const[,n,r,a]=e;return[`--${n??r}`,a]}function WO(t,e,n=1){const[r,a]=PU(t);if(!r)return;const u=window.getComputedStyle(e).getPropertyValue(r);if(u){const c=u.trim();return wO(c)?parseFloat(c):c}return ng(a)?WO(a,e,n+1):a}function fg(t,e){return t?.[e]??t?.default??t}const e_=new Set(["width","height","top","left","right","bottom",...Qo]),IU={test:t=>t==="auto",parse:t=>t},t_=t=>e=>e.test(t),n_=[Zo,de,mi,_r,j4,$4,IU],V1=t=>n_.find(t_(t));function HU(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||TO(t):!0}const FU=new Set(["brightness","contrast","saturate","opacity"]);function GU(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(ig)||[];if(!r)return t;const a=n.replace(r,"");let u=FU.has(e)?1:0;return r!==n&&(u*=100),e+"("+u+a+")"}const YU=/\b([a-z-]*)\(.*?\)/gu,Vm={...Ur,getAnimatableNone:t=>{const e=t.match(YU);return e?e.map(GU).join(" "):t}},U1={...Zo,transform:Math.round},JU={rotate:_r,rotateX:_r,rotateY:_r,rotateZ:_r,scale:bc,scaleX:bc,scaleY:bc,scaleZ:bc,skew:_r,skewX:_r,skewY:_r,distance:de,translateX:de,translateY:de,translateZ:de,x:de,y:de,z:de,perspective:de,transformPerspective:de,opacity:Sl,originX:_1,originY:_1,originZ:de},dg={borderWidth:de,borderTopWidth:de,borderRightWidth:de,borderBottomWidth:de,borderLeftWidth:de,borderRadius:de,radius:de,borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomRightRadius:de,borderBottomLeftRadius:de,width:de,maxWidth:de,height:de,maxHeight:de,top:de,right:de,bottom:de,left:de,padding:de,paddingTop:de,paddingRight:de,paddingBottom:de,paddingLeft:de,margin:de,marginTop:de,marginRight:de,marginBottom:de,marginLeft:de,backgroundPositionX:de,backgroundPositionY:de,...JU,zIndex:U1,fillOpacity:Sl,strokeOpacity:Sl,numOctaves:U1},XU={...dg,color:At,backgroundColor:At,outlineColor:At,fill:At,stroke:At,borderColor:At,borderTopColor:At,borderRightColor:At,borderBottomColor:At,borderLeftColor:At,filter:Vm,WebkitFilter:Vm},i_=t=>XU[t];function r_(t,e){let n=i_(t);return n!==Vm&&(n=Ur),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ZU=new Set(["auto","none","0"]);function QU(t,e,n){let r=0,a;for(;r<t.length&&!a;){const u=t[r];typeof u=="string"&&!ZU.has(u)&&wl(u).values.length&&(a=t[r]),r++}if(a&&n)for(const u of e)t[u]=r_(n,a)}class WU extends cg{constructor(e,n,r,a,u){super(e,n,r,a,u,!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 m=e[h];if(typeof m=="string"&&(m=m.trim(),ng(m))){const y=WO(m,n.current);y!==void 0&&(e[h]=y),h===e.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!e_.has(r)||e.length!==2)return;const[a,u]=e,c=V1(a),f=V1(u);if(c!==f)if(j1(c)&&j1(f))for(let h=0;h<e.length;h++){const m=e[h];typeof m=="string"&&(e[h]=parseFloat(m))}else ws[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let a=0;a<e.length;a++)(e[a]===null||HU(e[a]))&&r.push(a);r.length&&QU(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=ws[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&e.getValue(r,a).jump(a,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const a=e.getValue(n);a&&a.jump(this.measuredOrigin,!1);const u=r.length-1,c=r[u];r[u]=ws[n](e.measureViewportBox(),window.getComputedStyle(e.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([f,h])=>{e.getValue(f).set(h)}),this.resolveNoneKeyframes()}}function eK(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const a=n?.[t]??r.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}const s_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function tK(t){return xO(t)&&"offsetHeight"in t}const K1=30,nK=t=>!isNaN(parseFloat(t));class iK{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=fn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=fn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=nK(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 Qy);const r=this.events[e].add(n);return e==="change"?()=>{r(),it.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=fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>K1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,K1);return AO(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 Io(t,e){return new iK(t,e)}const{schedule:hg}=jO(queueMicrotask,!1),Zn={x:!1,y:!1};function o_(){return Zn.x||Zn.y}function rK(t){return t==="x"||t==="y"?Zn[t]?null:(Zn[t]=!0,()=>{Zn[t]=!1}):Zn.x||Zn.y?null:(Zn.x=Zn.y=!0,()=>{Zn.x=Zn.y=!1})}function a_(t,e){const n=eK(t),r=new AbortController,a={passive:!0,...e,signal:r.signal};return[n,a,()=>r.abort()]}function q1(t){return!(t.pointerType==="touch"||o_())}function sK(t,e,n={}){const[r,a,u]=a_(t,n),c=f=>{if(!q1(f))return;const{target:h}=f,m=e(h,f);if(typeof m!="function"||!h)return;const y=g=>{q1(g)&&(m(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,a)};return r.forEach(f=>{f.addEventListener("pointerenter",c,a)}),u}const l_=(t,e)=>e?t===e?!0:l_(t,e.parentElement):!1,pg=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,oK=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function aK(t){return oK.has(t.tagName)||t.tabIndex!==-1}const Dc=new WeakSet;function P1(t){return e=>{e.key==="Enter"&&t(e)}}function Mp(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const lK=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=P1(()=>{if(Dc.has(n))return;Mp(n,"down");const a=P1(()=>{Mp(n,"up")}),u=()=>Mp(n,"cancel");n.addEventListener("keyup",a,e),n.addEventListener("blur",u,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function I1(t){return pg(t)&&!o_()}function uK(t,e,n={}){const[r,a,u]=a_(t,n),c=f=>{const h=f.currentTarget;if(!I1(f))return;Dc.add(h);const m=e(h,f),y=(S,x)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),Dc.has(h)&&Dc.delete(h),I1(S)&&typeof m=="function"&&m(S,{success:x})},g=S=>{y(S,h===window||h===document||n.useGlobalTarget||l_(h,S.target))},v=S=>{y(S,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(f=>{(n.useGlobalTarget?window:f).addEventListener("pointerdown",c,a),tK(f)&&(f.addEventListener("focus",m=>lK(m,a)),!aK(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),u}function u_(t){return xO(t)&&"ownerSVGElement"in t}function cK(t){return u_(t)&&t.tagName==="svg"}const Jt=t=>!!(t&&t.getVelocity),fK=[...n_,At,Ur],dK=t=>fK.find(t_(t)),c_=$.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function hK(t=!0){const e=$.useContext(Gy);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=e,u=$.useId();$.useEffect(()=>{if(t)return a(u)},[t]);const c=$.useCallback(()=>t&&r&&r(u),[u,r,t]);return!n&&r?[!1,c]:[!0]}const f_=$.createContext({strict:!1}),H1={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"]},Ho={};for(const t in H1)Ho[t]={isEnabled:e=>H1[t].some(n=>!!e[n])};function pK(t){for(const e in t)Ho[e]={...Ho[e],...t[e]}}const mK=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 sf(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||mK.has(t)}let d_=t=>!sf(t);function yK(t){typeof t=="function"&&(d_=e=>e.startsWith("on")?!sf(e):t(e))}try{yK(require("@emotion/is-prop-valid").default)}catch{}function gK(t,e,n){const r={};for(const a in t)a==="values"&&typeof t.values=="object"||(d_(a)||n===!0&&sf(a)||!e&&!sf(a)||t.draggable&&a.startsWith("onDrag"))&&(r[a]=t[a]);return r}const $f=$.createContext({});function jf(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function xl(t){return typeof t=="string"||Array.isArray(t)}const mg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yg=["initial",...mg];function Bf(t){return jf(t.animate)||yg.some(e=>xl(t[e]))}function h_(t){return!!(Bf(t)||t.variants)}function bK(t,e){if(Bf(t)){const{initial:n,animate:r}=t;return{initial:n===!1||xl(n)?n:void 0,animate:xl(r)?r:void 0}}return t.inherit!==!1?e:{}}function vK(t){const{initial:e,animate:n}=bK(t,$.useContext($f));return $.useMemo(()=>({initial:e,animate:n}),[F1(e),F1(n)])}function F1(t){return Array.isArray(t)?t.join(" "):t}const Tl={};function SK(t){for(const e in t)Tl[e]=t[e],tg(e)&&(Tl[e].isCSSVariable=!0)}function p_(t,{layout:e,layoutId:n}){return Wo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Tl[t]||t==="opacity")}const wK={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xK=Qo.length;function TK(t,e,n){let r="",a=!0;for(let u=0;u<xK;u++){const c=Qo[u],f=t[c];if(f===void 0)continue;let h=!0;if(typeof f=="number"?h=f===(c.startsWith("scale")?1:0):h=parseFloat(f)===0,!h||n){const m=s_(f,dg[c]);if(!h){a=!1;const y=wK[c]||c;r+=`${y}(${m}) `}n&&(e[c]=m)}}return r=r.trim(),n?r=n(e,a?"":r):a&&(r="none"),r}function gg(t,e,n){const{style:r,vars:a,transformOrigin:u}=t;let c=!1,f=!1;for(const h in e){const m=e[h];if(Wo.has(h)){c=!0;continue}else if(tg(h)){a[h]=m;continue}else{const y=s_(m,dg[h]);h.startsWith("origin")?(f=!0,u[h]=y):r[h]=y}}if(e.transform||(c||n?r.transform=TK(e,t.transform,n):r.transform&&(r.transform="none")),f){const{originX:h="50%",originY:m="50%",originZ:y=0}=u;r.transformOrigin=`${h} ${m} ${y}`}}const bg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function m_(t,e,n){for(const r in e)!Jt(e[r])&&!p_(r,n)&&(t[r]=e[r])}function AK({transformTemplate:t},e){return $.useMemo(()=>{const n=bg();return gg(n,e,t),Object.assign({},n.vars,n.style)},[e])}function EK(t,e){const n=t.style||{},r={};return m_(r,n,t),Object.assign(r,AK(t,e)),r}function OK(t,e){const n={},r=EK(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 _K={offset:"stroke-dashoffset",array:"stroke-dasharray"},RK={offset:"strokeDashoffset",array:"strokeDasharray"};function CK(t,e,n=1,r=0,a=!0){t.pathLength=1;const u=a?_K:RK;t[u.offset]=de.transform(-r);const c=de.transform(e),f=de.transform(n);t[u.array]=`${c} ${f}`}function y_(t,{attrX:e,attrY:n,attrScale:r,pathLength:a,pathSpacing:u=1,pathOffset:c=0,...f},h,m,y){if(gg(t,f,m),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),a!==void 0&&CK(g,a,u,c,!1)}const g_=()=>({...bg(),attrs:{}}),b_=t=>typeof t=="string"&&t.toLowerCase()==="svg";function kK(t,e,n,r){const a=$.useMemo(()=>{const u=g_();return y_(u,e,b_(r),t.transformTemplate,t.style),{...u.attrs,style:{...u.style}}},[e]);if(t.style){const u={};m_(u,t.style,t),a.style={...u,...a.style}}return a}const MK=["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 vg(t){return typeof t!="string"||t.includes("-")?!1:!!(MK.indexOf(t)>-1||/[A-Z]/u.test(t))}function DK(t,e,n,{latestValues:r},a,u=!1){const f=(vg(t)?kK:OK)(e,r,a,t),h=gK(e,typeof t=="string",u),m=t!==$.Fragment?{...h,...f,ref:n}:{},{children:y}=e,g=$.useMemo(()=>Jt(y)?y.get():y,[y]);return $.createElement(t,{...m,children:g})}function G1(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Sg(t,e,n,r){if(typeof e=="function"){const[a,u]=G1(r);e=e(n!==void 0?n:t.custom,a,u)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,u]=G1(r);e=e(n!==void 0?n:t.custom,a,u)}return e}function Nc(t){return Jt(t)?t.get():t}function NK({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,a){return{latestValues:$K(n,r,a,t),renderState:e()}}function $K(t,e,n,r){const a={},u=r(t,{});for(const v in u)a[v]=Nc(u[v]);let{initial:c,animate:f}=t;const h=Bf(t),m=h_(t);e&&m&&!h&&t.inherit!==!1&&(c===void 0&&(c=e.initial),f===void 0&&(f=e.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?f:c;if(g&&typeof g!="boolean"&&!jf(g)){const v=Array.isArray(g)?g:[g];for(let S=0;S<v.length;S++){const x=Sg(t,v[S]);if(x){const{transitionEnd:T,transition:M,...C}=x;for(const _ in C){let R=C[_];if(Array.isArray(R)){const G=y?R.length-1:0;R=R[G]}R!==null&&(a[_]=R)}for(const _ in T)a[_]=T[_]}}}return a}const v_=t=>(e,n)=>{const r=$.useContext($f),a=$.useContext(Gy),u=()=>NK(t,e,r,a);return n?u():p4(u)};function wg(t,e,n){const{style:r}=t,a={};for(const u in r)(Jt(r[u])||e.style&&Jt(e.style[u])||p_(u,t)||n?.getValue(u)?.liveStyle!==void 0)&&(a[u]=r[u]);return a}const jK=v_({scrapeMotionValuesFromProps:wg,createRenderState:bg});function S_(t,e,n){const r=wg(t,e,n);for(const a in t)if(Jt(t[a])||Jt(e[a])){const u=Qo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[u]=t[a]}return r}const BK=v_({scrapeMotionValuesFromProps:S_,createRenderState:g_}),zK=Symbol.for("motionComponentSymbol");function Ao(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function LK(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):Ao(n)&&(n.current=r))},[e])}const xg=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),VK="framerAppearId",w_="data-"+xg(VK),x_=$.createContext({});function UK(t,e,n,r,a){const{visualElement:u}=$.useContext($f),c=$.useContext(f_),f=$.useContext(Gy),h=$.useContext(c_).reducedMotion,m=$.useRef(null);r=r||c.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:u,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:h}));const y=m.current,g=$.useContext(x_);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&KK(m.current,n,a,g);const v=$.useRef(!1);$.useInsertionEffect(()=>{y&&v.current&&y.update(n,f)});const S=n[w_],x=$.useRef(!!S&&!window.MotionHandoffIsComplete?.(S)&&window.MotionHasOptimisedAnimation?.(S));return m4(()=>{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 KK(t,e,n,r){const{layoutId:a,layout:u,drag:c,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutCrossfade:y}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:T_(t.parent)),t.projection.setOptions({layoutId:a,layout:u,alwaysMeasureLayout:!!c||f&&Ao(f),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:r,crossfade:y,layoutScroll:h,layoutRoot:m})}function T_(t){if(t)return t.options.allowProjection!==!1?t.projection:T_(t.parent)}function Dp(t,{forwardMotionProps:e=!1}={},n,r){n&&pK(n);const a=vg(t)?BK:jK;function u(f,h){let m;const y={...$.useContext(c_),...f,layoutId:qK(f)},{isStatic:g}=y,v=vK(f),S=a(f,g);if(!g&&Fy){PK();const x=IK(y);m=x.MeasureLayout,v.visualElement=UK(t,S,y,r,x.ProjectionNode)}return F.jsxs($f.Provider,{value:v,children:[m&&v.visualElement?F.jsx(m,{visualElement:v.visualElement,...y}):null,DK(t,f,LK(S,v.visualElement,h),S,g,e)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=$.forwardRef(u);return c[zK]=t,c}function qK({layoutId:t}){const e=$.useContext(SO).id;return e&&t!==void 0?e+"-"+t:t}function PK(t,e){$.useContext(f_).strict}function IK(t){const{drag:e,layout:n}=Ho;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 Dp;const n=new Map,r=(u,c)=>Dp(u,c,t,e),a=(u,c)=>r(u,c);return new Proxy(a,{get:(u,c)=>c==="create"?r:(n.has(c)||n.set(c,Dp(c,void 0,t,e)),n.get(c))})}function A_({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function FK({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function GK(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 Np(t){return t===void 0||t===1}function Um({scale:t,scaleX:e,scaleY:n}){return!Np(t)||!Np(e)||!Np(n)}function ms(t){return Um(t)||E_(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function E_(t){return Y1(t.x)||Y1(t.y)}function Y1(t){return t&&t!=="0%"}function of(t,e,n){const r=t-n,a=e*r;return n+a}function J1(t,e,n,r,a){return a!==void 0&&(t=of(t,a,r)),of(t,n,r)+e}function Km(t,e=0,n=1,r,a){t.min=J1(t.min,e,n,r,a),t.max=J1(t.max,e,n,r,a)}function O_(t,{x:e,y:n}){Km(t.x,e.translate,e.scale,e.originPoint),Km(t.y,n.translate,n.scale,n.originPoint)}const X1=.999999999999,Z1=1.0000000000001;function YK(t,e,n,r=!1){const a=n.length;if(!a)return;e.x=e.y=1;let u,c;for(let f=0;f<a;f++){u=n[f],c=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(r&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Oo(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(e.x*=c.x.scale,e.y*=c.y.scale,O_(t,c)),r&&ms(u.latestValues)&&Oo(t,u.latestValues))}e.x<Z1&&e.x>X1&&(e.x=1),e.y<Z1&&e.y>X1&&(e.y=1)}function Eo(t,e){t.min=t.min+e,t.max=t.max+e}function Q1(t,e,n,r,a=.5){const u=rt(t.min,t.max,a);Km(t,e,n,u,r)}function Oo(t,e){Q1(t.x,e.x,e.scaleX,e.scale,e.originX),Q1(t.y,e.y,e.scaleY,e.scale,e.originY)}function __(t,e){return A_(GK(t.getBoundingClientRect(),e))}function JK(t,e,n){const r=__(t,n),{scroll:a}=e;return a&&(Eo(r.x,a.offset.x),Eo(r.y,a.offset.y)),r}const W1=()=>({translate:0,scale:1,origin:0,originPoint:0}),_o=()=>({x:W1(),y:W1()}),ex=()=>({min:0,max:0}),yt=()=>({x:ex(),y:ex()}),qm={current:null},R_={current:!1};function XK(){if(R_.current=!0,!!Fy)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>qm.current=t.matches;t.addEventListener("change",e),e()}else qm.current=!1}const ZK=new WeakMap;function QK(t,e,n){for(const r in e){const a=e[r],u=n[r];if(Jt(a))t.addValue(r,a);else if(Jt(u))t.addValue(r,Io(a,{owner:t}));else if(u!==a)if(t.hasValue(r)){const c=t.getValue(r);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=t.getStaticValue(r);t.addValue(r,Io(c!==void 0?c:a,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const tx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class WK{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:a,blockInitialAnimation:u,visualState:c},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=cg,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=fn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,it.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=f,this.blockInitialAnimation=!!u,this.isControllingVariants=Bf(n),this.isVariantNode=h_(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&&Jt(S)&&S.set(h[v])}}mount(e){this.current=e,ZK.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)),R_.current||XK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:qm.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Vr(this.notifyUpdate),Vr(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=Wo.has(e);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",c=>{this.latestValues[e]=c,this.props.onUpdate&&it.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{a(),u&&u(),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 Ho){const n=Ho[e];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[e]&&a&&r(this.props)&&(this.features[e]=new a(this)),this.features[e]){const u=this.features[e];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):yt()}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<tx.length;r++){const a=tx[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const u="on"+a,c=e[u];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=QK(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=Io(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"&&(wO(r)||TO(r))?r=parseFloat(r):!dK(r)&&Ur.test(n)&&(r=r_(e,n)),this.setBaseTarget(e,Jt(r)?r.get():r)),Jt(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 u=Sg(this.props,n,this.presenceContext?.custom);u&&(r=u[e])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!Jt(a)?a:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Qy),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){hg.render(this.render)}}class C_ 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;Jt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function k_(t,{style:e,vars:n},r,a){const u=t.style;let c;for(c in e)u[c]=e[c];a?.applyProjectionStyles(u,r);for(c in n)u.setProperty(c,n[c])}function eq(t){return window.getComputedStyle(t)}class tq extends C_{constructor(){super(...arguments),this.type="html",this.renderInstance=k_}readValueFromInstance(e,n){if(Wo.has(n))return this.projection?.isProjecting?Nm(n):bU(e,n);{const r=eq(e),a=(tg(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return __(e,n)}build(e,n,r){gg(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return wg(e,n,r)}}const M_=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 nq(t,e,n,r){k_(t,e,void 0,r);for(const a in e.attrs)t.setAttribute(M_.has(a)?a:xg(a),e.attrs[a])}class iq extends C_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Wo.has(n)){const r=i_(n);return r&&r.default||0}return n=M_.has(n)?n:xg(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return S_(e,n,r)}build(e,n,r){y_(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,a){nq(e,n,r,a)}mount(e){this.isSVGTag=b_(e.tagName),super.mount(e)}}const rq=(t,e)=>vg(t)?new iq(e):new tq(e,{allowProjection:t!==$.Fragment});function jo(t,e,n){const r=t.getProps();return Sg(r,e,n!==void 0?n:r.custom,t)}const Pm=t=>Array.isArray(t);function sq(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Io(n))}function oq(t){return Pm(t)?t[t.length-1]||0:t}function aq(t,e){const n=jo(t,e);let{transitionEnd:r={},transition:a={},...u}=n||{};u={...u,...r};for(const c in u){const f=oq(u[c]);sq(t,c,f)}}function lq(t){return!!(Jt(t)&&t.add)}function Im(t,e){const n=t.getValue("willChange");if(lq(n))return n.add(e);if(!n&&Qi.WillChange){const r=new Qi.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function D_(t){return t.props[w_]}const uq=t=>t!==null;function cq(t,{repeat:e,repeatType:n="loop"},r){const a=t.filter(uq),u=e&&n!=="loop"&&e%2===1?0:a.length-1;return a[u]}const fq={type:"spring",stiffness:500,damping:25,restSpeed:10},dq=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),hq={type:"keyframes",duration:.8},pq={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mq=(t,{keyframes:e})=>e.length>2?hq:Wo.has(t)?t.startsWith("scale")?dq(e[1]):fq:pq;function yq({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:u,repeatType:c,repeatDelay:f,from:h,elapsed:m,...y}){return!!Object.keys(y).length}const Tg=(t,e,n,r={},a,u)=>c=>{const f=fg(r,t)||{},h=f.delay||r.delay||0;let{elapsed:m=0}=r;m=m-pi(h);const y={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...f,delay:-m,onUpdate:v=>{e.set(v),f.onUpdate&&f.onUpdate(v)},onComplete:()=>{c(),f.onComplete&&f.onComplete()},name:t,motionValue:e,element:u?void 0:a};yq(f)||Object.assign(y,mq(t,y)),y.duration&&(y.duration=pi(y.duration)),y.repeatDelay&&(y.repeatDelay=pi(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let g=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(Lm(y),y.delay===0&&(g=!0)),(Qi.instantAnimations||Qi.skipAnimations)&&(g=!0,Lm(y),y.delay=0),y.allowFlatten=!f.type&&!f.ease,g&&!u&&e.get()!==void 0){const v=cq(y.keyframes,f);if(v!==void 0){it.update(()=>{y.onUpdate(v),y.onComplete()});return}}return f.isSync?new ug(y):new KU(y)};function gq({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function N_(t,e,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:u=t.getDefaultTransition(),transitionEnd:c,...f}=e;r&&(u=r);const h=[],m=a&&t.animationState&&t.animationState.getState()[a];for(const y in f){const g=t.getValue(y,t.latestValues[y]??null),v=f[y];if(v===void 0||m&&gq(m,y))continue;const S={delay:n,...fg(u||{},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 C=D_(t);if(C){const _=window.MotionHandoffAnimation(C,y,it);_!==null&&(S.startTime=_,T=!0)}}Im(t,y),g.start(Tg(y,g,v,t.shouldReduceMotion&&e_.has(y)?{type:!1}:S,t,T));const M=g.animation;M&&h.push(M)}return c&&Promise.all(h).then(()=>{it.update(()=>{c&&aq(t,c)})}),h}function $_(t,e,n,r=0,a=1){const u=Array.from(t).sort((m,y)=>m.sortNodePosition(y)).indexOf(e),c=t.size,f=(c-1)*r;return typeof n=="function"?n(u,c):a===1?u*r:f-u*r}function Hm(t,e,n={}){const r=jo(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const u=r?()=>Promise.all(N_(t,r,n)):()=>Promise.resolve(),c=t.variantChildren&&t.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:y,staggerDirection:g}=a;return bq(t,e,h,m,y,g,n)}:()=>Promise.resolve(),{when:f}=a;if(f){const[h,m]=f==="beforeChildren"?[u,c]:[c,u];return h().then(()=>m())}else return Promise.all([u(),c(n.delay)])}function bq(t,e,n=0,r=0,a=0,u=1,c){const f=[];for(const h of t.variantChildren)h.notify("AnimationStart",e),f.push(Hm(h,e,{...c,delay:n+(typeof r=="function"?0:r)+$_(t.variantChildren,h,r,a,u)}).then(()=>h.notify("AnimationComplete",e)));return Promise.all(f)}function vq(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const a=e.map(u=>Hm(t,u,n));r=Promise.all(a)}else if(typeof e=="string")r=Hm(t,e,n);else{const a=typeof e=="function"?jo(t,e,n.custom):e;r=Promise.all(N_(t,a,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function j_(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 Sq=yg.length;function B_(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?B_(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Sq;n++){const r=yg[n],a=t.props[r];(xl(a)||a===!1)&&(e[r]=a)}return e}const wq=[...mg].reverse(),xq=mg.length;function Tq(t){return e=>Promise.all(e.map(({animation:n,options:r})=>vq(t,n,r)))}function Aq(t){let e=Tq(t),n=nx(),r=!0;const a=h=>(m,y)=>{const g=jo(t,y,h==="exit"?t.presenceContext?.custom:void 0);if(g){const{transition:v,transitionEnd:S,...x}=g;m={...m,...x,...S}}return m};function u(h){e=h(t)}function c(h){const{props:m}=t,y=B_(t.parent)||{},g=[],v=new Set;let S={},x=1/0;for(let M=0;M<xq;M++){const C=wq[M],_=n[C],R=m[C]!==void 0?m[C]:y[C],G=xl(R),I=C===h?_.isActive:null;I===!1&&(x=M);let ee=R===y[C]&&R!==m[C]&&G;if(ee&&r&&t.manuallyAnimateOnMount&&(ee=!1),_.protectedKeys={...S},!_.isActive&&I===null||!R&&!_.prevProp||jf(R)||typeof R=="boolean")continue;const J=Eq(_.prevProp,R);let X=J||C===h&&_.isActive&&!ee&&G||M>x&&G,he=!1;const pe=Array.isArray(R)?R:[R];let we=pe.reduce(a(C),{});I===!1&&(we={});const{prevResolvedValues:je={}}=_,ve={...je,...we},Z=U=>{X=!0,v.has(U)&&(he=!0,v.delete(U)),_.needsAnimating[U]=!0;const L=t.getValue(U);L&&(L.liveStyle=!1)};for(const U in ve){const L=we[U],te=je[U];if(S.hasOwnProperty(U))continue;let oe=!1;Pm(L)&&Pm(te)?oe=!j_(L,te):oe=L!==te,oe?L!=null?Z(U):v.add(U):L!==void 0&&v.has(U)?Z(U):_.protectedKeys[U]=!0}_.prevProp=R,_.prevResolvedValues=we,_.isActive&&(S={...S,...we}),r&&t.blockInitialAnimation&&(X=!1);const ne=ee&&J;X&&(!ne||he)&&g.push(...pe.map(U=>{const L={type:C};if(typeof U=="string"&&r&&!ne&&t.manuallyAnimateOnMount&&t.parent){const{parent:te}=t,oe=jo(te,U);if(te.enteringChildren&&oe){const{delayChildren:E}=oe.transition||{};L.delay=$_(te.enteringChildren,t,E)}}return{animation:U,options:L}}))}if(v.size){const M={};if(typeof m.initial!="boolean"){const C=jo(t,Array.isArray(m.initial)?m.initial[0]:m.initial);C&&C.transition&&(M.transition=C.transition)}v.forEach(C=>{const _=t.getBaseTarget(C),R=t.getValue(C);R&&(R.liveStyle=!0),M[C]=_??null}),g.push({animation:M})}let T=!!g.length;return r&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(T=!1),r=!1,T?e(g):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();t.variantChildren?.forEach(g=>g.animationState?.setActive(h,m)),n[h].isActive=m;const y=c(h);for(const g in n)n[g].protectedKeys={};return y}return{animateChanges:c,setActive:f,setAnimateFunction:u,getState:()=>n,reset:()=>{n=nx()}}}function Eq(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!j_(e,t):!1}function ds(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nx(){return{animate:ds(!0),whileInView:ds(),whileHover:ds(),whileTap:ds(),whileDrag:ds(),whileFocus:ds(),exit:ds()}}class Gr{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Oq extends Gr{constructor(e){super(e),e.animationState||(e.animationState=Aq(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();jf(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 _q=0;class Rq extends Gr{constructor(){super(...arguments),this.id=_q++}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 a=this.node.animationState.setActive("exit",!e);n&&!e&&a.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 Cq={animation:{Feature:Oq},exit:{Feature:Rq}};function Al(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Ul(t){return{point:{x:t.pageX,y:t.pageY}}}const kq=t=>e=>pg(e)&&t(e,Ul(e));function ol(t,e,n,r){return Al(t,e,kq(n),r)}const z_=1e-4,Mq=1-z_,Dq=1+z_,L_=.01,Nq=0-L_,$q=0+L_;function Wt(t){return t.max-t.min}function jq(t,e,n){return Math.abs(t-e)<=n}function ix(t,e,n,r=.5){t.origin=r,t.originPoint=rt(e.min,e.max,t.origin),t.scale=Wt(n)/Wt(e),t.translate=rt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Mq&&t.scale<=Dq||isNaN(t.scale))&&(t.scale=1),(t.translate>=Nq&&t.translate<=$q||isNaN(t.translate))&&(t.translate=0)}function al(t,e,n,r){ix(t.x,e.x,n.x,r?r.originX:void 0),ix(t.y,e.y,n.y,r?r.originY:void 0)}function rx(t,e,n){t.min=n.min+e.min,t.max=t.min+Wt(e)}function Bq(t,e,n){rx(t.x,e.x,n.x),rx(t.y,e.y,n.y)}function sx(t,e,n){t.min=e.min-n.min,t.max=t.min+Wt(e)}function ll(t,e,n){sx(t.x,e.x,n.x),sx(t.y,e.y,n.y)}function Ln(t){return[t("x"),t("y")]}const V_=({current:t})=>t?t.ownerDocument.defaultView:null,ox=(t,e)=>Math.abs(t-e);function zq(t,e){const n=ox(t.x,e.x),r=ox(t.y,e.y);return Math.sqrt(n**2+r**2)}class U_{constructor(e,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:u=!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=jp(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,x=zq(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!x)return;const{point:T}=v,{timestamp:M}=Ht;this.history.push({...T,timestamp:M});const{onStart:C,onMove:_}=this.handlers;S||(C&&C(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=$p(S,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:x,onSessionEnd:T,resumeAnimation:M}=this.handlers;if(this.dragSnapToOrigin&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=jp(v.type==="pointercancel"?this.lastMoveEventInfo:$p(S,this.transformPagePoint),this.history);this.startEvent&&x&&x(v,C),T&&T(v,C)},!pg(e))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=a||window;const f=Ul(e),h=$p(f,this.transformPagePoint),{point:m}=h,{timestamp:y}=Ht;this.history=[{...m,timestamp:y}];const{onSessionStart:g}=n;g&&g(e,jp(h,this.history)),this.removeListeners=zl(ol(this.contextWindow,"pointermove",this.handlePointerMove),ol(this.contextWindow,"pointerup",this.handlePointerUp),ol(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Vr(this.updatePoint)}}function $p(t,e){return e?{point:e(t.point)}:t}function ax(t,e){return{x:t.x-e.x,y:t.y-e.y}}function jp({point:t},e){return{point:t,delta:ax(t,K_(e)),offset:ax(t,Lq(e)),velocity:Vq(e,.1)}}function Lq(t){return t[0]}function K_(t){return t[t.length-1]}function Vq(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const a=K_(t);for(;n>=0&&(r=t[n],!(a.timestamp-r.timestamp>pi(e)));)n--;if(!r)return{x:0,y:0};const u=qn(a.timestamp-r.timestamp);if(u===0)return{x:0,y:0};const c={x:(a.x-r.x)/u,y:(a.y-r.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function Uq(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?rt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?rt(n,t,r.max):Math.min(t,n)),t}function lx(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 Kq(t,{top:e,left:n,bottom:r,right:a}){return{x:lx(t.x,n,a),y:lx(t.y,e,r)}}function ux(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 qq(t,e){return{x:ux(t.x,e.x),y:ux(t.y,e.y)}}function Pq(t,e){let n=.5;const r=Wt(t),a=Wt(e);return a>r?n=vl(e.min,e.max-r,t.min):r>a&&(n=vl(t.min,t.max-a,e.min)),Zi(0,1,n)}function Iq(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 Fm=.35;function Hq(t=Fm){return t===!1?t=0:t===!0&&(t=Fm),{x:cx(t,"left","right"),y:cx(t,"top","bottom")}}function cx(t,e,n){return{min:fx(t,e),max:fx(t,n)}}function fx(t,e){return typeof t=="number"?t:t[e]||0}const Fq=new WeakMap;class Gq{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=yt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const u=g=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ul(g).point)},c=(g,v)=>{const{drag:S,dragPropagation:x,onDragStart:T}=this.getProps();if(S&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rK(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),Ln(C=>{let _=this.getAxisMotionValue(C).get()||0;if(mi.test(_)){const{projection:R}=this.visualElement;if(R&&R.layout){const G=R.layout.layoutBox[C];G&&(_=Wt(G)*(parseFloat(_)/100))}}this.originPoint[C]=_}),T&&it.postRender(()=>T(g,v)),Im(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},f=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:S,dragDirectionLock:x,onDirectionLock:T,onDrag:M}=this.getProps();if(!S&&!this.openDragLock)return;const{offset:C}=v;if(x&&this.currentDirection===null){this.currentDirection=Yq(C),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",v.point,C),this.updateAxis("y",v.point,C),this.visualElement.render(),M&&M(g,v)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>Ln(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:y}=this.getProps();this.panSession=new U_(e,{onSessionStart:u,onStart:c,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:r,contextWindow:V_(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,a=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!a||!r)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:f}=this.getProps();f&&it.postRender(()=>f(r,a))}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:a}=this.getProps();if(!r||!vc(e,a,this.currentDirection))return;const u=this.getAxisMotionValue(e);let c=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(c=Uq(c,this.constraints[e],this.elastic[e])),u.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,a=this.constraints;e&&Ao(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Kq(r.layoutBox,e):this.constraints=!1,this.elastic=Hq(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ln(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=Iq(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ao(e))return!1;const r=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const u=JK(r,a.root,this.visualElement.getTransformPagePoint());let c=qq(a.layout.layoutBox,u);if(n){const f=n(FK(c));this.hasMutatedConstraints=!!f,f&&(c=A_(f))}return c}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=Ln(y=>{if(!vc(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=a?200:1e6,S=a?40:1e7,x={type:"inertia",velocity:r?e[y]:0,bounceStiffness:v,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...g};return this.startAxisValueAnimation(y,x)});return Promise.all(m).then(f)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Im(this.visualElement,e),r.start(Tg(e,r,0,n,this.visualElement,!1))}stopAnimation(){Ln(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ln(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(),a=r[n];return a||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Ln(n=>{const{drag:r}=this.getProps();if(!vc(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,u=this.getAxisMotionValue(n);if(a&&a.layout){const{min:c,max:f}=a.layout.layoutBox[n];u.set(e[n]-rt(c,f,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ao(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Ln(c=>{const f=this.getAxisMotionValue(c);if(f&&this.constraints!==!1){const h=f.get();a[c]=Pq({min:h,max:h},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ln(c=>{if(!vc(c,e,null))return;const f=this.getAxisMotionValue(c),{min:h,max:m}=this.constraints[c];f.set(rt(h,m,a[c]))})}addListeners(){if(!this.visualElement.current)return;Fq.set(this.visualElement,this);const e=this.visualElement.current,n=ol(e,"pointerdown",h=>{const{drag:m,dragListener:y=!0}=this.getProps();m&&y&&this.start(h)}),r=()=>{const{dragConstraints:h}=this.getProps();Ao(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,u=a.addEventListener("measure",r);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),it.read(r);const c=Al(window,"resize",()=>this.scalePositionWithinConstraints()),f=a.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(Ln(y=>{const g=this.getAxisMotionValue(y);g&&(this.originPoint[y]+=h[y].translate,g.set(g.get()+h[y].translate))}),this.visualElement.render())}));return()=>{c(),n(),u(),f&&f()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:u=!1,dragElastic:c=Fm,dragMomentum:f=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:u,dragElastic:c,dragMomentum:f}}}function vc(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Yq(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Jq extends Gr{constructor(e){super(e),this.removeGroupControls=Pn,this.removeListeners=Pn,this.controls=new Gq(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Pn}unmount(){this.removeGroupControls(),this.removeListeners()}}const dx=t=>(e,n)=>{t&&it.postRender(()=>t(e,n))};class Xq extends Gr{constructor(){super(...arguments),this.removePointerDownListener=Pn}onPointerDown(e){this.session=new U_(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V_(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:dx(e),onStart:dx(n),onMove:r,onEnd:(u,c)=>{delete this.session,a&&it.postRender(()=>a(u,c))}}}mount(){this.removePointerDownListener=ol(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 $c={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function hx(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ja={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(de.test(t))t=parseFloat(t);else return t;const n=hx(t,e.target.x),r=hx(t,e.target.y);return`${n}% ${r}%`}},Zq={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,a=Ur.parse(t);if(a.length>5)return r;const u=Ur.createTransformer(t),c=typeof a[0]!="number"?1:0,f=n.x.scale*e.x,h=n.y.scale*e.y;a[0+c]/=f,a[1+c]/=h;const m=rt(f,h,.5);return typeof a[2+c]=="number"&&(a[2+c]/=m),typeof a[3+c]=="number"&&(a[3+c]/=m),u(a)}};let Bp=!1;class Qq extends $.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:u}=e;SK(Wq),u&&(n.group&&n.group.add(u),r&&r.register&&a&&r.register(u),Bp&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),$c.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:a,isPresent:u}=this.props,{projection:c}=r;return c&&(c.isPresent=u,Bp=!0,a||e.layoutDependency!==n||n===void 0||e.isPresent!==u?c.willUpdate():this.safeToRemove(),e.isPresent!==u&&(u?c.promote():c.relegate()||it.postRender(()=>{const f=c.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hg.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=e;Bp=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function q_(t){const[e,n]=hK(),r=$.useContext(SO);return F.jsx(Qq,{...t,layoutGroup:r,switchLayoutGroup:$.useContext(x_),isPresent:e,safeToRemove:n})}const Wq={borderRadius:{...Ja,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ja,borderTopRightRadius:Ja,borderBottomLeftRadius:Ja,borderBottomRightRadius:Ja,boxShadow:Zq};function e6(t,e,n){const r=Jt(t)?t:Io(t);return r.start(Tg("",r,e,n)),r.animation}const t6=(t,e)=>t.depth-e.depth;class n6{constructor(){this.children=[],this.isDirty=!1}add(e){Yy(this.children,e),this.isDirty=!0}remove(e){Jy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(t6),this.isDirty=!1,this.children.forEach(e)}}function i6(t,e){const n=fn.now(),r=({timestamp:a})=>{const u=a-n;u>=e&&(Vr(r),t(u-e))};return it.setup(r,!0),()=>Vr(r)}const P_=["TopLeft","TopRight","BottomLeft","BottomRight"],r6=P_.length,px=t=>typeof t=="string"?parseFloat(t):t,mx=t=>typeof t=="number"||de.test(t);function s6(t,e,n,r,a,u){a?(t.opacity=rt(0,n.opacity??1,o6(r)),t.opacityExit=rt(e.opacity??1,0,a6(r))):u&&(t.opacity=rt(e.opacity??1,n.opacity??1,r));for(let c=0;c<r6;c++){const f=`border${P_[c]}Radius`;let h=yx(e,f),m=yx(n,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||mx(h)===mx(m)?(t[f]=Math.max(rt(px(h),px(m),r),0),(mi.test(m)||mi.test(h))&&(t[f]+="%")):t[f]=m}(e.rotate||n.rotate)&&(t.rotate=rt(e.rotate||0,n.rotate||0,r))}function yx(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const o6=I_(0,.5,MO),a6=I_(.5,.95,Pn);function I_(t,e,n){return r=>r<t?0:r>e?1:n(vl(t,e,r))}function gx(t,e){t.min=e.min,t.max=e.max}function Bn(t,e){gx(t.x,e.x),gx(t.y,e.y)}function bx(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function vx(t,e,n,r,a){return t-=e,t=of(t,1/n,r),a!==void 0&&(t=of(t,1/a,r)),t}function l6(t,e=0,n=1,r=.5,a,u=t,c=t){if(mi.test(e)&&(e=parseFloat(e),e=rt(c.min,c.max,e/100)-c.min),typeof e!="number")return;let f=rt(u.min,u.max,r);t===u&&(f-=e),t.min=vx(t.min,e,n,f,a),t.max=vx(t.max,e,n,f,a)}function Sx(t,e,[n,r,a],u,c){l6(t,e[n],e[r],e[a],e.scale,u,c)}const u6=["x","scaleX","originX"],c6=["y","scaleY","originY"];function wx(t,e,n,r){Sx(t.x,e,u6,n?n.x:void 0,r?r.x:void 0),Sx(t.y,e,c6,n?n.y:void 0,r?r.y:void 0)}function xx(t){return t.translate===0&&t.scale===1}function H_(t){return xx(t.x)&&xx(t.y)}function Tx(t,e){return t.min===e.min&&t.max===e.max}function f6(t,e){return Tx(t.x,e.x)&&Tx(t.y,e.y)}function Ax(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function F_(t,e){return Ax(t.x,e.x)&&Ax(t.y,e.y)}function Ex(t){return Wt(t.x)/Wt(t.y)}function Ox(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class d6{constructor(){this.members=[]}add(e){Yy(this.members,e),e.scheduleRender()}remove(e){if(Jy(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(a=>e===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const u=this.members[a];if(u.isPresent!==!1){r=u;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:a}=e.options;a===!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 h6(t,e,n){let r="";const a=t.x.translate/e.x,u=t.y.translate/e.y,c=n?.z||0;if((a||u||c)&&(r=`translate3d(${a}px, ${u}px, ${c}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:m,rotate:y,rotateX:g,rotateY:v,skewX:S,skewY:x}=n;m&&(r=`perspective(${m}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 f=t.x.scale*e.x,h=t.y.scale*e.y;return(f!==1||h!==1)&&(r+=`scale(${f}, ${h})`),r||"none"}const zp=["","X","Y","Z"],p6=1e3;let m6=0;function Lp(t,e,n,r){const{latestValues:a}=e;a[t]&&(n[t]=a[t],e.setStaticValue(t,0),r&&(r[t]=0))}function G_(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=D_(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(a||u))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&G_(r)}function Y_({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},f=e?.()){this.id=m6++,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(b6),this.nodes.forEach(x6),this.nodes.forEach(T6),this.nodes.forEach(v6)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new n6)}addEventListener(c,f){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Qy),this.eventHandlers.get(c).add(f)}notifyListeners(c,...f){const h=this.eventHandlers.get(c);h&&h.notify(...f)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=u_(c)&&!cK(c),this.instance=c;const{layoutId:f,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||f)&&(this.isLayoutDirty=!0),t){let y,g=0;const v=()=>this.root.updateBlockedByResize=!1;it.read(()=>{g=window.innerWidth}),t(c,()=>{const S=window.innerWidth;S!==g&&(g=S,this.root.updateBlockedByResize=!0,y&&y(),y=i6(v,250),$c.hasAnimatedSinceResize&&($c.hasAnimatedSinceResize=!1,this.nodes.forEach(Cx)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||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||m.getDefaultTransition()||R6,{onLayoutAnimationStart:T,onLayoutAnimationComplete:M}=m.getProps(),C=!this.targetLayout||!F_(this.targetLayout,S),_=!g&&v;if(this.options.layoutRoot||this.resumeFrom||_||g&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...fg(x,"layout"),onPlay:T,onComplete:M};(m.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(y,_)}else g||Cx(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(),Vr(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(A6),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&&G_(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:f,layout:h}=this.options;if(f===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_x);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Rx);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(w6),this.nodes.forEach(y6),this.nodes.forEach(g6)):this.nodes.forEach(Rx),this.clearAllSnapshots();const f=fn.now();Ht.delta=Zi(0,1e3/60,f-Ht.timestamp),Ht.timestamp=f,Ht.isProcessing=!0,Op.update.process(Ht),Op.preRender.process(Ht),Op.render.process(Ht),Ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(S6),this.sharedNodes.forEach(E6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Wt(this.snapshot.measuredBox.x)&&!Wt(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=yt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(f=!1),f&&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(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!H_(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,y=m!==this.prevTransformTemplateValue;c&&this.instance&&(f||ms(this.latestValues)||y)&&(a(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const f=this.measurePageBox();let h=this.removeElementScroll(f);return c&&(h=this.removeTransform(h)),C6(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return yt();const f=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(k6))){const{scroll:m}=this.root;m&&(Eo(f.x,m.offset.x),Eo(f.y,m.offset.y))}return f}removeElementScroll(c){const f=yt();if(Bn(f,c),this.scroll?.wasRoot)return f;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:y,options:g}=m;m!==this.root&&y&&g.layoutScroll&&(y.wasRoot&&Bn(f,c),Eo(f.x,y.offset.x),Eo(f.y,y.offset.y))}return f}applyTransform(c,f=!1){const h=yt();Bn(h,c);for(let m=0;m<this.path.length;m++){const y=this.path[m];!f&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Oo(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),ms(y.latestValues)&&Oo(h,y.latestValues)}return ms(this.latestValues)&&Oo(h,this.latestValues),h}removeTransform(c){const f=yt();Bn(f,c);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!ms(m.latestValues))continue;Um(m.latestValues)&&m.updateSnapshot();const y=yt(),g=m.measurePageBox();Bn(y,g),wx(f,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,y)}return ms(this.latestValues)&&wx(f,this.latestValues),f}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!==Ht.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==f;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=Ht.timestamp,!this.targetDelta&&!this.relativeTarget){const v=this.getClosestProjectingParent();v&&v.layout&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=yt(),this.relativeTargetOrigin=yt(),ll(this.relativeTargetOrigin,this.layout.layoutBox,v.layout.layoutBox),Bn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=yt(),this.targetWithTransforms=yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bq(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Bn(this.target,this.layout.layoutBox),O_(this.target,this.targetDelta)):Bn(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=yt(),this.relativeTargetOrigin=yt(),ll(this.relativeTargetOrigin,this.target,v.target),Bn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Um(this.parent.latestValues)||E_(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(),f=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Ht.timestamp&&(h=!1),h)return;const{layout:m,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||!(m||y))return;Bn(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;YK(this.layoutCorrected,this.treeScale,this.path,f),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=yt());const{target:S}=c;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bx(this.prevProjectionDelta.x,this.projectionDelta.x),bx(this.prevProjectionDelta.y,this.projectionDelta.y)),al(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!Ox(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ox(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 f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_o(),this.projectionDelta=_o(),this.projectionDeltaWithTransform=_o()}setAnimationOrigin(c,f=!1){const h=this.snapshot,m=h?h.latestValues:{},y={...this.latestValues},g=_o();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const v=yt(),S=h?h.source:void 0,x=this.layout?this.layout.source:void 0,T=S!==x,M=this.getStack(),C=!M||M.members.length<=1,_=!!(T&&!C&&this.options.crossfade===!0&&!this.path.some(_6));this.animationProgress=0;let R;this.mixTargetDelta=G=>{const I=G/1e3;kx(g.x,c.x,I),kx(g.y,c.y,I),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ll(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),O6(this.relativeTarget,this.relativeTargetOrigin,v,I),R&&f6(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=yt()),Bn(R,this.relativeTarget)),T&&(this.animationValues=y,s6(y,m,this.latestValues,I,_,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Vr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{$c.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Io(0)),this.currentAnimation=e6(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),c.onUpdate&&c.onUpdate(f)},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(p6),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:f,target:h,layout:m,latestValues:y}=c;if(!(!f||!h||!m)){if(this!==c&&this.layout&&m&&J_(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||yt();const g=Wt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Wt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Bn(f,h),Oo(f,y),al(this.projectionDeltaWithTransform,this.layoutCorrected,f,y)}}registerSharedNode(c,f){this.sharedNodes.has(c)||this.sharedNodes.set(c,new d6),this.sharedNodes.get(c).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):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:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let f=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)return;const m={};h.z&&Lp("z",c,m,this.animationValues);for(let y=0;y<zp.length;y++)Lp(`rotate${zp[y]}`,c,m,this.animationValues),Lp(`skew${zp[y]}`,c,m,this.animationValues);c.render();for(const y in m)c.setStaticValue(y,m[y]),this.animationValues&&(this.animationValues[y]=m[y]);c.scheduleRender()}applyProjectionStyles(c,f){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=Nc(f?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Nc(f?.pointerEvents)||""),this.hasProjected&&!ms(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const y=m.animationValues||m.latestValues;this.applyTransformsToTarget();let g=h6(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`,m.animationValues?c.opacity=m===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:c.opacity=m===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const x in Tl){if(y[x]===void 0)continue;const{correct:T,applyTo:M,isCSSVariable:C}=Tl[x],_=g==="none"?y[x]:T(y[x],m);if(M){const R=M.length;for(let G=0;G<R;G++)c[M[G]]=_}else C?this.options.visualElement.renderState.vars[x]=_:c[x]=_}this.options.layoutId&&(c.pointerEvents=m===this?Nc(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(_x),this.root.sharedNodes.clear()}}}function y6(t){t.updateLayout()}function g6(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:a}=t.options,u=e.source!==t.layout.source;a==="size"?Ln(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Wt(g);g.min=n[y].min,g.max=g.min+v}):J_(a,e.layoutBox,n)&&Ln(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Wt(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=_o();al(c,n,e.layoutBox);const f=_o();u?al(f,t.applyTransform(r,!0),e.measuredBox):al(f,n,e.layoutBox);const h=!H_(c);let m=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:g,layout:v}=y;if(g&&v){const S=yt();ll(S,e.layoutBox,g.layoutBox);const x=yt();ll(x,n,v.layoutBox),F_(S,x)||(m=!0),y.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=S,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:f,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function b6(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 v6(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function S6(t){t.clearSnapshot()}function _x(t){t.clearMeasurements()}function Rx(t){t.isLayoutDirty=!1}function w6(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Cx(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function x6(t){t.resolveTargetDelta()}function T6(t){t.calcProjection()}function A6(t){t.resetSkewAndRotation()}function E6(t){t.removeLeadSnapshot()}function kx(t,e,n){t.translate=rt(e.translate,0,n),t.scale=rt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Mx(t,e,n,r){t.min=rt(e.min,n.min,r),t.max=rt(e.max,n.max,r)}function O6(t,e,n,r){Mx(t.x,e.x,n.x,r),Mx(t.y,e.y,n.y,r)}function _6(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const R6={duration:.45,ease:[.4,0,.1,1]},Dx=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Nx=Dx("applewebkit/")&&!Dx("chrome/")?Math.round:Pn;function $x(t){t.min=Nx(t.min),t.max=Nx(t.max)}function C6(t){$x(t.x),$x(t.y)}function J_(t,e,n){return t==="position"||t==="preserve-aspect"&&!jq(Ex(e),Ex(n),.2)}function k6(t){return t!==t.root&&t.scroll?.wasRoot}const M6=Y_({attachResizeListener:(t,e)=>Al(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Vp={current:void 0},X_=Y_({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Vp.current){const t=new M6({});t.mount(window),t.setOptions({layoutScroll:!0}),Vp.current=t}return Vp.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),D6={pan:{Feature:Xq},drag:{Feature:Jq,ProjectionNode:X_,MeasureLayout:q_}};function jx(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,u=r[a];u&&it.postRender(()=>u(e,Ul(e)))}class N6 extends Gr{mount(){const{current:e}=this.node;e&&(this.unmount=sK(e,(n,r)=>(jx(this.node,r,"Start"),a=>jx(this.node,a,"End"))))}unmount(){}}class $6 extends Gr{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=zl(Al(this.node.current,"focus",()=>this.onFocus()),Al(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Bx(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 a="onTap"+(n==="End"?"":n),u=r[a];u&&it.postRender(()=>u(e,Ul(e)))}class j6 extends Gr{mount(){const{current:e}=this.node;e&&(this.unmount=uK(e,(n,r)=>(Bx(this.node,r,"Start"),(a,{success:u})=>Bx(this.node,a,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Gm=new WeakMap,Up=new WeakMap,B6=t=>{const e=Gm.get(t.target);e&&e(t)},z6=t=>{t.forEach(B6)};function L6({root:t,...e}){const n=t||document;Up.has(n)||Up.set(n,{});const r=Up.get(n),a=JSON.stringify(e);return r[a]||(r[a]=new IntersectionObserver(z6,{root:t,...e})),r[a]}function V6(t,e,n){const r=L6(e);return Gm.set(t,n),r.observe(t),()=>{Gm.delete(t),r.unobserve(t)}}const U6={some:0,all:1};class K6 extends Gr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:u}=e,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:U6[a]},f=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,u&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:y,onViewportLeave:g}=this.node.getProps(),v=m?y:g;v&&v(h)};return V6(this.node.current,c,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(q6(e,n))&&this.startObserver()}unmount(){}}function q6({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const P6={inView:{Feature:K6},tap:{Feature:j6},focus:{Feature:$6},hover:{Feature:N6}},I6={layout:{ProjectionNode:X_,MeasureLayout:q_}},H6={...Cq,...P6,...D6,...I6},F6=HK(H6,rq);function G6(){const t=Wn(Po),e=Wn(di),n=Wn(Hi),r=Et(Po),a=Et(di),u=Et(Hi),c=`email-${$.useId()}`,f=`password-${$.useId()}`,h=`one-time-code-${$.useId()}`,[m,y]=$.useState(null),[g,v]=$.useState("email"),S=`form-${$.useId()}`;return $.useEffect(()=>{if(u.length===6){const x=document.getElementById(S);x instanceof HTMLFormElement&&x.requestSubmit()}},[u]),F.jsx("form",{id:S,onSubmit:async x=>{x.preventDefault();const T=nt(ui);try{switch(g){case"email":{const{nextStep:M,userKey:C}=await cn.declareAuthTarget.query({email:r});switch(De(ui,C),M){case"otc_login":case"otc_verify":{v("otc");break}case"password_login":{v("password");break}}break}case"otc":{if(!T){console.error("somehow userKey is null");return}const M=await cn.verifyAccountAction.mutate({oneTimeCode:u,userKey:T});De(ut,M),gi.once("connect",()=>{Os("/game"),t(""),n("")});break}case"password":{const M=await cn.openSession.mutate({email:r,password:a});De(ut,M),gi.once("connect",()=>{Os("/game"),t(""),e("")});break}}}catch(M){M instanceof bl&&y(M.message)}},children:F.jsxs("main",{children:[m?F.jsx("aside",{children:m}):null,F.jsxs(F6.label,{htmlFor:c,children:[F.jsx("span",{children:"Email"}),F.jsx("input",{id:c,type:"text",value:r,onChange:x=>{t(x.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:g!=="email"})]}),g==="password"?F.jsxs("label",{htmlFor:f,children:[F.jsx("span",{children:"Password"}),F.jsx("input",{id:f,type:"password",value:a,onChange:x=>{e(x.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:g==="password"})]}):null,g==="otc"?F.jsxs("label",{htmlFor:h,children:[F.jsx("span",{children:"One-time Code"}),F.jsx("input",{id:h,type:"number",inputMode:"numeric",enterKeyHint:"go",value:u,onChange:x=>{n(x.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:g==="otc"})]}):null,F.jsxs("footer",{children:[g==="password"?F.jsx("button",{type:"button",onClick:async()=>{const x=nt(ui);if(!x)return new Error("No userKey");await cn.startPasswordReset.mutate({userKey:x}),v("otc")},children:"Forgot Password?"}):null,F.jsx("span",{}),F.jsx("button",{type:"submit",disabled:!r&&g==="email"||!a&&g==="password"||!u&&g==="otc",children:">>->"})]})]})})}function Y6({route:[,t]}){const e=Et(ut),n=Et(Hi),r=Wn(Hi),a=`code-${$.useId()}`;return $.useEffect(()=>{t&&r(t)},[]),e?F.jsx("form",{onSubmit:async u=>{u.preventDefault();try{const c=await cn.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});De(ut,c),c.action==="resetPassword"?Os("/account"):Os("/game")}catch(c){console.error(c)}},children:F.jsxs("main",{children:[F.jsx("p",{children:"Check your email for a verification code."}),F.jsxs("label",{htmlFor:a,children:[F.jsx("span",{children:"Verification code"}),F.jsx("input",{id:a,type:"text",value:n,onChange:u=>{r(u.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})}):F.jsx("p",{children:"You must be logged in to verify your account."})}function J6(){const t=Et(r4),e=Et(ut),[n,r]=$.useState(!1),{refs:a,floatingStyles:u,context:c}=K2({open:n,onOpenChange:r,placement:"bottom-end",middleware:[d2(5),p2(),h2()],whileElementsMounted:r2}),f=B2(c),h=V2(c),m=I2(c),{getReferenceProps:y,getFloatingProps:g}=q2([f,h,m]),v=Et(FL);return F.jsxs("main",{className:Bz.class,children:[F.jsxs("header",{children:[F.jsxs("main",{children:[F.jsx(jz,{}),F.jsx("span",{children:F.jsx(zz,{input:v})})]}),F.jsx("button",{"data-css":"profile",ref:a.setReference,...y(),children:e?.username?e.username.slice(0,2):""}),n&&e&&F.jsx($2,{context:c,modal:!1,children:F.jsxs("div",{"data-css":"profile-actions",ref:a.setFloating,style:u,...g(),children:[F.jsx("span",{children:e.username}),F.jsx("button",{type:"button",onClick:()=>{Os("/account")},children:"Account"}),F.jsx("button",{type:"button",onClick:async()=>{e&&(await cn.closeSession.mutate({username:e.username}),gi.once("disconnect",()=>{De(ut,null),Os("/")}),gi.disconnect())},children:"Sign out"})]})})]}),F.jsx("main",{children:typeof t=="number"?F.jsxs("article",{children:[F.jsx("h1",{children:t}),F.jsx("h2",{children:JSON.parse(jE[t])}),F.jsx(BE,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(t[0]){case void 0:return F.jsx(G6,{});case"admin":return F.jsx(u4,{});case"game":return F.jsx(f4,{route:t});case"verify":return F.jsx(Y6,{route:t});case"account":return F.jsx(l4,{})}})()})]})}LM.createRoot(document.getElementById("root")).render(F.jsx($.StrictMode,{children:F.jsx(CM,{socket:gi,children:F.jsx(J6,{})})}));
|
|
66
|
+
fn("string", ":", "number")(s => s.length)`;class q3 extends Hr{$;constructor(e){super((...n)=>new fc(e)(...n),{bind:e}),this.$=e}in(e){return new fc(this.$,e===void 0?void 0:this.$.parse(e))}at(e,n){return new fc(this.$).at(e,n)}case(e,n){return new fc(this.$).case(e,n)}}class fc extends Hr{$;in;key;branches=[];constructor(e,n){super(r=>this.caseEntries(Object.entries(r).map(([a,u])=>a==="default"?[a,u]:[this.$.parse(a),u]))),this.$=e,this.in=n}at(e,n){return this.key&&Y(I3),this.branches.length&&Y(P3),this.key=e,n?this.match(n):this}case(e,n){return this.caseEntry(this.$.parse(e),n)}caseEntry(e,n){const a=(this.key?this.$.parse({[this.key]:e}):e).pipe(n);return this.branches.push(a),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,a]=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(a);if(typeof a!="function")return Y(`Value for case "${r}" must be a function (was ${ti(a)})`);this.caseEntry(r,a)}return this}default(e){typeof e=="function"&&this.case(me.unknown,e);const n={branches:this.branches,ordered:!0};(e==="never"||e==="assert")&&(n.meta={onFail:Jw});const r=this.$.node("union",n);if(!this.in)return this.$.finalize(r);let a=this.in.pipe(r);return(e==="never"||e==="assert")&&(a=a.configureReferences({onFail:Jw},"self")),this.$.finalize(a)}}const Jw=t=>t.throw(),P3="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",I3="At most one key matcher may be specified per expression",TE=(t,e)=>{if(Xt(t)){if(t[1]==="=")return[e.$.parseOwnDefinitionFormat(t[0],e),"=",t[2]];if(t[1]==="?")return[e.$.parseOwnDefinitionFormat(t[0],e),"?"]}return kE(t,e)},H3="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",F3="Only required keys may specify default values, e.g. { value: 'number = 0' }",G3=(t,e)=>{let n;const r={},a=Fc(t);for(const[c,f]of a){const h=X3(c);if(h.kind==="spread"){if(!Rl(r))return Y(J3);const S=e.$.parseOwnDefinitionFormat(f,e);if(S.equals(me.object))continue;if(!S.hasKind("intersection")||!S.basis?.equals(me.object))return Y(Z3(S.expression));n=S.structure;continue}if(h.kind==="undeclared"){f!=="reject"&&f!=="delete"&&f!=="ignore"&&Y(Y3(f)),r.undeclared=f;continue}const m=TE(f,e),y=h;if(h.kind==="required"){Xt(m)?mp(r,"optional",m[1]==="="?{key:h.normalized,value:m[0],default:m[2]}:{key:h.normalized,value:m[0]},e):mp(r,"required",{key:h.normalized,value:m},e);continue}if(Xt(m)&&(m[1]==="?"&&Y(H3),m[1]==="="&&Y(F3)),h.kind==="optional"){mp(r,"optional",{key:h.normalized,value:m},e);continue}const g=e.$.parseOwnDefinitionFormat(y.normalized,e),v=fm(g,m,e.$);v.index&&(r.index=Fe(r.index,v.index)),v.required&&(r.required=Fe(r.required,v.required))}const u=e.$.node("structure",r);return e.$.parseSchema({domain:"object",structure:n?.merge(u)??u})},mp=(t,e,n,r)=>{t[e]=Fe(t[e],r.$.node(e,n))},Y3=t=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${Ie(t)})`,J3="Spread operator may only be used as the first key in an object",X3=t=>typeof t=="symbol"?{kind:"required",normalized:t}:t[t.length-1]==="?"?t[t.length-2]===tl?{kind:"required",normalized:`${t.slice(0,-2)}?`}:{kind:"optional",normalized:t.slice(0,-1)}:t[0]==="["&&t[t.length-1]==="]"?{kind:"index",normalized:t.slice(1,-1)}:t[0]===tl&&t[1]==="["&&t[t.length-1]==="]"?{kind:"required",normalized:t.slice(1)}:t==="..."?{kind:"spread"}:t==="+"?{kind:"undeclared"}:{kind:"required",normalized:t==="\\..."?"...":t==="\\+"?"+":t},Z3=t=>`Spread operand must resolve to an object literal type (was ${t})`,Q3=(t,e)=>lB(t)?_E[t[0]](t,e):oB(t)?OE[t[1]](t,e):null,W3=(t,e)=>e.$.parseOwnDefinitionFormat(t[1],e).keyof(),yp=(t,e)=>{if(t[2]===void 0)return Y(vE(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 a=t[1]==="&"?Xi(n,r,e.$):lm(n,r,e.$);return a instanceof ae?a.throw():a},eB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).array(),tB=(t,e)=>typeof t[2]!="function"?Y(AE("=>",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).pipe(t[2]),AE=(t,e)=>`${t===":"?"Narrow":"Morph"} expression requires a function following '${t}' (was ${typeof e})`,nB=(t,e)=>typeof t[2]!="function"?Y(AE(":",t[2])):e.$.parseOwnDefinitionFormat(t[0],e).constrain("predicate",t[2]),iB=(t,e)=>e.$.parseOwnDefinitionFormat(t[0],e).configure(t[2],t[3]),EE=t=>t,rB=EE({"[]":eB,"?":()=>Y(pE)}),sB=EE({"|":yp,"&":yp,":":nB,"=>":tB,"|>":yp,"@":iB,"=":()=>Y(mE)}),OE={...rB,...sB},oB=t=>OE[t[1]]!==void 0,aB=t=>t,_E=aB({keyof:W3,instanceof:(t,e)=>{if(typeof t[1]!="function")return Y(Xw(tm(t[1])));const n=t.slice(1).map(r=>typeof r=="function"?e.$.node("proto",{proto:r}):Y(Xw(tm(r))));return n.length===1?n[0]:e.$.node("union",{branches:n})},"===":(t,e)=>e.$.units(t.slice(1))}),lB=t=>_E[t[0]]!==void 0,Xw=t=>`Expected a constructor following 'instanceof' operator (was ${t})`,uB=(t,e)=>{let n=[{}],r=0;for(;r<t.length;){let a=!1;t[r]==="..."&&r<t.length-1&&(a=!0,r++);const u=TE(t[r],e),[c,f,h]=Xt(u)?u:[u];if(r++,a){if(!c.extends(W.intrinsic.Array))return Y(dB(c.expression));n=n.flatMap(m=>c.distribute(y=>fB(dA(m),y)))}else n=n.map(m=>f==="?"?RE(m,c):f==="="?cB(m,c,h):ym(m,c))}return e.$.parseSchema(n.map(a=>Rl(a)?{proto:Array,exactLength:0}:{proto:Array,sequence:a}))},ym=(t,e)=>t.defaultables||t.optionals?Y(t.variadic?JA:hB):(t.variadic?t.postfix=Fe(t.postfix,e):t.prefix=Fe(t.prefix,e),t),RE=(t,e)=>t.variadic?Y(CE):(t.optionals=Fe(t.optionals,e),t),cB=(t,e,n)=>t.variadic?Y(CE):t.optionals?Y(pB):(t.defaultables=Fe(t.defaultables,[[e,n]]),t),Zw=(t,e)=>(t.postfix&&Y(Qw),t.variadic?t.variadic.equals(e)||Y(Qw):t.variadic=e.internal,t),fB=(t,e)=>{const n=e.select({method:"find",kind:"sequence"});if(!n)return Zw(t,W.intrinsic.unknown);if(n.prefix)for(const r of n.prefix)ym(t,r);if(n.optionals)for(const r of n.optionals)RE(t,r);if(n.variadic&&Zw(t,n.variadic),n.postfix)for(const r of n.postfix)ym(t,r);return t},dB=t=>`Spread element must be an array (was ${t})`,Qw="A tuple may have at most one variadic element",hB="A required element may not follow an optional element",CE="An optional element may not follow a variadic element",pB="A defaultable element may not follow an optional element without a default",mB={},kE=(t,e)=>{if(typeof t=="string"){if(e.args&&Object.keys(e.args).some(r=>t.includes(r)))return Gw(t,e);const n=mB[e.$.name]??={};return n[t]??=Gw(t,e)}return Cs(t,"object")?yB(t,e):Y(gm(ti(t)))},yB=(t,e)=>{const n=xy(t);switch(n){case void 0:return fe(t,"root")?t:G3(t,e);case"Array":return gB(t,e);case"RegExp":return e.$.node("intersection",{domain:"string",pattern:t},{prereduced:!0});case"Function":{const r=Sf(t)?t():t;return fe(r,"root")?r:Y(gm("Function"))}default:return Y(gm(n??Ie(t)))}},gB=(t,e)=>Q3(t,e)??uB(t,e),gm=t=>`Type definitions must be strings or objects (was ${t})`;class bB extends Hr{constructor(e){const n=Object.assign({errors:Lr,hkt:Si,$:e,raw:e.parse,module:e.constructor.module,scope:e.constructor.scope,declare:e.declare,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,fn:e.fn},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][r[0].length-1]===">"){const a=r[0].slice(1,-1),u=e.parseGenericParams(a,{});return new Qc(u,r[1],e,e,null)}return e.parse(r)},{attach:n})}}const yl=W;class Rf extends nE{get ambientAttachments(){if(yl.typeAttachments)return this.cacheGetter("ambientAttachments",Ge(yl.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}`,f=this.resolvedConfig.keywords?.[c];return f&&(n=[n,"@",f]),[e,n]}e[e.length-1]!==">"&&Y("'>' must be the last character of a generic declaration in a scope");const a=e.slice(0,r),u=e.slice(r+1,-1);return[a,()=>{const c=this.parseGenericParams(u,{alias:a});return u$(c,n,this)}]}parseGenericParams(e,n){return mm(new oA(e),[],this.createParseContext({...n,def:e,prefix:"generic"}))}normalizeRootScopeValue(e){return Sf(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 a=kE(e,n);if(Xt(a)){if(a[1]==="=")return Y(mE);if(a[1]==="?")return Y(pE)}return a}unit=e=>this.units([e]);valueOf=e=>this.units(rN(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);fn=new V3(this);match=new q3(this);declare=()=>({type:this.type});define(e){return e}type=new bB(this);static scope=((e,n={})=>new Rf(e,n));static module=((e,n={})=>this.scope(e,n).export())}const vB=Object.assign(Rf.scope,{define:t=>t}),ze=Rf;class SB extends Si{description='merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`'}const wB=er(["base",me.object],["props",me.object])(t=>t.base.merge(t.props),SB),xB=ze.module({Key:me.key,Merge:wB});class TB extends Si{}const AB=er("element")(t=>{const e=t.element.exclude(me.Array),n=e.array();return e.rawOr(n).pipe(_l).distribute(r=>r.assertHasKind("morph").declareOut(n),Ye)},TB),EB=ze.module({root:me.Array,readonly:"root",index:me.nonNegativeIntegerString,liftFrom:AB},{name:"Array"}),bm=Ye(["string",Cl.FileConstructor]),OB=bm.rawOr(bm.array()),Ww=Ye({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:OB}}),_B=ze.module({root:["instanceof",FormData],value:bm,parsed:Ww,parse:Ye({in:FormData,morphs:t=>{const e={};for(const[n,r]of t)if(n in e){const a=e[n];typeof a=="string"||a instanceof Cl.FileConstructor?e[n]=[a,r]:a.push(r)}else e[n]=r;return e},declaredOut:Ww})},{name:"FormData"}),RB=ze.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"}),CB={Boolean:1,Number:1,String:1},kB=ze.module({...Ge({...JT,...ZT},(t,e)=>t in CB?[]:[t,["instanceof",e]]),Array:EB,TypedArray:RB,FormData:_B}),MB=Ye({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),DB=Ye({domain:"number",divisor:1}),ME=ze.module({root:me.number,integer:DB,epoch:MB,safe:Ye({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"}),et=(t,e,n)=>{const r={domain:"string",pattern:{rule:t.source,flags:t.flags,meta:e}};return n&&(r.meta={format:n}),By("intersection",r)},e1=et(Gc,"a well-formed integer string"),DE=ze.module({root:e1,parse:Ye({in:e1,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:me.integer})},{name:"string.integer"}),NB=et(/^[\dA-Fa-f]+$/,"hex characters only"),$B=ze.module({root:et(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:et(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),t1=et(/^[A-Z].*$/,"capitalized"),jB=ze.module({root:Ye({in:"string",morphs:t=>t.charAt(0).toUpperCase()+t.slice(1),declaredOut:t1}),preformatted:t1},{name:"string.capitalize"}),BB=t=>{const e=t.replace(/[ -]+/g,"");let n=0,r,a,u=!1;for(let c=e.length-1;c>=0;c--)r=e.substring(c,c+1),a=Number.parseInt(r,10),u?(a*=2,n+=a>=10?a%10+1:a):n+=a,u=!u;return!!(n%10===0&&e)},zB=/^(?: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}))$/,LB=Ye({domain:"string",pattern:{meta:"a credit card number",rule:zB.source},predicate:{meta:"a credit card number",predicate:BB}}),VB=/^([+-]?\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)?)?)?)?$/,UB=t=>!Number.isNaN(new Date(t).valueOf()),n1=Ye({domain:"string",predicate:{meta:"a parsable date",predicate:UB}}).assertHasKind("intersection"),i1=DE.root.internal.narrow((t,e)=>{const n=Number.parseInt(t),r=ME.epoch(n);return r instanceof Lr?(e.errors.merge(r),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),KB=ze.module({root:i1,parse:Ye({in:i1,morphs:t=>new Date(t),declaredOut:me.Date})},{name:"string.date.epoch"}),r1=et(VB,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),qB=ze.module({root:r1,parse:Ye({in:r1,morphs:t=>new Date(t),declaredOut:me.Date})},{name:"string.date.iso"}),PB=ze.module({root:n1,parse:Ye({declaredIn:n1,in:"string",morphs:(t,e)=>{const n=new Date(t);return Number.isNaN(n.valueOf())?e.error("a parsable date"):n},declaredOut:me.Date}),iso:qB,epoch:KB},{name:"string.date"}),IB=et(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),s1="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",Or=`(${s1}[.]){3}${s1}`,HB=new RegExp(`^${Or}$`),Tt="(?:[0-9a-fA-F]{1,4})",FB=new RegExp(`^((?:${Tt}:){7}(?:${Tt}|:)|(?:${Tt}:){6}(?:${Or}|:${Tt}|:)|(?:${Tt}:){5}(?::${Or}|(:${Tt}){1,2}|:)|(?:${Tt}:){4}(?:(:${Tt}){0,1}:${Or}|(:${Tt}){1,3}|:)|(?:${Tt}:){3}(?:(:${Tt}){0,2}:${Or}|(:${Tt}){1,4}|:)|(?:${Tt}:){2}(?:(:${Tt}){0,3}:${Or}|(:${Tt}){1,5}|:)|(?:${Tt}:){1}(?:(:${Tt}){0,4}:${Or}|(:${Tt}){1,6}|:)|(?::((?::${Tt}){0,5}:${Or}|(?::${Tt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),GB=ze.module({root:["v4 | v6","@","an IP address"],v4:et(HB,"an IPv4 address","ipv4"),v6:et(FB,"an IPv6 address","ipv6")},{name:"string.ip"}),Do="a JSON string",NE=t=>{if(!(t instanceof SyntaxError))throw t;return`must be ${Do} (${t})`},YB=Ye({meta:Do,domain:"string",predicate:{meta:Do,predicate:(t,e)=>{try{return JSON.parse(t),!0}catch(n){return e.reject({code:"predicate",expected:Do,problem:NE(n)})}}}}),JB=(t,e)=>{if(t.length===0)return e.error({code:"predicate",expected:Do,actual:"empty"});try{return JSON.parse(t)}catch(n){return e.error({code:"predicate",expected:Do,problem:NE(n)})}},XB=ze.module({root:YB,parse:Ye({meta:"safe JSON string parser",in:"string",morphs:JB,declaredOut:me.jsonObject})},{name:"string.json"}),o1=et(/^[a-z]*$/,"only lowercase letters"),ZB=ze.module({root:Ye({in:"string",morphs:t=>t.toLowerCase(),declaredOut:o1}),preformatted:o1},{name:"string.lower"}),$E=["NFC","NFD","NFKC","NFKD"],jl=Ge($E,(t,e)=>[e,Ye({domain:"string",predicate:n=>n.normalize(e)===n,meta:`${e}-normalized unicode`})]),Cf=Ge($E,(t,e)=>[e,Ye({in:"string",morphs:n=>n.normalize(e),declaredOut:jl[e]})]),QB=ze.module({root:Cf.NFC,preformatted:jl.NFC},{name:"string.normalize.NFC"}),WB=ze.module({root:Cf.NFD,preformatted:jl.NFD},{name:"string.normalize.NFD"}),ez=ze.module({root:Cf.NFKC,preformatted:jl.NFKC},{name:"string.normalize.NFKC"}),tz=ze.module({root:Cf.NFKD,preformatted:jl.NFKD},{name:"string.normalize.NFKD"}),nz=ze.module({root:"NFC",NFC:QB,NFD:WB,NFKC:ez,NFKD:tz},{name:"string.normalize"}),a1=et(nm,"a well-formed numeric string"),iz=ze.module({root:a1,parse:Ye({in:a1,morphs:t=>Number.parseFloat(t),declaredOut:me.number})},{name:"string.numeric"}),l1="a regex pattern",rz=Ye({domain:"string",predicate:{meta:l1,predicate:(t,e)=>{try{return new RegExp(t),!0}catch(n){return e.reject({code:"predicate",expected:l1,problem:String(n)})}}},meta:{format:"regex"}}),sz=/^(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-]+)*))?$/,oz=et(sz,"a semantic version (see https://semver.org/)"),u1=et(/^\S.*\S$|^\S?$/,"trimmed"),az=ze.module({root:Ye({in:"string",morphs:t=>t.trim(),declaredOut:u1}),preformatted:u1},{name:"string.trim"}),c1=et(/^[A-Z]*$/,"only uppercase letters"),lz=ze.module({root:Ye({in:"string",morphs:t=>t.toUpperCase(),declaredOut:c1}),preformatted:c1},{name:"string.upper"}),uz=t=>URL.canParse(t),f1=Ye({domain:"string",predicate:{meta:"a URL string",predicate:uz},meta:{format:"uri"}}),cz=ze.module({root:f1,parse:Ye({declaredIn:f1,in:"string",morphs:(t,e)=>{try{return new URL(t)}catch{return e.error("a URL string")}},declaredOut:Ye(URL)})},{name:"string.url"}),fz=ze.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:et(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:et(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:et(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:et(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:et(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:et(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:et(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:et(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),dz=ze.module({root:me.string,alpha:et(/^[A-Za-z]*$/,"only letters"),alphanumeric:et(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:NB,base64:$B,capitalize:jB,creditCard:LB,date:PB,digits:et(/^\d*$/,"only digits 0-9"),email:IB,integer:DE,ip:GB,json:XB,lower:ZB,normalize:nz,numeric:iz,regex:rz,semver:oz,trim:az,upper:lz,url:cz,uuid:fz},{name:"string"}),hz=ze.module({bigint:me.bigint,boolean:me.boolean,false:me.false,never:me.never,null:me.null,number:me.number,object:me.object,string:me.string,symbol:me.symbol,true:me.true,unknown:me.unknown,undefined:me.undefined}),pz=ze.module({root:me.unknown,any:me.unknown},{name:"unknown"}),mz=ze.module({root:me.jsonObject,stringify:By("morph",{in:me.jsonObject,morphs:t=>JSON.stringify(t),declaredOut:me.string})},{name:"object.json"}),yz=ze.module({root:me.object,json:mz},{name:"object"});class gz extends Si{description='instantiate an object from an index signature and corresponding value type like `Record("string", "number")`'}const bz=er(["K",me.key],"V")(t=>({domain:"object",index:{signature:t.K,value:t.V}}),gz);class vz extends Si{description='pick a set of properties from an object like `Pick(User, "name | age")`'}const Sz=er(["T",me.object],["K",me.key])(t=>t.T.pick(t.K),vz);class wz extends Si{description='omit a set of properties from an object like `Omit(User, "age")`'}const xz=er(["T",me.object],["K",me.key])(t=>t.T.omit(t.K),wz);class Tz extends Si{description="make all named properties of an object optional like `Partial(User)`"}const Az=er(["T",me.object])(t=>t.T.partial(),Tz);class Ez extends Si{description="make all named properties of an object required like `Required(User)`"}const Oz=er(["T",me.object])(t=>t.T.required(),Ez);class _z extends Si{description='exclude branches of a union like `Exclude("boolean", "true")`'}const Rz=er("T","U")(t=>t.T.exclude(t.U),_z);class Cz extends Si{description='extract branches of a union like `Extract("0 | false | 1", "number")`'}const kz=er("T","U")(t=>t.T.extract(t.U),Cz),Mz=ze.module({Exclude:Rz,Extract:kz,Omit:xz,Partial:Az,Pick:Sz,Record:bz,Required:Oz}),Fr=vB({...hz,...Mz,...kB,...xB,string:dz,number:ME,object:yz,unknown:pz},{prereducedAliases:!0,name:"ark"}),jt=Fr.export();Object.assign(yl.ambient,jt);yl.typeAttachments={string:jt.string.root,number:jt.number.root,bigint:jt.bigint,boolean:jt.boolean,symbol:jt.symbol,undefined:jt.undefined,null:jt.null,object:jt.object.root,unknown:jt.unknown.root,false:jt.false,true:jt.true,never:jt.never,arrayIndex:jt.Array.index,Key:jt.Key,Record:jt.Record,Array:jt.Array.root,Date:jt.Date};const Ot=Object.assign(Fr.type,yl.typeAttachments);Fr.match;Fr.fn;Fr.generic;Fr.schema;Fr.define;Fr.declare;const jE={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 Dz(t){return Number.parseInt(t,10)}const Nz=Ot(jE),$z=Nz.keyof().pipe(t=>Dz(t));Ot([$z,"string"]);function jz(t){return F.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...t,children:[F.jsx("title",{children:"Tempest Games Logo"}),F.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),F.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}}),F.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}}),F.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}}),F.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}}),F.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}}),F.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),F.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}}),F.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}}),F.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}}),F.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}}),F.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}}),F.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 BE(t){return F.jsx("a",{...t})}const Bz={class:"_class_1riwg_1"},gp=["⠋","⠙","⠸","⠴","⠦","⠇"];function zz({input:t}){const e=$.useRef(null),[n,r]=$.useState(typeof t=="string"?t:null);return $.useEffect(()=>{let a=!0,u;if(typeof t=="string")r(t);else{let c=0;u=setInterval(()=>{e.current&&(e.current.textContent=gp[c],c=(c+1)%gp.length)},100),t.then(f=>{a&&(clearInterval(u),r(f))})}return()=>{a=!1,u&&clearInterval(u)}},[t]),F.jsx("span",{ref:e,children:n??gp[0]})}var Lz=Object.create,zE=Object.defineProperty,Vz=Object.getOwnPropertyDescriptor,LE=Object.getOwnPropertyNames,Uz=Object.getPrototypeOf,Kz=Object.prototype.hasOwnProperty,wi=(t,e)=>function(){return e||(0,t[LE(t)[0]])((e={exports:{}}).exports,e),e.exports},qz=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=LE(e),u=0,c=a.length,f;u<c;u++)f=a[u],!Kz.call(t,f)&&f!==n&&zE(t,f,{get:(h=>e[h]).bind(null,f),enumerable:!(r=Vz(e,f))||r.enumerable});return t},bt=(t,e,n)=>(n=t!=null?Lz(Uz(t)):{},qz(zE(n,"default",{value:t,enumerable:!0}),t)),VE=wi({"../../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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),Pz=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=VE().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var f=c.call(a,u||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),Iz=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=VE().default,r=Pz();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),ks=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=Iz();function r(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),ni=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ks();function r(u,c){var f=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(m){return Object.getOwnPropertyDescriptor(u,m).enumerable})),f.push.apply(f,h)}return f}function a(u){for(var c=1;c<arguments.length;c++){var f=arguments[c]!=null?arguments[c]:{};c%2?r(Object(f),!0).forEach(function(h){n(u,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(f)):r(Object(f)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(f,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});function kf(t){const e={subscribe(n){let r=null,a=!1,u=!1,c=!1;function f(){if(r===null){c=!0;return}u||(u=!0,typeof r=="function"?r():r&&r.unsubscribe())}return r=t({next(h){var m;a||(m=n.next)===null||m===void 0||m.call(n,h)},error(h){var m;a||(a=!0,(m=n.error)===null||m===void 0||m.call(n,h),f())},complete(){var h;a||(a=!0,(h=n.complete)===null||h===void 0||h.call(n),f())}}),c&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(Hz,e)}};return e}function Hz(t,e){return e(t)}function Fz(t){const e=new AbortController;return new Promise((r,a)=>{let u=!1;function c(){u||(u=!0,f.unsubscribe())}e.signal.addEventListener("abort",()=>{a(e.signal.reason)});const f=t.subscribe({next(h){u=!0,r(h),c()},error(h){a(h)},complete(){e.abort(),c()}})})}function Gz(t){return e=>{let n=0,r=null;const a=[];function u(){r||(r=e.subscribe({next(f){for(const m of a){var h;(h=m.next)===null||h===void 0||h.call(m,f)}},error(f){for(const m of a){var h;(h=m.error)===null||h===void 0||h.call(m,f)}},complete(){for(const h of a){var f;(f=h.complete)===null||f===void 0||f.call(h)}}}))}function c(){if(n===0&&r){const f=r;r=null,f.unsubscribe()}}return kf(f=>(n++,a.push(f),u(),{unsubscribe(){n--,c();const h=a.findIndex(m=>m===f);h>-1&&a.splice(h,1)}}))}}function Yz(t){let e=t;const n=[],r=c=>{e!==void 0&&c.next(e),n.push(c)},a=c=>{n.splice(n.indexOf(c),1)},u=kf(c=>(r(c),()=>{a(c)}));return u.next=c=>{if(e!==c){e=c;for(const f of n)f.next(c)}},u.get=()=>e,u}function Jz(t){return kf(e=>{function n(a=0,u=t.op){const c=t.links[a];if(!c)throw new Error("No more links to execute - did you forget to add an ending link?");return c({op:u,next(h){return n(a+1,h)}})}return n().subscribe(e)})}function gl(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}var Xz=Object.create,UE=Object.defineProperty,Zz=Object.getOwnPropertyDescriptor,KE=Object.getOwnPropertyNames,Qz=Object.getPrototypeOf,Wz=Object.prototype.hasOwnProperty,Bl=(t,e)=>function(){return e||(0,t[KE(t)[0]])((e={exports:{}}).exports,e),e.exports},eL=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(var a=KE(e),u=0,c=a.length,f;u<c;u++)f=a[u],!Wz.call(t,f)&&f!==n&&UE(t,f,{get:(h=>e[h]).bind(null,f),enumerable:!(r=Zz(e,f))||r.enumerable});return t},Mf=(t,e,n)=>(n=t!=null?Xz(Qz(t)):{},eL(UE(n,"default",{value:t,enumerable:!0}),t));const qE=()=>{},d1=t=>{Object.freeze&&Object.freeze(t)};function PE(t,e,n){var r;const a=e.join(".");return(r=n[a])!==null&&r!==void 0||(n[a]=new Proxy(qE,{get(u,c){if(!(typeof c!="string"||c==="then"))return PE(t,[...e,c],n)},apply(u,c,f){const h=e[e.length-1];let m={args:f,path:e};return h==="call"?m={args:f.length>=2?[f[1]]:[],path:e.slice(0,-1)}:h==="apply"&&(m={args:f.length>=2?f[1]:[],path:e.slice(0,-1)}),d1(m.args),d1(m.path),t(m)}})),n[a]}const tL=t=>PE(t,[],Object.create(null)),nL=t=>new Proxy(qE,{get(e,n){if(n!=="then")return t(n)}});var IE=Bl({"../../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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},e.exports.__esModule=!0,e.exports.default=e.exports,n(r)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),iL=Bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=IE().default;function r(a,u){if(n(a)!="object"||!a)return a;var c=a[Symbol.toPrimitive];if(c!==void 0){var f=c.call(a,u||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(a)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),rL=Bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=IE().default,r=iL();function a(u){var c=r(u,"string");return n(c)=="symbol"?c:c+""}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}}),HE=Bl({"../../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(a,u,c){return(u=n(u))in a?Object.defineProperty(a,u,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[u]=c,a}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),Vy=Bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=HE();function r(u,c){var f=Object.keys(u);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(u);c&&(h=h.filter(function(m){return Object.getOwnPropertyDescriptor(u,m).enumerable})),f.push.apply(f,h)}return f}function a(u){for(var c=1;c<arguments.length;c++){var f=arguments[c]!=null?arguments[c]:{};c%2?r(Object(f),!0).forEach(function(h){n(u,h,f[h])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(f)):r(Object(f)).forEach(function(h){Object.defineProperty(u,h,Object.getOwnPropertyDescriptor(f,h))})}return u}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports}});Mf(Vy());Mf(HE());var dc=Mf(Vy());function sL(t,e){if("error"in t){const r=e.deserialize(t.error);return{ok:!1,error:(0,dc.default)((0,dc.default)({},t),{},{error:r})}}return{ok:!0,result:(0,dc.default)((0,dc.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var bp=class extends Error{constructor(){super("Unable to transform response from server")}};function oL(t,e){let n;try{n=sL(t,e)}catch{throw new bp}if(!n.ok&&(!gl(n.error.error)||typeof n.error.error.code!="number"))throw new bp;if(n.ok&&!gl(n.result))throw new bp;return n}Mf(Vy());var hc=bt(ks()),vo=bt(ni());function aL(t){return t instanceof bl}function lL(t){return gl(t)&&gl(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function uL(t,e){return typeof t=="string"?t:gl(t)&&typeof t.message=="string"?t.message:e}var bl=class Ec extends Error{constructor(e,n){var r,a;const u=n?.cause;super(e,{cause:u}),(0,hc.default)(this,"cause",void 0),(0,hc.default)(this,"shape",void 0),(0,hc.default)(this,"data",void 0),(0,hc.default)(this,"meta",void 0),this.meta=n?.meta,this.cause=u,this.shape=n==null||(r=n.result)===null||r===void 0?void 0:r.error,this.data=n==null||(a=n.result)===null||a===void 0?void 0:a.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,Ec.prototype)}static from(e,n={}){const r=e;return aL(r)?(n.meta&&(r.meta=(0,vo.default)((0,vo.default)({},r.meta),n.meta)),r):lL(r)?new Ec(r.error.message,(0,vo.default)((0,vo.default)({},n),{},{result:r})):new Ec(uL(r,"Unknown error"),(0,vo.default)((0,vo.default)({},n),{},{cause:r}))}};function cL(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 h1=t=>typeof t=="function";function fL(t){if(t)return t;if(typeof window<"u"&&h1(window.fetch))return window.fetch;if(typeof globalThis<"u"&&h1(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var il=bt(ni());function dL(t){return{url:t.url.toString(),fetch:t.fetch,transformer:cL(t.transformer),methodOverride:t.methodOverride}}function hL(t){const e={};for(let n=0;n<t.length;n++){const r=t[n];e[n]=r}return e}const pL={query:"GET",mutation:"POST",subscription:"PATCH"};function FE(t){return"input"in t?t.transformer.input.serialize(t.input):hL(t.inputs.map(e=>t.transformer.input.serialize(e)))}const GE=t=>{const e=t.url.split("?");let r=e[0].replace(/\/$/,"")+"/"+t.path;const a=[];if(e[1]&&a.push(e[1]),"inputs"in t&&a.push("batch=1"),t.type==="query"||t.type==="subscription"){const u=FE(t);u!==void 0&&t.methodOverride!=="POST"&&a.push(`input=${encodeURIComponent(JSON.stringify(u))}`)}return a.length&&(r+="?"+a.join("&")),r},mL=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=FE(t);return e!==void 0?JSON.stringify(e):void 0},yL=t=>SL((0,il.default)((0,il.default)({},t),{},{contentTypeHeader:"application/json",getUrl:GE,getBody:mL}));var gL=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const bL=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 gL};async function vL(t){var e;bL(t.signal);const n=t.getUrl(t),r=t.getBody(t),a=(e=t.methodOverride)!==null&&e!==void 0?e:pL[t.type],u=await(async()=>{const f=await t.headers();return Symbol.iterator in f?Object.fromEntries(f):f})(),c=(0,il.default)((0,il.default)((0,il.default)({},t.contentTypeHeader&&a!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{"trpc-accept":t.trpcAcceptHeader}:void 0),u);return fL(t.fetch)(n,{method:a,signal:t.signal,body:r,headers:c})}async function SL(t){const e={},n=await vL(t);e.response=n;const r=await n.json();return e.responseJSON=r,{json:r,meta:e}}bt(ni());const p1=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function m1(t){let e=null,n=null;const r=()=>{clearTimeout(n),n=null,e=null};function a(f){const h=[[]];let m=0;for(;;){const v=f[m];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")),m++;continue}if(t.validate(S.concat(v).map(T=>T.key))){S.push(v),m++;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")),m++;continue}h.push([])}return h}function u(){const f=a(e);r();for(const h of f){if(!h.length)continue;const m={items:h};for(const g of h)g.batch=m;t.fetch(m.items.map(g=>g.key)).then(async g=>{await Promise.all(g.map(async(S,x)=>{const T=m.items[x];try{var M;const _=await Promise.resolve(S);(M=T.resolve)===null||M===void 0||M.call(T,_)}catch(_){var C;(C=T.reject)===null||C===void 0||C.call(T,_)}T.batch=null,T.reject=null,T.resolve=null}));for(const S of m.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 m.items){var v;(v=S.reject)===null||v===void 0||v.call(S,g),S.batch=null}})}}function c(f){var h;const m={aborted:!1,key:f,batch:null,resolve:p1,reject:p1},y=new Promise((g,v)=>{var S;m.reject=v,m.resolve=g,(S=e)!==null&&S!==void 0||(e=[]),e.push(m)});return(h=n)!==null&&h!==void 0||(n=setTimeout(u)),y}return{load:c}}function wL(...t){const e=new AbortController,n=t.length;let r=0;const a=()=>{++r===n&&e.abort()};for(const u of t)u?.aborted?a():u?.addEventListener("abort",a,{once:!0});return e.signal}var pc=bt(ni());function xL(t){var e,n;const r=dL(t),a=(e=t.maxURLLength)!==null&&e!==void 0?e:1/0,u=(n=t.maxItems)!==null&&n!==void 0?n:1/0;return()=>{const c=y=>({validate(g){if(a===1/0&&u===1/0)return!0;if(g.length>u)return!1;const v=g.map(T=>T.path).join(","),S=g.map(T=>T.input);return GE((0,pc.default)((0,pc.default)({},r),{},{type:y,path:v,inputs:S,signal:null})).length<=a},async fetch(g){const v=g.map(_=>_.path).join(","),S=g.map(_=>_.input),x=wL(...g.map(_=>_.signal)),T=await yL((0,pc.default)((0,pc.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(_=>({meta:T.meta,json:_}))}}),f=m1(c("query")),h=m1(c("mutation")),m={query:f,mutation:h};return({op:y})=>kf(g=>{if(y.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const S=m[y.type].load(y);let x;return S.then(T=>{x=T;const M=oL(T.json,r.transformer.output);if(!M.ok){g.error(bl.from(M.error,{meta:T.meta}));return}g.next({context:T.meta,result:M.result}),g.complete()}).catch(T=>{g.error(bl.from(T,{meta:x?.meta}))}),()=>{}})}}bt(ni());const YE=(t,...e)=>typeof t=="function"?t(...e):t;bt(ks());function TL(){let t,e;return{promise:new Promise((r,a)=>{t=r,e=a}),resolve:t,reject:e}}async function AL(t){const e=await YE(t.url);if(!t.connectionParams)return e;const r=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+r}async function EL(t){const e={method:"connectionParams",data:await YE(t)};return JSON.stringify(e)}bt(ks());var ps=bt(ks());function OL(t){const{promise:e,resolve:n,reject:r}=TL();return t.addEventListener("open",()=>{t.removeEventListener("error",r),n()}),t.addEventListener("error",r),e}function _L(t,{intervalMs:e,pongTimeoutMs:n}){let r,a;function u(){r=setTimeout(()=>{t.send("PING"),a=setTimeout(()=>{t.close()},n)},e)}function c(){clearTimeout(r),u()}function f(){clearTimeout(a),c()}t.addEventListener("open",u),t.addEventListener("message",({data:h})=>{clearTimeout(r),u(),h==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(r),clearTimeout(a)})}var RL=class vm{constructor(e){var n;if((0,ps.default)(this,"id",++vm.connectCount),(0,ps.default)(this,"WebSocketPonyfill",void 0),(0,ps.default)(this,"urlOptions",void 0),(0,ps.default)(this,"keepAliveOpts",void 0),(0,ps.default)(this,"wsObservable",Yz(null)),(0,ps.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=++vm.connectCount;const n=AL(e.urlOptions).then(r=>new e.WebSocketPonyfill(r));e.openPromise=n.then(async r=>{e.ws=r,r.addEventListener("message",function({data:a}){a==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&_L(r,e.keepAliveOpts),r.addEventListener("close",()=>{e.ws===r&&(e.ws=null)}),await OL(r),e.urlOptions.connectionParams&&r.send(await EL(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,ps.default)(RL,"connectCount",0);bt(ks());bt(ni());var vp=bt(ks()),y1=bt(ni()),CL=class{constructor(t){(0,vp.default)(this,"links",void 0),(0,vp.default)(this,"runtime",void 0),(0,vp.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return Jz({links:this.links,op:(0,y1.default)((0,y1.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(Gz())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await Fz(n)).result.data}catch(n){throw bl.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(a){switch(a.result.type){case"state":{var u;(u=n.onConnectionStateChange)===null||u===void 0||u.call(n,a.result);break}case"started":{var c;(c=n.onStarted)===null||c===void 0||c.call(n,{context:a.context});break}case"stopped":{var f;(f=n.onStopped)===null||f===void 0||f.call(n);break}case"data":case void 0:{var h;(h=n.onData)===null||h===void 0||h.call(n,a.result.data);break}}},error(a){var u;(u=n.onError)===null||u===void 0||u.call(n,a)},complete(){var a;(a=n.onComplete)===null||a===void 0||a.call(n)}})}};const kL=Symbol.for("trpc_untypedClient"),ML={query:"query",mutate:"mutation",subscribe:"subscription"},DL=t=>ML[t];function NL(t){const e=tL(({path:n,args:r})=>{const a=[...n],u=DL(a.pop()),c=a.join(".");return t[u](c,...r)});return nL(n=>n===kL?t:e[n])}function $L(t){const e=new CL(t);return NL(e)}bt(ni());bt(ni());var jL=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(a){var u,c,f,h=2;for(typeof Symbol<"u"&&(c=Symbol.asyncIterator,f=Symbol.iterator);h--;){if(c&&(u=a[c])!=null)return u.call(a);if(f&&(u=a[f])!=null)return new r(u.call(a));c="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function r(a){function u(c){if(Object(c)!==c)return Promise.reject(new TypeError(c+" is not an object."));var f=c.done;return Promise.resolve(c.value).then(function(h){return{value:h,done:f}})}return r=function(f){this.s=f,this.n=f.next},r.prototype={s:null,n:null,next:function(){return u(this.n.apply(this.s,arguments))},return:function(f){var h=this.s.return;return h===void 0?Promise.resolve({value:f,done:!0}):u(h.apply(this.s,arguments))},throw:function(f){var h=this.s.return;return h===void 0?Promise.reject(f):u(h.apply(this.s,arguments))}},new r(a)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});bt(jL());bt(ni());var BL=wi({"../../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(f,h){var m=Error();return m.name="SuppressedError",m.error=f,m.suppressed=h,m},a={},u=[];function c(f,h){if(h!=null){if(Object(h)!==h)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var m=h[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(m===void 0&&(m=h[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var y=m;if(typeof m!="function")throw new TypeError("Object is not disposable.");y&&(m=function(){try{y.call(h)}catch(v){return Promise.reject(v)}}),u.push({v:h,d:m,a:f})}else f&&u.push({d:h,a:f});return h}return{e:a,u:c.bind(null,!1),a:c.bind(null,!0),d:function(){var h,m=this.e,y=0;function g(){for(;h=u.pop();)try{if(!h.a&&y===1)return y=0,u.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 m!==a?Promise.reject(m):Promise.resolve();if(m!==a)throw m}function v(S){return m=m!==a?new r(S,m):S,g()}return g()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),JE=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(r,a){this.v=r,this.k=a}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),zL=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=JE();function r(a){return new n(a,0)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}}),LL=wi({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=JE();function r(u){return function(){return new a(u.apply(this,arguments))}}function a(u){var c,f;function h(y,g){try{var v=u[y](g),S=v.value,x=S instanceof n;Promise.resolve(x?S.v:S).then(function(T){if(x){var M=y==="return"?"return":"next";if(!S.k||T.done)return h(M,T);T=u[M](T).value}m(v.done?"return":"normal",T)},function(T){h("throw",T)})}catch(T){m("throw",T)}}function m(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):f=null}this._invoke=function(y,g){return new Promise(function(v,S){var x={key:y,arg:g,resolve:v,reject:S,next:null};f?f=f.next=x:(c=f=x,h(y,g))})},typeof u.return!="function"&&(this.return=void 0)}a.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},a.prototype.next=function(u){return this._invoke("next",u)},a.prototype.throw=function(u){return this._invoke("throw",u)},a.prototype.return=function(u){return this._invoke("return",u)},e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports}});bt(BL());bt(zL());bt(LL());bt(ni());var VL={};function XE(t,e){if(t instanceof Promise)throw new Error(e)}function UL(t,e){const n={},r=[];for(const a in t){const u=t[a]["~standard"].validate(e[a]);if(XE(u,`Validation must be synchronous, but ${a} returned a Promise.`),u.issues){r.push(...u.issues.map(c=>({...c,message:c.message,path:[a,...c.path??[]]})));continue}n[a]=u.value}return r.length?{issues:r}:{value:n}}function KL(t){const e=t.runtimeEnvStrict??t.runtimeEnv??VL;if(t.emptyStringAsUndefined??!1)for(const[_,R]of Object.entries(e))R===""&&delete e[_];if(!!t.skipValidation)return e;const a=typeof t.client=="object"?t.client:{},u=typeof t.server=="object"?t.server:{},c=typeof t.shared=="object"?t.shared:{},f=t.isServer??(typeof window>"u"||"Deno"in window),h=f?{...u,...c,...a}:{...a,...c},m=t.createFinalSchema?.(h,f)["~standard"].validate(e)??UL(h,e);XE(m,"Validation must be synchronous");const y=t.onValidationError??(_=>{throw console.error("❌ Invalid environment variables:",_),new Error("Invalid environment variables")}),g=t.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(m.issues)return y(m.issues);const v=_=>t.clientPrefix?!_.startsWith(t.clientPrefix)&&!(_ in c):!0,S=_=>f||!v(_),x=_=>_==="__esModule"||_==="$$typeof",T=(t.extends??[]).reduce((_,R)=>Object.assign(_,R),{}),M=Object.assign(T,m.value);return new Proxy(M,{get(_,R){if(typeof R=="string"&&!x(R))return S(R)?Reflect.get(_,R):g(R)}})}const qL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},PL="__vite_start_time"in globalThis,IL=typeof window<"u",Ki=Ot("string"),g1=Ot('"true" | "false" | undefined'),ZE=KL({isServer:!PL&&!IL,server:{CI:Ot("string | undefined").pipe(Boolean),POSTGRES_USER:Ki,POSTGRES_PASSWORD:Ki,POSTGRES_DATABASE:Ki,POSTGRES_HOST:Ki,POSTGRES_PORT:Ki.pipe(t=>Number.parseInt(t,10)),BACKEND_PORT:Ki.pipe(t=>Number.parseInt(t,10)),RUN_WORKERS_FROM_SOURCE:g1.pipe(t=>t==="true"),FRONTEND_PORT:Ki.pipe(t=>Number.parseInt(t,10)),FRONTEND_ORIGINS:Ki.pipe.try(t=>JSON.parse(t),Ot("string[]")),API_KEY_OPENAI:Ot("string | undefined"),API_KEY_RESEND:Ot("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Ki,VITE_DEV_FRONTEND_HOST:Ot("string | undefined"),VITE_DEV_HTTPS:g1.pipe(t=>t==="true")},runtimeEnv:qL,emptyStringAsUndefined:!0}),cn=$L({links:[xL({url:ZE.VITE_BACKEND_ORIGIN,fetch(t,e){return e?(Object.assign(e,{credentials:"include"}),fetch(t,e)):fetch(t)}})]}),HL=ft({key:"appVersionQuery",default:cn.version.query});ft({key:"lastKnownVersion",default:null,effects:[mT(localStorage,JSON,"lastKnownVersion")]});const FL=Wi({key:"appVersion",get:async({get:t})=>{const e=t(HL),{version:n}=await e;return n}});function Sp(t){return["optional",t]}function GL(t,e){let n=[t];for(const r of e){if(typeof r!="string")return!1;n=n.flatMap(a=>{if(a===null)return[];const u=[],c=a[1],f=c[r];f!==void 0&&u.push(f);const h=Object.keys(c).find(m=>m.startsWith("$"));if(h){const m=c[h];m&&u.push(m)}return u})}for(const r of n)if(r===null||r[0]==="optional")return!0;return!1}const yi=Object.create(null);yi.open="0";yi.close="1";yi.ping="2";yi.pong="3";yi.message="4";yi.upgrade="5";yi.noop="6";const Oc=Object.create(null);Object.keys(yi).forEach(t=>{Oc[yi[t]]=t});const Sm={type:"error",data:"parser error"},QE=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",WE=typeof ArrayBuffer=="function",eO=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,Uy=({type:t,data:e},n,r)=>QE&&e instanceof Blob?n?r(e):b1(e,r):WE&&(e instanceof ArrayBuffer||eO(e))?n?r(e):b1(new Blob([e]),r):r(yi[t]+(e||"")),b1=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+(r||""))},n.readAsDataURL(t)};function v1(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}let wp;function YL(t,e){if(QE&&t.data instanceof Blob)return t.data.arrayBuffer().then(v1).then(e);if(WE&&(t.data instanceof ArrayBuffer||eO(t.data)))return e(v1(t.data));Uy(t,!1,n=>{wp||(wp=new TextEncoder),e(wp.encode(n))})}const S1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wa=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let t=0;t<S1.length;t++)Wa[S1.charCodeAt(t)]=t;const JL=t=>{let e=t.length*.75,n=t.length,r,a=0,u,c,f,h;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const m=new ArrayBuffer(e),y=new Uint8Array(m);for(r=0;r<n;r+=4)u=Wa[t.charCodeAt(r)],c=Wa[t.charCodeAt(r+1)],f=Wa[t.charCodeAt(r+2)],h=Wa[t.charCodeAt(r+3)],y[a++]=u<<2|c>>4,y[a++]=(c&15)<<4|f>>2,y[a++]=(f&3)<<6|h&63;return m},XL=typeof ArrayBuffer=="function",Ky=(t,e)=>{if(typeof t!="string")return{type:"message",data:tO(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:ZL(t.substring(1),e)}:Oc[n]?t.length>1?{type:Oc[n],data:t.substring(1)}:{type:Oc[n]}:Sm},ZL=(t,e)=>{if(XL){const n=JL(t);return tO(n,e)}else return{base64:!0,data:t}},tO=(t,e)=>{switch(e){case"blob":return t instanceof Blob?t:new Blob([t]);case"arraybuffer":default:return t instanceof ArrayBuffer?t:t.buffer}},nO="",QL=(t,e)=>{const n=t.length,r=new Array(n);let a=0;t.forEach((u,c)=>{Uy(u,!1,f=>{r[c]=f,++a===n&&e(r.join(nO))})})},WL=(t,e)=>{const n=t.split(nO),r=[];for(let a=0;a<n.length;a++){const u=Ky(n[a],e);if(r.push(u),u.type==="error")break}return r};function eV(){return new TransformStream({transform(t,e){YL(t,n=>{const r=n.length;let a;if(r<126)a=new Uint8Array(1),new DataView(a.buffer).setUint8(0,r);else if(r<65536){a=new Uint8Array(3);const u=new DataView(a.buffer);u.setUint8(0,126),u.setUint16(1,r)}else{a=new Uint8Array(9);const u=new DataView(a.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(r))}t.data&&typeof t.data!="string"&&(a[0]|=128),e.enqueue(a),e.enqueue(n)})}})}let xp;function mc(t){return t.reduce((e,n)=>e+n.length,0)}function yc(t,e){if(t[0].length===e)return t.shift();const n=new Uint8Array(e);let r=0;for(let a=0;a<e;a++)n[a]=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){xp||(xp=new TextDecoder);const n=[];let r=0,a=-1,u=!1;return new TransformStream({transform(c,f){for(n.push(c);;){if(r===0){if(mc(n)<1)break;const h=yc(n,1);u=(h[0]&128)===128,a=h[0]&127,a<126?r=3:a===126?r=1:r=2}else if(r===1){if(mc(n)<2)break;const h=yc(n,2);a=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),r=3}else if(r===2){if(mc(n)<8)break;const h=yc(n,8),m=new DataView(h.buffer,h.byteOffset,h.length),y=m.getUint32(0);if(y>Math.pow(2,21)-1){f.enqueue(Sm);break}a=y*Math.pow(2,32)+m.getUint32(4),r=3}else{if(mc(n)<a)break;const h=yc(n,a);f.enqueue(Ky(u?h:xp.decode(h),e)),r=0}if(a===0||a>t){f.enqueue(Sm);break}}}})}const iO=4;function _t(t){if(t)return nV(t)}function nV(t){for(var e in _t.prototype)t[e]=_t.prototype[e];return t}_t.prototype.on=_t.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};_t.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};_t.prototype.off=_t.prototype.removeListener=_t.prototype.removeAllListeners=_t.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,a=0;a<n.length;a++)if(r=n[a],r===e||r.fn===e){n.splice(a,1);break}return n.length===0&&delete this._callbacks["$"+t],this};_t.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,a=n.length;r<a;++r)n[r].apply(this,e)}return this};_t.prototype.emitReserved=_t.prototype.emit;_t.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};_t.prototype.hasListeners=function(t){return!!this.listeners(t).length};const Df=typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0),Un=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iV="arraybuffer";function rO(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const rV=Un.setTimeout,sV=Un.clearTimeout;function Nf(t,e){e.useNativeTimers?(t.setTimeoutFn=rV.bind(Un),t.clearTimeoutFn=sV.bind(Un)):(t.setTimeoutFn=Un.setTimeout.bind(Un),t.clearTimeoutFn=Un.clearTimeout.bind(Un))}const oV=1.33;function aV(t){return typeof t=="string"?lV(t):Math.ceil((t.byteLength||t.size)*oV)}function lV(t){let e=0,n=0;for(let r=0,a=t.length;r<a;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 sO(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uV(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function cV(t){let e={},n=t.split("&");for(let r=0,a=n.length;r<a;r++){let u=n[r].split("=");e[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return e}class fV extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class qy extends _t{constructor(e){super(),this.writable=!1,Nf(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 fV(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=Ky(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=uV(e);return n.length?"?"+n:""}}class dV extends qy{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)};WL(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,QL(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]=sO()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(e,n)}}let oO=!1;try{oO=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hV=oO;function pV(){}class mV extends dV{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",(a,u)=>{this.onError("xhr post error",a,u)})}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 No=class _c extends _t{constructor(e,n,r){super(),this.createRequest=e,Nf(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=rO(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 a in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(a)&&r.setRequestHeader(a,this._opts.extraHeaders[a])}}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 a;r.readyState===3&&((a=this._opts.cookieJar)===null||a===void 0||a.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(a){this.setTimeoutFn(()=>{this._onError(a)},0);return}typeof document<"u"&&(this._index=_c.requestsCount++,_c.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=pV,e)try{this._xhr.abort()}catch{}typeof document<"u"&&delete _c.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()}};No.requestsCount=0;No.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",w1);else if(typeof addEventListener=="function"){const t="onpagehide"in Un?"pagehide":"unload";addEventListener(t,w1,!1)}}function w1(){for(let t in No.requests)No.requests.hasOwnProperty(t)&&No.requests[t].abort()}const yV=(function(){const t=aO({xdomain:!1});return t&&t.responseType!==null})();class gV extends mV{constructor(e){super(e);const n=e&&e.forceBase64;this.supportsBinary=yV&&!n}request(e={}){return Object.assign(e,{xd:this.xd},this.opts),new No(aO,this.uri(),e)}}function aO(t){const e=t.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!e||hV))return new XMLHttpRequest}catch{}if(!e)try{return new Un[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const lO=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bV extends qy{get name(){return"websocket"}doOpen(){const e=this.uri(),n=this.opts.protocols,r=lO?{}:rO(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(a){return this.emitReserved("error",a)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=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],a=n===e.length-1;Uy(r,this.supportsBinary,u=>{try{this.doWrite(r,u)}catch{}a&&Df(()=>{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]=sO()),this.supportsBinary||(n.b64=1),this.createUri(e,n)}}const Tp=Un.WebSocket||Un.MozWebSocket;class vV extends bV{createSocket(e,n,r){return lO?new Tp(e,n,r):n?new Tp(e,n):new Tp(e)}doWrite(e,n){this.ws.send(n)}}class SV extends qy{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(),a=eV();a.readable.pipeTo(e.writable),this._writer=a.writable.getWriter();const u=()=>{r.read().then(({done:f,value:h})=>{f||(this.onPacket(h),u())}).catch(f=>{})};u();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],a=n===e.length-1;this._writer.write(r).then(()=>{a&&Df(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var e;(e=this._transport)===null||e===void 0||e.close()}}const wV={websocket:vV,webtransport:SV,polling:gV},xV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,TV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function wm(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 a=xV.exec(t||""),u={},c=14;for(;c--;)u[TV[c]]=a[c]||"";return n!=-1&&r!=-1&&(u.source=e,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=AV(u,u.path),u.queryKey=EV(u,u.query),u}function AV(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 EV(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,a,u){a&&(n[a]=u)}),n}const xm=typeof addEventListener=="function"&&typeof removeEventListener=="function",Rc=[];xm&&addEventListener("offline",()=>{Rc.forEach(t=>t())},!1);class jr extends _t{constructor(e,n){if(super(),this.binaryType=iV,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=wm(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=wm(n.host).host);Nf(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const a=r.prototype.name;this.transports.push(a),this._transportsByName[a]=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=cV(this.opts.query)),xm&&(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"})},Rc.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=iO,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&&jr.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",jr.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 a=this.writeBuffer[r].data;if(a&&(n+=aV(a)),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,Df(()=>{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,a){if(typeof n=="function"&&(a=n,n=void 0),typeof r=="function"&&(a=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const u={type:e,data:n,options:r};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),a&&this.once("flush",a),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(jr.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(),xm&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Rc.indexOf(this._offlineEventListener);r!==-1&&Rc.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this._prevBufferLen=0}}}jr.protocol=iO;class OV extends jr{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;jr.priorWebsocketSuccess=!1;const a=()=>{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;jr.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 u(){r||(r=!0,y(),n.close(),n=null)}const c=g=>{const v=new Error("probe error: "+g);v.transport=n.name,u(),this.emitReserved("upgradeError",v)};function f(){c("transport closed")}function h(){c("socket closed")}function m(g){n&&g.name!==n.name&&u()}const y=()=>{n.removeListener("open",a),n.removeListener("error",c),n.removeListener("close",f),this.off("close",h),this.off("upgrading",m)};n.once("open",a),n.once("error",c),n.once("close",f),this.once("close",h),this.once("upgrading",m),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 _V=class extends OV{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(a=>wV[a]).filter(a=>!!a)),super(e,r)}};function RV(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=wm(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 u=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+u+":"+r.port+e,r.href=r.protocol+"://"+u+(n&&n.port===r.port?"":":"+r.port),r}const CV=typeof ArrayBuffer=="function",kV=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,uO=Object.prototype.toString,MV=typeof Blob=="function"||typeof Blob<"u"&&uO.call(Blob)==="[object BlobConstructor]",DV=typeof File=="function"||typeof File<"u"&&uO.call(File)==="[object FileConstructor]";function Py(t){return CV&&(t instanceof ArrayBuffer||kV(t))||MV&&t instanceof Blob||DV&&t instanceof File}function Cc(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(Cc(t[n]))return!0;return!1}if(Py(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return Cc(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&Cc(t[n]))return!0;return!1}function NV(t){const e=[],n=t.data,r=t;return r.data=Tm(n,e),r.attachments=e.length,{packet:r,buffers:e}}function Tm(t,e){if(!t)return t;if(Py(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]=Tm(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]=Tm(t[r],e));return n}return t}function $V(t,e){return t.data=Am(t.data,e),delete t.attachments,t}function Am(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]=Am(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=Am(t[n],e));return t}const jV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],BV=5;var ke;(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"})(ke||(ke={}));class zV{constructor(e){this.replacer=e}encode(e){return(e.type===ke.EVENT||e.type===ke.ACK)&&Cc(e)?this.encodeAsBinary({type:e.type===ke.EVENT?ke.BINARY_EVENT:ke.BINARY_ACK,nsp:e.nsp,data:e.data,id:e.id}):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===ke.BINARY_EVENT||e.type===ke.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=NV(e),r=this.encodeAsString(n.packet),a=n.buffers;return a.unshift(r),a}}function x1(t){return Object.prototype.toString.call(t)==="[object Object]"}class Iy extends _t{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===ke.BINARY_EVENT;r||n.type===ke.BINARY_ACK?(n.type=r?ke.EVENT:ke.ACK,this.reconstructor=new LV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Py(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(ke[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===ke.BINARY_EVENT||r.type===ke.BINARY_ACK){const u=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const c=e.substring(u,n);if(c!=Number(c)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(c)}if(e.charAt(n+1)==="/"){const u=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(u,n)}else r.nsp="/";const a=e.charAt(n+1);if(a!==""&&Number(a)==a){const u=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(u,n+1))}if(e.charAt(++n)){const u=this.tryParse(e.substr(n));if(Iy.isPayloadValid(r.type,u))r.data=u;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 ke.CONNECT:return x1(n);case ke.DISCONNECT:return n===void 0;case ke.CONNECT_ERROR:return typeof n=="string"||x1(n);case ke.EVENT:case ke.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&jV.indexOf(n[0])===-1);case ke.ACK:case ke.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class LV{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=$V(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const VV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Iy,Encoder:zV,get PacketType(){return ke},protocol:BV},Symbol.toStringTag,{value:"Module"}));function Qn(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const UV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class cO extends _t{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=[Qn(e,"open",this.onopen.bind(this)),Qn(e,"packet",this.onpacket.bind(this)),Qn(e,"error",this.onerror.bind(this)),Qn(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,a,u;if(UV.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:ke.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 f=(a=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||a===void 0?void 0:a.writable,h=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!f||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(e,n){var r;const a=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(a===void 0){this.acks[e]=n;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let f=0;f<this.sendBuffer.length;f++)this.sendBuffer[f].id===e&&this.sendBuffer.splice(f,1);n.call(this,new Error("operation has timed out"))},a),c=(...f)=>{this.io.clearTimeoutFn(u),n.apply(this,f)};c.withError=!0,this.acks[e]=c}emitWithAck(e,...n){return new Promise((r,a)=>{const u=(c,f)=>c?a(c):r(f);u.withError=!0,n.push(u),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((a,...u)=>r!==this._queue[0]?void 0:(a!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(a)):(this._queue.shift(),n&&n(null,...u)),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:ke.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 ke.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 ke.EVENT:case ke.BINARY_EVENT:this.onevent(e);break;case ke.ACK:case ke.BINARY_ACK:this.onack(e);break;case ke.DISCONNECT:this.ondisconnect();break;case ke.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(...a){r||(r=!0,n.packet({type:ke.ACK,id:e,data:a}))}}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:ke.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 Xo(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}Xo.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};Xo.prototype.reset=function(){this.attempts=0};Xo.prototype.setMin=function(t){this.ms=t};Xo.prototype.setMax=function(t){this.max=t};Xo.prototype.setJitter=function(t){this.jitter=t};class Em extends _t{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,Nf(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Xo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const a=n.parser||VV;this.encoder=new a.Encoder,this.decoder=new a.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 _V(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const a=Qn(n,"open",function(){r.onopen(),e&&e()}),u=f=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",f),e?e(f):this.maybeReconnectOnOpen()},c=Qn(n,"error",u);if(this._timeout!==!1){const f=this._timeout,h=this.setTimeoutFn(()=>{a(),u(new Error("timeout")),n.close()},f);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(a),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(Qn(e,"ping",this.onping.bind(this)),Qn(e,"data",this.ondata.bind(this)),Qn(e,"error",this.onerror.bind(this)),Qn(e,"close",this.onclose.bind(this)),Qn(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){Df(()=>{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 cO(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(a=>{a?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",a)):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 Ya={};function kc(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=RV(t,e.path||"/socket.io"),r=n.source,a=n.id,u=n.path,c=Ya[a]&&u in Ya[a].nsps,f=e.forceNew||e["force new connection"]||e.multiplex===!1||c;let h;return f?h=new Em(r,e):(Ya[a]||(Ya[a]=new Em(r,e)),h=Ya[a]),n.query&&!e.query&&(e.query=n.queryKey),h.socket(n.path,e)}Object.assign(kc,{Manager:Em,Socket:cO,io:kc,connect:kc});const KV=["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"],qV=3,PV=15,IV=/^[a-zA-Z0-9_-]+$/,HV=Ot(IV).pipe(Ot(`string > ${qV} & string < ${PV}`)).brand("username"),T1=20,A1={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function FV(t){let e="";for(const n of t)n in A1?e+=A1[n]:e+=n;return e}function GV(t){const e=t.toLocaleLowerCase(),n=FV(e);for(const r of KV)if(n.includes(r)||e.includes(r))return!0;return!1}function YV(t){const e=new Set(t).size;return t.length*Math.log2(e)}function JV(t){let e=0;return GV(t)&&(e-=100),e+=YV(t)*.5,Math.max(e,0)}const XV=Ot("string").narrow((t,e)=>{const n=JV(t);return n>=T1?!0:e.mustBe(`Of complexity ${T1} or more. Was ${n.toFixed(2)}.`)}).brand("password");Ot({"+":"delete",email:"string",password:"string"});const ZV=Ot("string").brand("email");Ot({"+":"delete",username:"string",password:"string",email:"string"});const QV=Ot({email:"string",userId:"string",username:"string",password:"boolean",verification:"'unverified' | 'verified'"}),gi=kc(ZE.VITE_BACKEND_ORIGIN,{auth:t=>{const e=nt(ut);e&&t(e)},withCredentials:!0,autoConnect:!1});gi.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),De(ut,null)}).on("usernameChanged",t=>{De(ut,e=>e===null?null:{...e,username:t})});const ut=ft({key:"auth",default:function(){const e=localStorage.getItem("auth");if(e)try{const n=qr(e),r=QV(n);return r instanceof Ot.errors?(console.error("failed to parse auth data",r),null):(r.verification==="verified"&&(console.log("connecting..."),gi.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($o,n.username),localStorage.setItem("auth",zt(n)),n.verification==="verified"?(console.log("connecting..."),gi.connect()):Os("/verify")):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]}),$o=ft({key:"username",default:nt(ut)?.username??""}),Ap=ft({key:"usernameDebounce",default:!0}),WV=ft({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:t})=>{Rk($o,()=>{nt(Ap)&&(t(nt($o)),De(Ap,!1),setTimeout(()=>{De(Ap,!0),t(nt($o))},2e3))})}]}),e4=Wi({key:"isUsernameTakenQuery",get:({get:t})=>{const e=t(WV);if(!e)return!1;const n=nt(ut);return e===n?.username?!1:cn.isUsernameTaken.query({username:e})}}),fO=Wi({key:"usernameIssues",get:({get:t})=>{const e=t($o),n=HV(e);return n instanceof Ot.errors?n:null}}),di=ft({key:"password0",default:""}),dO=Wi({key:"password0Issues",get:({get:t})=>{const e=t(di),n=XV(e);return n instanceof Ot.errors?n:null}}),Po=ft({key:"email",default:""}),hO=Wi({key:"emailIssues",get:({get:t})=>{const e=t(Po),n=ZV(e);return n instanceof Ot.errors?n:null}});Wi({key:"signupReady",get:({get:t})=>{const e=t(fO),n=t(dO),r=t(hO);return!(e??n??r)}});const Hi=ft({key:"oneTimeCode",default:""}),Om=ft({key:"oneTimeCodeNewEmail",default:""}),ui=ft({key:"authTarget",default:null}),pO=Sp({verify:Sp({$token:null}),game:Sp({clicker:null}),account:null,admin:null});function t4(t){return GL(pO,t)}const n4=[[]];function i4(t){return n4.some(e=>e.join("/")===t.join("/"))}function Os(t){history.pushState(null,"",t),De(mO,t)}const mO=ft({key:"pathName",default:window.location.pathname,effects:[({onSet:t,setSelf:e})=>{const n=a=>{history.replaceState(null,"",a),e(a)},r=a=>{switch(a){case"/":{const u=nt(ut);switch(console.log("/","auth",u),u?.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{nt(ut)?.verification==="verified"&&n("/game");break}case"/game":case"/game/clicker":{nt(ut)?.verification==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const u=nt(ut);if(!u){n("/");break}u.verification==="unverified"&&n("/verify");break}}};r(window.location.pathname),t(({newValue:a})=>{r(a)})},({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=Wi({key:"route",get:({get:t})=>{const n=t(mO).split("/").slice(1).filter(Boolean);return t4(n)?i4(n)||t(ut)?n:401:404}}),E1=ft({key:"buttonBlockActive",default:!1}),zn=ft({key:"editing",default:[],effects:[({onSet:t})=>{t(({newValue:e})=>{switch(e[0]){case"email":{nt(yO)?.focus();break}case"new-password":{nt(gO)?.focus();break}case"username":{nt(bO)?.focus();break}}})}]}),yO=ft({key:"emailInputElement",default:null}),gO=ft({key:"password0InputElement",default:null}),bO=ft({key:"usernameInputElement",default:null});function s4(t){const e=$.useRef(null);return $.useEffect(()=>{De(t,e.current)},[t]),e}const o4=Wi({key:"otcLoginFieldLabel",get:({get:t})=>{const e=t(ut);return e?`Code sent to ${e.email}`:""}}),a4=Wi({key:"otcVerifyFieldLabel",get:({get:t})=>{const e=t(Po);return e?`Code sent to ${e}`:""}});function Ep({label:t,inputToken:e,issuesToken:n,inputElementToken:r,initialState:a,onSubmit:u,onOpen:c,onCancel:f,extraIssues:h}){const m=Et(e),y=Wn(e),g=Et(Hi),v=Wn(Hi),S=Et(Om),x=Wn(Om),T=Et(di),M=Wn(di),C=Et(E1),_=Wn(E1),R=Et(zn),G=Wn(zn),I=Et(n),ee=Et(o4),J=Et(a4),X=s4(r),he=R[0]===t,pe=R.at(-1),[we,...je]=R;return F.jsxs("form",{onSubmit:async ve=>{if(ve.preventDefault(),C){_(!1);return}console.log(`submitted! changing ${t} to`,m);const Z=await u(m);Error.isError(Z)&&console.error(Z)},children:[he?F.jsx("button",{type:"button",onClick:async()=>{await f?.(),G([])},children:"x"}):null,F.jsxs("main",{children:[F.jsxs("label",{htmlFor:t,children:[I||h?F.jsxs("aside",{children:[h,I?.map(ve=>F.jsx("span",{children:ve.message},ve.path.join(".")))]}):null,F.jsx("span",{children:t==="new-password"?"Password":hs(t)}),F.jsx("input",{id:t,type:t==="new-password"?"password":"text",ref:X,value:m,onChange:ve=>{y(ve.target.value)},autoComplete:t,autoCapitalize:"none",disabled:pe!==t})]}),he?je.map(ve=>F.jsxs("label",{htmlFor:`${t}-${ve}`,children:[F.jsx("span",{children:(()=>{switch(ve){case"otcLogin":return ee;case"otcVerify":return J;case"passwordLogin":return"Password"}})()}),F.jsx("input",{id:`${t}-otc`,type:"text",ref:X,value:(()=>{switch(ve){case"otcLogin":return g;case"otcVerify":return t==="email"?S:g;case"passwordLogin":return T}})(),onChange:Z=>{switch(ve){case"otcLogin":v(Z.target.value);break;case"otcVerify":if(t==="email"){x(Z.target.value);break}v(Z.target.value);break;case"passwordLogin":M(Z.target.value)}},autoComplete:t.includes("otc")?"one-time-code":t.includes("password")?"password":"",autoCapitalize:"none",disabled:ve!==pe})]},`${t}-${ve}`)):null]}),R[0]===t?F.jsx("button",{type:"submit",children:"->"}):F.jsx("button",{type:"button",onMouseDown:async()=>{_(!0),await c?.(),G(a)},onMouseUp:()=>{_(!1)},children:"/"})]})}function l4(){const t=Et(ut),e=Et(e4);return $.useEffect(()=>{t&&De(Po,t.email),t?.password&&De(di,"••••••••••••")},[]),t?F.jsxs("article",{"data-css":"editor",children:[F.jsx(Ep,{label:"username",inputToken:$o,issuesToken:fO,inputElementToken:bO,initialState:["username"],onSubmit:async n=>(await new Promise(r=>{gi.once("usernameChanged",r),gi.emit("changeUsername",n)}),De(zn,[]),n),extraIssues:e?F.jsx("span",{children:"This username is taken."}):null}),F.jsx(Ep,{label:"email",inputToken:Po,issuesToken:hO,inputElementToken:yO,initialState:["email"],onSubmit:async n=>{const r=nt(zn);if(r[0]!=="email")return new Error("field not email");switch(r.length){case 1:{const{userKey:a,nextStep:u}=await cn.offerNewEmail.mutate({emailOffered:n});switch(console.log({authTarget:a,nextStep:u}),u){case"otc_login":{De(ui,a),De(zn,["email","otcLogin"]);break}case"password_login":{De(ui,a),De(zn,["email","passwordLogin"]);break}case"otc_verify":{De(ui,a),De(Hi,"not needed"),De(zn,["email","otcLogin","otcVerify"]);break}}return a}case 2:switch(console.log("case 2"),r[1]){case"otcLogin":{console.log("case 2.1");const a=nt(ui);if(!a)return new Error("No auth target");const u=nt(Hi),c=await cn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return De(ut,c),De(zn,["email","otcLogin","otcVerify"]),a}case"passwordLogin":return new Error("not implemented")}break;case 3:{const a=nt(ui);if(!a)return new Error("No auth target");const u=nt(Om),c=await cn.verifyAccountAction.mutate({oneTimeCode:u,userKey:a});return De(ut,c),De(zn,[]),c.email}}}}),F.jsx(Ep,{label:"new-password",inputToken:di,issuesToken:dO,inputElementToken:gO,initialState:t.password?["new-password","otcVerify"]:["new-password"],onSubmit:async n=>{const r=nt(zn);if(r[0]!=="new-password")return new Error("field not new-password");switch(r.length){case 1:return await cn.setPassword.mutate({password:n}),De(di,"••••••••••••"),De(ut,a=>a&&{...a,password:!0}),De(zn,[]),"done";case 2:{const a=nt(ui);return a?(await cn.verifyAccountAction.mutate({oneTimeCode:nt(Hi),userKey:a}),De(ut,u=>u&&{...u,password:!1}),De(di,""),De(zn,["new-password"]),"done"):new Error("No userKey")}}},onCancel:()=>{t.password&&De(di,"••••••••••••")},onOpen:async()=>{if(t.password){const n=nt(ui);if(!n)return new Error("No userKey");await cn.startPasswordReset.mutate({userKey:n})}}})]}):F.jsx("p",{children:"You must be logged in to verify your account."})}function u4(){return F.jsx("article",{children:F.jsx("h1",{children:"admin"})})}const Hy=ft({key:"count",default:0}),vO=Ck({key:"incrementTX",do:({set:t})=>{t(Hy,e=>e+1)}}),c4=SM({key:"countContinuity",config:t=>t.add(Hy).add(vO)});function f4({route:[,t]}){return F.jsx("article",{children:t?F.jsx(h4,{gameId:t}):F.jsx(d4,{})})}function d4(){return F.jsx("nav",{children:F.jsx(BE,{href:"/game/clicker",children:"Clicker"})})}Mk(pO[1].game[1]);function h4({gameId:t}){console.log(t);const e=Et(Hy),n=kk(vO);return DM(c4),F.jsxs("article",{children:[F.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",e]}),F.jsx("p",{children:"Let's see how high we can count!"})]})}const SO=$.createContext({});function p4(t){const e=$.useRef(null);return e.current===null&&(e.current=t()),e.current}const Fy=typeof window<"u",m4=Fy?$.useLayoutEffect:$.useEffect,Gy=$.createContext(null);function Yy(t,e){t.indexOf(e)===-1&&t.push(e)}function Jy(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const Zi=(t,e,n)=>n>e?e:n<t?t:n;let Xy=()=>{};const Qi={},wO=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function xO(t){return typeof t=="object"&&t!==null}const TO=t=>/^0[^.\s]+$/u.test(t);function Zy(t){let e;return()=>(e===void 0&&(e=t()),e)}const Pn=t=>t,y4=(t,e)=>n=>e(t(n)),zl=(...t)=>t.reduce(y4),vl=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Qy{constructor(){this.subscriptions=[]}add(e){return Yy(this.subscriptions,e),()=>Jy(this.subscriptions,e)}notify(e,n,r){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,n,r);else for(let u=0;u<a;u++){const c=this.subscriptions[u];c&&c(e,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const pi=t=>t*1e3,qn=t=>t/1e3;function AO(t,e){return e?t*(1e3/e):0}const EO=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,g4=1e-7,b4=12;function v4(t,e,n,r,a){let u,c,f=0;do c=e+(n-e)/2,u=EO(c,r,a)-t,u>0?n=c:e=c;while(Math.abs(u)>g4&&++f<b4);return c}function Ll(t,e,n,r){if(t===e&&n===r)return Pn;const a=u=>v4(u,0,1,t,n);return u=>u===0||u===1?u:EO(a(u),e,r)}const OO=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,_O=t=>e=>1-t(1-e),RO=Ll(.33,1.53,.69,.99),Wy=_O(RO),CO=OO(Wy),kO=t=>(t*=2)<1?.5*Wy(t):.5*(2-Math.pow(2,-10*(t-1))),eg=t=>1-Math.sin(Math.acos(t)),MO=_O(eg),DO=OO(eg),S4=Ll(.42,0,1,1),w4=Ll(0,0,.58,1),NO=Ll(.42,0,.58,1),x4=t=>Array.isArray(t)&&typeof t[0]!="number",$O=t=>Array.isArray(t)&&typeof t[0]=="number",T4={linear:Pn,easeIn:S4,easeInOut:NO,easeOut:w4,circIn:eg,circInOut:DO,circOut:MO,backIn:Wy,backInOut:CO,backOut:RO,anticipate:kO},A4=t=>typeof t=="string",O1=t=>{if($O(t)){Xy(t.length===4);const[e,n,r,a]=t;return Ll(e,n,r,a)}else if(A4(t))return T4[t];return t},gc=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function E4(t,e){let n=new Set,r=new Set,a=!1,u=!1;const c=new WeakSet;let f={delta:0,timestamp:0,isProcessing:!1};function h(y){c.has(y)&&(m.schedule(y),t()),y(f)}const m={schedule:(y,g=!1,v=!1)=>{const x=v&&a?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(f=y,a){u=!0;return}a=!0,[n,r]=[r,n],n.forEach(h),n.clear(),a=!1,u&&(u=!1,m.process(y))}};return m}const O4=40;function jO(t,e){let n=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,c=gc.reduce((R,G)=>(R[G]=E4(u),R),{}),{setup:f,read:h,resolveKeyframes:m,preUpdate:y,update:g,preRender:v,render:S,postRender:x}=c,T=()=>{const R=Qi.useManualTiming?a.timestamp:performance.now();n=!1,Qi.useManualTiming||(a.delta=r?1e3/60:Math.max(Math.min(R-a.timestamp,O4),1)),a.timestamp=R,a.isProcessing=!0,f.process(a),h.process(a),m.process(a),y.process(a),g.process(a),v.process(a),S.process(a),x.process(a),a.isProcessing=!1,n&&e&&(r=!1,t(T))},M=()=>{n=!0,r=!0,a.isProcessing||t(T)};return{schedule:gc.reduce((R,G)=>{const I=c[G];return R[G]=(ee,J=!1,X=!1)=>(n||M(),I.schedule(ee,J,X)),R},{}),cancel:R=>{for(let G=0;G<gc.length;G++)c[gc[G]].cancel(R)},state:a,steps:c}}const{schedule:it,cancel:Vr,state:Ht,steps:Op}=jO(typeof requestAnimationFrame<"u"?requestAnimationFrame:Pn,!0);let Mc;function _4(){Mc=void 0}const fn={now:()=>(Mc===void 0&&fn.set(Ht.isProcessing||Qi.useManualTiming?Ht.timestamp:performance.now()),Mc),set:t=>{Mc=t,queueMicrotask(_4)}},BO=t=>e=>typeof e=="string"&&e.startsWith(t),tg=BO("--"),R4=BO("var(--"),ng=t=>R4(t)?C4.test(t.split("/*")[0].trim()):!1,C4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Zo={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Sl={...Zo,transform:t=>Zi(0,1,t)},bc={...Zo,default:1},rl=t=>Math.round(t*1e5)/1e5,ig=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function k4(t){return t==null}const M4=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rg=(t,e)=>n=>!!(typeof n=="string"&&M4.test(n)&&n.startsWith(t)||e&&!k4(n)&&Object.prototype.hasOwnProperty.call(n,e)),zO=(t,e,n)=>r=>{if(typeof r!="string")return r;const[a,u,c,f]=r.match(ig);return{[t]:parseFloat(a),[e]:parseFloat(u),[n]:parseFloat(c),alpha:f!==void 0?parseFloat(f):1}},D4=t=>Zi(0,255,t),_p={...Zo,transform:t=>Math.round(D4(t))},gs={test:rg("rgb","red"),parse:zO("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+_p.transform(t)+", "+_p.transform(e)+", "+_p.transform(n)+", "+rl(Sl.transform(r))+")"};function N4(t){let e="",n="",r="",a="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),a=t.substring(4,5),e+=e,n+=n,r+=r,a+=a),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:a?parseInt(a,16)/255:1}}const _m={test:rg("#"),parse:N4,transform:gs.transform},Vl=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),_r=Vl("deg"),mi=Vl("%"),de=Vl("px"),$4=Vl("vh"),j4=Vl("vw"),_1={...mi,parse:t=>mi.parse(t)/100,transform:t=>mi.transform(t*100)},To={test:rg("hsl","hue"),parse:zO("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+mi.transform(rl(e))+", "+mi.transform(rl(n))+", "+rl(Sl.transform(r))+")"},At={test:t=>gs.test(t)||_m.test(t)||To.test(t),parse:t=>gs.test(t)?gs.parse(t):To.test(t)?To.parse(t):_m.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?gs.transform(t):To.transform(t),getAnimatableNone:t=>{const e=At.parse(t);return e.alpha=0,At.transform(e)}},B4=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function z4(t){return isNaN(t)&&typeof t=="string"&&(t.match(ig)?.length||0)+(t.match(B4)?.length||0)>0}const LO="number",VO="color",L4="var",V4="var(",R1="${}",U4=/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 wl(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},a=[];let u=0;const f=e.replace(U4,h=>(At.test(h)?(r.color.push(u),a.push(VO),n.push(At.parse(h))):h.startsWith(V4)?(r.var.push(u),a.push(L4),n.push(h)):(r.number.push(u),a.push(LO),n.push(parseFloat(h))),++u,R1)).split(R1);return{values:n,split:f,indexes:r,types:a}}function UO(t){return wl(t).values}function KO(t){const{split:e,types:n}=wl(t),r=e.length;return a=>{let u="";for(let c=0;c<r;c++)if(u+=e[c],a[c]!==void 0){const f=n[c];f===LO?u+=rl(a[c]):f===VO?u+=At.transform(a[c]):u+=a[c]}return u}}const K4=t=>typeof t=="number"?0:At.test(t)?At.getAnimatableNone(t):t;function q4(t){const e=UO(t);return KO(t)(e.map(K4))}const Ur={test:z4,parse:UO,createTransformer:KO,getAnimatableNone:q4};function Rp(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 P4({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let a=0,u=0,c=0;if(!e)a=u=c=n;else{const f=n<.5?n*(1+e):n+e-n*e,h=2*n-f;a=Rp(h,f,t+1/3),u=Rp(h,f,t),c=Rp(h,f,t-1/3)}return{red:Math.round(a*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:r}}function tf(t,e){return n=>n>0?e:t}const rt=(t,e,n)=>t+(e-t)*n,Cp=(t,e,n)=>{const r=t*t,a=n*(e*e-r)+r;return a<0?0:Math.sqrt(a)},I4=[_m,gs,To],H4=t=>I4.find(e=>e.test(t));function C1(t){const e=H4(t);if(!e)return!1;let n=e.parse(t);return e===To&&(n=P4(n)),n}const k1=(t,e)=>{const n=C1(t),r=C1(e);if(!n||!r)return tf(t,e);const a={...n};return u=>(a.red=Cp(n.red,r.red,u),a.green=Cp(n.green,r.green,u),a.blue=Cp(n.blue,r.blue,u),a.alpha=rt(n.alpha,r.alpha,u),gs.transform(a))},Rm=new Set(["none","hidden"]);function F4(t,e){return Rm.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function G4(t,e){return n=>rt(t,e,n)}function sg(t){return typeof t=="number"?G4:typeof t=="string"?ng(t)?tf:At.test(t)?k1:X4:Array.isArray(t)?qO:typeof t=="object"?At.test(t)?k1:Y4:tf}function qO(t,e){const n=[...t],r=n.length,a=t.map((u,c)=>sg(u)(u,e[c]));return u=>{for(let c=0;c<r;c++)n[c]=a[c](u);return n}}function Y4(t,e){const n={...t,...e},r={};for(const a in n)t[a]!==void 0&&e[a]!==void 0&&(r[a]=sg(t[a])(t[a],e[a]));return a=>{for(const u in r)n[u]=r[u](a);return n}}function J4(t,e){const n=[],r={color:0,var:0,number:0};for(let a=0;a<e.values.length;a++){const u=e.types[a],c=t.indexes[u][r[u]],f=t.values[c]??0;n[a]=f,r[u]++}return n}const X4=(t,e)=>{const n=Ur.createTransformer(e),r=wl(t),a=wl(e);return r.indexes.var.length===a.indexes.var.length&&r.indexes.color.length===a.indexes.color.length&&r.indexes.number.length>=a.indexes.number.length?Rm.has(t)&&!a.values.length||Rm.has(e)&&!r.values.length?F4(t,e):zl(qO(J4(r,a),a.values),n):tf(t,e)};function PO(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?rt(t,e,n):sg(t)(t,e)}const Z4=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>it.update(e,n),stop:()=>Vr(e),now:()=>Ht.isProcessing?Ht.timestamp:fn.now()}},IO=(t,e,n=10)=>{let r="";const a=Math.max(Math.round(e/n),2);for(let u=0;u<a;u++)r+=Math.round(t(u/(a-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},nf=2e4;function og(t){let e=0;const n=50;let r=t.next(e);for(;!r.done&&e<nf;)e+=n,r=t.next(e);return e>=nf?1/0:e}function Q4(t,e=100,n){const r=n({...t,keyframes:[0,e]}),a=Math.min(og(r),nf);return{type:"keyframes",ease:u=>r.next(a*u).value/e,duration:qn(a)}}const W4=5;function HO(t,e,n){const r=Math.max(e-W4,0);return AO(n-t(r),e-r)}const lt={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},kp=.001;function eU({duration:t=lt.duration,bounce:e=lt.bounce,velocity:n=lt.velocity,mass:r=lt.mass}){let a,u,c=1-e;c=Zi(lt.minDamping,lt.maxDamping,c),t=Zi(lt.minDuration,lt.maxDuration,qn(t)),c<1?(a=m=>{const y=m*c,g=y*t,v=y-n,S=Cm(m,c),x=Math.exp(-g);return kp-v/S*x},u=m=>{const g=m*c*t,v=g*n+n,S=Math.pow(c,2)*Math.pow(m,2)*t,x=Math.exp(-g),T=Cm(Math.pow(m,2),c);return(-a(m)+kp>0?-1:1)*((v-S)*x)/T}):(a=m=>{const y=Math.exp(-m*t),g=(m-n)*t+1;return-kp+y*g},u=m=>{const y=Math.exp(-m*t),g=(n-m)*(t*t);return y*g});const f=5/t,h=nU(a,u,f);if(t=pi(t),isNaN(h))return{stiffness:lt.stiffness,damping:lt.damping,duration:t};{const m=Math.pow(h,2)*r;return{stiffness:m,damping:c*2*Math.sqrt(r*m),duration:t}}}const tU=12;function nU(t,e,n){let r=n;for(let a=1;a<tU;a++)r=r-t(r)/e(r);return r}function Cm(t,e){return t*Math.sqrt(1-e*e)}const iU=["duration","bounce"],rU=["stiffness","damping","mass"];function M1(t,e){return e.some(n=>t[n]!==void 0)}function sU(t){let e={velocity:lt.velocity,stiffness:lt.stiffness,damping:lt.damping,mass:lt.mass,isResolvedFromDuration:!1,...t};if(!M1(t,rU)&&M1(t,iU))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),a=r*r,u=2*Zi(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:lt.mass,stiffness:a,damping:u}}else{const n=eU(t);e={...e,...n,mass:lt.mass},e.isResolvedFromDuration=!0}return e}function rf(t=lt.visualDuration,e=lt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:a}=n;const u=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],f={done:!1,value:u},{stiffness:h,damping:m,mass:y,duration:g,velocity:v,isResolvedFromDuration:S}=sU({...n,velocity:-qn(n.velocity||0)}),x=v||0,T=m/(2*Math.sqrt(h*y)),M=c-u,C=qn(Math.sqrt(h/y)),_=Math.abs(M)<5;r||(r=_?lt.restSpeed.granular:lt.restSpeed.default),a||(a=_?lt.restDelta.granular:lt.restDelta.default);let R;if(T<1){const I=Cm(C,T);R=ee=>{const J=Math.exp(-T*C*ee);return c-J*((x+T*C*M)/I*Math.sin(I*ee)+M*Math.cos(I*ee))}}else if(T===1)R=I=>c-Math.exp(-C*I)*(M+(x+C*M)*I);else{const I=C*Math.sqrt(T*T-1);R=ee=>{const J=Math.exp(-T*C*ee),X=Math.min(I*ee,300);return c-J*((x+T*C*M)*Math.sinh(X)+I*M*Math.cosh(X))/I}}const G={calculatedDuration:S&&g||null,next:I=>{const ee=R(I);if(S)f.done=I>=g;else{let J=I===0?x:0;T<1&&(J=I===0?pi(x):HO(R,I,ee));const X=Math.abs(J)<=r,he=Math.abs(c-ee)<=a;f.done=X&&he}return f.value=f.done?c:ee,f},toString:()=>{const I=Math.min(og(G),nf),ee=IO(J=>G.next(I*J).value,I,30);return I+"ms "+ee},toTransition:()=>{}};return G}rf.applyToOptions=t=>{const e=Q4(t,100,rf);return t.ease=e.ease,t.duration=pi(e.duration),t.type="keyframes",t};function km({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:a=10,bounceStiffness:u=500,modifyTarget:c,min:f,max:h,restDelta:m=.5,restSpeed:y}){const g=t[0],v={done:!1,value:g},S=X=>f!==void 0&&X<f||h!==void 0&&X>h,x=X=>f===void 0?h:h===void 0||Math.abs(f-X)<Math.abs(h-X)?f:h;let T=n*e;const M=g+T,C=c===void 0?M:c(M);C!==M&&(T=C-g);const _=X=>-T*Math.exp(-X/r),R=X=>C+_(X),G=X=>{const he=_(X),pe=R(X);v.done=Math.abs(he)<=m,v.value=v.done?C:pe};let I,ee;const J=X=>{S(v.value)&&(I=X,ee=rf({keyframes:[v.value,x(v.value)],velocity:HO(R,X,v.value),damping:a,stiffness:u,restDelta:m,restSpeed:y}))};return J(0),{calculatedDuration:null,next:X=>{let he=!1;return!ee&&I===void 0&&(he=!0,G(X),J(X)),I!==void 0&&X>=I?ee.next(X-I):(!he&&G(X),v)}}}function oU(t,e,n){const r=[],a=n||Qi.mix||PO,u=t.length-1;for(let c=0;c<u;c++){let f=a(t[c],t[c+1]);if(e){const h=Array.isArray(e)?e[c]||Pn:e;f=zl(h,f)}r.push(f)}return r}function aU(t,e,{clamp:n=!0,ease:r,mixer:a}={}){const u=t.length;if(Xy(u===e.length),u===1)return()=>e[0];if(u===2&&e[0]===e[1])return()=>e[1];const c=t[0]===t[1];t[0]>t[u-1]&&(t=[...t].reverse(),e=[...e].reverse());const f=oU(e,r,a),h=f.length,m=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=vl(t[g],t[g+1],y);return f[g](v)};return n?y=>m(Zi(t[0],t[u-1],y)):m}function lU(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const a=vl(0,e,r);t.push(rt(n,1,a))}}function uU(t){const e=[0];return lU(e,t.length-1),e}function cU(t,e){return t.map(n=>n*e)}function fU(t,e){return t.map(()=>e||NO).splice(0,t.length-1)}function sl({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const a=x4(r)?r.map(O1):O1(r),u={done:!1,value:e[0]},c=cU(n&&n.length===e.length?n:uU(e),t),f=aU(c,e,{ease:Array.isArray(a)?a:fU(e,a)});return{calculatedDuration:t,next:h=>(u.value=f(h),u.done=h>=t,u)}}const dU=t=>t!==null;function ag(t,{repeat:e,repeatType:n="loop"},r,a=1){const u=t.filter(dU),f=a<0||e&&n!=="loop"&&e%2===1?0:u.length-1;return!f||r===void 0?u[f]:r}const hU={decay:km,inertia:km,tween:sl,keyframes:sl,spring:rf};function FO(t){typeof t.type=="string"&&(t.type=hU[t.type])}class lg{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 pU=t=>t/100;class ug extends lg{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!==fn.now()&&this.tick(fn.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;FO(e);const{type:n=sl,repeat:r=0,repeatDelay:a=0,repeatType:u,velocity:c=0}=e;let{keyframes:f}=e;const h=n||sl;h!==sl&&typeof f[0]!="number"&&(this.mixKeyframes=zl(pU,PO(f[0],f[1])),f=[0,100]);const m=h({...e,keyframes:f});u==="mirror"&&(this.mirroredGenerator=h({...e,keyframes:[...f].reverse(),velocity:-c})),m.calculatedDuration===null&&(m.calculatedDuration=og(m));const{calculatedDuration:y}=m;this.calculatedDuration=y,this.resolvedDuration=y+a,this.totalDuration=this.resolvedDuration*(r+1)-a,this.generator=m}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:a,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:f,calculatedDuration:h}=this;if(this.startTime===null)return r.next(0);const{delay:m=0,keyframes:y,repeat:g,repeatType:v,repeatDelay:S,type:x,onUpdate:T,finalKeyframe:M}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const C=this.currentTime-m*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?C<0:C>a;this.currentTime=Math.max(C,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let R=this.currentTime,G=r;if(g){const X=Math.min(this.currentTime,a)/f;let he=Math.floor(X),pe=X%1;!pe&&X>=1&&(pe=1),pe===1&&he--,he=Math.min(he,g+1),!!(he%2)&&(v==="reverse"?(pe=1-pe,S&&(pe-=S/f)):v==="mirror"&&(G=c)),R=Zi(0,1,pe)*f}const I=_?{done:!1,value:y[0]}:G.next(R);u&&(I.value=u(I.value));let{done:ee}=I;!_&&h!==null&&(ee=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const J=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ee);return J&&x!==km&&(I.value=ag(y,this.options,M,this.speed)),T&&T(I.value),J&&this.finish(),I}then(e,n){return this.finished.then(e,n)}get duration(){return qn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qn(e)}get time(){return qn(this.currentTime)}set time(e){e=pi(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(fn.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=qn(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=Z4,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),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(fn.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 mU(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const bs=t=>t*180/Math.PI,Mm=t=>{const e=bs(Math.atan2(t[1],t[0]));return Dm(e)},yU={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:Mm,rotateZ:Mm,skewX:t=>bs(Math.atan(t[1])),skewY:t=>bs(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Dm=t=>(t=t%360,t<0&&(t+=360),t),D1=Mm,N1=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),$1=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),gU={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:N1,scaleY:$1,scale:t=>(N1(t)+$1(t))/2,rotateX:t=>Dm(bs(Math.atan2(t[6],t[5]))),rotateY:t=>Dm(bs(Math.atan2(-t[2],t[0]))),rotateZ:D1,rotate:D1,skewX:t=>bs(Math.atan(t[4])),skewY:t=>bs(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Nm(t){return t.includes("scale")?1:0}function $m(t,e){if(!t||t==="none")return Nm(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,a;if(n)r=gU,a=n;else{const f=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=yU,a=f}if(!a)return Nm(e);const u=r[e],c=a[1].split(",").map(vU);return typeof u=="function"?u(c):c[u]}const bU=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $m(n,e)};function vU(t){return parseFloat(t.trim())}const Qo=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Wo=new Set(Qo),j1=t=>t===Zo||t===de,SU=new Set(["x","y","z"]),wU=Qo.filter(t=>!SU.has(t));function xU(t){const e=[];return wU.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const ws={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")};ws.translateX=ws.x;ws.translateY=ws.y;const xs=new Set;let jm=!1,Bm=!1,zm=!1;function GO(){if(Bm){const t=Array.from(xs).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const a=xU(r);a.length&&(n.set(r,a),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const a=n.get(r);a&&a.forEach(([u,c])=>{r.getValue(u)?.set(c)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Bm=!1,jm=!1,xs.forEach(t=>t.complete(zm)),xs.clear()}function YO(){xs.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(Bm=!0)})}function TU(){zm=!0,YO(),GO(),zm=!1}class cg{constructor(e,n,r,a,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=a,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(xs.add(this),jm||(jm=!0,it.read(YO),it.resolveKeyframes(GO))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:a}=this;if(e[0]===null){const u=a?.get(),c=e[e.length-1];if(u!==void 0)e[0]=u;else if(r&&n){const f=r.readValue(n,c);f!=null&&(e[0]=f)}e[0]===void 0&&(e[0]=c),a&&u===void 0&&a.set(e[0])}mU(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),xs.delete(this)}cancel(){this.state==="scheduled"&&(xs.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const AU=t=>t.startsWith("--");function EU(t,e,n){AU(e)?t.style.setProperty(e,n):t.style[e]=n}const OU=Zy(()=>window.ScrollTimeline!==void 0),_U={};function RU(t,e){const n=Zy(t);return()=>_U[e]??n()}const JO=RU(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),el=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,B1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:el([0,.65,.55,1]),circOut:el([.55,0,1,.45]),backIn:el([.31,.01,.66,-.59]),backOut:el([.33,1.53,.69,.99])};function XO(t,e){if(t)return typeof t=="function"?JO()?IO(t,e):"ease-out":$O(t)?el(t):Array.isArray(t)?t.map(n=>XO(n,e)||B1.easeOut):B1[t]}function CU(t,e,n,{delay:r=0,duration:a=300,repeat:u=0,repeatType:c="loop",ease:f="easeOut",times:h}={},m=void 0){const y={[e]:n};h&&(y.offset=h);const g=XO(f,a);Array.isArray(g)&&(y.easing=g);const v={delay:r,duration:a,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return m&&(v.pseudoElement=m),t.animate(y,v)}function ZO(t){return typeof t=="function"&&"applyToOptions"in t}function kU({type:t,...e}){return ZO(t)&&JO()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class MU extends lg{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:a,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:f,onComplete:h}=e;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=e,Xy(typeof e.type!="string");const m=kU(e);this.animation=CU(n,r,a,m,u),m.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const y=ag(a,this.options,f,this.speed);this.updateMotionValue?this.updateMotionValue(y):EU(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 qn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+qn(e)}get time(){return qn(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=pi(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&&OU()?(this.animation.timeline=e,Pn):n(this)}}const QO={anticipate:kO,backInOut:CO,circInOut:DO};function DU(t){return t in QO}function NU(t){typeof t.ease=="string"&&DU(t.ease)&&(t.ease=QO[t.ease])}const z1=10;class $U extends MU{constructor(e){NU(e),FO(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:a,element:u,...c}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const f=new ug({...c,autoplay:!1}),h=pi(this.finishedTime??this.time);n.setWithVelocity(f.sample(h-z1).value,f.sample(h).value,z1),f.stop()}}const L1=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ur.test(t)||t==="0")&&!t.startsWith("url("));function jU(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 BU(t,e,n,r){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const u=t[t.length-1],c=L1(a,e),f=L1(u,e);return!c||!f?!1:jU(t)||(n==="spring"||ZO(n))&&r}function Lm(t){t.duration=0,t.type="keyframes"}const zU=new Set(["opacity","clipPath","filter","transform"]),LU=Zy(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function VU(t){const{motionValue:e,name:n,repeatDelay:r,repeatType:a,damping:u,type:c}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:m}=e.owner.getProps();return LU()&&n&&zU.has(n)&&(n!=="transform"||!m)&&!h&&!r&&a!=="mirror"&&u!==0&&c!=="inertia"}const UU=40;class KU extends lg{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:a=0,repeatDelay:u=0,repeatType:c="loop",keyframes:f,name:h,motionValue:m,element:y,...g}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=fn.now();const v={autoplay:e,delay:n,type:r,repeat:a,repeatDelay:u,repeatType:c,name:h,motionValue:m,element:y,...g},S=y?.KeyframeResolver||cg;this.keyframeResolver=new S(f,(x,T,M)=>this.onKeyframesResolved(x,T,v,!M),h,m,y),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,r,a){this.keyframeResolver=void 0;const{name:u,type:c,velocity:f,delay:h,isHandoff:m,onUpdate:y}=r;this.resolvedAt=fn.now(),BU(e,u,c,f)||((Qi.instantAnimations||!h)&&y?.(ag(e,r,n)),e[0]=e[e.length-1],Lm(r),r.repeat=0);const v={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>UU?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},S=!m&&VU(v)?new $U({...v,element:v.motionValue.owner.current}):new ug(v);S.finished.then(()=>this.notifyFinished()).catch(Pn),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(),TU()),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 qU=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function PU(t){const e=qU.exec(t);if(!e)return[,];const[,n,r,a]=e;return[`--${n??r}`,a]}function WO(t,e,n=1){const[r,a]=PU(t);if(!r)return;const u=window.getComputedStyle(e).getPropertyValue(r);if(u){const c=u.trim();return wO(c)?parseFloat(c):c}return ng(a)?WO(a,e,n+1):a}function fg(t,e){return t?.[e]??t?.default??t}const e_=new Set(["width","height","top","left","right","bottom",...Qo]),IU={test:t=>t==="auto",parse:t=>t},t_=t=>e=>e.test(t),n_=[Zo,de,mi,_r,j4,$4,IU],V1=t=>n_.find(t_(t));function HU(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||TO(t):!0}const FU=new Set(["brightness","contrast","saturate","opacity"]);function GU(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(ig)||[];if(!r)return t;const a=n.replace(r,"");let u=FU.has(e)?1:0;return r!==n&&(u*=100),e+"("+u+a+")"}const YU=/\b([a-z-]*)\(.*?\)/gu,Vm={...Ur,getAnimatableNone:t=>{const e=t.match(YU);return e?e.map(GU).join(" "):t}},U1={...Zo,transform:Math.round},JU={rotate:_r,rotateX:_r,rotateY:_r,rotateZ:_r,scale:bc,scaleX:bc,scaleY:bc,scaleZ:bc,skew:_r,skewX:_r,skewY:_r,distance:de,translateX:de,translateY:de,translateZ:de,x:de,y:de,z:de,perspective:de,transformPerspective:de,opacity:Sl,originX:_1,originY:_1,originZ:de},dg={borderWidth:de,borderTopWidth:de,borderRightWidth:de,borderBottomWidth:de,borderLeftWidth:de,borderRadius:de,radius:de,borderTopLeftRadius:de,borderTopRightRadius:de,borderBottomRightRadius:de,borderBottomLeftRadius:de,width:de,maxWidth:de,height:de,maxHeight:de,top:de,right:de,bottom:de,left:de,padding:de,paddingTop:de,paddingRight:de,paddingBottom:de,paddingLeft:de,margin:de,marginTop:de,marginRight:de,marginBottom:de,marginLeft:de,backgroundPositionX:de,backgroundPositionY:de,...JU,zIndex:U1,fillOpacity:Sl,strokeOpacity:Sl,numOctaves:U1},XU={...dg,color:At,backgroundColor:At,outlineColor:At,fill:At,stroke:At,borderColor:At,borderTopColor:At,borderRightColor:At,borderBottomColor:At,borderLeftColor:At,filter:Vm,WebkitFilter:Vm},i_=t=>XU[t];function r_(t,e){let n=i_(t);return n!==Vm&&(n=Ur),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const ZU=new Set(["auto","none","0"]);function QU(t,e,n){let r=0,a;for(;r<t.length&&!a;){const u=t[r];typeof u=="string"&&!ZU.has(u)&&wl(u).values.length&&(a=t[r]),r++}if(a&&n)for(const u of e)t[u]=r_(n,a)}class WU extends cg{constructor(e,n,r,a,u){super(e,n,r,a,u,!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 m=e[h];if(typeof m=="string"&&(m=m.trim(),ng(m))){const y=WO(m,n.current);y!==void 0&&(e[h]=y),h===e.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!e_.has(r)||e.length!==2)return;const[a,u]=e,c=V1(a),f=V1(u);if(c!==f)if(j1(c)&&j1(f))for(let h=0;h<e.length;h++){const m=e[h];typeof m=="string"&&(e[h]=parseFloat(m))}else ws[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,r=[];for(let a=0;a<e.length;a++)(e[a]===null||HU(e[a]))&&r.push(a);r.length&&QU(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=ws[r](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&e.getValue(r,a).jump(a,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const a=e.getValue(n);a&&a.jump(this.measuredOrigin,!1);const u=r.length-1,c=r[u];r[u]=ws[n](e.measureViewportBox(),window.getComputedStyle(e.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),this.removedTransforms?.length&&this.removedTransforms.forEach(([f,h])=>{e.getValue(f).set(h)}),this.resolveNoneKeyframes()}}function eK(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const a=n?.[t]??r.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}const s_=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function tK(t){return xO(t)&&"offsetHeight"in t}const K1=30,nK=t=>!isNaN(parseFloat(t));class iK{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{const a=fn.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const u of this.dependents)u.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=fn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=nK(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 Qy);const r=this.events[e].add(n);return e==="change"?()=>{r(),it.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=fn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>K1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,K1);return AO(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 Io(t,e){return new iK(t,e)}const{schedule:hg}=jO(queueMicrotask,!1),Zn={x:!1,y:!1};function o_(){return Zn.x||Zn.y}function rK(t){return t==="x"||t==="y"?Zn[t]?null:(Zn[t]=!0,()=>{Zn[t]=!1}):Zn.x||Zn.y?null:(Zn.x=Zn.y=!0,()=>{Zn.x=Zn.y=!1})}function a_(t,e){const n=eK(t),r=new AbortController,a={passive:!0,...e,signal:r.signal};return[n,a,()=>r.abort()]}function q1(t){return!(t.pointerType==="touch"||o_())}function sK(t,e,n={}){const[r,a,u]=a_(t,n),c=f=>{if(!q1(f))return;const{target:h}=f,m=e(h,f);if(typeof m!="function"||!h)return;const y=g=>{q1(g)&&(m(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,a)};return r.forEach(f=>{f.addEventListener("pointerenter",c,a)}),u}const l_=(t,e)=>e?t===e?!0:l_(t,e.parentElement):!1,pg=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,oK=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function aK(t){return oK.has(t.tagName)||t.tabIndex!==-1}const Dc=new WeakSet;function P1(t){return e=>{e.key==="Enter"&&t(e)}}function Mp(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const lK=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=P1(()=>{if(Dc.has(n))return;Mp(n,"down");const a=P1(()=>{Mp(n,"up")}),u=()=>Mp(n,"cancel");n.addEventListener("keyup",a,e),n.addEventListener("blur",u,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function I1(t){return pg(t)&&!o_()}function uK(t,e,n={}){const[r,a,u]=a_(t,n),c=f=>{const h=f.currentTarget;if(!I1(f))return;Dc.add(h);const m=e(h,f),y=(S,x)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),Dc.has(h)&&Dc.delete(h),I1(S)&&typeof m=="function"&&m(S,{success:x})},g=S=>{y(S,h===window||h===document||n.useGlobalTarget||l_(h,S.target))},v=S=>{y(S,!1)};window.addEventListener("pointerup",g,a),window.addEventListener("pointercancel",v,a)};return r.forEach(f=>{(n.useGlobalTarget?window:f).addEventListener("pointerdown",c,a),tK(f)&&(f.addEventListener("focus",m=>lK(m,a)),!aK(f)&&!f.hasAttribute("tabindex")&&(f.tabIndex=0))}),u}function u_(t){return xO(t)&&"ownerSVGElement"in t}function cK(t){return u_(t)&&t.tagName==="svg"}const Yt=t=>!!(t&&t.getVelocity),fK=[...n_,At,Ur],dK=t=>fK.find(t_(t)),c_=$.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function hK(t=!0){const e=$.useContext(Gy);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:a}=e,u=$.useId();$.useEffect(()=>{if(t)return a(u)},[t]);const c=$.useCallback(()=>t&&r&&r(u),[u,r,t]);return!n&&r?[!1,c]:[!0]}const f_=$.createContext({strict:!1}),H1={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"]},Ho={};for(const t in H1)Ho[t]={isEnabled:e=>H1[t].some(n=>!!e[n])};function pK(t){for(const e in t)Ho[e]={...Ho[e],...t[e]}}const mK=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 sf(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||mK.has(t)}let d_=t=>!sf(t);function yK(t){typeof t=="function"&&(d_=e=>e.startsWith("on")?!sf(e):t(e))}try{yK(require("@emotion/is-prop-valid").default)}catch{}function gK(t,e,n){const r={};for(const a in t)a==="values"&&typeof t.values=="object"||(d_(a)||n===!0&&sf(a)||!e&&!sf(a)||t.draggable&&a.startsWith("onDrag"))&&(r[a]=t[a]);return r}const $f=$.createContext({});function jf(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function xl(t){return typeof t=="string"||Array.isArray(t)}const mg=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yg=["initial",...mg];function Bf(t){return jf(t.animate)||yg.some(e=>xl(t[e]))}function h_(t){return!!(Bf(t)||t.variants)}function bK(t,e){if(Bf(t)){const{initial:n,animate:r}=t;return{initial:n===!1||xl(n)?n:void 0,animate:xl(r)?r:void 0}}return t.inherit!==!1?e:{}}function vK(t){const{initial:e,animate:n}=bK(t,$.useContext($f));return $.useMemo(()=>({initial:e,animate:n}),[F1(e),F1(n)])}function F1(t){return Array.isArray(t)?t.join(" "):t}const Tl={};function SK(t){for(const e in t)Tl[e]=t[e],tg(e)&&(Tl[e].isCSSVariable=!0)}function p_(t,{layout:e,layoutId:n}){return Wo.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Tl[t]||t==="opacity")}const wK={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},xK=Qo.length;function TK(t,e,n){let r="",a=!0;for(let u=0;u<xK;u++){const c=Qo[u],f=t[c];if(f===void 0)continue;let h=!0;if(typeof f=="number"?h=f===(c.startsWith("scale")?1:0):h=parseFloat(f)===0,!h||n){const m=s_(f,dg[c]);if(!h){a=!1;const y=wK[c]||c;r+=`${y}(${m}) `}n&&(e[c]=m)}}return r=r.trim(),n?r=n(e,a?"":r):a&&(r="none"),r}function gg(t,e,n){const{style:r,vars:a,transformOrigin:u}=t;let c=!1,f=!1;for(const h in e){const m=e[h];if(Wo.has(h)){c=!0;continue}else if(tg(h)){a[h]=m;continue}else{const y=s_(m,dg[h]);h.startsWith("origin")?(f=!0,u[h]=y):r[h]=y}}if(e.transform||(c||n?r.transform=TK(e,t.transform,n):r.transform&&(r.transform="none")),f){const{originX:h="50%",originY:m="50%",originZ:y=0}=u;r.transformOrigin=`${h} ${m} ${y}`}}const bg=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function m_(t,e,n){for(const r in e)!Yt(e[r])&&!p_(r,n)&&(t[r]=e[r])}function AK({transformTemplate:t},e){return $.useMemo(()=>{const n=bg();return gg(n,e,t),Object.assign({},n.vars,n.style)},[e])}function EK(t,e){const n=t.style||{},r={};return m_(r,n,t),Object.assign(r,AK(t,e)),r}function OK(t,e){const n={},r=EK(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 _K={offset:"stroke-dashoffset",array:"stroke-dasharray"},RK={offset:"strokeDashoffset",array:"strokeDasharray"};function CK(t,e,n=1,r=0,a=!0){t.pathLength=1;const u=a?_K:RK;t[u.offset]=de.transform(-r);const c=de.transform(e),f=de.transform(n);t[u.array]=`${c} ${f}`}function y_(t,{attrX:e,attrY:n,attrScale:r,pathLength:a,pathSpacing:u=1,pathOffset:c=0,...f},h,m,y){if(gg(t,f,m),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),a!==void 0&&CK(g,a,u,c,!1)}const g_=()=>({...bg(),attrs:{}}),b_=t=>typeof t=="string"&&t.toLowerCase()==="svg";function kK(t,e,n,r){const a=$.useMemo(()=>{const u=g_();return y_(u,e,b_(r),t.transformTemplate,t.style),{...u.attrs,style:{...u.style}}},[e]);if(t.style){const u={};m_(u,t.style,t),a.style={...u,...a.style}}return a}const MK=["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 vg(t){return typeof t!="string"||t.includes("-")?!1:!!(MK.indexOf(t)>-1||/[A-Z]/u.test(t))}function DK(t,e,n,{latestValues:r},a,u=!1){const f=(vg(t)?kK:OK)(e,r,a,t),h=gK(e,typeof t=="string",u),m=t!==$.Fragment?{...h,...f,ref:n}:{},{children:y}=e,g=$.useMemo(()=>Yt(y)?y.get():y,[y]);return $.createElement(t,{...m,children:g})}function G1(t){const e=[{},{}];return t?.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Sg(t,e,n,r){if(typeof e=="function"){const[a,u]=G1(r);e=e(n!==void 0?n:t.custom,a,u)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,u]=G1(r);e=e(n!==void 0?n:t.custom,a,u)}return e}function Nc(t){return Yt(t)?t.get():t}function NK({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,a){return{latestValues:$K(n,r,a,t),renderState:e()}}function $K(t,e,n,r){const a={},u=r(t,{});for(const v in u)a[v]=Nc(u[v]);let{initial:c,animate:f}=t;const h=Bf(t),m=h_(t);e&&m&&!h&&t.inherit!==!1&&(c===void 0&&(c=e.initial),f===void 0&&(f=e.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?f:c;if(g&&typeof g!="boolean"&&!jf(g)){const v=Array.isArray(g)?g:[g];for(let S=0;S<v.length;S++){const x=Sg(t,v[S]);if(x){const{transitionEnd:T,transition:M,...C}=x;for(const _ in C){let R=C[_];if(Array.isArray(R)){const G=y?R.length-1:0;R=R[G]}R!==null&&(a[_]=R)}for(const _ in T)a[_]=T[_]}}}return a}const v_=t=>(e,n)=>{const r=$.useContext($f),a=$.useContext(Gy),u=()=>NK(t,e,r,a);return n?u():p4(u)};function wg(t,e,n){const{style:r}=t,a={};for(const u in r)(Yt(r[u])||e.style&&Yt(e.style[u])||p_(u,t)||n?.getValue(u)?.liveStyle!==void 0)&&(a[u]=r[u]);return a}const jK=v_({scrapeMotionValuesFromProps:wg,createRenderState:bg});function S_(t,e,n){const r=wg(t,e,n);for(const a in t)if(Yt(t[a])||Yt(e[a])){const u=Qo.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;r[u]=t[a]}return r}const BK=v_({scrapeMotionValuesFromProps:S_,createRenderState:g_}),zK=Symbol.for("motionComponentSymbol");function Ao(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function LK(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):Ao(n)&&(n.current=r))},[e])}const xg=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),VK="framerAppearId",w_="data-"+xg(VK),x_=$.createContext({});function UK(t,e,n,r,a){const{visualElement:u}=$.useContext($f),c=$.useContext(f_),f=$.useContext(Gy),h=$.useContext(c_).reducedMotion,m=$.useRef(null);r=r||c.renderer,!m.current&&r&&(m.current=r(t,{visualState:e,parent:u,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:h}));const y=m.current,g=$.useContext(x_);y&&!y.projection&&a&&(y.type==="html"||y.type==="svg")&&KK(m.current,n,a,g);const v=$.useRef(!1);$.useInsertionEffect(()=>{y&&v.current&&y.update(n,f)});const S=n[w_],x=$.useRef(!!S&&!window.MotionHandoffIsComplete?.(S)&&window.MotionHasOptimisedAnimation?.(S));return m4(()=>{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 KK(t,e,n,r){const{layoutId:a,layout:u,drag:c,dragConstraints:f,layoutScroll:h,layoutRoot:m,layoutCrossfade:y}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:T_(t.parent)),t.projection.setOptions({layoutId:a,layout:u,alwaysMeasureLayout:!!c||f&&Ao(f),visualElement:t,animationType:typeof u=="string"?u:"both",initialPromotionConfig:r,crossfade:y,layoutScroll:h,layoutRoot:m})}function T_(t){if(t)return t.options.allowProjection!==!1?t.projection:T_(t.parent)}function Dp(t,{forwardMotionProps:e=!1}={},n,r){n&&pK(n);const a=vg(t)?BK:jK;function u(f,h){let m;const y={...$.useContext(c_),...f,layoutId:qK(f)},{isStatic:g}=y,v=vK(f),S=a(f,g);if(!g&&Fy){PK();const x=IK(y);m=x.MeasureLayout,v.visualElement=UK(t,S,y,r,x.ProjectionNode)}return F.jsxs($f.Provider,{value:v,children:[m&&v.visualElement?F.jsx(m,{visualElement:v.visualElement,...y}):null,DK(t,f,LK(S,v.visualElement,h),S,g,e)]})}u.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=$.forwardRef(u);return c[zK]=t,c}function qK({layoutId:t}){const e=$.useContext(SO).id;return e&&t!==void 0?e+"-"+t:t}function PK(t,e){$.useContext(f_).strict}function IK(t){const{drag:e,layout:n}=Ho;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 Dp;const n=new Map,r=(u,c)=>Dp(u,c,t,e),a=(u,c)=>r(u,c);return new Proxy(a,{get:(u,c)=>c==="create"?r:(n.has(c)||n.set(c,Dp(c,void 0,t,e)),n.get(c))})}function A_({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function FK({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function GK(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 Np(t){return t===void 0||t===1}function Um({scale:t,scaleX:e,scaleY:n}){return!Np(t)||!Np(e)||!Np(n)}function ms(t){return Um(t)||E_(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function E_(t){return Y1(t.x)||Y1(t.y)}function Y1(t){return t&&t!=="0%"}function of(t,e,n){const r=t-n,a=e*r;return n+a}function J1(t,e,n,r,a){return a!==void 0&&(t=of(t,a,r)),of(t,n,r)+e}function Km(t,e=0,n=1,r,a){t.min=J1(t.min,e,n,r,a),t.max=J1(t.max,e,n,r,a)}function O_(t,{x:e,y:n}){Km(t.x,e.translate,e.scale,e.originPoint),Km(t.y,n.translate,n.scale,n.originPoint)}const X1=.999999999999,Z1=1.0000000000001;function YK(t,e,n,r=!1){const a=n.length;if(!a)return;e.x=e.y=1;let u,c;for(let f=0;f<a;f++){u=n[f],c=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(r&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Oo(t,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(e.x*=c.x.scale,e.y*=c.y.scale,O_(t,c)),r&&ms(u.latestValues)&&Oo(t,u.latestValues))}e.x<Z1&&e.x>X1&&(e.x=1),e.y<Z1&&e.y>X1&&(e.y=1)}function Eo(t,e){t.min=t.min+e,t.max=t.max+e}function Q1(t,e,n,r,a=.5){const u=rt(t.min,t.max,a);Km(t,e,n,u,r)}function Oo(t,e){Q1(t.x,e.x,e.scaleX,e.scale,e.originX),Q1(t.y,e.y,e.scaleY,e.scale,e.originY)}function __(t,e){return A_(GK(t.getBoundingClientRect(),e))}function JK(t,e,n){const r=__(t,n),{scroll:a}=e;return a&&(Eo(r.x,a.offset.x),Eo(r.y,a.offset.y)),r}const W1=()=>({translate:0,scale:1,origin:0,originPoint:0}),_o=()=>({x:W1(),y:W1()}),ex=()=>({min:0,max:0}),yt=()=>({x:ex(),y:ex()}),qm={current:null},R_={current:!1};function XK(){if(R_.current=!0,!!Fy)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>qm.current=t.matches;t.addEventListener("change",e),e()}else qm.current=!1}const ZK=new WeakMap;function QK(t,e,n){for(const r in e){const a=e[r],u=n[r];if(Yt(a))t.addValue(r,a);else if(Yt(u))t.addValue(r,Io(a,{owner:t}));else if(u!==a)if(t.hasValue(r)){const c=t.getValue(r);c.liveStyle===!0?c.jump(a):c.hasAnimated||c.set(a)}else{const c=t.getStaticValue(r);t.addValue(r,Io(c!==void 0?c:a,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const tx=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class WK{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:a,blockInitialAnimation:u,visualState:c},f={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=cg,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=fn.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,it.render(this.render,!1,!0))};const{latestValues:h,renderState:m}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=m,this.parent=e,this.props=n,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=f,this.blockInitialAnimation=!!u,this.isControllingVariants=Bf(n),this.isVariantNode=h_(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&&Yt(S)&&S.set(h[v])}}mount(e){this.current=e,ZK.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)),R_.current||XK(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:qm.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Vr(this.notifyUpdate),Vr(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=Wo.has(e);r&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",c=>{this.latestValues[e]=c,this.props.onUpdate&&it.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let u;window.MotionCheckAppearSync&&(u=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{a(),u&&u(),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 Ho){const n=Ho[e];if(!n)continue;const{isEnabled:r,Feature:a}=n;if(!this.features[e]&&a&&r(this.props)&&(this.features[e]=new a(this)),this.features[e]){const u=this.features[e];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):yt()}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<tx.length;r++){const a=tx[r];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const u="on"+a,c=e[u];c&&(this.propEventSubscriptions[a]=this.on(a,c))}this.prevMotionValues=QK(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=Io(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"&&(wO(r)||TO(r))?r=parseFloat(r):!dK(r)&&Ur.test(n)&&(r=r_(e,n)),this.setBaseTarget(e,Yt(r)?r.get():r)),Yt(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 u=Sg(this.props,n,this.presenceContext?.custom);u&&(r=u[e])}if(n&&r!==void 0)return r;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!Yt(a)?a:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Qy),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){hg.render(this.render)}}class C_ 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;Yt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function k_(t,{style:e,vars:n},r,a){const u=t.style;let c;for(c in e)u[c]=e[c];a?.applyProjectionStyles(u,r);for(c in n)u.setProperty(c,n[c])}function eq(t){return window.getComputedStyle(t)}class tq extends C_{constructor(){super(...arguments),this.type="html",this.renderInstance=k_}readValueFromInstance(e,n){if(Wo.has(n))return this.projection?.isProjecting?Nm(n):bU(e,n);{const r=eq(e),a=(tg(n)?r.getPropertyValue(n):r[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return __(e,n)}build(e,n,r){gg(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return wg(e,n,r)}}const M_=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 nq(t,e,n,r){k_(t,e,void 0,r);for(const a in e.attrs)t.setAttribute(M_.has(a)?a:xg(a),e.attrs[a])}class iq extends C_{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yt}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(Wo.has(n)){const r=i_(n);return r&&r.default||0}return n=M_.has(n)?n:xg(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return S_(e,n,r)}build(e,n,r){y_(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,a){nq(e,n,r,a)}mount(e){this.isSVGTag=b_(e.tagName),super.mount(e)}}const rq=(t,e)=>vg(t)?new iq(e):new tq(e,{allowProjection:t!==$.Fragment});function jo(t,e,n){const r=t.getProps();return Sg(r,e,n!==void 0?n:r.custom,t)}const Pm=t=>Array.isArray(t);function sq(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Io(n))}function oq(t){return Pm(t)?t[t.length-1]||0:t}function aq(t,e){const n=jo(t,e);let{transitionEnd:r={},transition:a={},...u}=n||{};u={...u,...r};for(const c in u){const f=oq(u[c]);sq(t,c,f)}}function lq(t){return!!(Yt(t)&&t.add)}function Im(t,e){const n=t.getValue("willChange");if(lq(n))return n.add(e);if(!n&&Qi.WillChange){const r=new Qi.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function D_(t){return t.props[w_]}const uq=t=>t!==null;function cq(t,{repeat:e,repeatType:n="loop"},r){const a=t.filter(uq),u=e&&n!=="loop"&&e%2===1?0:a.length-1;return a[u]}const fq={type:"spring",stiffness:500,damping:25,restSpeed:10},dq=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),hq={type:"keyframes",duration:.8},pq={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},mq=(t,{keyframes:e})=>e.length>2?hq:Wo.has(t)?t.startsWith("scale")?dq(e[1]):fq:pq;function yq({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:a,repeat:u,repeatType:c,repeatDelay:f,from:h,elapsed:m,...y}){return!!Object.keys(y).length}const Tg=(t,e,n,r={},a,u)=>c=>{const f=fg(r,t)||{},h=f.delay||r.delay||0;let{elapsed:m=0}=r;m=m-pi(h);const y={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...f,delay:-m,onUpdate:v=>{e.set(v),f.onUpdate&&f.onUpdate(v)},onComplete:()=>{c(),f.onComplete&&f.onComplete()},name:t,motionValue:e,element:u?void 0:a};yq(f)||Object.assign(y,mq(t,y)),y.duration&&(y.duration=pi(y.duration)),y.repeatDelay&&(y.repeatDelay=pi(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let g=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(Lm(y),y.delay===0&&(g=!0)),(Qi.instantAnimations||Qi.skipAnimations)&&(g=!0,Lm(y),y.delay=0),y.allowFlatten=!f.type&&!f.ease,g&&!u&&e.get()!==void 0){const v=cq(y.keyframes,f);if(v!==void 0){it.update(()=>{y.onUpdate(v),y.onComplete()});return}}return f.isSync?new ug(y):new KU(y)};function gq({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function N_(t,e,{delay:n=0,transitionOverride:r,type:a}={}){let{transition:u=t.getDefaultTransition(),transitionEnd:c,...f}=e;r&&(u=r);const h=[],m=a&&t.animationState&&t.animationState.getState()[a];for(const y in f){const g=t.getValue(y,t.latestValues[y]??null),v=f[y];if(v===void 0||m&&gq(m,y))continue;const S={delay:n,...fg(u||{},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 C=D_(t);if(C){const _=window.MotionHandoffAnimation(C,y,it);_!==null&&(S.startTime=_,T=!0)}}Im(t,y),g.start(Tg(y,g,v,t.shouldReduceMotion&&e_.has(y)?{type:!1}:S,t,T));const M=g.animation;M&&h.push(M)}return c&&Promise.all(h).then(()=>{it.update(()=>{c&&aq(t,c)})}),h}function $_(t,e,n,r=0,a=1){const u=Array.from(t).sort((m,y)=>m.sortNodePosition(y)).indexOf(e),c=t.size,f=(c-1)*r;return typeof n=="function"?n(u,c):a===1?u*r:f-u*r}function Hm(t,e,n={}){const r=jo(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(a=n.transitionOverride);const u=r?()=>Promise.all(N_(t,r,n)):()=>Promise.resolve(),c=t.variantChildren&&t.variantChildren.size?(h=0)=>{const{delayChildren:m=0,staggerChildren:y,staggerDirection:g}=a;return bq(t,e,h,m,y,g,n)}:()=>Promise.resolve(),{when:f}=a;if(f){const[h,m]=f==="beforeChildren"?[u,c]:[c,u];return h().then(()=>m())}else return Promise.all([u(),c(n.delay)])}function bq(t,e,n=0,r=0,a=0,u=1,c){const f=[];for(const h of t.variantChildren)h.notify("AnimationStart",e),f.push(Hm(h,e,{...c,delay:n+(typeof r=="function"?0:r)+$_(t.variantChildren,h,r,a,u)}).then(()=>h.notify("AnimationComplete",e)));return Promise.all(f)}function vq(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const a=e.map(u=>Hm(t,u,n));r=Promise.all(a)}else if(typeof e=="string")r=Hm(t,e,n);else{const a=typeof e=="function"?jo(t,e,n.custom):e;r=Promise.all(N_(t,a,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function j_(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 Sq=yg.length;function B_(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?B_(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<Sq;n++){const r=yg[n],a=t.props[r];(xl(a)||a===!1)&&(e[r]=a)}return e}const wq=[...mg].reverse(),xq=mg.length;function Tq(t){return e=>Promise.all(e.map(({animation:n,options:r})=>vq(t,n,r)))}function Aq(t){let e=Tq(t),n=nx(),r=!0;const a=h=>(m,y)=>{const g=jo(t,y,h==="exit"?t.presenceContext?.custom:void 0);if(g){const{transition:v,transitionEnd:S,...x}=g;m={...m,...x,...S}}return m};function u(h){e=h(t)}function c(h){const{props:m}=t,y=B_(t.parent)||{},g=[],v=new Set;let S={},x=1/0;for(let M=0;M<xq;M++){const C=wq[M],_=n[C],R=m[C]!==void 0?m[C]:y[C],G=xl(R),I=C===h?_.isActive:null;I===!1&&(x=M);let ee=R===y[C]&&R!==m[C]&&G;if(ee&&r&&t.manuallyAnimateOnMount&&(ee=!1),_.protectedKeys={...S},!_.isActive&&I===null||!R&&!_.prevProp||jf(R)||typeof R=="boolean")continue;const J=Eq(_.prevProp,R);let X=J||C===h&&_.isActive&&!ee&&G||M>x&&G,he=!1;const pe=Array.isArray(R)?R:[R];let we=pe.reduce(a(C),{});I===!1&&(we={});const{prevResolvedValues:je={}}=_,ve={...je,...we},Z=U=>{X=!0,v.has(U)&&(he=!0,v.delete(U)),_.needsAnimating[U]=!0;const L=t.getValue(U);L&&(L.liveStyle=!1)};for(const U in ve){const L=we[U],te=je[U];if(S.hasOwnProperty(U))continue;let oe=!1;Pm(L)&&Pm(te)?oe=!j_(L,te):oe=L!==te,oe?L!=null?Z(U):v.add(U):L!==void 0&&v.has(U)?Z(U):_.protectedKeys[U]=!0}_.prevProp=R,_.prevResolvedValues=we,_.isActive&&(S={...S,...we}),r&&t.blockInitialAnimation&&(X=!1);const ne=ee&&J;X&&(!ne||he)&&g.push(...pe.map(U=>{const L={type:C};if(typeof U=="string"&&r&&!ne&&t.manuallyAnimateOnMount&&t.parent){const{parent:te}=t,oe=jo(te,U);if(te.enteringChildren&&oe){const{delayChildren:E}=oe.transition||{};L.delay=$_(te.enteringChildren,t,E)}}return{animation:U,options:L}}))}if(v.size){const M={};if(typeof m.initial!="boolean"){const C=jo(t,Array.isArray(m.initial)?m.initial[0]:m.initial);C&&C.transition&&(M.transition=C.transition)}v.forEach(C=>{const _=t.getBaseTarget(C),R=t.getValue(C);R&&(R.liveStyle=!0),M[C]=_??null}),g.push({animation:M})}let T=!!g.length;return r&&(m.initial===!1||m.initial===m.animate)&&!t.manuallyAnimateOnMount&&(T=!1),r=!1,T?e(g):Promise.resolve()}function f(h,m){if(n[h].isActive===m)return Promise.resolve();t.variantChildren?.forEach(g=>g.animationState?.setActive(h,m)),n[h].isActive=m;const y=c(h);for(const g in n)n[g].protectedKeys={};return y}return{animateChanges:c,setActive:f,setAnimateFunction:u,getState:()=>n,reset:()=>{n=nx()}}}function Eq(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!j_(e,t):!1}function ds(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function nx(){return{animate:ds(!0),whileInView:ds(),whileHover:ds(),whileTap:ds(),whileDrag:ds(),whileFocus:ds(),exit:ds()}}class Gr{constructor(e){this.isMounted=!1,this.node=e}update(){}}class Oq extends Gr{constructor(e){super(e),e.animationState||(e.animationState=Aq(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();jf(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 _q=0;class Rq extends Gr{constructor(){super(...arguments),this.id=_q++}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 a=this.node.animationState.setActive("exit",!e);n&&!e&&a.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 Cq={animation:{Feature:Oq},exit:{Feature:Rq}};function Al(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Ul(t){return{point:{x:t.pageX,y:t.pageY}}}const kq=t=>e=>pg(e)&&t(e,Ul(e));function ol(t,e,n,r){return Al(t,e,kq(n),r)}const z_=1e-4,Mq=1-z_,Dq=1+z_,L_=.01,Nq=0-L_,$q=0+L_;function Wt(t){return t.max-t.min}function jq(t,e,n){return Math.abs(t-e)<=n}function ix(t,e,n,r=.5){t.origin=r,t.originPoint=rt(e.min,e.max,t.origin),t.scale=Wt(n)/Wt(e),t.translate=rt(n.min,n.max,t.origin)-t.originPoint,(t.scale>=Mq&&t.scale<=Dq||isNaN(t.scale))&&(t.scale=1),(t.translate>=Nq&&t.translate<=$q||isNaN(t.translate))&&(t.translate=0)}function al(t,e,n,r){ix(t.x,e.x,n.x,r?r.originX:void 0),ix(t.y,e.y,n.y,r?r.originY:void 0)}function rx(t,e,n){t.min=n.min+e.min,t.max=t.min+Wt(e)}function Bq(t,e,n){rx(t.x,e.x,n.x),rx(t.y,e.y,n.y)}function sx(t,e,n){t.min=e.min-n.min,t.max=t.min+Wt(e)}function ll(t,e,n){sx(t.x,e.x,n.x),sx(t.y,e.y,n.y)}function Ln(t){return[t("x"),t("y")]}const V_=({current:t})=>t?t.ownerDocument.defaultView:null,ox=(t,e)=>Math.abs(t-e);function zq(t,e){const n=ox(t.x,e.x),r=ox(t.y,e.y);return Math.sqrt(n**2+r**2)}class U_{constructor(e,n,{transformPagePoint:r,contextWindow:a=window,dragSnapToOrigin:u=!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=jp(this.lastMoveEventInfo,this.history),S=this.startEvent!==null,x=zq(v.offset,{x:0,y:0})>=this.distanceThreshold;if(!S&&!x)return;const{point:T}=v,{timestamp:M}=Ht;this.history.push({...T,timestamp:M});const{onStart:C,onMove:_}=this.handlers;S||(C&&C(this.lastMoveEvent,v),this.startEvent=this.lastMoveEvent),_&&_(this.lastMoveEvent,v)},this.handlePointerMove=(v,S)=>{this.lastMoveEvent=v,this.lastMoveEventInfo=$p(S,this.transformPagePoint),it.update(this.updatePoint,!0)},this.handlePointerUp=(v,S)=>{this.end();const{onEnd:x,onSessionEnd:T,resumeAnimation:M}=this.handlers;if(this.dragSnapToOrigin&&M&&M(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const C=jp(v.type==="pointercancel"?this.lastMoveEventInfo:$p(S,this.transformPagePoint),this.history);this.startEvent&&x&&x(v,C),T&&T(v,C)},!pg(e))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=c,this.contextWindow=a||window;const f=Ul(e),h=$p(f,this.transformPagePoint),{point:m}=h,{timestamp:y}=Ht;this.history=[{...m,timestamp:y}];const{onSessionStart:g}=n;g&&g(e,jp(h,this.history)),this.removeListeners=zl(ol(this.contextWindow,"pointermove",this.handlePointerMove),ol(this.contextWindow,"pointerup",this.handlePointerUp),ol(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Vr(this.updatePoint)}}function $p(t,e){return e?{point:e(t.point)}:t}function ax(t,e){return{x:t.x-e.x,y:t.y-e.y}}function jp({point:t},e){return{point:t,delta:ax(t,K_(e)),offset:ax(t,Lq(e)),velocity:Vq(e,.1)}}function Lq(t){return t[0]}function K_(t){return t[t.length-1]}function Vq(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const a=K_(t);for(;n>=0&&(r=t[n],!(a.timestamp-r.timestamp>pi(e)));)n--;if(!r)return{x:0,y:0};const u=qn(a.timestamp-r.timestamp);if(u===0)return{x:0,y:0};const c={x:(a.x-r.x)/u,y:(a.y-r.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function Uq(t,{min:e,max:n},r){return e!==void 0&&t<e?t=r?rt(e,t,r.min):Math.max(t,e):n!==void 0&&t>n&&(t=r?rt(n,t,r.max):Math.min(t,n)),t}function lx(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 Kq(t,{top:e,left:n,bottom:r,right:a}){return{x:lx(t.x,n,a),y:lx(t.y,e,r)}}function ux(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 qq(t,e){return{x:ux(t.x,e.x),y:ux(t.y,e.y)}}function Pq(t,e){let n=.5;const r=Wt(t),a=Wt(e);return a>r?n=vl(e.min,e.max-r,t.min):r>a&&(n=vl(t.min,t.max-a,e.min)),Zi(0,1,n)}function Iq(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 Fm=.35;function Hq(t=Fm){return t===!1?t=0:t===!0&&(t=Fm),{x:cx(t,"left","right"),y:cx(t,"top","bottom")}}function cx(t,e,n){return{min:fx(t,e),max:fx(t,n)}}function fx(t,e){return typeof t=="number"?t:t[e]||0}const Fq=new WeakMap;class Gq{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=yt(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const u=g=>{const{dragSnapToOrigin:v}=this.getProps();v?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Ul(g).point)},c=(g,v)=>{const{drag:S,dragPropagation:x,onDragStart:T}=this.getProps();if(S&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=rK(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),Ln(C=>{let _=this.getAxisMotionValue(C).get()||0;if(mi.test(_)){const{projection:R}=this.visualElement;if(R&&R.layout){const G=R.layout.layoutBox[C];G&&(_=Wt(G)*(parseFloat(_)/100))}}this.originPoint[C]=_}),T&&it.postRender(()=>T(g,v)),Im(this.visualElement,"transform");const{animationState:M}=this.visualElement;M&&M.setActive("whileDrag",!0)},f=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v;const{dragPropagation:S,dragDirectionLock:x,onDirectionLock:T,onDrag:M}=this.getProps();if(!S&&!this.openDragLock)return;const{offset:C}=v;if(x&&this.currentDirection===null){this.currentDirection=Yq(C),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",v.point,C),this.updateAxis("y",v.point,C),this.visualElement.render(),M&&M(g,v)},h=(g,v)=>{this.latestPointerEvent=g,this.latestPanInfo=v,this.stop(g,v),this.latestPointerEvent=null,this.latestPanInfo=null},m=()=>Ln(g=>this.getAnimationState(g)==="paused"&&this.getAxisMotionValue(g).animation?.play()),{dragSnapToOrigin:y}=this.getProps();this.panSession=new U_(e,{onSessionStart:u,onStart:c,onMove:f,onSessionEnd:h,resumeAnimation:m},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:y,distanceThreshold:r,contextWindow:V_(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,a=n||this.latestPanInfo,u=this.isDragging;if(this.cancel(),!u||!a||!r)return;const{velocity:c}=a;this.startAnimation(c);const{onDragEnd:f}=this.getProps();f&&it.postRender(()=>f(r,a))}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:a}=this.getProps();if(!r||!vc(e,a,this.currentDirection))return;const u=this.getAxisMotionValue(e);let c=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(c=Uq(c,this.constraints[e],this.elastic[e])),u.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,a=this.constraints;e&&Ao(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Kq(r.layoutBox,e):this.constraints=!1,this.elastic=Hq(n),a!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ln(u=>{this.constraints!==!1&&this.getAxisMotionValue(u)&&(this.constraints[u]=Iq(r.layoutBox[u],this.constraints[u]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ao(e))return!1;const r=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const u=JK(r,a.root,this.visualElement.getTransformPagePoint());let c=qq(a.layout.layoutBox,u);if(n){const f=n(FK(c));this.hasMutatedConstraints=!!f,f&&(c=A_(f))}return c}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:a,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:f}=this.getProps(),h=this.constraints||{},m=Ln(y=>{if(!vc(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=a?200:1e6,S=a?40:1e7,x={type:"inertia",velocity:r?e[y]:0,bounceStiffness:v,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...g};return this.startAxisValueAnimation(y,x)});return Promise.all(m).then(f)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Im(this.visualElement,e),r.start(Tg(e,r,0,n,this.visualElement,!1))}stopAnimation(){Ln(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ln(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(),a=r[n];return a||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Ln(n=>{const{drag:r}=this.getProps();if(!vc(n,r,this.currentDirection))return;const{projection:a}=this.visualElement,u=this.getAxisMotionValue(n);if(a&&a.layout){const{min:c,max:f}=a.layout.layoutBox[n];u.set(e[n]-rt(c,f,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ao(n)||!r||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Ln(c=>{const f=this.getAxisMotionValue(c);if(f&&this.constraints!==!1){const h=f.get();a[c]=Pq({min:h,max:h},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ln(c=>{if(!vc(c,e,null))return;const f=this.getAxisMotionValue(c),{min:h,max:m}=this.constraints[c];f.set(rt(h,m,a[c]))})}addListeners(){if(!this.visualElement.current)return;Fq.set(this.visualElement,this);const e=this.visualElement.current,n=ol(e,"pointerdown",h=>{const{drag:m,dragListener:y=!0}=this.getProps();m&&y&&this.start(h)}),r=()=>{const{dragConstraints:h}=this.getProps();Ao(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,u=a.addEventListener("measure",r);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),it.read(r);const c=Al(window,"resize",()=>this.scalePositionWithinConstraints()),f=a.addEventListener("didUpdate",(({delta:h,hasLayoutChanged:m})=>{this.isDragging&&m&&(Ln(y=>{const g=this.getAxisMotionValue(y);g&&(this.originPoint[y]+=h[y].translate,g.set(g.get()+h[y].translate))}),this.visualElement.render())}));return()=>{c(),n(),u(),f&&f()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:a=!1,dragConstraints:u=!1,dragElastic:c=Fm,dragMomentum:f=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:a,dragConstraints:u,dragElastic:c,dragMomentum:f}}}function vc(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Yq(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Jq extends Gr{constructor(e){super(e),this.removeGroupControls=Pn,this.removeListeners=Pn,this.controls=new Gq(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Pn}unmount(){this.removeGroupControls(),this.removeListeners()}}const dx=t=>(e,n)=>{t&&it.postRender(()=>t(e,n))};class Xq extends Gr{constructor(){super(...arguments),this.removePointerDownListener=Pn}onPointerDown(e){this.session=new U_(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:V_(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:a}=this.node.getProps();return{onSessionStart:dx(e),onStart:dx(n),onMove:r,onEnd:(u,c)=>{delete this.session,a&&it.postRender(()=>a(u,c))}}}mount(){this.removePointerDownListener=ol(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 $c={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function hx(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ja={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(de.test(t))t=parseFloat(t);else return t;const n=hx(t,e.target.x),r=hx(t,e.target.y);return`${n}% ${r}%`}},Zq={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,a=Ur.parse(t);if(a.length>5)return r;const u=Ur.createTransformer(t),c=typeof a[0]!="number"?1:0,f=n.x.scale*e.x,h=n.y.scale*e.y;a[0+c]/=f,a[1+c]/=h;const m=rt(f,h,.5);return typeof a[2+c]=="number"&&(a[2+c]/=m),typeof a[3+c]=="number"&&(a[3+c]/=m),u(a)}};let Bp=!1;class Qq extends $.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:a}=this.props,{projection:u}=e;SK(Wq),u&&(n.group&&n.group.add(u),r&&r.register&&a&&r.register(u),Bp&&u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),$c.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:a,isPresent:u}=this.props,{projection:c}=r;return c&&(c.isPresent=u,Bp=!0,a||e.layoutDependency!==n||n===void 0||e.isPresent!==u?c.willUpdate():this.safeToRemove(),e.isPresent!==u&&(u?c.promote():c.relegate()||it.postRender(()=>{const f=c.getStack();(!f||!f.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hg.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:a}=e;Bp=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),r&&r.deregister&&r.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function q_(t){const[e,n]=hK(),r=$.useContext(SO);return F.jsx(Qq,{...t,layoutGroup:r,switchLayoutGroup:$.useContext(x_),isPresent:e,safeToRemove:n})}const Wq={borderRadius:{...Ja,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ja,borderTopRightRadius:Ja,borderBottomLeftRadius:Ja,borderBottomRightRadius:Ja,boxShadow:Zq};function e6(t,e,n){const r=Yt(t)?t:Io(t);return r.start(Tg("",r,e,n)),r.animation}const t6=(t,e)=>t.depth-e.depth;class n6{constructor(){this.children=[],this.isDirty=!1}add(e){Yy(this.children,e),this.isDirty=!0}remove(e){Jy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(t6),this.isDirty=!1,this.children.forEach(e)}}function i6(t,e){const n=fn.now(),r=({timestamp:a})=>{const u=a-n;u>=e&&(Vr(r),t(u-e))};return it.setup(r,!0),()=>Vr(r)}const P_=["TopLeft","TopRight","BottomLeft","BottomRight"],r6=P_.length,px=t=>typeof t=="string"?parseFloat(t):t,mx=t=>typeof t=="number"||de.test(t);function s6(t,e,n,r,a,u){a?(t.opacity=rt(0,n.opacity??1,o6(r)),t.opacityExit=rt(e.opacity??1,0,a6(r))):u&&(t.opacity=rt(e.opacity??1,n.opacity??1,r));for(let c=0;c<r6;c++){const f=`border${P_[c]}Radius`;let h=yx(e,f),m=yx(n,f);if(h===void 0&&m===void 0)continue;h||(h=0),m||(m=0),h===0||m===0||mx(h)===mx(m)?(t[f]=Math.max(rt(px(h),px(m),r),0),(mi.test(m)||mi.test(h))&&(t[f]+="%")):t[f]=m}(e.rotate||n.rotate)&&(t.rotate=rt(e.rotate||0,n.rotate||0,r))}function yx(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const o6=I_(0,.5,MO),a6=I_(.5,.95,Pn);function I_(t,e,n){return r=>r<t?0:r>e?1:n(vl(t,e,r))}function gx(t,e){t.min=e.min,t.max=e.max}function Bn(t,e){gx(t.x,e.x),gx(t.y,e.y)}function bx(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function vx(t,e,n,r,a){return t-=e,t=of(t,1/n,r),a!==void 0&&(t=of(t,1/a,r)),t}function l6(t,e=0,n=1,r=.5,a,u=t,c=t){if(mi.test(e)&&(e=parseFloat(e),e=rt(c.min,c.max,e/100)-c.min),typeof e!="number")return;let f=rt(u.min,u.max,r);t===u&&(f-=e),t.min=vx(t.min,e,n,f,a),t.max=vx(t.max,e,n,f,a)}function Sx(t,e,[n,r,a],u,c){l6(t,e[n],e[r],e[a],e.scale,u,c)}const u6=["x","scaleX","originX"],c6=["y","scaleY","originY"];function wx(t,e,n,r){Sx(t.x,e,u6,n?n.x:void 0,r?r.x:void 0),Sx(t.y,e,c6,n?n.y:void 0,r?r.y:void 0)}function xx(t){return t.translate===0&&t.scale===1}function H_(t){return xx(t.x)&&xx(t.y)}function Tx(t,e){return t.min===e.min&&t.max===e.max}function f6(t,e){return Tx(t.x,e.x)&&Tx(t.y,e.y)}function Ax(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function F_(t,e){return Ax(t.x,e.x)&&Ax(t.y,e.y)}function Ex(t){return Wt(t.x)/Wt(t.y)}function Ox(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class d6{constructor(){this.members=[]}add(e){Yy(this.members,e),e.scheduleRender()}remove(e){if(Jy(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(a=>e===a);if(n===0)return!1;let r;for(let a=n;a>=0;a--){const u=this.members[a];if(u.isPresent!==!1){r=u;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:a}=e.options;a===!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 h6(t,e,n){let r="";const a=t.x.translate/e.x,u=t.y.translate/e.y,c=n?.z||0;if((a||u||c)&&(r=`translate3d(${a}px, ${u}px, ${c}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:m,rotate:y,rotateX:g,rotateY:v,skewX:S,skewY:x}=n;m&&(r=`perspective(${m}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 f=t.x.scale*e.x,h=t.y.scale*e.y;return(f!==1||h!==1)&&(r+=`scale(${f}, ${h})`),r||"none"}const zp=["","X","Y","Z"],p6=1e3;let m6=0;function Lp(t,e,n,r){const{latestValues:a}=e;a[t]&&(n[t]=a[t],e.setStaticValue(t,0),r&&(r[t]=0))}function G_(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=D_(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:u}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",it,!(a||u))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&G_(r)}function Y_({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:a}){return class{constructor(c={},f=e?.()){this.id=m6++,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(b6),this.nodes.forEach(x6),this.nodes.forEach(T6),this.nodes.forEach(v6)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=f?f.root||f:this,this.path=f?[...f.path,f]:[],this.parent=f,this.depth=f?f.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new n6)}addEventListener(c,f){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new Qy),this.eventHandlers.get(c).add(f)}notifyListeners(c,...f){const h=this.eventHandlers.get(c);h&&h.notify(...f)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=u_(c)&&!cK(c),this.instance=c;const{layoutId:f,layout:h,visualElement:m}=this.options;if(m&&!m.current&&m.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||f)&&(this.isLayoutDirty=!0),t){let y,g=0;const v=()=>this.root.updateBlockedByResize=!1;it.read(()=>{g=window.innerWidth}),t(c,()=>{const S=window.innerWidth;S!==g&&(g=S,this.root.updateBlockedByResize=!0,y&&y(),y=i6(v,250),$c.hasAnimatedSinceResize&&($c.hasAnimatedSinceResize=!1,this.nodes.forEach(Cx)))})}f&&this.root.registerSharedNode(f,this),this.options.animate!==!1&&m&&(f||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||m.getDefaultTransition()||R6,{onLayoutAnimationStart:T,onLayoutAnimationComplete:M}=m.getProps(),C=!this.targetLayout||!F_(this.targetLayout,S),_=!g&&v;if(this.options.layoutRoot||this.resumeFrom||_||g&&(C||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const R={...fg(x,"layout"),onPlay:T,onComplete:M};(m.shouldReduceMotion||this.options.layoutRoot)&&(R.delay=0,R.type=!1),this.startAnimation(R),this.setAnimationOrigin(y,_)}else g||Cx(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(),Vr(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(A6),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&&G_(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:f,layout:h}=this.options;if(f===void 0&&!h)return;const m=this.getTransformTemplate();this.prevTransformTemplateValue=m?m(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(_x);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Rx);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(w6),this.nodes.forEach(y6),this.nodes.forEach(g6)):this.nodes.forEach(Rx),this.clearAllSnapshots();const f=fn.now();Ht.delta=Zi(0,1e3/60,f-Ht.timestamp),Ht.timestamp=f,Ht.isProcessing=!0,Op.update.process(Ht),Op.preRender.process(Ht),Op.render.process(Ht),Ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hg.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(S6),this.sharedNodes.forEach(E6)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,it.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){it.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Wt(this.snapshot.measuredBox.x)&&!Wt(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=yt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:f}=this.options;f&&f.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let f=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(f=!1),f&&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(!a)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,f=this.projectionDelta&&!H_(this.projectionDelta),h=this.getTransformTemplate(),m=h?h(this.latestValues,""):void 0,y=m!==this.prevTransformTemplateValue;c&&this.instance&&(f||ms(this.latestValues)||y)&&(a(this.instance,m),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const f=this.measurePageBox();let h=this.removeElementScroll(f);return c&&(h=this.removeTransform(h)),C6(h),{animationId:this.root.animationId,measuredBox:f,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:c}=this.options;if(!c)return yt();const f=c.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(k6))){const{scroll:m}=this.root;m&&(Eo(f.x,m.offset.x),Eo(f.y,m.offset.y))}return f}removeElementScroll(c){const f=yt();if(Bn(f,c),this.scroll?.wasRoot)return f;for(let h=0;h<this.path.length;h++){const m=this.path[h],{scroll:y,options:g}=m;m!==this.root&&y&&g.layoutScroll&&(y.wasRoot&&Bn(f,c),Eo(f.x,y.offset.x),Eo(f.y,y.offset.y))}return f}applyTransform(c,f=!1){const h=yt();Bn(h,c);for(let m=0;m<this.path.length;m++){const y=this.path[m];!f&&y.options.layoutScroll&&y.scroll&&y!==y.root&&Oo(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),ms(y.latestValues)&&Oo(h,y.latestValues)}return ms(this.latestValues)&&Oo(h,this.latestValues),h}removeTransform(c){const f=yt();Bn(f,c);for(let h=0;h<this.path.length;h++){const m=this.path[h];if(!m.instance||!ms(m.latestValues))continue;Um(m.latestValues)&&m.updateSnapshot();const y=yt(),g=m.measurePageBox();Bn(y,g),wx(f,m.latestValues,m.snapshot?m.snapshot.layoutBox:void 0,y)}return ms(this.latestValues)&&wx(f,this.latestValues),f}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!==Ht.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){const f=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=f.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=f.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=f.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==f;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=Ht.timestamp,!this.targetDelta&&!this.relativeTarget){const v=this.getClosestProjectingParent();v&&v.layout&&this.animationProgress!==1?(this.relativeParent=v,this.forceRelativeParentToResolveTarget(),this.relativeTarget=yt(),this.relativeTargetOrigin=yt(),ll(this.relativeTargetOrigin,this.layout.layoutBox,v.layout.layoutBox),Bn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=yt(),this.targetWithTransforms=yt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Bq(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Bn(this.target,this.layout.layoutBox),O_(this.target,this.targetDelta)):Bn(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=yt(),this.relativeTargetOrigin=yt(),ll(this.relativeTargetOrigin,this.target,v.target),Bn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Um(this.parent.latestValues)||E_(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(),f=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(h=!1),f&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Ht.timestamp&&(h=!1),h)return;const{layout:m,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||!(m||y))return;Bn(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;YK(this.layoutCorrected,this.treeScale,this.path,f),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=yt());const{target:S}=c;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bx(this.prevProjectionDelta.x,this.projectionDelta.x),bx(this.prevProjectionDelta.y,this.projectionDelta.y)),al(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!Ox(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ox(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 f=this.getStack();f&&f.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=_o(),this.projectionDelta=_o(),this.projectionDeltaWithTransform=_o()}setAnimationOrigin(c,f=!1){const h=this.snapshot,m=h?h.latestValues:{},y={...this.latestValues},g=_o();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!f;const v=yt(),S=h?h.source:void 0,x=this.layout?this.layout.source:void 0,T=S!==x,M=this.getStack(),C=!M||M.members.length<=1,_=!!(T&&!C&&this.options.crossfade===!0&&!this.path.some(_6));this.animationProgress=0;let R;this.mixTargetDelta=G=>{const I=G/1e3;kx(g.x,c.x,I),kx(g.y,c.y,I),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ll(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),O6(this.relativeTarget,this.relativeTargetOrigin,v,I),R&&f6(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=yt()),Bn(R,this.relativeTarget)),T&&(this.animationValues=y,s6(y,m,this.latestValues,I,_,C)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Vr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=it.update(()=>{$c.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Io(0)),this.currentAnimation=e6(this.motionValue,[0,1e3],{...c,velocity:0,isSync:!0,onUpdate:f=>{this.mixTargetDelta(f),c.onUpdate&&c.onUpdate(f)},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(p6),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:f,target:h,layout:m,latestValues:y}=c;if(!(!f||!h||!m)){if(this!==c&&this.layout&&m&&J_(this.options.animationType,this.layout.layoutBox,m.layoutBox)){h=this.target||yt();const g=Wt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Wt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Bn(f,h),Oo(f,y),al(this.projectionDeltaWithTransform,this.layoutCorrected,f,y)}}registerSharedNode(c,f){this.sharedNodes.has(c)||this.sharedNodes.set(c,new d6),this.sharedNodes.get(c).add(f);const m=f.options.initialPromotionConfig;f.promote({transition:m?m.transition:void 0,preserveFollowOpacity:m&&m.shouldPreserveFollowOpacity?m.shouldPreserveFollowOpacity(f):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:f,preserveFollowOpacity:h}={}){const m=this.getStack();m&&m.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),f&&this.setOptions({transition:f})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let f=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(f=!0),!f)return;const m={};h.z&&Lp("z",c,m,this.animationValues);for(let y=0;y<zp.length;y++)Lp(`rotate${zp[y]}`,c,m,this.animationValues),Lp(`skew${zp[y]}`,c,m,this.animationValues);c.render();for(const y in m)c.setStaticValue(y,m[y]),this.animationValues&&(this.animationValues[y]=m[y]);c.scheduleRender()}applyProjectionStyles(c,f){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=Nc(f?.pointerEvents)||"",c.transform=h?h(this.latestValues,""):"none";return}const m=this.getLead();if(!this.projectionDelta||!this.layout||!m.target){this.options.layoutId&&(c.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,c.pointerEvents=Nc(f?.pointerEvents)||""),this.hasProjected&&!ms(this.latestValues)&&(c.transform=h?h({},""):"none",this.hasProjected=!1);return}c.visibility="";const y=m.animationValues||m.latestValues;this.applyTransformsToTarget();let g=h6(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`,m.animationValues?c.opacity=m===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:c.opacity=m===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const x in Tl){if(y[x]===void 0)continue;const{correct:T,applyTo:M,isCSSVariable:C}=Tl[x],_=g==="none"?y[x]:T(y[x],m);if(M){const R=M.length;for(let G=0;G<R;G++)c[M[G]]=_}else C?this.options.visualElement.renderState.vars[x]=_:c[x]=_}this.options.layoutId&&(c.pointerEvents=m===this?Nc(f?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>c.currentAnimation?.stop()),this.root.nodes.forEach(_x),this.root.sharedNodes.clear()}}}function y6(t){t.updateLayout()}function g6(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:a}=t.options,u=e.source!==t.layout.source;a==="size"?Ln(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Wt(g);g.min=n[y].min,g.max=g.min+v}):J_(a,e.layoutBox,n)&&Ln(y=>{const g=u?e.measuredBox[y]:e.layoutBox[y],v=Wt(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=_o();al(c,n,e.layoutBox);const f=_o();u?al(f,t.applyTransform(r,!0),e.measuredBox):al(f,n,e.layoutBox);const h=!H_(c);let m=!1;if(!t.resumeFrom){const y=t.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:g,layout:v}=y;if(g&&v){const S=yt();ll(S,e.layoutBox,g.layoutBox);const x=yt();ll(x,n,v.layoutBox),F_(S,x)||(m=!0),y.options.layoutRoot&&(t.relativeTarget=x,t.relativeTargetOrigin=S,t.relativeParent=y)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:f,layoutDelta:c,hasLayoutChanged:h,hasRelativeLayoutChanged:m})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function b6(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 v6(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function S6(t){t.clearSnapshot()}function _x(t){t.clearMeasurements()}function Rx(t){t.isLayoutDirty=!1}function w6(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Cx(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function x6(t){t.resolveTargetDelta()}function T6(t){t.calcProjection()}function A6(t){t.resetSkewAndRotation()}function E6(t){t.removeLeadSnapshot()}function kx(t,e,n){t.translate=rt(e.translate,0,n),t.scale=rt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Mx(t,e,n,r){t.min=rt(e.min,n.min,r),t.max=rt(e.max,n.max,r)}function O6(t,e,n,r){Mx(t.x,e.x,n.x,r),Mx(t.y,e.y,n.y,r)}function _6(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const R6={duration:.45,ease:[.4,0,.1,1]},Dx=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Nx=Dx("applewebkit/")&&!Dx("chrome/")?Math.round:Pn;function $x(t){t.min=Nx(t.min),t.max=Nx(t.max)}function C6(t){$x(t.x),$x(t.y)}function J_(t,e,n){return t==="position"||t==="preserve-aspect"&&!jq(Ex(e),Ex(n),.2)}function k6(t){return t!==t.root&&t.scroll?.wasRoot}const M6=Y_({attachResizeListener:(t,e)=>Al(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Vp={current:void 0},X_=Y_({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Vp.current){const t=new M6({});t.mount(window),t.setOptions({layoutScroll:!0}),Vp.current=t}return Vp.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),D6={pan:{Feature:Xq},drag:{Feature:Jq,ProjectionNode:X_,MeasureLayout:q_}};function jx(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,u=r[a];u&&it.postRender(()=>u(e,Ul(e)))}class N6 extends Gr{mount(){const{current:e}=this.node;e&&(this.unmount=sK(e,(n,r)=>(jx(this.node,r,"Start"),a=>jx(this.node,a,"End"))))}unmount(){}}class $6 extends Gr{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=zl(Al(this.node.current,"focus",()=>this.onFocus()),Al(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Bx(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 a="onTap"+(n==="End"?"":n),u=r[a];u&&it.postRender(()=>u(e,Ul(e)))}class j6 extends Gr{mount(){const{current:e}=this.node;e&&(this.unmount=uK(e,(n,r)=>(Bx(this.node,r,"Start"),(a,{success:u})=>Bx(this.node,a,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Gm=new WeakMap,Up=new WeakMap,B6=t=>{const e=Gm.get(t.target);e&&e(t)},z6=t=>{t.forEach(B6)};function L6({root:t,...e}){const n=t||document;Up.has(n)||Up.set(n,{});const r=Up.get(n),a=JSON.stringify(e);return r[a]||(r[a]=new IntersectionObserver(z6,{root:t,...e})),r[a]}function V6(t,e,n){const r=L6(e);return Gm.set(t,n),r.observe(t),()=>{Gm.delete(t),r.unobserve(t)}}const U6={some:0,all:1};class K6 extends Gr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:a="some",once:u}=e,c={root:n?n.current:void 0,rootMargin:r,threshold:typeof a=="number"?a:U6[a]},f=h=>{const{isIntersecting:m}=h;if(this.isInView===m||(this.isInView=m,u&&!m&&this.hasEnteredView))return;m&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",m);const{onViewportEnter:y,onViewportLeave:g}=this.node.getProps(),v=m?y:g;v&&v(h)};return V6(this.node.current,c,f)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(q6(e,n))&&this.startObserver()}unmount(){}}function q6({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const P6={inView:{Feature:K6},tap:{Feature:j6},focus:{Feature:$6},hover:{Feature:N6}},I6={layout:{ProjectionNode:X_,MeasureLayout:q_}},H6={...Cq,...P6,...D6,...I6},F6=HK(H6,rq);function G6(){const t=Wn(Po),e=Wn(di),n=Wn(Hi),r=Et(Po),a=Et(di),u=Et(Hi),c=`email-${$.useId()}`,f=`password-${$.useId()}`,h=`one-time-code-${$.useId()}`,[m,y]=$.useState(null),[g,v]=$.useState("email"),S=`form-${$.useId()}`;return $.useEffect(()=>{if(u.length===6){const x=document.getElementById(S);x instanceof HTMLFormElement&&x.requestSubmit()}},[u]),F.jsx("form",{id:S,onSubmit:async x=>{x.preventDefault();const T=nt(ui);try{switch(g){case"email":{const{nextStep:M,userKey:C}=await cn.declareAuthTarget.query({email:r});switch(De(ui,C),M){case"otc_login":case"otc_verify":{v("otc");break}case"password_login":{v("password");break}}break}case"otc":{if(!T){console.error("somehow userKey is null");return}const M=await cn.verifyAccountAction.mutate({oneTimeCode:u,userKey:T});De(ut,M),gi.once("connect",()=>{Os("/game"),t(""),n("")});break}case"password":{const M=await cn.openSession.mutate({email:r,password:a});De(ut,M),gi.once("connect",()=>{Os("/game"),t(""),e("")});break}}}catch(M){M instanceof bl&&y(M.message)}},children:F.jsxs("main",{children:[m?F.jsx("aside",{children:m}):null,F.jsxs(F6.label,{htmlFor:c,children:[F.jsx("span",{children:"Email"}),F.jsx("input",{id:c,type:"text",value:r,onChange:x=>{t(x.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:g!=="email"})]}),g==="password"?F.jsxs("label",{htmlFor:f,children:[F.jsx("span",{children:"Password"}),F.jsx("input",{id:f,type:"password",value:a,onChange:x=>{e(x.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:g==="password"})]}):null,g==="otc"?F.jsxs("label",{htmlFor:h,children:[F.jsx("span",{children:"One-time Code"}),F.jsx("input",{id:h,type:"number",inputMode:"numeric",enterKeyHint:"go",value:u,onChange:x=>{n(x.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:g==="otc"})]}):null,F.jsxs("footer",{children:[g==="password"?F.jsx("button",{type:"button",onClick:async()=>{const x=nt(ui);if(!x)return new Error("No userKey");await cn.startPasswordReset.mutate({userKey:x}),v("otc")},children:"Forgot Password?"}):null,F.jsx("span",{}),F.jsx("button",{type:"submit",disabled:!r&&g==="email"||!a&&g==="password"||!u&&g==="otc",children:">>->"})]})]})})}function Y6({route:[,t]}){const e=Et(ut),n=Et(Hi),r=Wn(Hi),a=`code-${$.useId()}`;return $.useEffect(()=>{t&&r(t)},[]),e?F.jsx("form",{onSubmit:async u=>{u.preventDefault();try{const c=await cn.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});De(ut,c),c.action==="resetPassword"?Os("/account"):Os("/game")}catch(c){console.error(c)}},children:F.jsxs("main",{children:[F.jsx("p",{children:"Check your email for a verification code."}),F.jsxs("label",{htmlFor:a,children:[F.jsx("span",{children:"Verification code"}),F.jsx("input",{id:a,type:"text",value:n,onChange:u=>{r(u.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})}):F.jsx("p",{children:"You must be logged in to verify your account."})}function J6(){const t=Et(r4),e=Et(ut),[n,r]=$.useState(!1),{refs:a,floatingStyles:u,context:c}=K2({open:n,onOpenChange:r,placement:"bottom-end",middleware:[d2(5),p2(),h2()],whileElementsMounted:r2}),f=B2(c),h=V2(c),m=I2(c),{getReferenceProps:y,getFloatingProps:g}=q2([f,h,m]),v=Et(FL);return F.jsxs("main",{className:Bz.class,children:[F.jsxs("header",{children:[F.jsxs("main",{children:[F.jsx(jz,{}),F.jsx("span",{children:F.jsx(zz,{input:v})})]}),F.jsx("button",{"data-css":"profile",ref:a.setReference,...y(),children:e?.username?e.username.slice(0,2):""}),n&&e&&F.jsx($2,{context:c,modal:!1,children:F.jsxs("div",{"data-css":"profile-actions",ref:a.setFloating,style:u,...g(),children:[F.jsx("span",{children:e.username}),F.jsx("button",{type:"button",onClick:()=>{Os("/account")},children:"Account"}),F.jsx("button",{type:"button",onClick:async()=>{e&&(await cn.closeSession.mutate({username:e.username}),gi.once("disconnect",()=>{De(ut,null),Os("/")}),gi.disconnect())},children:"Sign out"})]})})]}),F.jsx("main",{children:typeof t=="number"?F.jsxs("article",{children:[F.jsx("h1",{children:t}),F.jsx("h2",{children:JSON.parse(jE[t])}),F.jsx(BE,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(t[0]){case void 0:return F.jsx(G6,{});case"admin":return F.jsx(u4,{});case"game":return F.jsx(f4,{route:t});case"verify":return F.jsx(Y6,{route:t});case"account":return F.jsx(l4,{})}})()})]})}LM.createRoot(document.getElementById("root")).render(F.jsx($.StrictMode,{children:F.jsx(CM,{socket:gi,children:F.jsx(J6,{})})}));
|