tmex-cli 0.11.0 → 0.12.2
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 +22 -12
- package/dist/runtime/server.js +752 -48
- package/package.json +1 -1
- package/resources/fe-dist/assets/DevicePage-B0fQ6yWB.js +25 -0
- package/resources/fe-dist/assets/DevicesPage-C7THDzTX.js +2 -0
- package/resources/fe-dist/assets/{FilePage-YWma96aj.js → FilePage-D8V8P2IA.js} +8 -8
- package/resources/fe-dist/assets/{SettingsPage-LhUD03Ln.js → SettingsPage-BOTyBhHH.js} +8 -8
- package/resources/fe-dist/assets/{arc-DLVa298O.js → arc-DcujnLz7.js} +2 -2
- package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-i8499Wfc.js +37 -0
- package/resources/fe-dist/assets/{blockDiagram-GPEHLZMM-BTwwkzZh.js → blockDiagram-GPEHLZMM-BFh4xZY2.js} +2 -2
- package/resources/fe-dist/assets/{c4Diagram-AAUBKEIU-xvTqXxl9.js → c4Diagram-AAUBKEIU-nUyGK7Ke.js} +2 -2
- package/resources/fe-dist/assets/{card-cbVDy0Xp.js → card-BkRqR9zz.js} +2 -2
- package/resources/fe-dist/assets/channel-DqmfsuLY.js +2 -0
- package/resources/fe-dist/assets/{chunk-2J33WTMH-Blr6l1Nk.js → chunk-2J33WTMH-z2oMKYMn.js} +2 -2
- package/resources/fe-dist/assets/{chunk-4BX2VUAB-D_Y2TeLg.js → chunk-4BX2VUAB-CCD_pyAh.js} +2 -2
- package/resources/fe-dist/assets/{chunk-55IACEB6-CimNoYDH.js → chunk-55IACEB6-Dx2_9d-z.js} +2 -2
- package/resources/fe-dist/assets/{chunk-727SXJPM-JPYDN0Cb.js → chunk-727SXJPM-DA36poir.js} +2 -2
- package/resources/fe-dist/assets/{chunk-AQP2D5EJ-Cb3NZBib.js → chunk-AQP2D5EJ-CQoXkVd4.js} +2 -2
- package/resources/fe-dist/assets/{chunk-FMBD7UC4-DyZ7Ot2F.js → chunk-FMBD7UC4-A6Yn7A44.js} +2 -2
- package/resources/fe-dist/assets/{chunk-ND2GUHAM-SU6Ea3wF.js → chunk-ND2GUHAM-BsNl2EMT.js} +2 -2
- package/resources/fe-dist/assets/{chunk-QZHKN3VN-B6qXX6sU.js → chunk-QZHKN3VN-BM_QNxf6.js} +2 -2
- package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-D3Z9BeOE.js +2 -0
- package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-D3Z9BeOE.js +2 -0
- package/resources/fe-dist/assets/cose-bilkent-S5V4N54A-1lMO_Dod.js +2 -0
- package/resources/fe-dist/assets/{dagre-BM42HDAG-Ckrx9BXZ.js → dagre-BM42HDAG-C9Up3ckQ.js} +2 -2
- package/resources/fe-dist/assets/{diagram-2AECGRRQ-DTnZtf2k.js → diagram-2AECGRRQ-CtuDndmY.js} +2 -2
- package/resources/fe-dist/assets/{diagram-5GNKFQAL-DBpgZj4a.js → diagram-5GNKFQAL-BQfskK8S.js} +2 -2
- package/resources/fe-dist/assets/{diagram-KO2AKTUF-CfijYCeY.js → diagram-KO2AKTUF-CGJi8q81.js} +2 -2
- package/resources/fe-dist/assets/{diagram-LMA3HP47-D7nBmQ-E.js → diagram-LMA3HP47-DAMQIoLQ.js} +2 -2
- package/resources/fe-dist/assets/{diagram-OG6HWLK6-Bi8sHV0O.js → diagram-OG6HWLK6-D2s__dFc.js} +2 -2
- package/resources/fe-dist/assets/{erDiagram-TEJ5UH35-DcoDesO2.js → erDiagram-TEJ5UH35-_UJYLIQN.js} +2 -2
- package/resources/fe-dist/assets/{flowDiagram-I6XJVG4X-Bbcl9kxS.js → flowDiagram-I6XJVG4X-DN-qktDh.js} +2 -2
- package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-CNuuuhXX.js +293 -0
- package/resources/fe-dist/assets/{gitGraphDiagram-PVQCEYII-x3wpNQcW.js → gitGraphDiagram-PVQCEYII-Qar2sVRo.js} +2 -2
- package/resources/fe-dist/assets/index-BhU3LRKb.css +1 -0
- package/resources/fe-dist/assets/index-Ra6pj0rt.js +488 -0
- package/resources/fe-dist/assets/{infoDiagram-5YYISTIA-Bl6cgwVb.js → infoDiagram-5YYISTIA-2e6tU_v9.js} +2 -2
- package/resources/fe-dist/assets/{ishikawaDiagram-YF4QCWOH-BfQ7aZxN.js → ishikawaDiagram-YF4QCWOH-BghKvoM4.js} +2 -2
- package/resources/fe-dist/assets/{journeyDiagram-JHISSGLW-DSwQzmdL.js → journeyDiagram-JHISSGLW-D-cHSGb_.js} +2 -2
- package/resources/fe-dist/assets/{kanban-definition-UN3LZRKU-B1aWDl4E.js → kanban-definition-UN3LZRKU-BE6Cb-OK.js} +2 -2
- package/resources/fe-dist/assets/{linear-CfhRC4iX.js → linear-CwDBnUH0.js} +2 -2
- package/resources/fe-dist/assets/{markdown-preview-CfBRMViB.js → markdown-preview-BlQiC8ND.js} +4 -4
- package/resources/fe-dist/assets/{mermaid.core-M-o4g4TO.js → mermaid.core-DDMkLXrp.js} +6 -6
- package/resources/fe-dist/assets/{mindmap-definition-RKZ34NQL-D976sxOA.js → mindmap-definition-RKZ34NQL-C9xVR7Ut.js} +2 -2
- package/resources/fe-dist/assets/{pieDiagram-4H26LBE5-PVQ3-EB6.js → pieDiagram-4H26LBE5-DW_4RcBv.js} +2 -2
- package/resources/fe-dist/assets/{quadrantDiagram-W4KKPZXB-BNEFhYNq.js → quadrantDiagram-W4KKPZXB-DoIrZmk2.js} +2 -2
- package/resources/fe-dist/assets/{requirementDiagram-4Y6WPE33-B7Zd2lpN.js → requirementDiagram-4Y6WPE33-CYcJSuPe.js} +2 -2
- package/resources/fe-dist/assets/{sankeyDiagram-5OEKKPKP-D_Td4j-B.js → sankeyDiagram-5OEKKPKP-CrIkKM6h.js} +2 -2
- package/resources/fe-dist/assets/{sequenceDiagram-3UESZ5HK-DQSVX5mL.js → sequenceDiagram-3UESZ5HK-DgzGHhGk.js} +2 -2
- package/resources/fe-dist/assets/{stateDiagram-AJRCARHV-C0PNCTfs.js → stateDiagram-AJRCARHV-C6Dhr3fY.js} +2 -2
- package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-BiSh2azE.js +2 -0
- package/resources/fe-dist/assets/terminal-settings-panel-CpnmWQtf.js +9 -0
- package/resources/fe-dist/assets/{timeline-definition-PNZ67QCA-BlMj8Fl1.js → timeline-definition-PNZ67QCA-jJ1iauQ0.js} +2 -2
- package/resources/fe-dist/assets/{vennDiagram-CIIHVFJN-DuGxwZiq.js → vennDiagram-CIIHVFJN-DLRoaoJ9.js} +2 -2
- package/resources/fe-dist/assets/{wardley-L42UT6IY-4VhWbg10.js → wardley-L42UT6IY-CykeHWp8.js} +2 -2
- package/resources/fe-dist/assets/{wardleyDiagram-YWT4CUSO-Bu4k6xIx.js → wardleyDiagram-YWT4CUSO-U22jzD8a.js} +2 -2
- package/resources/fe-dist/assets/{xychartDiagram-2RQKCTM6-Cv88IDWh.js → xychartDiagram-2RQKCTM6-CiXS9PJ2.js} +2 -2
- package/resources/fe-dist/fonts/generated/blex-mono/blex-mono-bold.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/blex-mono/blex-mono-regular.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/fira-code/fira-code-bold.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/fira-code/fira-code-regular.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/jetbrains-mono/jetbrains-mono-bold.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/jetbrains-mono/jetbrains-mono-regular.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/noto-sans-mono/noto-sans-mono-bold.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/noto-sans-mono/noto-sans-mono-regular.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/victor-mono/victor-mono-bold.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/victor-mono/victor-mono-regular.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/zed-mono/zed-mono-bold.woff2 +0 -0
- package/resources/fe-dist/fonts/generated/zed-mono/zed-mono-regular.woff2 +0 -0
- package/resources/fe-dist/index.html +2 -2
- package/resources/fe-dist/assets/DevicePage-fGI-do8S.js +0 -26
- package/resources/fe-dist/assets/DevicesPage-kGrzwhGj.js +0 -2
- package/resources/fe-dist/assets/architectureDiagram-3BPJPVTR-EOUpuRby.js +0 -37
- package/resources/fe-dist/assets/channel-DbG6qNF6.js +0 -2
- package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-rB1DgxOZ.js +0 -2
- package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-rB1DgxOZ.js +0 -2
- package/resources/fe-dist/assets/cose-bilkent-S5V4N54A-BAyMopHS.js +0 -2
- package/resources/fe-dist/assets/ganttDiagram-6RSMTGT7-BM8Y7jwp.js +0 -293
- package/resources/fe-dist/assets/index-cfY8KuW7.js +0 -466
- package/resources/fe-dist/assets/index-vcS0VPIW.css +0 -1
- package/resources/fe-dist/assets/refresh-cw-cfX5JiIH.js +0 -7
- package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-CB5OePKf.js +0 -2
|
@@ -1,466 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SettingsPage-LhUD03Ln.js","assets/card-cbVDy0Xp.js","assets/refresh-cw-cfX5JiIH.js","assets/markdown-preview-CfBRMViB.js","assets/markdown-preview-Bf_6UH9R.css","assets/DevicesPage-kGrzwhGj.js","assets/DevicePage-fGI-do8S.js","assets/FilePage-YWma96aj.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var eL=Object.defineProperty;var pC=e=>{throw TypeError(e)};var tL=(e,t,n)=>t in e?eL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var at=(e,t,n)=>tL(e,typeof t!="symbol"?t+"":t,n),Uy=(e,t,n)=>t.has(e)||pC("Cannot "+n);var re=(e,t,n)=>(Uy(e,t,"read from private field"),n?n.call(e):t.get(e)),pt=(e,t,n)=>t.has(e)?pC("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Qe=(e,t,n,r)=>(Uy(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),Bt=(e,t,n)=>(Uy(e,t,"access private method"),n);var xh=(e,t,n,r)=>({set _(a){Qe(e,t,a,n)},get _(){return re(e,t,r)}});function nL(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();const rL="modulepreload",iL=function(e){return"/"+e},mC={},Kp=function(t,n,r){let a=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(m=>Promise.resolve(m).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),f=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));a=l(n.map(d=>{if(d=iL(d),d in mC)return;mC[d]=!0;const m=d.endsWith(".css"),h=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${h}`))return;const y=document.createElement("link");if(y.rel=m?"stylesheet":rL,m||(y.as="script"),y.crossOrigin="",y.href=d,f&&y.setAttribute("nonce",f),document.head.appendChild(y),m)return new Promise((g,w)=>{y.addEventListener("load",g),y.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${d}`)))})}))}function o(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return a.then(l=>{for(const c of l||[])c.status==="rejected"&&o(c.reason);return t().catch(o)})};function Gp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qy={exports:{}},Ou={};/**
|
|
3
|
-
* @license React
|
|
4
|
-
* react-jsx-runtime.production.js
|
|
5
|
-
*
|
|
6
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
-
*
|
|
8
|
-
* This source code is licensed under the MIT license found in the
|
|
9
|
-
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var gC;function aL(){if(gC)return Ou;gC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var c in a)c!=="key"&&(o[c]=a[c])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Ou.Fragment=t,Ou.jsx=n,Ou.jsxs=n,Ou}var yC;function oL(){return yC||(yC=1,qy.exports=aL()),qy.exports}var S=oL(),Mc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},sL={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ko,Mx,lM,lL=(lM=class{constructor(){pt(this,ko,sL);pt(this,Mx,!1)}setTimeoutProvider(e){Qe(this,ko,e)}setTimeout(e,t){return re(this,ko).setTimeout(e,t)}clearTimeout(e){re(this,ko).clearTimeout(e)}setInterval(e,t){return re(this,ko).setInterval(e,t)}clearInterval(e){re(this,ko).clearInterval(e)}},ko=new WeakMap,Mx=new WeakMap,lM),Cs=new lL;function cL(e){setTimeout(e,0)}var Bs=typeof window>"u"||"Deno"in globalThis;function Rr(){}function uL(e,t){return typeof e=="function"?e(t):e}function av(e){return typeof e=="number"&&e>=0&&e!==1/0}function vM(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Fo(e,t){return typeof e=="function"?e(t):e}function bi(e,t){return typeof e=="function"?e(t):e}function bC(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:c}=e;if(l){if(r){if(t.queryHash!==Ax(l,t.options))return!1}else if(!gd(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof c=="boolean"&&t.isStale()!==c||a&&a!==t.state.fetchStatus||o&&!o(t))}function vC(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(Hs(t.options.mutationKey)!==Hs(o))return!1}else if(!gd(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Ax(e,t){return((t==null?void 0:t.queryKeyHashFn)||Hs)(e)}function Hs(e){return JSON.stringify(e,(t,n)=>ov(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function gd(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>gd(e[n],t[n])):!1}var dL=Object.prototype.hasOwnProperty;function xM(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=xC(e)&&xC(t);if(!r&&!(ov(e)&&ov(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),c=l.length,f=r?new Array(c):{};let d=0;for(let m=0;m<c;m++){const h=r?m:l[m],y=e[h],g=t[h];if(y===g){f[h]=y,(r?m<o:dL.call(e,h))&&d++;continue}if(y===null||g===null||typeof y!="object"||typeof g!="object"){f[h]=g;continue}const w=xM(y,g,n+1);f[h]=w,w===y&&d++}return o===c&&d===o?e:f}function gp(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function xC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function ov(e){if(!wC(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!wC(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function wC(e){return Object.prototype.toString.call(e)==="[object Object]"}function fL(e){return new Promise(t=>{Cs.setTimeout(t,e)})}function sv(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?xM(e,t):t}function hL(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function pL(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Nx=Symbol();function wM(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Nx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ox(e,t){return typeof e=="function"?e(...t):!!e}function mL(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var Ms,Mo,sc,cM,gL=(cM=class extends Mc{constructor(){super();pt(this,Ms);pt(this,Mo);pt(this,sc);Qe(this,sc,t=>{if(!Bs&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){re(this,Mo)||this.setEventListener(re(this,sc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Mo))==null||t.call(this),Qe(this,Mo,void 0))}setEventListener(t){var n;Qe(this,sc,t),(n=re(this,Mo))==null||n.call(this),Qe(this,Mo,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){re(this,Ms)!==t&&(Qe(this,Ms,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof re(this,Ms)=="boolean"?re(this,Ms):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},Ms=new WeakMap,Mo=new WeakMap,sc=new WeakMap,cM),Dx=new gL;function lv(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var yL=cL;function bL(){let e=[],t=0,n=c=>{c()},r=c=>{c()},a=yL;const o=c=>{t?e.push(c):a(()=>{n(c)})},l=()=>{const c=e;e=[],c.length&&a(()=>{r(()=>{c.forEach(f=>{n(f)})})})};return{batch:c=>{let f;t++;try{f=c()}finally{t--,t||l()}return f},batchCalls:c=>(...f)=>{o(()=>{c(...f)})},schedule:o,setNotifyFunction:c=>{n=c},setBatchNotifyFunction:c=>{r=c},setScheduler:c=>{a=c}}}var Xn=bL(),lc,Ao,cc,uM,vL=(uM=class extends Mc{constructor(){super();pt(this,lc,!0);pt(this,Ao);pt(this,cc);Qe(this,cc,t=>{if(!Bs&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){re(this,Ao)||this.setEventListener(re(this,cc))}onUnsubscribe(){var t;this.hasListeners()||((t=re(this,Ao))==null||t.call(this),Qe(this,Ao,void 0))}setEventListener(t){var n;Qe(this,cc,t),(n=re(this,Ao))==null||n.call(this),Qe(this,Ao,t(this.setOnline.bind(this)))}setOnline(t){re(this,lc)!==t&&(Qe(this,lc,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return re(this,lc)}},lc=new WeakMap,Ao=new WeakMap,cc=new WeakMap,uM),yp=new vL;function xL(e){return Math.min(1e3*2**e,3e4)}function SM(e){return(e??"online")==="online"?yp.isOnline():!0}var cv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function EM(e){let t=!1,n=0,r;const a=lv(),o=()=>a.status!=="pending",l=C=>{var R;if(!o()){const E=new cv(C);y(E),(R=e.onCancel)==null||R.call(e,E)}},c=()=>{t=!0},f=()=>{t=!1},d=()=>Dx.isFocused()&&(e.networkMode==="always"||yp.isOnline())&&e.canRun(),m=()=>SM(e.networkMode)&&e.canRun(),h=C=>{o()||(r==null||r(),a.resolve(C))},y=C=>{o()||(r==null||r(),a.reject(C))},g=()=>new Promise(C=>{var R;r=E=>{(o()||d())&&C(E)},(R=e.onPause)==null||R.call(e)}).then(()=>{var C;r=void 0,o()||(C=e.onContinue)==null||C.call(e)}),w=()=>{if(o())return;let C;const R=n===0?e.initialPromise:void 0;try{C=R??e.fn()}catch(E){C=Promise.reject(E)}Promise.resolve(C).then(h).catch(E=>{var A;if(o())return;const T=e.retry??(Bs?0:3),k=e.retryDelay??xL,M=typeof k=="function"?k(n,E):k,D=T===!0||typeof T=="number"&&n<T||typeof T=="function"&&T(n,E);if(t||!D){y(E);return}n++,(A=e.onFail)==null||A.call(e,n,E),fL(M).then(()=>d()?void 0:g()).then(()=>{t?y(E):w()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:c,continueRetry:f,canStart:m,start:()=>(m()?w():g().then(w),a)}}var As,dM,CM=(dM=class{constructor(){pt(this,As)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),av(this.gcTime)&&Qe(this,As,Cs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Bs?1/0:300*1e3))}clearGcTimeout(){re(this,As)&&(Cs.clearTimeout(re(this,As)),Qe(this,As,void 0))}},As=new WeakMap,dM),Ns,uc,gi,Os,ar,Dd,Ds,Li,Da,fM,wL=(fM=class extends CM{constructor(t){super();pt(this,Li);pt(this,Ns);pt(this,uc);pt(this,gi);pt(this,Os);pt(this,ar);pt(this,Dd);pt(this,Ds);Qe(this,Ds,!1),Qe(this,Dd,t.defaultOptions),this.setOptions(t.options),this.observers=[],Qe(this,Os,t.client),Qe(this,gi,re(this,Os).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Qe(this,Ns,EC(this.options)),this.state=t.state??re(this,Ns),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=re(this,ar))==null?void 0:t.promise}setOptions(t){if(this.options={...re(this,Dd),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=EC(this.options);n.data!==void 0&&(this.setState(SC(n.data,n.dataUpdatedAt)),Qe(this,Ns,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&re(this,gi).remove(this)}setData(t,n){const r=sv(this.state.data,t,this.options);return Bt(this,Li,Da).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){Bt(this,Li,Da).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=re(this,ar))==null?void 0:r.promise;return(a=re(this,ar))==null||a.cancel(t),n?n.then(Rr).catch(Rr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(re(this,Ns))}isActive(){return this.observers.some(t=>bi(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Nx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>Fo(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!vM(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,ar))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=re(this,ar))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),re(this,gi).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(re(this,ar)&&(re(this,Ds)?re(this,ar).cancel({revert:!0}):re(this,ar).cancelRetry()),this.scheduleGc()),re(this,gi).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Bt(this,Li,Da).call(this,{type:"invalidate"})}async fetch(t,n){var f,d,m,h,y,g,w,C,R,E,T,k;if(this.state.fetchStatus!=="idle"&&((f=re(this,ar))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(re(this,ar))return re(this,ar).continueRetry(),re(this,ar).promise}if(t&&this.setOptions(t),!this.options.queryFn){const M=this.observers.find(D=>D.options.queryFn);M&&this.setOptions(M.options)}const r=new AbortController,a=M=>{Object.defineProperty(M,"signal",{enumerable:!0,get:()=>(Qe(this,Ds,!0),r.signal)})},o=()=>{const M=wM(this.options,n),A=(()=>{const N={client:re(this,Os),queryKey:this.queryKey,meta:this.meta};return a(N),N})();return Qe(this,Ds,!1),this.options.persister?this.options.persister(M,A,this):M(A)},c=(()=>{const M={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:re(this,Os),state:this.state,fetchFn:o};return a(M),M})();(d=this.options.behavior)==null||d.onFetch(c,this),Qe(this,uc,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=c.fetchOptions)==null?void 0:m.meta))&&Bt(this,Li,Da).call(this,{type:"fetch",meta:(h=c.fetchOptions)==null?void 0:h.meta}),Qe(this,ar,EM({initialPromise:n==null?void 0:n.initialPromise,fn:c.fetchFn,onCancel:M=>{M instanceof cv&&M.revert&&this.setState({...re(this,uc),fetchStatus:"idle"}),r.abort()},onFail:(M,D)=>{Bt(this,Li,Da).call(this,{type:"failed",failureCount:M,error:D})},onPause:()=>{Bt(this,Li,Da).call(this,{type:"pause"})},onContinue:()=>{Bt(this,Li,Da).call(this,{type:"continue"})},retry:c.options.retry,retryDelay:c.options.retryDelay,networkMode:c.options.networkMode,canRun:()=>!0}));try{const M=await re(this,ar).start();if(M===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(M),(g=(y=re(this,gi).config).onSuccess)==null||g.call(y,M,this),(C=(w=re(this,gi).config).onSettled)==null||C.call(w,M,this.state.error,this),M}catch(M){if(M instanceof cv){if(M.silent)return re(this,ar).promise;if(M.revert){if(this.state.data===void 0)throw M;return this.state.data}}throw Bt(this,Li,Da).call(this,{type:"error",error:M}),(E=(R=re(this,gi).config).onError)==null||E.call(R,M,this),(k=(T=re(this,gi).config).onSettled)==null||k.call(T,this.state.data,M,this),M}finally{this.scheduleGc()}}},Ns=new WeakMap,uc=new WeakMap,gi=new WeakMap,Os=new WeakMap,ar=new WeakMap,Dd=new WeakMap,Ds=new WeakMap,Li=new WeakSet,Da=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...RM(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...SC(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Qe(this,uc,t.manual?a:void 0),a;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),Xn.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),re(this,gi).notify({query:this,type:"updated",action:t})})},fM);function RM(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:SM(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function SC(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function EC(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var jr,nn,Id,Cr,Is,dc,ja,No,Pd,fc,hc,Ps,Ls,Oo,pc,pn,Yu,uv,dv,fv,hv,pv,mv,gv,TM,hM,SL=(hM=class extends Mc{constructor(t,n){super();pt(this,pn);pt(this,jr);pt(this,nn);pt(this,Id);pt(this,Cr);pt(this,Is);pt(this,dc);pt(this,ja);pt(this,No);pt(this,Pd);pt(this,fc);pt(this,hc);pt(this,Ps);pt(this,Ls);pt(this,Oo);pt(this,pc,new Set);this.options=n,Qe(this,jr,t),Qe(this,No,null),Qe(this,ja,lv()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(re(this,nn).addObserver(this),CC(re(this,nn),this.options)?Bt(this,pn,Yu).call(this):this.updateResult(),Bt(this,pn,hv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return yv(re(this,nn),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return yv(re(this,nn),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Bt(this,pn,pv).call(this),Bt(this,pn,mv).call(this),re(this,nn).removeObserver(this)}setOptions(t){const n=this.options,r=re(this,nn);if(this.options=re(this,jr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof bi(this.options.enabled,re(this,nn))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Bt(this,pn,gv).call(this),re(this,nn).setOptions(this.options),n._defaulted&&!gp(this.options,n)&&re(this,jr).getQueryCache().notify({type:"observerOptionsUpdated",query:re(this,nn),observer:this});const a=this.hasListeners();a&&RC(re(this,nn),r,this.options,n)&&Bt(this,pn,Yu).call(this),this.updateResult(),a&&(re(this,nn)!==r||bi(this.options.enabled,re(this,nn))!==bi(n.enabled,re(this,nn))||Fo(this.options.staleTime,re(this,nn))!==Fo(n.staleTime,re(this,nn)))&&Bt(this,pn,uv).call(this);const o=Bt(this,pn,dv).call(this);a&&(re(this,nn)!==r||bi(this.options.enabled,re(this,nn))!==bi(n.enabled,re(this,nn))||o!==re(this,Oo))&&Bt(this,pn,fv).call(this,o)}getOptimisticResult(t){const n=re(this,jr).getQueryCache().build(re(this,jr),t),r=this.createResult(n,t);return CL(this,r)&&(Qe(this,Cr,r),Qe(this,dc,this.options),Qe(this,Is,re(this,nn).state)),r}getCurrentResult(){return re(this,Cr)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&re(this,ja).status==="pending"&&re(this,ja).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){re(this,pc).add(t)}getCurrentQuery(){return re(this,nn)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=re(this,jr).defaultQueryOptions(t),r=re(this,jr).getQueryCache().build(re(this,jr),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return Bt(this,pn,Yu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),re(this,Cr)))}createResult(t,n){var q;const r=re(this,nn),a=this.options,o=re(this,Cr),l=re(this,Is),c=re(this,dc),d=t!==r?t.state:re(this,Id),{state:m}=t;let h={...m},y=!1,g;if(n._optimisticResults){const F=this.hasListeners(),Y=!F&&CC(t,n),_=F&&RC(t,r,n,a);(Y||_)&&(h={...h,...RM(m.data,t.options)}),n._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:w,errorUpdatedAt:C,status:R}=h;g=h.data;let E=!1;if(n.placeholderData!==void 0&&g===void 0&&R==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(c==null?void 0:c.placeholderData)?(F=o.data,E=!0):F=typeof n.placeholderData=="function"?n.placeholderData((q=re(this,hc))==null?void 0:q.state.data,re(this,hc)):n.placeholderData,F!==void 0&&(R="success",g=sv(o==null?void 0:o.data,F,n),y=!0)}if(n.select&&g!==void 0&&!E)if(o&&g===(l==null?void 0:l.data)&&n.select===re(this,Pd))g=re(this,fc);else try{Qe(this,Pd,n.select),g=n.select(g),g=sv(o==null?void 0:o.data,g,n),Qe(this,fc,g),Qe(this,No,null)}catch(F){Qe(this,No,F)}re(this,No)&&(w=re(this,No),g=re(this,fc),C=Date.now(),R="error");const T=h.fetchStatus==="fetching",k=R==="pending",M=R==="error",D=k&&T,A=g!==void 0,L={status:R,fetchStatus:h.fetchStatus,isPending:k,isSuccess:R==="success",isError:M,isInitialLoading:D,isLoading:D,data:g,dataUpdatedAt:h.dataUpdatedAt,error:w,errorUpdatedAt:C,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>d.dataUpdateCount||h.errorUpdateCount>d.errorUpdateCount,isFetching:T,isRefetching:T&&!k,isLoadingError:M&&!A,isPaused:h.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:M&&A,isStale:Ix(t,n),refetch:this.refetch,promise:re(this,ja),isEnabled:bi(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const F=L.data!==void 0,Y=L.status==="error"&&!F,_=B=>{Y?B.reject(L.error):F&&B.resolve(L.data)},V=()=>{const B=Qe(this,ja,L.promise=lv());_(B)},$=re(this,ja);switch($.status){case"pending":t.queryHash===r.queryHash&&_($);break;case"fulfilled":(Y||L.data!==$.value)&&V();break;case"rejected":(!Y||L.error!==$.reason)&&V();break}}return L}updateResult(){const t=re(this,Cr),n=this.createResult(re(this,nn),this.options);if(Qe(this,Is,re(this,nn).state),Qe(this,dc,this.options),re(this,Is).data!==void 0&&Qe(this,hc,re(this,nn)),gp(n,t))return;Qe(this,Cr,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!re(this,pc).size)return!0;const l=new Set(o??re(this,pc));return this.options.throwOnError&&l.add("error"),Object.keys(re(this,Cr)).some(c=>{const f=c;return re(this,Cr)[f]!==t[f]&&l.has(f)})};Bt(this,pn,TM).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Bt(this,pn,hv).call(this)}},jr=new WeakMap,nn=new WeakMap,Id=new WeakMap,Cr=new WeakMap,Is=new WeakMap,dc=new WeakMap,ja=new WeakMap,No=new WeakMap,Pd=new WeakMap,fc=new WeakMap,hc=new WeakMap,Ps=new WeakMap,Ls=new WeakMap,Oo=new WeakMap,pc=new WeakMap,pn=new WeakSet,Yu=function(t){Bt(this,pn,gv).call(this);let n=re(this,nn).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Rr)),n},uv=function(){Bt(this,pn,pv).call(this);const t=Fo(this.options.staleTime,re(this,nn));if(Bs||re(this,Cr).isStale||!av(t))return;const r=vM(re(this,Cr).dataUpdatedAt,t)+1;Qe(this,Ps,Cs.setTimeout(()=>{re(this,Cr).isStale||this.updateResult()},r))},dv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(re(this,nn)):this.options.refetchInterval)??!1},fv=function(t){Bt(this,pn,mv).call(this),Qe(this,Oo,t),!(Bs||bi(this.options.enabled,re(this,nn))===!1||!av(re(this,Oo))||re(this,Oo)===0)&&Qe(this,Ls,Cs.setInterval(()=>{(this.options.refetchIntervalInBackground||Dx.isFocused())&&Bt(this,pn,Yu).call(this)},re(this,Oo)))},hv=function(){Bt(this,pn,uv).call(this),Bt(this,pn,fv).call(this,Bt(this,pn,dv).call(this))},pv=function(){re(this,Ps)&&(Cs.clearTimeout(re(this,Ps)),Qe(this,Ps,void 0))},mv=function(){re(this,Ls)&&(Cs.clearInterval(re(this,Ls)),Qe(this,Ls,void 0))},gv=function(){const t=re(this,jr).getQueryCache().build(re(this,jr),this.options);if(t===re(this,nn))return;const n=re(this,nn);Qe(this,nn,t),Qe(this,Id,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},TM=function(t){Xn.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(re(this,Cr))}),re(this,jr).getQueryCache().notify({query:re(this,nn),type:"observerResultsUpdated"})})},hM);function EL(e,t){return bi(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function CC(e,t){return EL(e,t)||e.state.data!==void 0&&yv(e,t,t.refetchOnMount)}function yv(e,t,n){if(bi(t.enabled,e)!==!1&&Fo(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Ix(e,t)}return!1}function RC(e,t,n,r){return(e!==t||bi(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Ix(e,n)}function Ix(e,t){return bi(t.enabled,e)!==!1&&e.isStaleByTime(Fo(t.staleTime,e))}function CL(e,t){return!gp(e.getCurrentResult(),t)}function TC(e){return{onFetch:(t,n)=>{var m,h,y,g,w;const r=t.options,a=(y=(h=(m=t.fetchOptions)==null?void 0:m.meta)==null?void 0:h.fetchMore)==null?void 0:y.direction,o=((g=t.state.data)==null?void 0:g.pages)||[],l=((w=t.state.data)==null?void 0:w.pageParams)||[];let c={pages:[],pageParams:[]},f=0;const d=async()=>{let C=!1;const R=k=>{mL(k,()=>t.signal,()=>C=!0)},E=wM(t.options,t.fetchOptions),T=async(k,M,D)=>{if(C)return Promise.reject();if(M==null&&k.pages.length)return Promise.resolve(k);const N=(()=>{const Y={client:t.client,queryKey:t.queryKey,pageParam:M,direction:D?"backward":"forward",meta:t.options.meta};return R(Y),Y})(),L=await E(N),{maxPages:q}=t.options,F=D?pL:hL;return{pages:F(k.pages,L,q),pageParams:F(k.pageParams,M,q)}};if(a&&o.length){const k=a==="backward",M=k?RL:kC,D={pages:o,pageParams:l},A=M(r,D);c=await T(D,A,k)}else{const k=e??o.length;do{const M=f===0?l[0]??r.initialPageParam:kC(r,c);if(f>0&&M==null)break;c=await T(c,M),f++}while(f<k)}return c};t.options.persister?t.fetchFn=()=>{var C,R;return(R=(C=t.options).persister)==null?void 0:R.call(C,d,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=d}}}function kC(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function RL(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ld,Qi,gr,_s,Zi,So,pM,TL=(pM=class extends CM{constructor(t){super();pt(this,Zi);pt(this,Ld);pt(this,Qi);pt(this,gr);pt(this,_s);Qe(this,Ld,t.client),this.mutationId=t.mutationId,Qe(this,gr,t.mutationCache),Qe(this,Qi,[]),this.state=t.state||kM(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){re(this,Qi).includes(t)||(re(this,Qi).push(t),this.clearGcTimeout(),re(this,gr).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Qe(this,Qi,re(this,Qi).filter(n=>n!==t)),this.scheduleGc(),re(this,gr).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){re(this,Qi).length||(this.state.status==="pending"?this.scheduleGc():re(this,gr).remove(this))}continue(){var t;return((t=re(this,_s))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,c,f,d,m,h,y,g,w,C,R,E,T,k,M,D,A,N;const n=()=>{Bt(this,Zi,So).call(this,{type:"continue"})},r={client:re(this,Ld),meta:this.options.meta,mutationKey:this.options.mutationKey};Qe(this,_s,EM({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(L,q)=>{Bt(this,Zi,So).call(this,{type:"failed",failureCount:L,error:q})},onPause:()=>{Bt(this,Zi,So).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>re(this,gr).canRun(this)}));const a=this.state.status==="pending",o=!re(this,_s).canStart();try{if(a)n();else{Bt(this,Zi,So).call(this,{type:"pending",variables:t,isPaused:o}),re(this,gr).config.onMutate&&await re(this,gr).config.onMutate(t,this,r);const q=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,r));q!==this.state.context&&Bt(this,Zi,So).call(this,{type:"pending",context:q,variables:t,isPaused:o})}const L=await re(this,_s).start();return await((d=(f=re(this,gr).config).onSuccess)==null?void 0:d.call(f,L,t,this.state.context,this,r)),await((h=(m=this.options).onSuccess)==null?void 0:h.call(m,L,t,this.state.context,r)),await((g=(y=re(this,gr).config).onSettled)==null?void 0:g.call(y,L,null,this.state.variables,this.state.context,this,r)),await((C=(w=this.options).onSettled)==null?void 0:C.call(w,L,null,t,this.state.context,r)),Bt(this,Zi,So).call(this,{type:"success",data:L}),L}catch(L){try{await((E=(R=re(this,gr).config).onError)==null?void 0:E.call(R,L,t,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((k=(T=this.options).onError)==null?void 0:k.call(T,L,t,this.state.context,r))}catch(q){Promise.reject(q)}try{await((D=(M=re(this,gr).config).onSettled)==null?void 0:D.call(M,void 0,L,this.state.variables,this.state.context,this,r))}catch(q){Promise.reject(q)}try{await((N=(A=this.options).onSettled)==null?void 0:N.call(A,void 0,L,t,this.state.context,r))}catch(q){Promise.reject(q)}throw Bt(this,Zi,So).call(this,{type:"error",error:L}),L}finally{re(this,gr).runNext(this)}}},Ld=new WeakMap,Qi=new WeakMap,gr=new WeakMap,_s=new WeakMap,Zi=new WeakSet,So=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Xn.batch(()=>{re(this,Qi).forEach(r=>{r.onMutationUpdate(t)}),re(this,gr).notify({mutation:this,type:"updated",action:t})})},pM);function kM(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var za,_i,_d,mM,kL=(mM=class extends Mc{constructor(t={}){super();pt(this,za);pt(this,_i);pt(this,_d);this.config=t,Qe(this,za,new Set),Qe(this,_i,new Map),Qe(this,_d,0)}build(t,n,r){const a=new TL({client:t,mutationCache:this,mutationId:++xh(this,_d)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){re(this,za).add(t);const n=wh(t);if(typeof n=="string"){const r=re(this,_i).get(n);r?r.push(t):re(this,_i).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(re(this,za).delete(t)){const n=wh(t);if(typeof n=="string"){const r=re(this,_i).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&re(this,_i).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=wh(t);if(typeof n=="string"){const r=re(this,_i).get(n),a=r==null?void 0:r.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=wh(t);if(typeof n=="string"){const a=(r=re(this,_i).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Xn.batch(()=>{re(this,za).forEach(t=>{this.notify({type:"removed",mutation:t})}),re(this,za).clear(),re(this,_i).clear()})}getAll(){return Array.from(re(this,za))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>vC(n,r))}findAll(t={}){return this.getAll().filter(n=>vC(t,n))}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return Xn.batch(()=>Promise.all(t.map(n=>n.continue().catch(Rr))))}},za=new WeakMap,_i=new WeakMap,_d=new WeakMap,mM);function wh(e){var t;return(t=e.options.scope)==null?void 0:t.id}var Fa,Do,zr,Ba,Ua,Xh,bv,gM,ML=(gM=class extends Mc{constructor(n,r){super();pt(this,Ua);pt(this,Fa);pt(this,Do);pt(this,zr);pt(this,Ba);Qe(this,Fa,n),this.setOptions(r),this.bindMethods(),Bt(this,Ua,Xh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=re(this,Fa).defaultMutationOptions(n),gp(this.options,r)||re(this,Fa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:re(this,zr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Hs(r.mutationKey)!==Hs(this.options.mutationKey)?this.reset():((a=re(this,zr))==null?void 0:a.state.status)==="pending"&&re(this,zr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=re(this,zr))==null||n.removeObserver(this)}onMutationUpdate(n){Bt(this,Ua,Xh).call(this),Bt(this,Ua,bv).call(this,n)}getCurrentResult(){return re(this,Do)}reset(){var n;(n=re(this,zr))==null||n.removeObserver(this),Qe(this,zr,void 0),Bt(this,Ua,Xh).call(this),Bt(this,Ua,bv).call(this)}mutate(n,r){var a;return Qe(this,Ba,r),(a=re(this,zr))==null||a.removeObserver(this),Qe(this,zr,re(this,Fa).getMutationCache().build(re(this,Fa),this.options)),re(this,zr).addObserver(this),re(this,zr).execute(n)}},Fa=new WeakMap,Do=new WeakMap,zr=new WeakMap,Ba=new WeakMap,Ua=new WeakSet,Xh=function(){var r;const n=((r=re(this,zr))==null?void 0:r.state)??kM();Qe(this,Do,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},bv=function(n){Xn.batch(()=>{var r,a,o,l,c,f,d,m;if(re(this,Ba)&&this.hasListeners()){const h=re(this,Do).variables,y=re(this,Do).context,g={client:re(this,Fa),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=re(this,Ba)).onSuccess)==null||a.call(r,n.data,h,y,g)}catch(w){Promise.reject(w)}try{(l=(o=re(this,Ba)).onSettled)==null||l.call(o,n.data,null,h,y,g)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(f=(c=re(this,Ba)).onError)==null||f.call(c,n.error,h,y,g)}catch(w){Promise.reject(w)}try{(m=(d=re(this,Ba)).onSettled)==null||m.call(d,void 0,n.error,h,y,g)}catch(w){Promise.reject(w)}}}this.listeners.forEach(h=>{h(re(this,Do))})})},gM),Ji,yM,AL=(yM=class extends Mc{constructor(t={}){super();pt(this,Ji);this.config=t,Qe(this,Ji,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??Ax(a,n);let l=this.get(o);return l||(l=new wL({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){re(this,Ji).has(t.queryHash)||(re(this,Ji).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=re(this,Ji).get(t.queryHash);n&&(t.destroy(),n===t&&re(this,Ji).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Xn.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return re(this,Ji).get(t)}getAll(){return[...re(this,Ji).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>bC(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>bC(t,r)):n}notify(t){Xn.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Xn.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ji=new WeakMap,yM),zn,Io,Po,mc,gc,Lo,yc,bc,bM,NL=(bM=class{constructor(e={}){pt(this,zn);pt(this,Io);pt(this,Po);pt(this,mc);pt(this,gc);pt(this,Lo);pt(this,yc);pt(this,bc);Qe(this,zn,e.queryCache||new AL),Qe(this,Io,e.mutationCache||new kL),Qe(this,Po,e.defaultOptions||{}),Qe(this,mc,new Map),Qe(this,gc,new Map),Qe(this,Lo,0)}mount(){xh(this,Lo)._++,re(this,Lo)===1&&(Qe(this,yc,Dx.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,zn).onFocus())})),Qe(this,bc,yp.subscribe(async e=>{e&&(await this.resumePausedMutations(),re(this,zn).onOnline())})))}unmount(){var e,t;xh(this,Lo)._--,re(this,Lo)===0&&((e=re(this,yc))==null||e.call(this),Qe(this,yc,void 0),(t=re(this,bc))==null||t.call(this),Qe(this,bc,void 0))}isFetching(e){return re(this,zn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return re(this,Io).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,zn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=re(this,zn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Fo(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return re(this,zn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=re(this,zn).get(r.queryHash),o=a==null?void 0:a.state.data,l=uL(t,o);if(l!==void 0)return re(this,zn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return Xn.batch(()=>re(this,zn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=re(this,zn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=re(this,zn);Xn.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=re(this,zn);return Xn.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=Xn.batch(()=>re(this,zn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(Rr).catch(Rr)}invalidateQueries(e,t={}){return Xn.batch(()=>(re(this,zn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=Xn.batch(()=>re(this,zn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(Rr)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(Rr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=re(this,zn).build(this,t);return n.isStaleByTime(Fo(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Rr).catch(Rr)}fetchInfiniteQuery(e){return e.behavior=TC(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Rr).catch(Rr)}ensureInfiniteQueryData(e){return e.behavior=TC(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yp.isOnline()?re(this,Io).resumePausedMutations():Promise.resolve()}getQueryCache(){return re(this,zn)}getMutationCache(){return re(this,Io)}getDefaultOptions(){return re(this,Po)}setDefaultOptions(e){Qe(this,Po,e)}setQueryDefaults(e,t){re(this,mc).set(Hs(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...re(this,mc).values()],n={};return t.forEach(r=>{gd(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){re(this,gc).set(Hs(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...re(this,gc).values()],n={};return t.forEach(r=>{gd(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...re(this,Po).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Ax(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Nx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...re(this,Po).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){re(this,zn).clear(),re(this,Io).clear()}},zn=new WeakMap,Io=new WeakMap,Po=new WeakMap,mc=new WeakMap,gc=new WeakMap,Lo=new WeakMap,yc=new WeakMap,bc=new WeakMap,bM),Vy={exports:{}},Pt={};/**
|
|
11
|
-
* @license React
|
|
12
|
-
* react.production.js
|
|
13
|
-
*
|
|
14
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the MIT license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var MC;function OL(){if(MC)return Pt;MC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),y=Symbol.iterator;function g(U){return U===null||typeof U!="object"?null:(U=y&&U[y]||U["@@iterator"],typeof U=="function"?U:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,R={};function E(U,G,I){this.props=U,this.context=G,this.refs=R,this.updater=I||w}E.prototype.isReactComponent={},E.prototype.setState=function(U,G){if(typeof U!="object"&&typeof U!="function"&&U!=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,U,G,"setState")},E.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function T(){}T.prototype=E.prototype;function k(U,G,I){this.props=U,this.context=G,this.refs=R,this.updater=I||w}var M=k.prototype=new T;M.constructor=k,C(M,E.prototype),M.isPureReactComponent=!0;var D=Array.isArray;function A(){}var N={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function q(U,G,I){var Q=I.ref;return{$$typeof:e,type:U,key:G,ref:Q!==void 0?Q:null,props:I}}function F(U,G){return q(U.type,G,U.props)}function Y(U){return typeof U=="object"&&U!==null&&U.$$typeof===e}function _(U){var G={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(I){return G[I]})}var V=/\/+/g;function $(U,G){return typeof U=="object"&&U!==null&&U.key!=null?_(""+U.key):G.toString(36)}function B(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(A,A):(U.status="pending",U.then(function(G){U.status==="pending"&&(U.status="fulfilled",U.value=G)},function(G){U.status==="pending"&&(U.status="rejected",U.reason=G)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function j(U,G,I,Q,le){var ae=typeof U;(ae==="undefined"||ae==="boolean")&&(U=null);var Z=!1;if(U===null)Z=!0;else switch(ae){case"bigint":case"string":case"number":Z=!0;break;case"object":switch(U.$$typeof){case e:case t:Z=!0;break;case m:return Z=U._init,j(Z(U._payload),G,I,Q,le)}}if(Z)return le=le(U),Z=Q===""?"."+$(U,0):Q,D(le)?(I="",Z!=null&&(I=Z.replace(V,"$&/")+"/"),j(le,G,I,"",function(Se){return Se})):le!=null&&(Y(le)&&(le=F(le,I+(le.key==null||U&&U.key===le.key?"":(""+le.key).replace(V,"$&/")+"/")+Z)),G.push(le)),1;Z=0;var ue=Q===""?".":Q+":";if(D(U))for(var ve=0;ve<U.length;ve++)Q=U[ve],ae=ue+$(Q,ve),Z+=j(Q,G,I,ae,le);else if(ve=g(U),typeof ve=="function")for(U=ve.call(U),ve=0;!(Q=U.next()).done;)Q=Q.value,ae=ue+$(Q,ve++),Z+=j(Q,G,I,ae,le);else if(ae==="object"){if(typeof U.then=="function")return j(B(U),G,I,Q,le);throw G=String(U),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Z}function z(U,G,I){if(U==null)return U;var Q=[],le=0;return j(U,Q,"","",function(ae){return G.call(I,ae,le++)}),Q}function H(U){if(U._status===-1){var G=U._result;G=G(),G.then(function(I){(U._status===0||U._status===-1)&&(U._status=1,U._result=I)},function(I){(U._status===0||U._status===-1)&&(U._status=2,U._result=I)}),U._status===-1&&(U._status=0,U._result=G)}if(U._status===1)return U._result.default;throw U._result}var K=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},P={map:z,forEach:function(U,G,I){z(U,function(){G.apply(this,arguments)},I)},count:function(U){var G=0;return z(U,function(){G++}),G},toArray:function(U){return z(U,function(G){return G})||[]},only:function(U){if(!Y(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Pt.Activity=h,Pt.Children=P,Pt.Component=E,Pt.Fragment=n,Pt.Profiler=a,Pt.PureComponent=k,Pt.StrictMode=r,Pt.Suspense=f,Pt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,Pt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return N.H.useMemoCache(U)}},Pt.cache=function(U){return function(){return U.apply(null,arguments)}},Pt.cacheSignal=function(){return null},Pt.cloneElement=function(U,G,I){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var Q=C({},U.props),le=U.key;if(G!=null)for(ae in G.key!==void 0&&(le=""+G.key),G)!L.call(G,ae)||ae==="key"||ae==="__self"||ae==="__source"||ae==="ref"&&G.ref===void 0||(Q[ae]=G[ae]);var ae=arguments.length-2;if(ae===1)Q.children=I;else if(1<ae){for(var Z=Array(ae),ue=0;ue<ae;ue++)Z[ue]=arguments[ue+2];Q.children=Z}return q(U.type,le,Q)},Pt.createContext=function(U){return U={$$typeof:l,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:o,_context:U},U},Pt.createElement=function(U,G,I){var Q,le={},ae=null;if(G!=null)for(Q in G.key!==void 0&&(ae=""+G.key),G)L.call(G,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(le[Q]=G[Q]);var Z=arguments.length-2;if(Z===1)le.children=I;else if(1<Z){for(var ue=Array(Z),ve=0;ve<Z;ve++)ue[ve]=arguments[ve+2];le.children=ue}if(U&&U.defaultProps)for(Q in Z=U.defaultProps,Z)le[Q]===void 0&&(le[Q]=Z[Q]);return q(U,ae,le)},Pt.createRef=function(){return{current:null}},Pt.forwardRef=function(U){return{$$typeof:c,render:U}},Pt.isValidElement=Y,Pt.lazy=function(U){return{$$typeof:m,_payload:{_status:-1,_result:U},_init:H}},Pt.memo=function(U,G){return{$$typeof:d,type:U,compare:G===void 0?null:G}},Pt.startTransition=function(U){var G=N.T,I={};N.T=I;try{var Q=U(),le=N.S;le!==null&&le(I,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(A,K)}catch(ae){K(ae)}finally{G!==null&&I.types!==null&&(G.types=I.types),N.T=G}},Pt.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},Pt.use=function(U){return N.H.use(U)},Pt.useActionState=function(U,G,I){return N.H.useActionState(U,G,I)},Pt.useCallback=function(U,G){return N.H.useCallback(U,G)},Pt.useContext=function(U){return N.H.useContext(U)},Pt.useDebugValue=function(){},Pt.useDeferredValue=function(U,G){return N.H.useDeferredValue(U,G)},Pt.useEffect=function(U,G){return N.H.useEffect(U,G)},Pt.useEffectEvent=function(U){return N.H.useEffectEvent(U)},Pt.useId=function(){return N.H.useId()},Pt.useImperativeHandle=function(U,G,I){return N.H.useImperativeHandle(U,G,I)},Pt.useInsertionEffect=function(U,G){return N.H.useInsertionEffect(U,G)},Pt.useLayoutEffect=function(U,G){return N.H.useLayoutEffect(U,G)},Pt.useMemo=function(U,G){return N.H.useMemo(U,G)},Pt.useOptimistic=function(U,G){return N.H.useOptimistic(U,G)},Pt.useReducer=function(U,G,I){return N.H.useReducer(U,G,I)},Pt.useRef=function(U){return N.H.useRef(U)},Pt.useState=function(U){return N.H.useState(U)},Pt.useSyncExternalStore=function(U,G,I){return N.H.useSyncExternalStore(U,G,I)},Pt.useTransition=function(){return N.H.useTransition()},Pt.version="19.2.4",Pt}var AC;function jd(){return AC||(AC=1,Vy.exports=OL()),Vy.exports}var v=jd();const Fe=Gp(v),Px=nL({__proto__:null,default:Fe},[v]);var MM=v.createContext(void 0),el=e=>{const t=v.useContext(MM);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},DL=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),S.jsx(MM.Provider,{value:e,children:t})),AM=v.createContext(!1),IL=()=>v.useContext(AM);AM.Provider;function PL(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var LL=v.createContext(PL()),_L=()=>v.useContext(LL),jL=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Ox(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},zL=e=>{v.useEffect(()=>{e.clearReset()},[e])},FL=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||Ox(n,[e.error,r])),BL=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},HL=(e,t)=>e.isLoading&&e.isFetching&&!t,UL=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,NC=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function qL(e,t,n){var y,g,w,C;const r=IL(),a=_L(),o=el(),l=o.defaultQueryOptions(e);(g=(y=o.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||g.call(y,l);const c=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",BL(l),jL(l,a,c),zL(a);const f=!o.getQueryCache().get(l.queryHash),[d]=v.useState(()=>new t(o,l)),m=d.getOptimisticResult(l),h=!r&&e.subscribed!==!1;if(v.useSyncExternalStore(v.useCallback(R=>{const E=h?d.subscribe(Xn.batchCalls(R)):Rr;return d.updateResult(),E},[d,h]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),v.useEffect(()=>{d.setOptions(l)},[l,d]),UL(l,m))throw NC(l,d,a);if(FL({result:m,errorResetBoundary:a,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw m.error;if((C=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||C.call(w,l,m),l.experimental_prefetchInRender&&!Bs&&HL(m,r)){const R=f?NC(l,d,a):c==null?void 0:c.promise;R==null||R.catch(Rr).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?m:d.trackResult(m)}function Ei(e,t){return qL(e,SL)}function VL(e,t){const n=el(),r=n.getQueryCache();return v.useSyncExternalStore(v.useCallback(a=>r.subscribe(Xn.batchCalls(a)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function yd(e,t){const n=el(),[r]=v.useState(()=>new ML(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);const a=v.useSyncExternalStore(v.useCallback(l=>r.subscribe(Xn.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=v.useCallback((l,c)=>{r.mutate(l,c).catch(Rr)},[r]);if(a.error&&Ox(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}const $L={en_US:{translation:{common:{loading:"Loading...",save:"Save",saving:"Saving...",cancel:"Cancel",add:"Add",delete:"Delete",edit:"Edit",confirm:"Confirm",close:"Close",expand:"Expand",collapse:"Collapse",refresh:"Refresh",test:"Test",send:"Send",success:"Success",error:"Error",warning:"Warning",info:"Info",yes:"Yes",no:"No",enabled:"Enabled",disabled:"Disabled",pending:"Pending",authorized:"Authorized",unknown:"Unknown",empty:"Empty",none:"None",default:"Default",optional:"Optional",required:"Required",pwaInstallTitle:"Install as app",pwaInstallHintIOSSafari:'iOS Safari does not show an automatic install prompt. Tap Share, then "Add to Home Screen".',pwaInstallHintIOSChrome:'iOS Chrome does not show an automatic install prompt. Tap Share, then "Add to Home Screen".'},nav:{manageDevices:"Manage Devices",settings:"Settings",sidebarExpand:"Expand Sidebar",sidebarCollapse:"Collapse Sidebar",openSidebar:"Open Sidebar",closeSidebar:"Close Sidebar",jumpToLatest:"Jump to Latest",switchToEditor:"Switch to Editor Input",switchToDirect:"Switch to Direct Input",refreshPage:"Refresh Page",refreshPageConfirm:"Are you sure you want to refresh the page? Unsaved content will be lost."},device:{title:"Device Management",devices:"Devices",addDevice:"Add Device",addDeviceDescription:"Fill in device details and choose a connection method",addFirstDevice:"Add First Device",editDevice:"Edit Device",editDeviceDescription:"Update device configuration",sectionBasic:"Basic Info",sectionConnection:"Connection",sectionAuth:"Authentication",noDevices:"No Devices",noDevicesDescription:"Add a local or SSH device to get started",name:"Device Name",namePlaceholder:"e.g., My Server",type:"Type",typeLocal:"Local Device",typeSSH:"SSH Remote Device",typeSSHBadge:"SSH",host:"Host",hostPlaceholder:"example.com",port:"Port",username:"Username",usernamePlaceholder:"root",session:"Tmux Session Name",sessionPlaceholder:"tmex",sessionHint:'Leave empty to use default "tmex"',authMode:"Authentication Mode",authPassword:"Password",authKey:"Private Key",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"Password",privateKey:"Private Key",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"Private Key Passphrase (Optional)",passphrase:"Passphrase",connect:"Connect",connected:"Connected",disconnect:"Disconnect",disconnected:"Disconnected",connecting:"Connecting...",dragHandle:"Drag to reorder device",reorderFailed:"Failed to reorder devices",deleteConfirm:"Delete this device?",deleteDescription:'Device "{{name}}" will be permanently removed. This action cannot be undone.',deleteSuccess:"Device deleted",createSuccess:"Device created",updateSuccess:"Device updated",deleteFailed:"Failed to delete device",createFailed:"Failed to create device",updateFailed:"Failed to update device",loadFailed:"Failed to load devices",localDevice:"Local Device",subtitle:"{{username}}@{{host}}:{{port}}",modify:"Modify Device",delete:"Delete"},terminal:{initializing:"Initializing terminal...",connecting:"Connecting to device...",initFailed:"Terminal initialization failed",inputPlaceholder:"Type command here...",clear:"Clear",deviceError:"Device Error",deviceErrorWithType:"[{{type}}] Device Error",noDeviceSelected:"No device selected",windowClosed:"Current window has been closed, please select a window from the sidebar.",paneClosed:"Current pane has been closed, please select a pane from the sidebar.",bellNotification:"Terminal Bell Notification",bellDescription:"Window {{window}} · Pane {{pane}}",bellFallback:"Received tmux bell",paneTitle:"Pane {{index}}",activePane:"Current Pane",activeWindow:"Current Window",editorPlaceholder:"Enter commands here...",editorClear:"Clear",editorSendWithEnter:"Send with Enter",editorSendLineByLine:"Send Line by Line",editorSend:"Send",sendShortcut:"Send {{key}}",inputModeDirect:"Direct Input",inputModeEditor:"Editor",newWindow:"New Window",closeWindow:"Close Window",closePane:"Close Pane",copy:"Copy",paste:"Paste",copied:"Copied to clipboard",copyFailed:"Copy failed",pasteFailed:"Could not read clipboard, check browser permissions",clearSelection:"Dismiss selection"},settings:{title:"System Settings",siteSettings:"Site Settings",siteName:"Site Name",siteNamePlaceholder:"tmex",siteUrl:"Site URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell Throttle (seconds)",notificationThrottle:"Notification Throttle (seconds)",enableBrowserBellToast:"Enable Browser Bell Toast",enableBrowserNotificationToast:"Enable Browser Notification Toast",enableTelegramBellPush:"Enable Telegram Bell Push",enableTelegramNotificationPush:"Enable Telegram Notification Push",sshReconnectRetries:"SSH Reconnect Retries",sshReconnectDelay:"SSH Reconnect Delay (seconds)",language:"Language",languagePlaceholder:"Select language",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"Dark Mode",themeLight:"Light",themeDark:"Dark",siteTab:"Site",notificationsTab:"Notifications",tabGroup:{general:"General",devicesAndFiles:"Devices & Files",notifications:"Notifications",ai:"AI"},deviceManagement:{title:"Device Management",description:"Add, edit, and connect to your local and SSH devices.",openButton:"Open Device Management"},refreshToApply:"Refresh to apply language change",saveSettings:"Save Settings",settingsSaved:"Settings saved",saveFailed:"Failed to save settings",loadFailed:"Failed to load settings",restartGateway:"Restart Gateway",restartScheduled:"Gateway restart scheduled",restartConfirm:"Are you sure you want to restart Gateway? This will interrupt all active connections.",restartFailed:"Failed to restart gateway",sshReconnectMaxRetries:"SSH Reconnect Retries",llm:{title:"LLM Providers",name:"Name",namePlaceholder:"e.g. OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"Adds /v1 automatically; end with / to keep the path as-is",protocol:"Protocol",apiKey:"API Key",apiKeyPlaceholder:"Enter API key",apiKeySetPlaceholder:"Already set, leave blank to keep",addProvider:"Add Provider",editProvider:"Edit Provider",formHint:"Configure the provider connection",models:"Models",modelsTitle:"Models for {{name}}",modelsHint:"Manage the available models for this provider: toggle and add manually",modelManual:"Manual",addModelPlaceholder:"Add a model ID",empty:"No providers yet",refreshModels:"Refresh Models",modelsCount:"{{total}} models",modelsNotFetched:"Models not fetched yet",modelsFetchFailed:"Failed to fetch models: {{error}}",deleteProvider:"Delete Provider",deleteConfirm:'Delete provider "{{name}}"?',defaults:"Global Defaults",defaultProvider:"Default Provider",defaultProviderNone:"Not set",defaultModel:"Default Model",defaultModelPlaceholder:"Type or pick a model ID",saveDefaults:"Save Defaults",loadFailed:"Failed to load LLM providers",createFailed:"Failed to create provider",updateFailed:"Failed to update provider",deleteFailed:"Failed to delete provider",refreshModelsFailed:"Failed to refresh models",settingsLoadFailed:"Failed to load LLM settings",settingsSaveFailed:"Failed to save LLM settings"},search:{title:"Search",provider:"Search Provider",responsesApiHint:"If your LLM provider uses the OpenAI Responses API protocol, it can use that API's built-in hosted search tool; the third-party search below is an optional supplement.",providerNone:"Disabled",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"Enter API key",keySetPlaceholder:"Already set, leave blank to keep",clearKey:"Clear",clearKeyConfirm:"Clear this API key? You will need to enter it again.",loadFailed:"Failed to load search settings",saveFailed:"Failed to save search settings"},files:{title:"Files",description:"Per-device directories browsable in the Files tab. Local devices read directly; SSH devices use rsync.",addRoot:"Add directory",roots:"Directories",empty:"No directories configured",missing:"Device missing",modalAddTitle:"Add directory",modalEditTitle:"Edit directory",device:"Device",devicePlaceholder:"Select a device",noDevices:"No devices yet — add one first",path:"Path",pathPlaceholder:"/absolute/path/to/directory",pathHint:"Absolute path on the selected device.",enabled:"Enabled",addFailed:"Failed to add directory",updateFailed:"Failed to update directory",deleteFailed:"Failed to remove directory",toggleFailed:"Failed to update directory",deleteTitle:"Remove directory?",deleteDesc:'Remove "{{path}}" from the whitelist? Files under it will no longer be accessible.'},version:{title:"Version & Updates",currentVersion:"Current version",installMethod:"Install method",installMethodCli:"Installed via CLI",installMethodNonCli:"Not installed via CLI",deployment:"Deployment",deploymentLaunchd:"launchd (macOS)",deploymentSystemd:"systemd (Linux)",deploymentNone:"None",checkUpdate:"Check for updates",checking:"Checking…",upToDate:"You are on the latest version.",updateAvailable:"Update available: {{version}}",changelog:"Changelog",changelogUnavailable:"No changelog available for this version.",publishedAt:"Published {{date}}",upgrade:"Upgrade now",upgradeDisabledDev:"In-app update is disabled outside the production environment.",upgradeDisabledNonCli:"In-app update is only available for CLI installations.",upgradeWarningTitle:"Confirm upgrade",upgradeWarningBody:"Upgrading restarts the service and will interrupt your current session. It may also affect the survival of tmux processes managed by the service. Continue?",upgradeStarted:"Upgrade started",stateDownloading:"Downloading the new version…",stateExecuting:"Applying the upgrade, the service is restarting…",interruptNotice:"The connection will drop while the service restarts; it will recover shortly.",checkFailed:"Failed to check for updates",terminalHint:"Or upgrade from a terminal: npx tmex-cli@<version> upgrade"}},telegram:{title:"Telegram Bot Management",botName:"Bot Name",botNamePlaceholder:"e.g., ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Add Bot",editBot:"Edit Bot",enableBot:"Enable Bot",allowAuthRequests:"Allow Authorization Requests",pendingChats:"Pending Authorization",chats:"Authorized Chats",authorizedChats:"Authorized",noPendingChats:"No pending chats",noAuthorizedChats:"No authorized chats",approve:"Approve",authorize:"Authorize",reject:"Reject",revokeAuth:"Revoke Authorization",testMessage:"Test Message",sendTestMessage:"Send Test Message",deleteBot:"Delete Bot",tokenOptional:"Token (leave empty to keep unchanged)",tokenPlaceholder:"Enter new token",botCreated:"Bot created",botUpdated:"Bot updated",botDeleted:"Bot deleted",authApproved:"Authorization approved",chatRemoved:"Chat removed",testMessageSent:"Test message sent",createFailed:"Failed to create bot",updateFailed:"Failed to update bot",deleteFailed:"Failed to delete bot",approveFailed:"Failed to approve authorization",removeFailed:"Failed to remove chat",testMessageFailed:"Failed to send test message",loadBotsFailed:"Failed to load bot list",loadChatsFailed:"Failed to load chat list",noBots:"No bots yet, add one first.",expand:"Expand",collapse:"Collapse",authCount:"{{authorized}} authorized / {{pending}} pending (max 8)",chatId:"Chat ID",applyTime:"Application Time",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}: Connection error on device "{{deviceName}}" ({{host}}) [{{category}}]
|
|
19
|
-
{{error}}`,agentCredentialWarning:'⚠️ {{siteName}}: A message in agent session "{{sessionTitle}}" appears to contain credentials ({{types}}). It will be sent to the LLM and stored — risk of leakage.',authSuccess:"✅ Authorized. You will now receive notifications.",authPending:"⏳ Authorization request received. Please approve in tmex settings.",authFailed:"❌ Authorization request failed. Please contact administrator.",testMessageTemplate:`🧪 Test Message
|
|
20
|
-
Site: {{siteName}}
|
|
21
|
-
Time: {{time}}`,approveMessageTemplate:`✅ Authorized via tmex.
|
|
22
|
-
Bot: {{botName}}
|
|
23
|
-
Time: {{time}}`,botNotFound:"Bot not found or unavailable",botNotRunning:"Bot is not running or unavailable"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"Secret",secretPlaceholder:"Used to sign payloads (HMAC-SHA256)",enabled:"Enabled",eventMask:"Events",add:"Add Webhook",empty:"No webhooks yet.",createFailed:"Failed to create webhook",deleteFailed:"Failed to delete webhook",loadFailed:"Failed to load webhooks"},sshError:{sshConfigRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",configRefNotSupported:"SSH Config reference is not supported in this version. Please use host + username with Agent/Key/Password authentication.",agentUnavailable:"SSH Agent unavailable: SSH_AUTH_SOCK not detected. Please check agent environment.",agentNoIdentity:"SSH Agent has no available keys. Please run ssh-add first.",agentNoIdentities:"SSH Agent has no available keys. Please run ssh-add first.",authFailed:"Authentication failed: incorrect username, password, or key. Please check device configuration.",authFailedGeneric:"Authentication failed: incorrect username, password, or key. Please check device configuration.",networkUnreachable:"Network unreachable: Please check routing, firewall, or VPN configuration.",connectionRefused:"Connection refused: Unable to connect to target host. Please check host address and port.",timeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",connectionTimeout:"Connection timeout: Unable to connect to device. Please check network or firewall settings.",hostNotFound:"Host not found: Unable to resolve hostname. Please check DNS or hostname configuration.",handshakeFailed:"Handshake failed: Unable to establish secure connection. Possibly incompatible key exchange algorithm.",tmuxUnavailable:"Remote tmux unavailable or failed to start. Please ensure tmux is installed and available in the remote shell PATH.",connectionClosed:"Connection closed, attempting to reconnect",unknown:"Connection failed: {{message}}",reconnecting:"Connection interrupted, reconnecting in {{delay}} seconds ({{attempt}}/{{maxRetries}})",reconnectFailed:"Auto-reconnect failed, please retry manually",reconnected:"Device reconnected automatically"},deviceStatus:{reconnecting:"Reconnecting {{delay}}s",offline:"Offline",errorBadge:{authFailed:"Auth failed",agentUnavailable:"Agent unavailable",agentNoIdentity:"Agent has no keys",configRefNotSupported:"SSH Config unsupported",networkUnreachable:"Network unreachable",connectionRefused:"Refused",timeout:"Timeout",hostNotFound:"Host not found",handshakeFailed:"Handshake failed",tmuxUnavailable:"Tmux unavailable",connectionClosed:"Disconnected",unknown:"Connection error"}},websocket:{error:"WebSocket connection error",checkGateway:"Please check Gateway status",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"Please check Gateway status"},apiError:{siteNameRequired:"Site name cannot be empty",siteUrlInvalid:"Site URL must start with http:// or https://",bellThrottleInvalid:"Bell throttle seconds must be between 0-300",sshRetriesInvalid:"SSH reconnect retries must be between 0-20",sshDelayInvalid:"SSH reconnect delay must be between 1-300 seconds",languageInvalid:"Language must be one of the supported locales",botNameRequired:"Bot name cannot be empty",botTokenRequired:"Bot token cannot be empty",missingFields:"Missing required fields",sshRequiresHost:"SSH device requires host or sshConfigRef",invalidRequest:"Invalid request",deviceNotFound:"Device not found",botNotFound:"Bot not found",chatNotFound:"Chat not found",urlAndSecretRequired:"URL and secret are required",notFound:"Not found",llmProviderNameRequired:"Provider name cannot be empty",llmProviderProtocolInvalid:"Protocol must be openai-chat or openai-responses",llmProviderBaseUrlInvalid:"Base URL must start with http:// or https://",llmProviderApiKeyRequired:"API key cannot be empty",llmProviderNotFound:"LLM provider not found",llmProviderDisabled:"LLM provider {{name}} is disabled",llmNoDefaultProvider:"No LLM provider specified and no default provider configured",llmNoDefaultModel:"No model specified and no default model configured",llmDefaultProviderNotFound:"Default provider does not exist",llmSearchProviderInvalid:"Search provider must be none, tavily or brave",llmFetchModelsFailed:"Failed to fetch model list: {{detail}}",agentSessionNotFound:"Agent session not found",agentSessionBusy:"Agent session is currently running, stop it or wait for completion",agentSessionAwaitingConfirmation:"Agent session has pending confirmations, resolve them first",agentDeviceRequired:"Device is required",agentPaneRequired:"Terminal pane is required",agentWriteModeInvalid:"Write mode must be confirm or auto",agentMaxStepsInvalid:"Max steps per turn must be between 1 and 100",agentProviderWebSearchRequiresResponses:"Provider built-in web search requires the openai-responses protocol",agentHostedToolUnknown:"Unknown hosted tool: {{name}}",agentHostedToolRequiresResponses:"Provider hosted tools require the openai-responses protocol",agentSessionOrphaned:"This agent session is orphaned (its terminal is gone) and is read-only",agentQueuedMessageNotFound:"Queued message not found",agentConfirmationNotFound:"Confirmation not found",agentConfirmationAlreadyDecided:"Confirmation has already been decided",agentMessageTextRequired:"Message text is required",watchRuleNotFound:"Watch rule not found",watchNameRequired:"Rule name is required",watchTriggerTypeInvalid:"Trigger type must be match, unchanged or llm",watchPatternRequired:"match/unchanged rules require a regular expression",watchPatternInvalid:"Invalid regular expression: {{detail}}",watchUnchangedMinutesInvalid:"unchanged rules require unchangedMinutes greater than 0",watchExtractGroupInvalid:"Capture group index must be an integer >= 0",watchConditionPromptRequired:"llm rules require a condition prompt",watchIntervalInvalid:"Sampling interval must be at least {{min}} seconds",watchNoMatchBehaviorInvalid:"No-match behavior must be reset or ignore",watchFireModeInvalid:"Fire mode must be once or repeat",watchCooldownInvalid:"Cooldown seconds must be an integer >= 0",watchAssistDescriptionRequired:"Please describe what to match",watchAssistModelUnavailable:"Model call failed: {{detail}}",fileRootInvalid:"Path must be an absolute, existing directory",fileOutsideRoots:"Path is outside the allowed directories",fileNotADirectory:"Not a directory",fileTooLarge:"File is too large",fileBinary:"Binary files are not supported",fileRootDeviceInvalid:"Invalid or unknown device",fileRootDuplicate:"This directory is already added for the device",upgradeNotAllowed:"In-app update is not available for this installation.",upgradeInProgress:"An upgrade is already in progress.",upgradeVersionRequired:"Target version is required.",updateCheckFailed:"Failed to query the npm registry."},notification:{clickToJump:"Click to jump to corresponding pane",eventType:{terminal_bell:"🔔 Terminal Bell",terminal_notification:"🔔 Terminal Notification",tmux_window_close:"🪟 Window Closed",tmux_pane_close:"📱 Pane Closed",device_tmux_missing:"⚠️ Tmux Missing",device_disconnect:"🔌 Device Disconnected",session_created:"🆕 Session Created",session_closed:"🚪 Session Closed",agent_confirmation_pending:"🤖 Agent Confirmation Pending",agent_turn_finished:"🤖 Agent Turn Finished",agent_error:"🤖 Agent Error",watch_triggered:"👁️ Watch Rule Triggered",watch_model_unavailable:"👁️ Watch Model Unavailable",watch_rule_error:"👁️ Watch Rule Error"},site:"Site",device:"Device",window:"Window",pane:"Pane",time:"Time",directLink:"Direct Link",message:"Message",paneTitle:"Title",process:"Process",telegramBell:{title:"🔔 Bell from {{siteName}}: {{terminalTopbarLabel}}",viewLink:"Click to view",terminalTopbarLabel:"Window {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:'Agent "{{title}}" requests to run tool {{toolName}}, awaiting confirmation',turnFinished:'Agent "{{title}}" turn finished',error:'Agent "{{title}}" error: {{message}}'},watch:{matchTriggered:'Watch "{{name}}" matched: {{text}}',unchangedTriggered:'Watch "{{name}}" value "{{value}}" has been unchanged for {{minutes}} minutes',llmTriggered:'Watch "{{name}}" condition met: {{reason}}',summaryTriggered:'Watch "{{name}}": {{summary}}',unconfirmedSuffix:" (model unavailable, not LLM-confirmed)",modelUnavailable:'Watch "{{name}}" model call failed: {{message}}',ruleError:'Watch "{{name}}" failed {{count}} times in a row and has been disabled: {{message}}',paneGone:'Watch "{{name}}" pane ({{paneId}}) was destroyed; the rule has been removed'}},sidebar:{noWindows:"No windows",noDevices:"No devices",addDeviceLink:"Add Device",openSettingsLink:"Open Settings",openSettings:"Open Settings",manageDevices:"Manage Devices",settings:"Settings",currentWindow:"Current Window",currentPane:"Current Pane",newWindow:"Create Window",closeWindow:"Close Window",closePane:"Close Pane",addDevice:"Add Device",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"Orphaned sessions"},agent:{error:{streamStalled:"The model stopped responding (upstream stream stalled). Please retry."},model:{select:"Select model",placeholder:"Model",noProviders:"No models — configure a provider in Settings"},queue:{title:"Queued ({{count}})",steer:"Steer now",steerHint:"Interrupt the current step and inject the queue now",withdraw:"Withdraw"},orphan:{readonly:"This session is orphaned (its terminal is gone) — read-only",title:"Orphaned",process:"Process",startedAt:"Started"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"Select or create a session",inputPlaceholder:"Type a message…",send:"Send",stop:"Stop",retry:"Retry",scrollToBottom:"Scroll to bottom"},welcome:{title:"New Agent chat",subtitle:"Describe your task to start working in the selected terminal"},session:{none:"No session selected",new:"New agent session",switch:"Switch session",selectPaneHint:"Select a pane in the Panes tab to start a session",noSessions:"No sessions yet",showAll:"Show all sessions",rename:"Rename session",renameTitle:"Rename session",renamePlaceholder:"Session title",save:"Save",cancel:"Cancel",delete:"Delete session",deleteTitle:"Delete this session?",deleteDesc:'"{{title}}" and all its messages will be permanently deleted.',deleteConfirm:"Delete",createDisabledNoPane:"Open a terminal pane to create a session",privacyNotice:"Sessions send terminal screen content to the configured LLM service."},binding:{invalid:"Pane unavailable",mismatchTitle:"This session is bound to a different pane",goTo:"Go to pane",rebind:"Rebind here"},writeMode:{confirm:"Confirm writes",auto:"Auto execute"},confirm:{title:"Approval required",approve:"Allow",deny:"Deny"},tool:{input:"Input",result:"Result",screen:"Screen capture",send_input:"Send input",read_screen:"Read screen",web_search:"Web search",fetch_url:"Fetch URL",denied:"Denied"},reasoning:{title:"Reasoning"},toast:{errorTitle:'Agent "{{title}}" error',credentialWarningTitle:"Message may contain credentials",credentialWarningDescription:"Detected {{types}}. The content is not modified, but it will be sent to the LLM and stored — risk of leakage."}},window:{noWindows:"No windows",new:"New Window",close:"Close window",closePane:"Close pane",closeConfirmTitle:"Close this window?",closePaneConfirmTitle:"Close this pane?",closeConfirmDesc:'Processes running in "{{name}}" will be terminated. This action cannot be undone.',menu:"Window actions",dragHandle:"Drag to reorder window",dragHandlePane:"Drag to reorder pane",rename:"Rename window",renamePlaceholder:"Enter a name",renameDesc:"The custom name overrides the title set by the terminal and is kept until the gateway restarts.",renameReset:"Use automatic name"},watch:{title:"Watch rules",dialogDesc:"Monitor this pane's screen and get notified when conditions are met",openMonitor:"Watch this pane",rules:{empty:"No watch rules for this pane yet",addRule:"New rule",edit:"Edit",delete:"Delete",viewState:"Status",lastTriggered:"Last triggered: {{time}}",neverTriggered:"Never triggered",deleteTitle:"Delete this rule?",deleteDesc:'"{{name}}" will be permanently deleted.',deleteConfirm:"Delete"},type:{match:"Match",unchanged:"Stuck",llm:"LLM"},typeDesc:{match:"Trigger when a regex matches the screen",unchanged:"Trigger when an extracted value stays unchanged for N minutes (e.g. stalled download)",llm:"An LLM periodically checks the screen against a natural-language condition"},form:{createTitle:"New watch rule",editTitle:"Edit watch rule",name:"Rule name",namePlaceholder:"e.g. Download stalled",triggerType:"Trigger type",pattern:"Regular expression",patternPlaceholder:"e.g. (\\d+)%",flags:"Flags",flagsPlaceholder:"e.g. i",extractGroup:"Capture group index",extractGroupHint:"0 = whole match; the group value is tracked over time",unchangedMinutes:"Unchanged for (minutes)",noMatchBehavior:"When nothing matches",noMatchReset:"Reset timer (progress line gone = task done)",noMatchIgnore:"Ignore (keep last value)",conditionPrompt:"Condition (natural language)",conditionPromptPlaceholder:"e.g. The build has failed with a compile error",model:"Model",followGlobalDefault:"Follow global default",modelPlaceholder:"Model ID",modelRequiredHint:"This rule calls an LLM. Make sure the selected (or global default) model is available.",confirmWithLlm:"LLM double-check before notifying",confirmWithLlmDesc:"Reduce false positives; fails open if the model is unavailable",summarizeWithLlm:"LLM notification summary",summarizeWithLlmDesc:"Summarize the screen into the notification text",intervalSeconds:"Sampling interval (seconds)",intervalHint:"Minimum {{min}}s",fireMode:"Fire mode",fireOnce:"Once (auto-disable after firing)",fireRepeat:"Repeat",cooldownSeconds:"Cooldown (seconds)",enabled:"Enabled",assistLabel:"Generate regex from a description",assistPlaceholder:"e.g. match the download progress percentage",assistButton:"Generate",assistExplanation:"Explanation",assistPreview:"Matches on current screen",assistPreviewEmpty:"No matches on the current screen sample",create:"Create",save:"Save",providerUnavailable:"Original provider unavailable",providerDisabled:"disabled"},validation:{nameRequired:"Rule name is required",patternRequired:"Regular expression is required",patternInvalid:"Invalid regular expression: {{detail}}",unchangedMinutesInvalid:"Unchanged minutes must be greater than 0",conditionPromptRequired:"Condition prompt is required",intervalMin:"Sampling interval must be at least {{min}} seconds"},state:{title:"Rule status",back:"Back",lastSampledAt:"Last sampled",lastValue:"Last value",lastValueChangedAt:"Value last changed",lastTriggeredAt:"Last triggered",consecutiveErrors:"Consecutive errors",lastError:"Last error",samples:"Recent samples",samplesEmpty:"No samples yet",hit:"hit",none:"—"},toast:{created:"Watch rule created",updated:"Watch rule updated",deleted:"Watch rule deleted",triggeredTitle:"Watch triggered",openTerminal:"Open terminal",modelUnavailableTitle:"Watch model unavailable",modelUnavailableHint:"The rule keeps running with degraded behavior.",ruleErrorTitle:"Watch rule auto-disabled"},notifPermission:{title:"Enable browser notifications?",desc:"Get notified when watch rules trigger, even when this tab is in the background.",enable:"Enable",dismiss:"Not now"}},validation:{deviceNameRequired:"Device name is required",hostRequired:"Host is required for SSH devices",portRequired:"A valid port is required for SSH devices",usernameRequired:"Username is required for SSH devices",sshConfigRequired:"SSH config path is required for SSH devices"},files:{title:"Files",refresh:"Refresh file list",noRoots:"No accessible directories. Add one in Settings → Files.",emptyDir:"Empty",truncated:"Too many items — list truncated",download:"Download",error:{invalid:"Invalid request",outside_roots:"Path is outside the allowed directory",not_found:"No longer exists",not_a_directory:"Not a directory",is_directory:"This is a directory",too_large:"File is too large to preview",binary:"Binary file cannot be previewed",permission_denied:"Permission denied",device_not_found:"Device not found",root_not_found:"Directory entry not found",root_disabled:"This directory is disabled",connection_failed:"Failed to connect to the device",auth_unsupported:"Device auth method unsupported for files (use key or ssh-agent)",rsync_missing_local:"rsync is not installed on the server",rsync_missing_remote:"rsync is not installed on the remote device",timeout:"Timed out",unknown:"Failed to load"},retry:"Retry (collapse then expand)",install:{button:"Install rsync",scopeLocal:"server",scopeRemote:"remote",connectFailed:"Failed to connect to the device",windowFailed:"Failed to create a window",prompt:"rsync is not installed on {{device}} ({{scope}}). Please install rsync using the appropriate command for this system (e.g. `brew install rsync`, `sudo apt-get install -y rsync`, or `sudo yum install -y rsync`), then reply once it is done."}},file:{invalidRef:"Invalid file reference",notFound:"File no longer exists",accessDenied:"Access denied",loadFailed:"Failed to load file",isDirectory:"This is a directory",notPreviewable:"Preview is not available for this file type",tooLarge:"File is too large to preview",binary:"Binary file cannot be previewed",download:"Download",openRaw:"Open raw"}}},zh_CN:{translation:{common:{loading:"加载中...",save:"保存",saving:"保存中...",cancel:"取消",add:"添加",delete:"删除",edit:"修改",confirm:"确认",close:"关闭",expand:"展开",collapse:"收起",refresh:"刷新",test:"测试",send:"发送",success:"成功",error:"错误",warning:"警告",info:"信息",yes:"是",no:"否",enabled:"已启用",disabled:"已禁用",pending:"待授权",authorized:"已授权",unknown:"未知",empty:"空",none:"无",default:"默认",optional:"可选",required:"必填",pwaInstallTitle:"安装为应用",pwaInstallHintIOSSafari:"iOS Safari 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」。",pwaInstallHintIOSChrome:"iOS Chrome 不会自动弹出安装提示。请点击「分享」,再选择「添加到主屏幕」"},nav:{manageDevices:"管理设备",settings:"设置",sidebarExpand:"展开侧边栏",sidebarCollapse:"收起侧边栏",openSidebar:"打开侧边栏",closeSidebar:"关闭侧边栏",jumpToLatest:"跳转到最新",switchToEditor:"切换到编辑器输入",switchToDirect:"切换到直接输入",refreshPage:"刷新页面",refreshPageConfirm:"确定要刷新页面吗?未保存的内容将会丢失。"},device:{title:"设备管理",devices:"设备",addDevice:"添加设备",addDeviceDescription:"填写设备信息并选择连接方式",addFirstDevice:"添加第一个设备",editDevice:"修改设备",editDeviceDescription:"更新设备配置",sectionBasic:"基本信息",sectionConnection:"连接信息",sectionAuth:"认证信息",noDevices:"暂无设备",noDevicesDescription:"添加本地或 SSH 设备开始使用",name:"设备名称",namePlaceholder:"例如:我的服务器",type:"类型",typeLocal:"本地设备",typeSSH:"SSH 远程设备",typeSSHBadge:"SSH",host:"主机",hostPlaceholder:"example.com",port:"端口",username:"用户名",usernamePlaceholder:"root",session:"Tmux 会话名称",sessionPlaceholder:"tmex",sessionHint:'留空将使用默认值 "tmex"',authMode:"认证方式",authPassword:"密码",authKey:"私钥",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"密码",privateKey:"私钥",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"私钥密码(可选)",passphrase:"私钥密码(可选)",connect:"连接",connected:"已连接",disconnect:"断开",disconnected:"已断开",connecting:"连接中...",dragHandle:"拖动以调整设备顺序",reorderFailed:"设备排序失败",deleteConfirm:"删除此设备?",deleteDescription:'设备 "{{name}}" 将被永久移除,此操作无法撤销。',deleteSuccess:"设备已删除",createSuccess:"设备已创建",updateSuccess:"设备已更新",deleteFailed:"删除设备失败",createFailed:"创建设备失败",updateFailed:"更新设备失败",loadFailed:"加载设备列表失败",localDevice:"本地设备",subtitle:"{{username}}@{{host}}:{{port}}",modify:"修改设备",delete:"删除"},terminal:{initializing:"初始化终端...",connecting:"连接设备...",initFailed:"终端初始化失败",inputPlaceholder:"在此输入命令...",clear:"清空",deviceError:"设备错误",deviceErrorWithType:"[{{type}}] 设备错误",noDeviceSelected:"未选择设备",windowClosed:"当前窗口已关闭,请在侧边栏重新选择窗口。",paneClosed:"当前 Pane 已关闭,请在侧边栏重新选择 Pane。",bellNotification:"终端 Bell 提醒",bellDescription:"窗口 {{window}} · Pane {{pane}}",bellFallback:"收到 tmux bell",paneTitle:"Pane {{index}}",activePane:"当前 pane",activeWindow:"当前窗口",editorPlaceholder:"在此输入命令...",editorClear:"清空",editorSendWithEnter:"发送附带回车",editorSendLineByLine:"逐行发送",editorSend:"发送",sendShortcut:"发送 {{key}}",inputModeDirect:"直接输入",inputModeEditor:"编辑器",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",copy:"复制",paste:"粘贴",copied:"已复制到剪贴板",copyFailed:"复制失败",pasteFailed:"无法读取剪贴板,请检查浏览器权限",clearSelection:"取消选择"},settings:{title:"系统设置",siteSettings:"站点设置",siteName:"站点名称",siteNamePlaceholder:"tmex",siteUrl:"站点访问 URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"Bell 频控(秒)",notificationThrottle:"通知频控(秒)",enableBrowserBellToast:"开启浏览器 Bell Toast",enableBrowserNotificationToast:"开启浏览器通知 Toast",enableTelegramBellPush:"开启 Telegram Bell 推送",enableTelegramNotificationPush:"开启 Telegram 通知推送",sshReconnectRetries:"SSH 重连次数",sshReconnectDelay:"SSH 重连等待(秒)",language:"语言",languagePlaceholder:"选择语言",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"深色模式",themeLight:"浅色",themeDark:"深色",siteTab:"站点",notificationsTab:"通知",tabGroup:{general:"通用设置",devicesAndFiles:"设备与文件",notifications:"通知设置",ai:"AI 设置"},deviceManagement:{title:"设备管理",description:"添加、编辑并连接你的本地与 SSH 设备。",openButton:"打开设备管理"},refreshToApply:"刷新后生效",saveSettings:"保存设置",settingsSaved:"站点设置已保存",saveFailed:"保存设置失败",loadFailed:"加载设置失败",restartGateway:"重启 Gateway",restartScheduled:"Gateway 重启请求已发送",restartConfirm:"确定要重启 Gateway 吗?这将中断所有活动连接。",restartFailed:"重启请求失败",sshReconnectMaxRetries:"SSH 重连次数",llm:{title:"LLM 提供商",name:"名称",namePlaceholder:"如 OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"默认自动补全 /v1;以 / 结尾则按原路径不补 /v1",protocol:"协议",apiKey:"API Key",apiKeyPlaceholder:"输入 API Key",apiKeySetPlaceholder:"已设置,留空不修改",addProvider:"添加提供商",editProvider:"编辑供应商",formHint:"配置供应商连接信息",models:"模型",modelsTitle:"{{name}} 的模型",modelsHint:"管理该供应商可用的模型,启停与手动添加",modelManual:"手动",addModelPlaceholder:"添加模型 ID",empty:"暂无提供商",refreshModels:"刷新模型",modelsCount:"{{total}} 个模型",modelsNotFetched:"尚未获取模型列表",modelsFetchFailed:"模型列表获取失败:{{error}}",deleteProvider:"删除提供商",deleteConfirm:"确定要删除提供商「{{name}}」吗?",defaults:"全局默认",defaultProvider:"默认提供商",defaultProviderNone:"未设置",defaultModel:"默认模型",defaultModelPlaceholder:"输入或选择模型 ID",saveDefaults:"保存默认设置",loadFailed:"加载 LLM 提供商失败",createFailed:"创建提供商失败",updateFailed:"更新提供商失败",deleteFailed:"删除提供商失败",refreshModelsFailed:"刷新模型失败",settingsLoadFailed:"加载 LLM 设置失败",settingsSaveFailed:"保存 LLM 设置失败"},search:{title:"搜索",provider:"搜索提供商",responsesApiHint:"若 LLM Provider 使用 OpenAI Responses API 协议,可直接使用其内置的 hosted 搜索工具;下方第三方搜索为可选补充。",providerNone:"不启用",tavilyApiKey:"Tavily API Key",braveApiKey:"Brave API Key",keyPlaceholder:"输入 API Key",keySetPlaceholder:"已设置,留空不修改",clearKey:"清除",clearKeyConfirm:"确定要清除此 API Key 吗?清除后需要重新填写。",loadFailed:"加载搜索设置失败",saveFailed:"保存搜索设置失败"},files:{title:"文件",description:"配置各设备下可在「文件」标签页浏览的目录。本地设备直接读取,SSH 设备走 rsync。",addRoot:"添加目录",roots:"目录",empty:"尚未配置任何目录",missing:"设备已失效",modalAddTitle:"添加目录",modalEditTitle:"编辑目录",device:"设备",devicePlaceholder:"选择设备",noDevices:"还没有设备,请先添加设备",path:"路径",pathPlaceholder:"/绝对路径/到/目录",pathHint:"所选设备上的绝对路径。",enabled:"启用",addFailed:"添加目录失败",updateFailed:"更新目录失败",deleteFailed:"移除目录失败",toggleFailed:"更新目录失败",deleteTitle:"移除目录?",deleteDesc:"将「{{path}}」移出白名单?该目录下的文件将不再可访问。"},version:{title:"版本与更新",currentVersion:"当前版本",installMethod:"安装方式",installMethodCli:"通过 CLI 安装",installMethodNonCli:"非 CLI 安装",deployment:"部署方式",deploymentLaunchd:"launchd(macOS)",deploymentSystemd:"systemd(Linux)",deploymentNone:"无",checkUpdate:"检查更新",checking:"检查中…",upToDate:"已是最新版本。",updateAvailable:"有可用更新:{{version}}",changelog:"更新日志",changelogUnavailable:"该版本暂无更新日志。",publishedAt:"发布于 {{date}}",upgrade:"立即升级",upgradeDisabledDev:"非 production 环境已禁用程序内更新。",upgradeDisabledNonCli:"程序内更新仅在通过 CLI 安装时可用。",upgradeWarningTitle:"确认升级",upgradeWarningBody:"升级会重启服务并中断当前访问,还可能影响该服务托管的 tmux 进程的存活。是否继续?",upgradeStarted:"升级已开始",stateDownloading:"正在下载新版本…",stateExecuting:"正在执行升级,服务即将重启…",interruptNotice:"服务重启期间连接会断开,稍候即可恢复。",checkFailed:"检查更新失败",terminalHint:"或通过终端升级:npx tmex-cli@<version> upgrade"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名称",botNamePlaceholder:"如:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"新增 Bot",editBot:"编辑 Bot",enableBot:"启用 Bot",allowAuthRequests:"允许申请授权",pendingChats:"待授权",chats:"已授权",authorizedChats:"已授权",noPendingChats:"暂无待授权 chat",noAuthorizedChats:"暂无已授权 chat",approve:"批准",authorize:"授权",reject:"拒绝",revokeAuth:"撤销授权",testMessage:"测试消息",sendTestMessage:"发送测试消息",deleteBot:"删除 Bot",tokenOptional:"Token(留空不改)",tokenPlaceholder:"输入新 token",botCreated:"Bot 已创建",botUpdated:"Bot 已更新",botDeleted:"Bot 已删除",authApproved:"授权已批准",chatRemoved:"chat 已移除",testMessageSent:"测试消息已发送",createFailed:"新增 Bot 失败",updateFailed:"更新 Bot 失败",deleteFailed:"删除 Bot 失败",approveFailed:"批准授权失败",removeFailed:"删除 chat 失败",testMessageFailed:"发送测试消息失败",loadBotsFailed:"加载 Bot 列表失败",loadChatsFailed:"加载 chat 列表失败",noBots:"暂无 Bot,先添加一个。",expand:"展开",collapse:"收起",authCount:"已授权 {{authorized}} / 待授权 {{pending}}(总上限 8)",chatId:"chatId",applyTime:"申请时间",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:设备「{{deviceName}}」({{host}}) 连接异常 [{{category}}]
|
|
24
|
-
{{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent 会话「{{sessionTitle}}」的一条消息疑似包含凭证({{types}})。该内容将发送至 LLM 并存储,存在泄露风险。",authSuccess:"✅ 已授权,可接收通知。",authPending:"⏳ 已收到授权申请,请在 tmex 设置页审批。",authFailed:"❌ 授权申请失败,请联系管理员。",testMessageTemplate:`🧪 测试消息
|
|
25
|
-
站点:{{siteName}}
|
|
26
|
-
时间:{{time}}`,approveMessageTemplate:`✅ 已通过 tmex 授权。
|
|
27
|
-
Bot:{{botName}}
|
|
28
|
-
时间:{{time}}`,botNotFound:"Bot 未启动或不可用",botNotRunning:"Bot 未启动或不可用"},webhook:{title:"Webhooks",url:"Webhook 地址",secret:"密钥",secretPlaceholder:"用于签名(HMAC-SHA256)",enabled:"启用",eventMask:"事件",add:"添加 Webhook",empty:"暂无 Webhook。",createFailed:"创建 Webhook 失败",deleteFailed:"删除 Webhook 失败",loadFailed:"加载 Webhook 失败"},sshError:{sshConfigRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",configRefNotSupported:"当前版本暂不支持 SSH Config 引用,请改为填写 host + username,并选择 Agent/私钥/密码认证",agentUnavailable:"SSH Agent 不可用:未检测到 SSH_AUTH_SOCK,请检查 agent 环境",agentNoIdentity:"SSH Agent 未加载可用密钥,请先执行 ssh-add",agentNoIdentities:"SSH Agent 未加载可用密钥,请先执行 ssh-add",authFailed:"认证失败:用户名、密码或密钥不正确,请检查设备配置",authFailedGeneric:"认证失败:用户名、密码或密钥不正确,请检查设备配置",networkUnreachable:"网络不可达:请检查路由、防火墙或 VPN 配置",connectionRefused:"连接被拒绝:无法连接到目标主机,请检查主机地址和端口是否正确",timeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",connectionTimeout:"连接超时:无法连接到设备,请检查网络或防火墙设置",hostNotFound:"主机未找到:无法解析主机地址,请检查 DNS 或主机名是否正确",handshakeFailed:"握手失败:无法建立安全连接,可能是密钥交换算法不兼容",tmuxUnavailable:"远端 tmux 不可用或启动失败,请检查远端是否已安装 tmux,且远端 shell PATH 可找到 tmux",connectionClosed:"连接已断开,尝试重连中",unknown:"连接失败:{{message}}",reconnecting:"连接中断,{{delay}} 秒后自动重连({{attempt}}/{{maxRetries}})",reconnectFailed:"自动重连失败,请手动重试",reconnected:"设备已自动重连"},deviceStatus:{reconnecting:"重连中 {{delay}}s",offline:"离线",errorBadge:{authFailed:"认证失败",agentUnavailable:"Agent 不可用",agentNoIdentity:"Agent 无密钥",configRefNotSupported:"不支持 SSH Config",networkUnreachable:"网络不可达",connectionRefused:"连接被拒",timeout:"连接超时",hostNotFound:"主机未找到",handshakeFailed:"握手失败",tmuxUnavailable:"tmux 不可用",connectionClosed:"连接已断开",unknown:"连接异常"}},websocket:{error:"WebSocket 连接错误",checkGateway:"请检查 Gateway 状态",upgradeFailed:"Upgrade failed",invalidMessage:"Invalid message format"},wsError:{checkGateway:"请检查 Gateway 状态"},apiError:{siteNameRequired:"站点名称不能为空",siteUrlInvalid:"站点 URL 必须以 http:// 或 https:// 开头",bellThrottleInvalid:"Bell 频控秒数需在 0-300 之间",sshRetriesInvalid:"SSH 重连次数需在 0-20 之间",sshDelayInvalid:"SSH 重连等待时间需在 1-300 秒之间",languageInvalid:"语言必须是受支持的区域设置之一",botNameRequired:"Bot 名称不能为空",botTokenRequired:"Bot token 不能为空",missingFields:"缺少必填字段",sshRequiresHost:"SSH 设备需要 host 或 sshConfigRef",invalidRequest:"请求无效",deviceNotFound:"Device not found",botNotFound:"Bot 不存在",chatNotFound:"Chat 不存在",urlAndSecretRequired:"URL and secret required",notFound:"Not found",llmProviderNameRequired:"Provider 名称不能为空",llmProviderProtocolInvalid:"协议必须是 openai-chat 或 openai-responses",llmProviderBaseUrlInvalid:"Base URL 必须以 http:// 或 https:// 开头",llmProviderApiKeyRequired:"API key 不能为空",llmProviderNotFound:"LLM provider 不存在",llmProviderDisabled:"LLM provider {{name}} 已被禁用",llmNoDefaultProvider:"未指定 LLM provider 且未配置默认 provider",llmNoDefaultModel:"未指定模型且未配置默认模型",llmDefaultProviderNotFound:"默认 provider 不存在",llmSearchProviderInvalid:"搜索服务必须是 none、tavily 或 brave",llmFetchModelsFailed:"拉取模型列表失败:{{detail}}",agentSessionNotFound:"Agent 会话不存在",agentSessionBusy:"Agent 会话正在运行中,请先停止或等待完成",agentSessionAwaitingConfirmation:"Agent 会话有待处理的确认请求,请先处理",agentDeviceRequired:"必须指定设备",agentPaneRequired:"必须指定终端 pane",agentWriteModeInvalid:"写入模式必须是 confirm 或 auto",agentMaxStepsInvalid:"每回合最大步数必须在 1-100 之间",agentProviderWebSearchRequiresResponses:"Provider 内置搜索仅支持 openai-responses 协议",agentHostedToolUnknown:"未知的 hosted 工具:{{name}}",agentHostedToolRequiresResponses:"Provider hosted 工具仅支持 openai-responses 协议",agentSessionOrphaned:"该 Agent 会话已孤立(绑定终端已不存在),仅可只读查看",agentQueuedMessageNotFound:"排队消息不存在",agentConfirmationNotFound:"确认请求不存在",agentConfirmationAlreadyDecided:"确认请求已被处理",agentMessageTextRequired:"消息内容不能为空",watchRuleNotFound:"Watch 规则不存在",watchNameRequired:"规则名称不能为空",watchTriggerTypeInvalid:"触发类型必须是 match、unchanged 或 llm",watchPatternRequired:"match/unchanged 规则必须提供正则表达式",watchPatternInvalid:"正则表达式无效:{{detail}}",watchUnchangedMinutesInvalid:"unchanged 规则的未变化分钟数必须大于 0",watchExtractGroupInvalid:"捕获组序号必须是不小于 0 的整数",watchConditionPromptRequired:"llm 规则必须提供条件描述",watchIntervalInvalid:"采样间隔不能小于 {{min}} 秒",watchNoMatchBehaviorInvalid:"无命中行为必须是 reset 或 ignore",watchFireModeInvalid:"触发模式必须是 once 或 repeat",watchCooldownInvalid:"冷却秒数必须是不小于 0 的整数",watchAssistDescriptionRequired:"请描述要匹配的内容",watchAssistModelUnavailable:"模型调用失败:{{detail}}",fileRootInvalid:"路径必须是已存在的绝对目录",fileOutsideRoots:"路径不在允许的目录范围内",fileNotADirectory:"不是目录",fileTooLarge:"文件过大",fileBinary:"不支持二进制文件",fileRootDeviceInvalid:"无效或未知的设备",fileRootDuplicate:"该设备下已添加过此目录",upgradeNotAllowed:"当前安装方式不支持程序内更新。",upgradeInProgress:"已有升级任务正在进行。",upgradeVersionRequired:"缺少目标版本号。",updateCheckFailed:"查询 npm registry 失败。"},notification:{clickToJump:"点击跳转到对应 Pane",eventType:{terminal_bell:"🔔 终端 Bell",terminal_notification:"🔔 终端通知",tmux_window_close:"🪟 窗口关闭",tmux_pane_close:"📱 Pane 关闭",device_tmux_missing:"⚠️ Tmux 不可用",device_disconnect:"🔌 设备断开",session_created:"🆕 会话创建",session_closed:"🚪 会话关闭",agent_confirmation_pending:"🤖 Agent 等待确认",agent_turn_finished:"🤖 Agent 回合完成",agent_error:"🤖 Agent 错误",watch_triggered:"👁️ Watch 规则触发",watch_model_unavailable:"👁️ Watch 模型不可用",watch_rule_error:"👁️ Watch 规则错误"},site:"站点",device:"设备",window:"窗口",pane:"Pane",time:"时间",directLink:"直达",message:"信息",paneTitle:"标题",process:"进程",telegramBell:{title:"🔔 来自 {{siteName}} 的 Bell:{{terminalTopbarLabel}}",viewLink:"点击查看",terminalTopbarLabel:"窗口 {{window}} · Pane {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」请求执行工具 {{toolName}},等待确认",turnFinished:"Agent「{{title}}」回合完成",error:"Agent「{{title}}」出错:{{message}}"},watch:{matchTriggered:"监控「{{name}}」命中:{{text}}",unchangedTriggered:"监控「{{name}}」的值「{{value}}」已 {{minutes}} 分钟未变化",llmTriggered:"监控「{{name}}」条件满足:{{reason}}",summaryTriggered:"监控「{{name}}」:{{summary}}",unconfirmedSuffix:"(模型不可用,未经 LLM 二次确认)",modelUnavailable:"监控「{{name}}」模型调用失败:{{message}}",ruleError:"监控「{{name}}」连续失败 {{count}} 次,已自动停用:{{message}}",paneGone:"监控「{{name}}」的 Pane({{paneId}})已销毁,规则已自动删除"}},sidebar:{noWindows:"暂无窗口",noDevices:"暂无设备",addDeviceLink:"添加设备",openSettingsLink:"打开设置",openSettings:"打开设置",manageDevices:"管理设备",settings:"设置",currentWindow:"当前窗口",currentPane:"当前 pane",newWindow:"新建窗口",closeWindow:"关闭窗口",closePane:"关闭 pane",addDevice:"添加设备",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立会话"},agent:{error:{streamStalled:"模型停止响应(上游流无响应),请重试。"},model:{select:"选择模型",placeholder:"模型",noProviders:"暂无模型 — 请先在设置中配置供应商"},queue:{title:"队列({{count}})",steer:"立即注入",steerHint:"中断当前步骤并立即注入队列",withdraw:"撤回"},orphan:{readonly:"该会话已孤立(绑定终端已不存在),仅可只读查看",title:"孤立会话",process:"进程",startedAt:"创建于"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"选择或创建一个会话",inputPlaceholder:"输入消息…",send:"发送",stop:"停止",retry:"重试",scrollToBottom:"回到底部"},welcome:{title:"新建 Agent 对话",subtitle:"向 Agent 描述你的需求,开始在所选终端中协作"},session:{none:"未选择会话",new:"新建 Agent 会话",switch:"切换会话",selectPaneHint:"请在 Panes 标签中选择一个 pane 来开启会话",noSessions:"暂无会话",showAll:"显示全部会话",rename:"重命名会话",renameTitle:"重命名会话",renamePlaceholder:"会话标题",save:"保存",cancel:"取消",delete:"删除会话",deleteTitle:"删除此会话?",deleteDesc:"“{{title}}”及其全部消息将被永久删除。",deleteConfirm:"删除",createDisabledNoPane:"请先打开一个终端 pane 再创建会话",privacyNotice:"会话将把终端屏幕内容发送给配置的 LLM 服务。"},binding:{invalid:"已失效",mismatchTitle:"此会话绑定的 pane 与当前终端不一致",goTo:"跳转过去",rebind:"重绑到当前"},writeMode:{confirm:"写入需确认",auto:"自动执行"},confirm:{title:"等待确认",approve:"允许",deny:"拒绝"},tool:{input:"输入",result:"结果",screen:"屏幕快照",send_input:"发送输入",read_screen:"读取屏幕",web_search:"网络搜索",fetch_url:"抓取网页",denied:"已拒绝"},reasoning:{title:"思考过程"},toast:{errorTitle:"Agent“{{title}}”出错",credentialWarningTitle:"消息疑似包含凭证",credentialWarningDescription:"检测到 {{types}}。内容不会被修改,但会发送至 LLM 并存储,存在泄露风险。"}},window:{noWindows:"暂无窗口",new:"新建窗口",close:"关闭窗口",closePane:"关闭面板",closeConfirmTitle:"关闭此窗口?",closePaneConfirmTitle:"关闭此面板?",closeConfirmDesc:'"{{name}}" 中运行的进程将被终止,此操作无法撤销。',menu:"窗口操作",dragHandle:"拖动以调整窗口顺序",dragHandlePane:"拖动以调整 pane 顺序",rename:"重命名窗口",renamePlaceholder:"输入名称",renameDesc:"自定义名称会覆盖终端设置的标题,并保留至 gateway 重启。",renameReset:"恢复自动名称"},watch:{title:"监控规则",dialogDesc:"监控该终端屏幕,条件满足时发送通知",openMonitor:"监控此终端",rules:{empty:"该终端还没有监控规则",addRule:"新建规则",edit:"编辑",delete:"删除",viewState:"状态",lastTriggered:"最近触发:{{time}}",neverTriggered:"从未触发",deleteTitle:"删除该规则?",deleteDesc:"“{{name}}”将被永久删除。",deleteConfirm:"删除"},type:{match:"匹配",unchanged:"卡住",llm:"LLM"},typeDesc:{match:"正则命中屏幕内容时触发",unchanged:"提取值连续 N 分钟不变时触发(如下载卡住)",llm:"由 LLM 周期查看屏幕并判断自然语言条件"},form:{createTitle:"新建监控规则",editTitle:"编辑监控规则",name:"规则名称",namePlaceholder:"如:下载卡住提醒",triggerType:"触发类型",pattern:"正则表达式",patternPlaceholder:"如:(\\d+)%",flags:"标志",flagsPlaceholder:"如:i",extractGroup:"捕获组序号",extractGroupHint:"0 = 整个匹配;该组的值将被持续跟踪",unchangedMinutes:"不变持续(分钟)",noMatchBehavior:"无命中时",noMatchReset:"重置计时(进度行消失视为任务结束)",noMatchIgnore:"忽略(保留上次值)",conditionPrompt:"条件(自然语言)",conditionPromptPlaceholder:"如:构建因编译错误而失败",model:"模型",followGlobalDefault:"跟随全局默认",modelPlaceholder:"模型 ID",modelRequiredHint:"该规则会调用 LLM,请确保所选(或全局默认)模型可用。",confirmWithLlm:"通知前 LLM 二次确认",confirmWithLlmDesc:"减少误报;模型不可用时直接通知",summarizeWithLlm:"LLM 生成通知摘要",summarizeWithLlmDesc:"由模型总结屏幕内容作为通知正文",intervalSeconds:"采样间隔(秒)",intervalHint:"最低 {{min}} 秒",fireMode:"触发模式",fireOnce:"单次(触发后自动停用)",fireRepeat:"重复",cooldownSeconds:"冷却时间(秒)",enabled:"启用",assistLabel:"用描述生成正则",assistPlaceholder:"如:匹配下载进度百分比",assistButton:"生成",assistExplanation:"说明",assistPreview:"当前屏幕命中",assistPreviewEmpty:"当前屏幕样本无命中",create:"创建",save:"保存",providerUnavailable:"原提供商已不可用",providerDisabled:"已禁用"},validation:{nameRequired:"规则名称不能为空",patternRequired:"正则表达式不能为空",patternInvalid:"正则表达式无效:{{detail}}",unchangedMinutesInvalid:"不变持续分钟数必须大于 0",conditionPromptRequired:"条件描述不能为空",intervalMin:"采样间隔不能低于 {{min}} 秒"},state:{title:"规则状态",back:"返回",lastSampledAt:"最近采样",lastValue:"最近值",lastValueChangedAt:"值最近变化",lastTriggeredAt:"最近触发",consecutiveErrors:"连续错误次数",lastError:"最近错误",samples:"近期样本",samplesEmpty:"暂无样本",hit:"命中",none:"—"},toast:{created:"监控规则已创建",updated:"监控规则已更新",deleted:"监控规则已删除",triggeredTitle:"监控触发",openTerminal:"打开终端",modelUnavailableTitle:"监控模型不可用",modelUnavailableHint:"规则将以降级方式继续运行。",ruleErrorTitle:"监控规则已自动停用"},notifPermission:{title:"启用浏览器通知?",desc:"即使页面在后台,监控触发时也能收到通知。",enable:"启用",dismiss:"暂不"}},validation:{deviceNameRequired:"设备名称为必填项",hostRequired:"SSH 设备需要填写主机地址",portRequired:"SSH 设备需要填写有效端口",usernameRequired:"SSH 设备需要填写用户名",sshConfigRequired:"SSH 设备需要填写 ssh config 路径"},files:{title:"文件",refresh:"刷新文件列表",noRoots:"没有可访问的目录。请在「设置 → 文件」中添加。",emptyDir:"空目录",truncated:"条目过多,列表已截断",download:"下载",error:{invalid:"无效请求",outside_roots:"路径超出允许的目录范围",not_found:"已不存在",not_a_directory:"不是目录",is_directory:"这是一个目录",too_large:"文件过大,无法预览",binary:"二进制文件无法预览",permission_denied:"无访问权限",device_not_found:"设备不存在",root_not_found:"目录项不存在",root_disabled:"该目录已禁用",connection_failed:"连接设备失败",auth_unsupported:"该设备的认证方式不支持文件访问(请用密钥或 ssh-agent)",rsync_missing_local:"服务器上未安装 rsync",rsync_missing_remote:"远程设备上未安装 rsync",timeout:"已超时",unknown:"加载失败"},retry:"重试(收起后再展开)",install:{button:"安装 rsync",scopeLocal:"服务器",scopeRemote:"远程",connectFailed:"连接设备失败",windowFailed:"创建窗口失败",prompt:"设备 {{device}}({{scope}})上未检测到 rsync。请根据系统选择合适的命令安装 rsync(例如 `brew install rsync`、`sudo apt-get install -y rsync` 或 `sudo yum install -y rsync`),安装完成后回复我。"}},file:{invalidRef:"无效的文件引用",notFound:"文件已不存在",accessDenied:"无访问权限",loadFailed:"加载文件失败",isDirectory:"这是一个目录",notPreviewable:"该文件类型不支持预览",tooLarge:"文件过大,无法预览",binary:"二进制文件无法预览",download:"下载",openRaw:"打开原始文件"}}},ja_JP:{translation:{common:{loading:"読み込み中...",save:"保存",saving:"保存中...",cancel:"キャンセル",add:"追加",delete:"削除",edit:"編集",confirm:"確認",close:"閉じる",expand:"展開",collapse:"折りたたむ",refresh:"更新",test:"テスト",send:"送信",success:"成功",error:"エラー",warning:"警告",info:"情報",yes:"はい",no:"いいえ",enabled:"有効",disabled:"無効",pending:"保留中",authorized:"承認済み",unknown:"不明",empty:"空",none:"なし",default:"デフォルト",optional:"任意",required:"必須",pwaInstallTitle:"アプリとしてインストール",pwaInstallHintIOSSafari:"iOS Safari では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。",pwaInstallHintIOSChrome:"iOS Chrome では自動的にインストールプロンプトが表示されません。共有ボタンをタップし、「ホーム画面に追加」を選択してください。"},nav:{manageDevices:"デバイス管理",settings:"設定",sidebarExpand:"サイドバーを展開",sidebarCollapse:"サイドバーを折りたたむ",openSidebar:"サイドバーを開く",closeSidebar:"サイドバーを閉じる",jumpToLatest:"最新にジャンプ",switchToEditor:"エディタ入力に切り替え",switchToDirect:"直接入力に切り替え",refreshPage:"ページを更新",refreshPageConfirm:"ページを更新してもよろしいですか?保存されていない内容は失われます。"},device:{title:"デバイス管理",devices:"デバイス",addDevice:"デバイスを追加",addDeviceDescription:"デバイス情報を入力し、接続方法を選択してください",addFirstDevice:"最初のデバイスを追加",editDevice:"デバイスを編集",editDeviceDescription:"デバイス設定を更新",sectionBasic:"基本情報",sectionConnection:"接続情報",sectionAuth:"認証情報",noDevices:"デバイスがありません",noDevicesDescription:"ローカルまたは SSH デバイスを追加して開始",name:"デバイス名",namePlaceholder:"例:My Server",type:"タイプ",typeLocal:"ローカルデバイス",typeSSH:"SSH リモートデバイス",typeSSHBadge:"SSH",host:"ホスト",hostPlaceholder:"example.com",port:"ポート",username:"ユーザー名",usernamePlaceholder:"root",session:"Tmux セッション名",sessionPlaceholder:"tmex",sessionHint:"空の場合、デフォルトの「tmex」が使用されます",authMode:"認証モード",authPassword:"パスワード",authKey:"秘密鍵",authAgent:"SSH Agent",authConfigRef:"SSH Config",password:"パスワード",privateKey:"秘密鍵",privateKeyPlaceholder:"-----BEGIN OPENSSH PRIVATE KEY-----",privateKeyPassphrase:"秘密鍵のパスフレーズ(任意)",passphrase:"パスフレーズ",connect:"接続",connected:"接続済み",disconnect:"切断",disconnected:"切断済み",connecting:"接続中...",dragHandle:"ドラッグしてデバイスを並べ替え",reorderFailed:"デバイスの並べ替えに失敗しました",deleteConfirm:"このデバイスを削除しますか?",deleteDescription:"デバイス「{{name}}」は完全に削除されます。この操作は取り消せません。",deleteSuccess:"デバイスを削除しました",createSuccess:"デバイスを作成しました",updateSuccess:"デバイスを更新しました",deleteFailed:"デバイスの削除に失敗しました",createFailed:"デバイスの作成に失敗しました",updateFailed:"デバイスの更新に失敗しました",loadFailed:"デバイス一覧の読み込みに失敗しました",localDevice:"ローカルデバイス",subtitle:"{{username}}@{{host}}:{{port}}",modify:"デバイスを変更",delete:"削除"},terminal:{initializing:"ターミナルを初期化中...",connecting:"デバイスに接続中...",initFailed:"ターミナルの初期化に失敗しました",inputPlaceholder:"ここにコマンドを入力...",clear:"クリア",deviceError:"デバイスエラー",deviceErrorWithType:"[{{type}}] デバイスエラー",noDeviceSelected:"デバイスが選択されていません",windowClosed:"現在のウィンドウは閉じられました。サイドバーからウィンドウを選択してください。",paneClosed:"現在のペインは閉じられました。サイドバーからペインを選択してください。",bellNotification:"ターミナルベル通知",bellDescription:"ウィンドウ {{window}} · ペイン {{pane}}",bellFallback:"tmux ベルを受信",paneTitle:"ペイン {{index}}",activePane:"現在のペイン",activeWindow:"現在のウィンドウ",editorPlaceholder:"ここにコマンドを入力...",editorClear:"クリア",editorSendWithEnter:"Enter で送信",editorSendLineByLine:"1行ずつ送信",editorSend:"送信",sendShortcut:"{{key}} を送信",inputModeDirect:"直接入力",inputModeEditor:"エディタ",newWindow:"新規ウィンドウ",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",copy:"コピー",paste:"貼り付け",copied:"クリップボードにコピーしました",copyFailed:"コピーに失敗しました",pasteFailed:"クリップボードを読み取れません。ブラウザの権限を確認してください",clearSelection:"選択を解除"},settings:{title:"システム設定",siteSettings:"サイト設定",siteName:"サイト名",siteNamePlaceholder:"tmex",siteUrl:"サイト URL",siteUrlPlaceholder:"http://localhost:3000",bellThrottle:"ベル制限(秒)",notificationThrottle:"通知制限(秒)",enableBrowserBellToast:"ブラウザベル Toast を有効にする",enableBrowserNotificationToast:"ブラウザ通知 Toast を有効にする",enableTelegramBellPush:"Telegram ベルプッシュを有効にする",enableTelegramNotificationPush:"Telegram 通知プッシュを有効にする",sshReconnectRetries:"SSH 再接続試行回数",sshReconnectDelay:"SSH 再接続待機(秒)",language:"言語",languagePlaceholder:"言語を選択",language_en_US:"English",language_zh_CN:"简体中文",language_ja_JP:"日本語",theme:"ダークモード",themeLight:"ライト",themeDark:"ダーク",siteTab:"サイト",notificationsTab:"通知",tabGroup:{general:"一般設定",devicesAndFiles:"デバイスとファイル",notifications:"通知設定",ai:"AI 設定"},deviceManagement:{title:"デバイス管理",description:"ローカルおよび SSH デバイスの追加・編集・接続を行います。",openButton:"デバイス管理を開く"},refreshToApply:"言語変更を適用するには更新してください",saveSettings:"設定を保存",settingsSaved:"設定を保存しました",saveFailed:"設定の保存に失敗しました",loadFailed:"設定の読み込みに失敗しました",restartGateway:"Gateway を再起動",restartScheduled:"Gateway の再起動が予定されました",restartConfirm:"Gateway を再起動してもよろしいですか?すべてのアクティブ接続が中断されます。",restartFailed:"Gateway の再起動に失敗しました",sshReconnectMaxRetries:"SSH 再接続試行回数",llm:{title:"LLM プロバイダー",name:"名前",namePlaceholder:"例: OpenAI",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.openai.com",baseUrlHint:"デフォルトで /v1 を自動補完。/ で終わるとパスをそのまま使用",protocol:"プロトコル",apiKey:"API キー",apiKeyPlaceholder:"API キーを入力",apiKeySetPlaceholder:"設定済み、空欄の場合は変更されません",addProvider:"プロバイダーを追加",editProvider:"プロバイダーを編集",formHint:"プロバイダーの接続を設定",models:"モデル",modelsTitle:"{{name}} のモデル",modelsHint:"このプロバイダーで利用するモデルを管理(有効化と手動追加)",modelManual:"手動",addModelPlaceholder:"モデル ID を追加",empty:"プロバイダーはまだありません",refreshModels:"モデルを更新",modelsCount:"{{total}} 個のモデル",modelsNotFetched:"モデル一覧は未取得です",modelsFetchFailed:"モデル一覧の取得に失敗しました:{{error}}",deleteProvider:"プロバイダーを削除",deleteConfirm:"プロバイダー「{{name}}」を削除しますか?",defaults:"グローバル既定",defaultProvider:"既定プロバイダー",defaultProviderNone:"未設定",defaultModel:"既定モデル",defaultModelPlaceholder:"モデル ID を入力または選択",saveDefaults:"既定を保存",loadFailed:"LLM プロバイダーの読み込みに失敗しました",createFailed:"プロバイダーの作成に失敗しました",updateFailed:"プロバイダーの更新に失敗しました",deleteFailed:"プロバイダーの削除に失敗しました",refreshModelsFailed:"モデルの更新に失敗しました",settingsLoadFailed:"LLM 設定の読み込みに失敗しました",settingsSaveFailed:"LLM 設定の保存に失敗しました"},search:{title:"検索",provider:"検索プロバイダー",responsesApiHint:"LLM プロバイダーが OpenAI Responses API プロトコルを使用している場合、その内蔵 hosted 検索ツールを利用できます。下記のサードパーティ検索は任意の補完です。",providerNone:"無効",tavilyApiKey:"Tavily API キー",braveApiKey:"Brave API キー",keyPlaceholder:"API キーを入力",keySetPlaceholder:"設定済み、空欄の場合は変更されません",clearKey:"クリア",clearKeyConfirm:"この API キーをクリアしますか?再度入力が必要になります。",loadFailed:"検索設定の読み込みに失敗しました",saveFailed:"検索設定の保存に失敗しました"},files:{title:"ファイル",description:"「ファイル」タブで閲覧できるデバイスごとのディレクトリを設定します。ローカルは直接読み取り、SSH は rsync を使用。",addRoot:"ディレクトリを追加",roots:"ディレクトリ",empty:"ディレクトリが設定されていません",missing:"デバイスが見つかりません",modalAddTitle:"ディレクトリを追加",modalEditTitle:"ディレクトリを編集",device:"デバイス",devicePlaceholder:"デバイスを選択",noDevices:"デバイスがありません。先に追加してください",path:"パス",pathPlaceholder:"/絶対パス/ディレクトリ",pathHint:"選択したデバイス上の絶対パス。",enabled:"有効",addFailed:"ディレクトリの追加に失敗しました",updateFailed:"ディレクトリの更新に失敗しました",deleteFailed:"ディレクトリの削除に失敗しました",toggleFailed:"ディレクトリの更新に失敗しました",deleteTitle:"ディレクトリを削除しますか?",deleteDesc:"「{{path}}」をホワイトリストから削除しますか?配下のファイルにアクセスできなくなります。"},version:{title:"バージョンと更新",currentVersion:"現在のバージョン",installMethod:"インストール方法",installMethodCli:"CLI でインストール",installMethodNonCli:"CLI 以外でインストール",deployment:"デプロイ方式",deploymentLaunchd:"launchd(macOS)",deploymentSystemd:"systemd(Linux)",deploymentNone:"なし",checkUpdate:"更新を確認",checking:"確認中…",upToDate:"最新バージョンです。",updateAvailable:"更新があります:{{version}}",changelog:"変更履歴",changelogUnavailable:"このバージョンの変更履歴はありません。",publishedAt:"公開日 {{date}}",upgrade:"今すぐ更新",upgradeDisabledDev:"production 以外の環境ではアプリ内更新は無効です。",upgradeDisabledNonCli:"アプリ内更新は CLI インストール時のみ利用できます。",upgradeWarningTitle:"更新の確認",upgradeWarningBody:"更新するとサービスが再起動し、現在のセッションが中断されます。サービスが管理する tmux プロセスの存続にも影響する可能性があります。続行しますか?",upgradeStarted:"更新を開始しました",stateDownloading:"新しいバージョンをダウンロード中…",stateExecuting:"更新を適用中、サービスを再起動しています…",interruptNotice:"サービス再起動中は接続が切断されますが、まもなく復旧します。",checkFailed:"更新の確認に失敗しました",terminalHint:"またはターミナルから更新:npx tmex-cli@<version> upgrade"}},telegram:{title:"Telegram Bot 管理",botName:"Bot 名",botNamePlaceholder:"例:ops-bot",botToken:"Bot Token",botTokenPlaceholder:"123456:AA...",addBot:"Bot を追加",editBot:"Bot を編集",enableBot:"Bot を有効にする",allowAuthRequests:"認証リクエストを許可",pendingChats:"承認待ち",chats:"承認済み",authorizedChats:"承認済み",noPendingChats:"承認待ちのチャットはありません",noAuthorizedChats:"承認済みのチャットはありません",approve:"承認",authorize:"認証",reject:"拒否",revokeAuth:"認証を取り消す",testMessage:"テストメッセージ",sendTestMessage:"テストメッセージを送信",deleteBot:"Bot を削除",tokenOptional:"Token(変更しない場合は空)",tokenPlaceholder:"新しい token を入力",botCreated:"Bot を作成しました",botUpdated:"Bot を更新しました",botDeleted:"Bot を削除しました",authApproved:"認証が承認されました",chatRemoved:"チャットを削除しました",testMessageSent:"テストメッセージを送信しました",createFailed:"Bot の作成に失敗しました",updateFailed:"Bot の更新に失敗しました",deleteFailed:"Bot の削除に失敗しました",approveFailed:"認証の承認に失敗しました",removeFailed:"チャットの削除に失敗しました",testMessageFailed:"テストメッセージの送信に失敗しました",loadBotsFailed:"Bot 一覧の読み込みに失敗しました",loadChatsFailed:"チャット一覧の読み込みに失敗しました",noBots:"Bot がありません。まず追加してください。",expand:"展開",collapse:"折りたたむ",authCount:"承認済み {{authorized}} / 承認待ち {{pending}}(最大 8)",chatId:"Chat ID",applyTime:"申請時間",gatewayOnline:"🟢 Gateway online @ {{siteName}}",deviceConnectionError:`🔴 {{siteName}}:デバイス「{{deviceName}}」({{host}}) で接続エラー [{{category}}]
|
|
29
|
-
{{error}}`,agentCredentialWarning:"⚠️ {{siteName}}:Agent セッション「{{sessionTitle}}」のメッセージに認証情報が含まれている可能性があります({{types}})。LLM に送信され保存されるため、漏洩のリスクがあります。",authSuccess:"✅ 承認されました。通知を受信できます。",authPending:"⏳ 認証リクエストを受信しました。tmex 設定ページで承認してください。",authFailed:"❌ 認証リクエストに失敗しました。管理者に連絡してください。",testMessageTemplate:`🧪 テストメッセージ
|
|
30
|
-
サイト:{{siteName}}
|
|
31
|
-
時間:{{time}}`,approveMessageTemplate:`✅ tmex で承認されました。
|
|
32
|
-
Bot:{{botName}}
|
|
33
|
-
時間:{{time}}`,botNotFound:"Bot が見つからないか利用できません",botNotRunning:"Bot が起動していないか利用できません"},webhook:{title:"Webhooks",url:"Webhook URL",secret:"シークレット",secretPlaceholder:"署名に使用(HMAC-SHA256)",enabled:"有効",eventMask:"イベント",add:"Webhook を追加",empty:"Webhook がありません。",createFailed:"Webhook の作成に失敗しました",deleteFailed:"Webhook の削除に失敗しました",loadFailed:"Webhook の読み込みに失敗しました"},sshError:{sshConfigRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",configRefNotSupported:"このバージョンでは SSH Config 参照はサポートされていません。host + username を使用し、Agent/秘密鍵/パスワード認証を選択してください。",agentUnavailable:"SSH Agent が利用できません:SSH_AUTH_SOCK が検出されません。agent 環境を確認してください。",agentNoIdentity:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",agentNoIdentities:"SSH Agent に利用可能な鍵がありません。ssh-add を実行してください。",authFailed:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",authFailedGeneric:"認証に失敗しました:ユーザー名、パスワード、または鍵が正しくありません。デバイス設定を確認してください。",networkUnreachable:"ネットワークに到達できません:ルーティング、ファイアウォール、または VPN 設定を確認してください。",connectionRefused:"接続が拒否されました:ターゲットホストに接続できません。ホストアドレスとポートを確認してください。",timeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",connectionTimeout:"接続タイムアウト:デバイスに接続できません。ネットワークまたはファイアウォール設定を確認してください。",hostNotFound:"ホストが見つかりません:ホスト名を解決できません。DNS またはホスト名設定を確認してください。",handshakeFailed:"ハンドシェイクに失敗しました:安全な接続を確立できません。キー交換アルゴリズムが互換性がない可能性があります。",tmuxUnavailable:"リモート tmux が利用できないか起動に失敗しました。tmux がインストールされ、リモート shell の PATH から参照できることを確認してください。",connectionClosed:"接続が切断されました。再接続を試みています",unknown:"接続に失敗しました:{{message}}",reconnecting:"接続が中断されました。{{delay}} 秒後に再接続します({{attempt}}/{{maxRetries}})",reconnectFailed:"自動再接続に失敗しました。手動で再試行してください",reconnected:"デバイスが自動的に再接続されました"},deviceStatus:{reconnecting:"再接続中 {{delay}}s",offline:"オフライン",errorBadge:{authFailed:"認証失敗",agentUnavailable:"Agent 利用不可",agentNoIdentity:"Agent に鍵なし",configRefNotSupported:"SSH Config 非対応",networkUnreachable:"ネットワーク不可達",connectionRefused:"接続拒否",timeout:"タイムアウト",hostNotFound:"ホスト未検出",handshakeFailed:"ハンドシェイク失敗",tmuxUnavailable:"tmux 利用不可",connectionClosed:"切断",unknown:"接続エラー"}},websocket:{error:"WebSocket 接続エラー",checkGateway:"Gateway 状態を確認してください",upgradeFailed:"アップグレードに失敗しました",invalidMessage:"無効なメッセージ形式"},wsError:{checkGateway:"Gateway 状態を確認してください"},apiError:{siteNameRequired:"サイト名は空にできません",siteUrlInvalid:"サイト URL は http:// または https:// で始まる必要があります",bellThrottleInvalid:"ベル制限秒数は 0-300 の間である必要があります",sshRetriesInvalid:"SSH 再接続試行回数は 0-20 の間である必要があります",sshDelayInvalid:"SSH 再接続待機時間は 1-300 秒の間である必要があります",languageInvalid:"言語はサポートされているロケールのいずれかである必要があります",botNameRequired:"Bot 名は空にできません",botTokenRequired:"Bot token は空にできません",missingFields:"必須フィールドがありません",sshRequiresHost:"SSH デバイスには host または sshConfigRef が必要です",invalidRequest:"無効なリクエスト",deviceNotFound:"デバイスが見つかりません",botNotFound:"Bot が見つかりません",chatNotFound:"チャットが見つかりません",urlAndSecretRequired:"URL とシークレットが必要です",notFound:"見つかりません",llmProviderNameRequired:"プロバイダー名は空にできません",llmProviderProtocolInvalid:"プロトコルは openai-chat または openai-responses である必要があります",llmProviderBaseUrlInvalid:"Base URL は http:// または https:// で始まる必要があります",llmProviderApiKeyRequired:"API key は空にできません",llmProviderNotFound:"LLM プロバイダーが見つかりません",llmProviderDisabled:"LLM プロバイダー {{name}} は無効化されています",llmNoDefaultProvider:"LLM プロバイダーが指定されておらず、デフォルトプロバイダーも設定されていません",llmNoDefaultModel:"モデルが指定されておらず、デフォルトモデルも設定されていません",llmDefaultProviderNotFound:"デフォルトプロバイダーが存在しません",llmSearchProviderInvalid:"検索プロバイダーは none、tavily、brave のいずれかである必要があります",llmFetchModelsFailed:"モデル一覧の取得に失敗しました:{{detail}}",agentSessionNotFound:"Agent セッションが存在しません",agentSessionBusy:"Agent セッションは実行中です。停止するか完了をお待ちください",agentSessionAwaitingConfirmation:"Agent セッションに未処理の確認リクエストがあります。先に処理してください",agentDeviceRequired:"デバイスを指定してください",agentPaneRequired:"ターミナル pane を指定してください",agentWriteModeInvalid:"書き込みモードは confirm または auto である必要があります",agentMaxStepsInvalid:"1 ターンあたりの最大ステップ数は 1〜100 の範囲で指定してください",agentProviderWebSearchRequiresResponses:"プロバイダ内蔵の Web 検索は openai-responses プロトコルのみ対応しています",agentHostedToolUnknown:"不明な hosted ツール: {{name}}",agentHostedToolRequiresResponses:"プロバイダの hosted ツールは openai-responses プロトコルのみ対応しています",agentSessionOrphaned:"この Agent セッションは孤立しており(端末が存在しません)、読み取り専用です",agentQueuedMessageNotFound:"キューのメッセージが存在しません",agentConfirmationNotFound:"確認リクエストが存在しません",agentConfirmationAlreadyDecided:"確認リクエストは既に処理済みです",agentMessageTextRequired:"メッセージ内容を入力してください",watchRuleNotFound:"Watch ルールが存在しません",watchNameRequired:"ルール名を入力してください",watchTriggerTypeInvalid:"トリガー種別は match、unchanged、llm のいずれかです",watchPatternRequired:"match/unchanged ルールには正規表現が必要です",watchPatternInvalid:"正規表現が無効です:{{detail}}",watchUnchangedMinutesInvalid:"unchanged ルールには 0 より大きい未変化分数が必要です",watchExtractGroupInvalid:"キャプチャグループ番号は 0 以上の整数で指定してください",watchConditionPromptRequired:"llm ルールには条件の説明が必要です",watchIntervalInvalid:"サンプリング間隔は {{min}} 秒以上で指定してください",watchNoMatchBehaviorInvalid:"非マッチ時の挙動は reset または ignore です",watchFireModeInvalid:"発火モードは once または repeat です",watchCooldownInvalid:"クールダウン秒数は 0 以上の整数で指定してください",watchAssistDescriptionRequired:"マッチさせたい内容を記述してください",watchAssistModelUnavailable:"モデル呼び出しに失敗しました:{{detail}}",fileRootInvalid:"絶対パスかつ既存のディレクトリを指定してください",fileOutsideRoots:"許可されたディレクトリの範囲外です",fileNotADirectory:"ディレクトリではありません",fileTooLarge:"ファイルが大きすぎます",fileBinary:"バイナリファイルはサポートされていません",fileRootDeviceInvalid:"無効または不明なデバイス",fileRootDuplicate:"このディレクトリはこのデバイスに既に追加されています",upgradeNotAllowed:"このインストールではアプリ内更新を利用できません。",upgradeInProgress:"すでに更新が進行中です。",upgradeVersionRequired:"対象バージョンが必要です。",updateCheckFailed:"npm registry の照会に失敗しました。"},notification:{clickToJump:"対応するペインにジャンプ",eventType:{terminal_bell:"🔔 ターミナルベル",terminal_notification:"🔔 ターミナル通知",tmux_window_close:"🪟 ウィンドウ閉じる",tmux_pane_close:"📱 ペイン閉じる",device_tmux_missing:"⚠️ Tmux がありません",device_disconnect:"🔌 デバイス切断",session_created:"🆕 セッション作成",session_closed:"🚪 セッション閉じる",agent_confirmation_pending:"🤖 エージェント確認待ち",agent_turn_finished:"🤖 エージェントターン完了",agent_error:"🤖 エージェントエラー",watch_triggered:"👁️ Watch ルール発動",watch_model_unavailable:"👁️ Watch モデル利用不可",watch_rule_error:"👁️ Watch ルールエラー"},site:"サイト",device:"デバイス",window:"ウィンドウ",pane:"ペイン",time:"時間",directLink:"直接リンク",message:"メッセージ",paneTitle:"タイトル",process:"プロセス",telegramBell:{title:"🔔 {{siteName}} からのベル:{{terminalTopbarLabel}}",viewLink:"表示",terminalTopbarLabel:"ウィンドウ {{window}} · ペイン {{pane}} @ {{device}}"},telegramNotification:{},agent:{confirmationPending:"Agent「{{title}}」がツール {{toolName}} の実行確認を求めています",turnFinished:"Agent「{{title}}」のターンが完了しました",error:"Agent「{{title}}」でエラーが発生しました:{{message}}"},watch:{matchTriggered:"Watch「{{name}}」がマッチしました:{{text}}",unchangedTriggered:"Watch「{{name}}」の値「{{value}}」が {{minutes}} 分間変化していません",llmTriggered:"Watch「{{name}}」の条件を満たしました:{{reason}}",summaryTriggered:"Watch「{{name}}」:{{summary}}",unconfirmedSuffix:"(モデル利用不可のため LLM 未確認)",modelUnavailable:"Watch「{{name}}」のモデル呼び出しに失敗しました:{{message}}",ruleError:"Watch「{{name}}」が {{count}} 回連続で失敗したため自動停止しました:{{message}}",paneGone:"Watch「{{name}}」のペイン({{paneId}})が破棄されたため、ルールを削除しました"}},sidebar:{noWindows:"ウィンドウがありません",noDevices:"デバイスがありません",addDeviceLink:"デバイスを追加",openSettingsLink:"設定を開く",openSettings:"設定を開く",manageDevices:"デバイス管理",settings:"設定",currentWindow:"現在のウィンドウ",currentPane:"現在のペイン",newWindow:"ウィンドウを作成",closeWindow:"ウィンドウを閉じる",closePane:"ペインを閉じる",addDevice:"デバイスを追加",tab:{panes:"Panes",agent:"Agent",files:"Files"},orphanedSessions:"孤立セッション"},agent:{error:{streamStalled:"モデルが応答を停止しました(上流ストリームが停止)。再試行してください。"},model:{select:"モデルを選択",placeholder:"モデル",noProviders:"モデルがありません — 設定でプロバイダーを構成してください"},queue:{title:"キュー({{count}})",steer:"今すぐ注入",steerHint:"現在のステップを中断してキューを今すぐ注入",withdraw:"取り消し"},orphan:{readonly:"このセッションは孤立しており(端末が存在しません)、読み取り専用です",title:"孤立セッション",process:"プロセス",startedAt:"作成日時"},files:{comingSoon:"Coming Soon"},panel:{title:"Agent",empty:"セッションを選択または作成してください",inputPlaceholder:"メッセージを入力…",send:"送信",stop:"停止",retry:"再試行",scrollToBottom:"最下部へ"},welcome:{title:"新しい Agent チャット",subtitle:"タスクを入力して、選択した端末での作業を始めましょう"},session:{none:"セッション未選択",new:"新規エージェントセッション",switch:"セッションを切り替え",selectPaneHint:"Panes タブでペインを選択してセッションを開始してください",noSessions:"セッションがありません",showAll:"すべてのセッションを表示",rename:"セッション名を変更",renameTitle:"セッション名を変更",renamePlaceholder:"セッション名",save:"保存",cancel:"キャンセル",delete:"セッションを削除",deleteTitle:"このセッションを削除しますか?",deleteDesc:"「{{title}}」とそのメッセージはすべて完全に削除されます。",deleteConfirm:"削除",createDisabledNoPane:"ターミナル pane を開いてからセッションを作成してください",privacyNotice:"セッションはターミナル画面の内容を設定済みの LLM サービスへ送信します。"},binding:{invalid:"無効",mismatchTitle:"このセッションは別の pane にバインドされています",goTo:"移動",rebind:"現在の pane に再バインド"},writeMode:{confirm:"書き込み確認",auto:"自動実行"},confirm:{title:"承認待ち",approve:"許可",deny:"拒否"},tool:{input:"入力",result:"結果",screen:"画面キャプチャ",send_input:"入力送信",read_screen:"画面読み取り",web_search:"Web 検索",fetch_url:"URL 取得",denied:"拒否されました"},reasoning:{title:"思考プロセス"},toast:{errorTitle:"Agent「{{title}}」でエラー",credentialWarningTitle:"メッセージに認証情報が含まれる可能性",credentialWarningDescription:"{{types}} を検出しました。内容は変更されませんが、LLM に送信され保存されるため、漏洩のリスクがあります。"}},window:{noWindows:"ウィンドウがありません",new:"新規ウィンドウ",close:"ウィンドウを閉じる",closePane:"ペインを閉じる",closeConfirmTitle:"このウィンドウを閉じますか?",closePaneConfirmTitle:"このペインを閉じますか?",closeConfirmDesc:'"{{name}}" で実行中のプロセスは終了されます。この操作は取り消せません。',menu:"ウィンドウ操作",dragHandle:"ドラッグしてウィンドウを並べ替え",dragHandlePane:"ドラッグしてペインを並べ替え",rename:"ウィンドウ名を変更",renamePlaceholder:"名前を入力",renameDesc:"カスタム名はターミナルが設定したタイトルを上書きし、ゲートウェイが再起動するまで保持されます。",renameReset:"自動名に戻す"},watch:{title:"監視ルール",dialogDesc:"このペインの画面を監視し、条件を満たしたら通知します",openMonitor:"このターミナルを監視",rules:{empty:"このペインにはまだ監視ルールがありません",addRule:"新規ルール",edit:"編集",delete:"削除",viewState:"状態",lastTriggered:"最終トリガー:{{time}}",neverTriggered:"未トリガー",deleteTitle:"このルールを削除しますか?",deleteDesc:"「{{name}}」は完全に削除されます。",deleteConfirm:"削除"},type:{match:"マッチ",unchanged:"停滞",llm:"LLM"},typeDesc:{match:"正規表現が画面にマッチしたらトリガー",unchanged:"抽出した値が N 分間変化しない場合にトリガー(例:ダウンロード停滞)",llm:"LLM が定期的に画面を確認し自然言語の条件を判定"},form:{createTitle:"監視ルールを作成",editTitle:"監視ルールを編集",name:"ルール名",namePlaceholder:"例:ダウンロード停滞アラート",triggerType:"トリガー種別",pattern:"正規表現",patternPlaceholder:"例:(\\d+)%",flags:"フラグ",flagsPlaceholder:"例:i",extractGroup:"キャプチャグループ番号",extractGroupHint:"0 = マッチ全体。このグループの値を追跡します",unchangedMinutes:"変化なし継続(分)",noMatchBehavior:"マッチしない場合",noMatchReset:"タイマーをリセット(進捗行の消失 = タスク完了)",noMatchIgnore:"無視(前回値を保持)",conditionPrompt:"条件(自然言語)",conditionPromptPlaceholder:"例:コンパイルエラーでビルドが失敗した",model:"モデル",followGlobalDefault:"グローバル既定に従う",modelPlaceholder:"モデル ID",modelRequiredHint:"このルールは LLM を呼び出します。選択した(またはグローバル既定の)モデルが利用可能か確認してください。",confirmWithLlm:"通知前に LLM で再確認",confirmWithLlmDesc:"誤検知を低減。モデル利用不可時はそのまま通知",summarizeWithLlm:"LLM による通知要約",summarizeWithLlmDesc:"画面内容をモデルが要約して通知本文にします",intervalSeconds:"サンプリング間隔(秒)",intervalHint:"最小 {{min}} 秒",fireMode:"発火モード",fireOnce:"一回(発火後に自動停止)",fireRepeat:"繰り返し",cooldownSeconds:"クールダウン(秒)",enabled:"有効",assistLabel:"説明から正規表現を生成",assistPlaceholder:"例:ダウンロード進捗のパーセンテージにマッチ",assistButton:"生成",assistExplanation:"説明",assistPreview:"現在の画面でのマッチ",assistPreviewEmpty:"現在の画面サンプルにマッチなし",create:"作成",save:"保存",providerUnavailable:"元のプロバイダーは利用できません",providerDisabled:"無効"},validation:{nameRequired:"ルール名は必須です",patternRequired:"正規表現は必須です",patternInvalid:"正規表現が無効です:{{detail}}",unchangedMinutesInvalid:"変化なし継続分は 0 より大きい必要があります",conditionPromptRequired:"条件の説明は必須です",intervalMin:"サンプリング間隔は {{min}} 秒以上にしてください"},state:{title:"ルール状態",back:"戻る",lastSampledAt:"最終サンプリング",lastValue:"最新値",lastValueChangedAt:"値の最終変化",lastTriggeredAt:"最終トリガー",consecutiveErrors:"連続エラー回数",lastError:"最新エラー",samples:"直近サンプル",samplesEmpty:"サンプルなし",hit:"ヒット",none:"—"},toast:{created:"監視ルールを作成しました",updated:"監視ルールを更新しました",deleted:"監視ルールを削除しました",triggeredTitle:"監視トリガー",openTerminal:"ターミナルを開く",modelUnavailableTitle:"監視モデル利用不可",modelUnavailableHint:"ルールは縮退動作で継続します。",ruleErrorTitle:"監視ルールを自動停止しました"},notifPermission:{title:"ブラウザ通知を有効にしますか?",desc:"タブがバックグラウンドでも監視トリガー時に通知を受け取れます。",enable:"有効にする",dismiss:"今はしない"}},validation:{deviceNameRequired:"デバイス名は必須です",hostRequired:"SSH デバイスにはホストアドレスが必要です",portRequired:"SSH デバイスには有効なポートが必要です",usernameRequired:"SSH デバイスにはユーザー名が必要です",sshConfigRequired:"SSH デバイスには ssh config のパスが必要です"},files:{title:"ファイル",refresh:"ファイル一覧を更新",noRoots:"アクセス可能なディレクトリがありません。「設定 → ファイル」で追加してください。",emptyDir:"空のディレクトリ",truncated:"項目が多すぎるため一覧を省略しました",download:"ダウンロード",error:{invalid:"不正なリクエスト",outside_roots:"許可されたディレクトリの範囲外です",not_found:"すでに存在しません",not_a_directory:"ディレクトリではありません",is_directory:"これはディレクトリです",too_large:"ファイルが大きすぎてプレビューできません",binary:"バイナリファイルはプレビューできません",permission_denied:"アクセスが拒否されました",device_not_found:"デバイスが見つかりません",root_not_found:"ディレクトリ項目が見つかりません",root_disabled:"このディレクトリは無効です",connection_failed:"デバイスへの接続に失敗しました",auth_unsupported:"このデバイスの認証方式はファイルアクセスに非対応です(鍵か ssh-agent を使用)",rsync_missing_local:"サーバーに rsync がインストールされていません",rsync_missing_remote:"リモートデバイスに rsync がインストールされていません",timeout:"タイムアウトしました",unknown:"読み込みに失敗しました"},retry:"再試行(折りたたんで再展開)",install:{button:"rsync をインストール",scopeLocal:"サーバー",scopeRemote:"リモート",connectFailed:"デバイスへの接続に失敗しました",windowFailed:"ウィンドウの作成に失敗しました",prompt:"{{device}}({{scope}})に rsync が見つかりません。システムに合わせた方法で rsync をインストールし(例: `brew install rsync`、`sudo apt-get install -y rsync`、`sudo yum install -y rsync`)、完了したら返信してください。"}},file:{invalidRef:"無効なファイル参照です",notFound:"ファイルは存在しません",accessDenied:"アクセスが拒否されました",loadFailed:"ファイルの読み込みに失敗しました",isDirectory:"これはディレクトリです",notPreviewable:"このファイル形式はプレビューできません",tooLarge:"ファイルが大きすぎてプレビューできません",binary:"バイナリファイルはプレビューできません",download:"ダウンロード",openRaw:"元ファイルを開く"}}}},Lx="en_US",Lte={locales:[{code:"en_US",name:"English",nativeName:"English",flag:"🇺🇸",isDefault:!0},{code:"zh_CN",name:"简体中文",nativeName:"简体中文",flag:"🇨🇳",isDefault:!1},{code:"ja_JP",name:"日本語",nativeName:"日本語",flag:"🇯🇵",isDefault:!1}]};function NM(e){return e.replace("_","-")}function WL(e,t){const n=(e==null?void 0:e.trim())||"unknown";return t?n:`${n}_dev`}var $y={},vs={},xs={},OC;function YL(){if(OC)return xs;OC=1,Object.defineProperty(xs,"__esModule",{value:!0}),xs.BinaryReader=xs.BinaryWriter=void 0;class e{constructor(r=1024){at(this,"buffer");at(this,"view");at(this,"offset",0);this.buffer=new Uint8Array(r),this.view=new DataView(this.buffer.buffer)}ensureCapacity(r){const a=this.offset+r;if(a<=this.buffer.length)return;let o=this.buffer.length;for(;o<a;)o*=2;const l=new Uint8Array(o);l.set(this.buffer),this.buffer=l,this.view=new DataView(this.buffer.buffer)}writeUint8(r){this.ensureCapacity(1),this.view.setUint8(this.offset,r),this.offset+=1}writeUint16(r){this.ensureCapacity(2),this.view.setUint16(this.offset,r,!0),this.offset+=2}writeUint32(r){this.ensureCapacity(4),this.view.setUint32(this.offset,r,!0),this.offset+=4}writeUint64(r){this.ensureCapacity(8),this.view.setBigUint64(this.offset,r,!0),this.offset+=8}writeUint128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),o=r>>BigInt(64);this.writeUint64(a),this.writeUint64(o)}writeInt8(r){this.ensureCapacity(1),this.view.setInt8(this.offset,r),this.offset+=1}writeInt16(r){this.ensureCapacity(2),this.view.setInt16(this.offset,r,!0),this.offset+=2}writeInt32(r){this.ensureCapacity(4),this.view.setInt32(this.offset,r,!0),this.offset+=4}writeInt64(r){this.ensureCapacity(8),this.view.setBigInt64(this.offset,r,!0),this.offset+=8}writeInt128(r){this.ensureCapacity(16);const a=r&BigInt("0xFFFFFFFFFFFFFFFF"),o=r>>BigInt(64);this.writeInt64(a),this.writeInt64(o)}writeFloat32(r){this.ensureCapacity(4),this.view.setFloat32(this.offset,r,!0),this.offset+=4}writeFloat64(r){this.ensureCapacity(8),this.view.setFloat64(this.offset,r,!0),this.offset+=8}writeBool(r){this.writeUint8(r?1:0)}writeString(r){const a=new TextEncoder().encode(r);this.writeUint32(a.length),this.ensureCapacity(a.length),this.buffer.set(a,this.offset),this.offset+=a.length}getBuffer(){return this.buffer.slice(0,this.offset)}}xs.BinaryWriter=e;class t{constructor(r){at(this,"buffer");at(this,"view");at(this,"offset",0);this.buffer=r,this.view=new DataView(r.buffer,r.byteOffset,r.byteLength)}readUint8(){const r=this.view.getUint8(this.offset);return this.offset+=1,r}readUint16(){const r=this.view.getUint16(this.offset,!0);return this.offset+=2,r}readUint32(){const r=this.view.getUint32(this.offset,!0);return this.offset+=4,r}readUint64(){const r=this.view.getBigUint64(this.offset,!0);return this.offset+=8,r}readUint128(){const r=this.readUint64();return this.readUint64()<<BigInt(64)|r}readInt8(){const r=this.view.getInt8(this.offset);return this.offset+=1,r}readInt16(){const r=this.view.getInt16(this.offset,!0);return this.offset+=2,r}readInt32(){const r=this.view.getInt32(this.offset,!0);return this.offset+=4,r}readInt64(){const r=this.view.getBigInt64(this.offset,!0);return this.offset+=8,r}readInt128(){const r=this.readUint64();return this.readInt64()<<BigInt(64)|r}readFloat32(){const r=this.view.getFloat32(this.offset,!0);return this.offset+=4,r}readFloat64(){const r=this.view.getFloat64(this.offset,!0);return this.offset+=8,r}readBool(){return!!this.readUint8()}readString(){const r=this.readUint32(),a=this.buffer.slice(this.offset,this.offset+r);return this.offset+=r,new TextDecoder().decode(a)}getOffset(){return this.offset}}return xs.BinaryReader=t,xs}var Wy={},DC;function KL(){return DC||(DC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){at(this,"handlers",new Map)}register(r,a){this.handlers.set(r,a)}getHandler(r){const a=this.handlers.get(r);if(!a)throw new Error(`No handler registered for type: ${r}`);return a}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(n,r)=>{if(r<0||r>255||!Number.isInteger(r))throw new Error("Value out of range for u8");n.writeUint8(r)},read:n=>n.readUint8()}),e.registry.register("u16",{write:(n,r)=>{if(r<0||r>65535||!Number.isInteger(r))throw new Error("Value out of range for u16");n.writeUint16(r)},read:n=>n.readUint16()}),e.registry.register("u32",{write:(n,r)=>{if(r<0||r>4294967295||!Number.isInteger(r))throw new Error("Value out of range for u32");n.writeUint32(r)},read:n=>n.readUint32()}),e.registry.register("u64",{write:(n,r)=>{if(r<0n||r>18446744073709551615n)throw new Error("Value out of range for u64");n.writeUint64(r)},read:n=>n.readUint64()}),e.registry.register("u128",{write:(n,r)=>{if(r<0n||r>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");n.writeUint128(r)},read:n=>n.readUint128()}),e.registry.register("i8",{write:(n,r)=>{if(r<-128||r>127||!Number.isInteger(r))throw new Error("Value out of range for i8");n.writeInt8(r)},read:n=>n.readInt8()}),e.registry.register("i16",{write:(n,r)=>{if(r<-32768||r>32767||!Number.isInteger(r))throw new Error("Value out of range for i16");n.writeInt16(r)},read:n=>n.readInt16()}),e.registry.register("i32",{write:(n,r)=>{if(r<-2147483648||r>2147483647||!Number.isInteger(r))throw new Error("Value out of range for i32");n.writeInt32(r)},read:n=>n.readInt32()}),e.registry.register("i64",{write:(n,r)=>{if(r<-9223372036854775808n||r>9223372036854775807n)throw new Error("Value out of range for i64");n.writeInt64(r)},read:n=>n.readInt64()}),e.registry.register("i128",{write:(n,r)=>{if(r<-170141183460469231731687303715884105728n||r>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");n.writeInt128(r)},read:n=>n.readInt128()}),e.registry.register("f32",{write:(n,r)=>n.writeFloat32(r),read:n=>n.readFloat32()}),e.registry.register("f64",{write:(n,r)=>{if(Number.isNaN(r))throw new Error("For portability reasons we do not allow serializing NaN values.");n.writeFloat64(r)},read:n=>n.readFloat64()}),e.registry.register("bool",{write:(n,r)=>n.writeBool(r),read:n=>n.readBool()}),e.registry.register("string",{write:(n,r)=>n.writeString(r),read:n=>n.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(n,r,a)=>{if(a)for(const[o,l]of Object.entries(a))e.registry.getHandler(l.type).write(n,r[o],l.options)},read:(n,r)=>{if(!r)return{};const a={};for(const[o,l]of Object.entries(r)){const c=e.registry.getHandler(l.type);a[o]=c.read(n,l.options)}return a}}),e.registry.register("vec",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l}=a,c=(ArrayBuffer.isView(r),r.length);n.writeUint32(c);const f=e.registry.getHandler(o);if(ArrayBuffer.isView(r))for(let d=0;d<c;d++)f.write(n,r[d],l);else for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:o}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,o));switch(a){case"u8":return new Uint8Array(f);case"u16":return new Uint16Array(f);case"u32":return new Uint32Array(f);case"i8":return new Int8Array(f);case"i16":return new Int16Array(f);case"i32":return new Int32Array(f);case"i64":return new BigInt64Array(f);case"f32":return new Float32Array(f);case"f64":return new Float64Array(f);default:return f}}}),e.registry.register("set",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l}=a,c=Array.from(r).sort();n.writeUint32(c.length);const f=e.registry.getHandler(o);for(const d of c)f.write(n,d,l)},read:(n,r)=>{if(!r)return new Set;const{elementType:a,elementOptions:o}=r,l=n.readUint32(),c=e.registry.getHandler(a),f=Array.from({length:l},()=>c.read(n,o));return new Set(f)}}),e.registry.register("map",{write:(n,r,a)=>{if(!a)return;const{keyType:o,keyOptions:l,valueType:c,valueOptions:f}=a,d=Array.from(r.entries()).sort();n.writeUint32(d.length);const m=e.registry.getHandler(o),h=e.registry.getHandler(c);for(const[y,g]of d)m.write(n,y,l),h.write(n,g,f)},read:(n,r)=>{if(!r)return new Map;const{keyType:a,keyOptions:o,valueType:l,valueOptions:c}=r,f=n.readUint32(),d=e.registry.getHandler(a),m=e.registry.getHandler(l),h=Array.from({length:f},()=>{const y=d.read(n,o),g=m.read(n,c);return[y,g]});return new Map(h)}}),e.registry.register("option",{write:(n,r,a)=>{if(!a)return;const{valueType:o,valueOptions:l}=a,c=r!==null;n.writeUint8(c?1:0),c&&e.registry.getHandler(o).write(n,r,l)},read:(n,r)=>{if(!r)return null;const{valueType:a,valueOptions:o}=r;return n.readUint8()===1?e.registry.getHandler(a).read(n,o):null}}),e.registry.register("enum",{write:(n,r,a)=>{if(!a)return;const o=Object.keys(r)[0],l=r[o],c=a.variants.find(f=>f.name===o);if(!c)throw new Error(`Unknown enum variant: ${o}`);n.writeUint8(c.index),c.type!=="unit"&&e.registry.getHandler(c.type).write(n,l,c.options)},read:(n,r)=>{if(!r)return{};const a=n.readUint8(),o=r.variants.find(f=>f.index===a);if(!o)throw new Error(`Unknown enum variant index: ${a}`);if(o.type==="unit")return{[o.name]:{}};const c=e.registry.getHandler(o.type).read(n,o.options);return{[o.name]:c}}}),e.registry.register("tuple",{write:(n,r,a)=>{if(a){if(r.length!==a.length)throw new Error(`Tuple length mismatch: expected ${a.length}, got ${r.length}`);for(let o=0;o<a.length;o++){const l=a[o];if(!l)throw new Error(`Missing type information for tuple element at index ${o}`);e.registry.getHandler(l.type).write(n,r[o],l.options)}}},read:(n,r)=>{if(!r)return[];const a=[];for(const o of r){const l=e.registry.getHandler(o.type);a.push(l.read(n,o.options))}return a}}),e.registry.register("array",{write:(n,r,a)=>{if(!a)return;const{elementType:o,elementOptions:l,length:c}=a;if(r.length!==c)throw new Error(`Array length mismatch: expected ${c}, got ${r.length}`);const f=e.registry.getHandler(o);for(const d of r)f.write(n,d,l)},read:(n,r)=>{if(!r)return[];const{elementType:a,elementOptions:o,length:l}=r,c=e.registry.getHandler(a);return Array.from({length:l},()=>c.read(n,o))}}),e.registry.register("bytes",{write:(n,r,a)=>{const o=r.length;if((a==null?void 0:a.length)!=null){if(o!==a.length)throw new Error(`Bytes length mismatch: expected ${a.length}, got ${o}`);for(let l=0;l<o;l++)n.writeUint8(r[l])}else{n.writeUint32(o);for(let l=0;l<o;l++)n.writeUint8(r[l])}},read:(n,r)=>{const a=(r==null?void 0:r.length)!=null?r.length:n.readUint32(),o=new Uint8Array(a);for(let l=0;l<a;l++)o[l]=n.readUint8();return o}}),e.registry.register("nativeEnum",{write:(n,r,a)=>{if(!a)return;const{valueToIndexMap:o}=a,l=r,c=o.get(l);if(c===void 0)throw new Error(`Invalid enum value: ${String(r)}`);n.writeUint8(c)},read:(n,r)=>{if(!r)return null;const{indexToValueMap:a}=r,o=n.readUint8(),l=a.get(o);if(l===void 0)throw new Error(`Invalid enum index: ${o}`);return l}})})(Wy)),Wy}var IC;function GL(){if(IC)return vs;IC=1,Object.defineProperty(vs,"__esModule",{value:!0}),vs.b=vs.Schema=void 0;const e=YL(),t=KL();class n{constructor(a,o,l){at(this,"type");at(this,"options");at(this,"registry");this.type=a,this.options=o,this.registry=l}serialize(a){const o=new e.BinaryWriter;return this.registry.getHandler(this.type).write(o,a,this.options),o.getBuffer()}deserialize(a){const o=new e.BinaryReader(a);return this.registry.getHandler(this.type).read(o,this.options)}}return vs.Schema=n,vs.b={u8:()=>new n("u8",null,t.registry),u16:()=>new n("u16",null,t.registry),u32:()=>new n("u32",null,t.registry),u64:()=>new n("u64",null,t.registry),u128:()=>new n("u128",null,t.registry),i8:()=>new n("i8",null,t.registry),i16:()=>new n("i16",null,t.registry),i32:()=>new n("i32",null,t.registry),i64:()=>new n("i64",null,t.registry),i128:()=>new n("i128",null,t.registry),f32:()=>new n("f32",null,t.registry),f64:()=>new n("f64",null,t.registry),bool:()=>new n("bool",null,t.registry),string:()=>new n("string",null,t.registry),unit:()=>new n("unit",null,t.registry),vec:r=>new n("vec",{elementType:r.type,elementOptions:r.options},t.registry),hashSet:r=>new n("set",{elementType:r.type,elementOptions:r.options},t.registry),hashMap:(r,a)=>new n("map",{keyType:r.type,keyOptions:r.options,valueType:a.type,valueOptions:a.options},t.registry),option:r=>new n("option",{valueType:r.type,valueOptions:r.options},t.registry),array:(r,a)=>new n("array",{elementType:r.type,elementOptions:r.options,length:a},t.registry),bytes:r=>new n("bytes",r!=null?{length:r}:{},t.registry),enum:r=>{const a=Object.entries(r).map(([o,l],c)=>({index:c,name:o,type:l.type,options:l.options}));return new n("enum",{variants:a},t.registry)},struct:r=>{const a=Object.fromEntries(Object.entries(r).map(([o,l])=>[o,{type:l.type,options:l.options}]));return new n("struct",a,t.registry)},tuple:(...r)=>{const a=r.map(o=>({type:o.type,options:o.options}));return new n("tuple",a,t.registry)},nativeEnum:r=>{const a=Object.entries(r).filter(([m])=>typeof m=="string"&&Number.isNaN(Number(m))),o=a.map(([m,h])=>h),l=o.some(m=>typeof m=="string"),c=o.some(m=>typeof m=="number");if(l&&c)throw new Error("Mixed string/numeric enums are not supported");const f=new Map,d=new Map;if(a.forEach(([m,h],y)=>{f.set(h,y),d.set(y,h)}),a.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new n("nativeEnum",{enumObj:r,valueToIndexMap:f,indexToValueMap:d},t.registry)}},vs}var PC;function XL(){return PC||(PC=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=GL();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})($y)),$y}var se=XL();const QL=1,ZL=2,JL=3,e_=4,t_=5,n_=257,r_=258,i_=259,a_=260,o_=261,s_=513,l_=514,c_=515,u_=516,d_=517,f_=518,h_=519,p_=520,m_=522,g_=523,y_=524,b_=769,v_=770,x_=771,w_=772,S_=773,E_=774,C_=1025,R_=1026,T_=1281,k_=1537,M_=1538,A_=1539,N_=1793,O_=1,D_=2,I_=3,P_=4,L_=5,__=6,j_=7,z_=8,F_=9,B_=10,H_=11,U_=12,q_=13,V_=1,$_=2,W_=3,Y_=1001,ea=1002,K_=1003,OM=1004,Qh=1005,G_=1101,X_=1102,Q_=1201,Z_=1202,J_=1301,ej=1302,tj=1401,nj={[Y_]:"Unsupported protocol version",[ea]:"Invalid frame format",[K_]:"Unknown message kind",[OM]:"Failed to decode payload",[Qh]:"Frame exceeds maximum size",[G_]:"Device not found",[X_]:"Failed to connect device",[Q_]:"Tmux target not found",[Z_]:"Tmux not ready",[J_]:"Select conflict",[ej]:"Select token mismatch",[tj]:"Internal server error"};function rj(e){return nj[e]??`Unknown error code: ${e}`}class ti extends Error{constructor(t,n=!1,r){super(r??rj(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const DM=se.b.struct({magic:se.b.bytes(2),version:se.b.u16(),kind:se.b.u16(),flags:se.b.u16(),seq:se.b.u32(),payload:se.b.bytes()}),ij=se.b.option(se.b.u32()),vc=se.b.option(se.b.u16()),Mr=se.b.option(se.b.string()),aj=se.b.struct({clientImpl:se.b.string(),clientVersion:se.b.string(),maxFrameBytes:se.b.u32(),supportsCompression:se.b.bool(),supportsDiffSnapshot:se.b.bool()}),oj=se.b.struct({serverImpl:se.b.string(),serverVersion:se.b.string(),selectedVersion:se.b.u16(),maxFrameBytes:se.b.u32(),heartbeatIntervalMs:se.b.u32(),capabilities:se.b.vec(se.b.string())}),sj=se.b.struct({nonce:se.b.u32(),timeMs:se.b.u64()});se.b.struct({refSeq:ij,code:se.b.u16(),message:se.b.string(),retryable:se.b.bool()});const lj=se.b.struct({deviceId:se.b.string()}),cj=se.b.struct({deviceId:se.b.string()}),uj=se.b.struct({deviceId:se.b.string()}),dj=se.b.struct({deviceId:se.b.string()}),fj=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),errorType:Mr,message:Mr,rawMessage:Mr}),hj=se.b.struct({deviceId:se.b.string(),windowId:Mr,paneId:Mr,selectToken:se.b.bytes(16),wantHistory:se.b.bool(),cols:vc,rows:vc}),pj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),mj=se.b.struct({deviceId:se.b.string(),name:Mr}),gj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string()}),yj=se.b.struct({deviceId:se.b.string(),paneId:se.b.string()}),bj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),name:se.b.string()}),vj=se.b.struct({deviceId:se.b.string(),style:se.b.string()}),xj=se.b.struct({deviceId:se.b.string(),windowIds:se.b.vec(se.b.string())}),wj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneIds:se.b.vec(se.b.string())}),Sj=se.b.struct({deviceId:se.b.string(),eventType:se.b.u8(),eventData:se.b.bytes()}),Ej=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),Cj=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes(),isComposing:se.b.bool()}),IM=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),cols:se.b.u16(),rows:se.b.u16()}),Rj=IM,Tj=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),encoding:se.b.u8(),data:se.b.bytes()}),kj=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16),encoding:se.b.u8(),alternateScreen:se.b.bool(),data:se.b.bytes()}),Mj=se.b.struct({deviceId:se.b.string(),windowId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),Aj=se.b.struct({deviceId:se.b.string(),paneId:se.b.string(),selectToken:se.b.bytes(16)}),PM=se.b.struct({chunkStreamId:se.b.u32(),originalKind:se.b.u16(),originalSeq:se.b.u32(),totalChunks:se.b.u16(),chunkIndex:se.b.u16(),data:se.b.bytes()}),Nj=se.b.struct({id:se.b.string(),windowId:se.b.string(),index:se.b.u16(),title:Mr,active:se.b.bool(),width:se.b.u16(),height:se.b.u16()}),Oj=se.b.struct({id:se.b.string(),name:se.b.string(),customName:Mr,index:se.b.u16(),active:se.b.bool(),panes:se.b.vec(Nj)}),Dj=se.b.struct({id:se.b.string(),name:se.b.string(),windows:se.b.vec(Oj)}),Ij=se.b.struct({deviceId:se.b.string(),session:se.b.option(Dj)});se.b.struct({deviceId:se.b.string(),baseRevision:se.b.u32(),revision:se.b.u32(),diffFormat:se.b.u8(),diffBytes:se.b.bytes()});const Pj=se.b.struct({sessionId:se.b.string()}),Lj=se.b.struct({sessionId:se.b.string()}),_j=se.b.struct({sessionId:se.b.string(),seq:se.b.u32(),eventType:se.b.u8(),payload:se.b.bytes()}),jj=se.b.struct({ruleId:se.b.string(),deviceId:se.b.string(),paneId:se.b.string(),eventType:se.b.u8(),payload:se.b.bytes()}),zj=se.b.struct({windowId:se.b.string()}),Fj=se.b.struct({windowId:se.b.string()}),Bj=se.b.struct({windowId:se.b.string(),name:se.b.string()}),Hj=se.b.struct({windowId:se.b.string()}),Uj=se.b.struct({paneId:se.b.string(),windowId:se.b.string()}),qj=se.b.struct({paneId:se.b.string()}),Vj=se.b.struct({windowId:se.b.string(),paneId:se.b.string()}),$j=se.b.struct({windowId:se.b.string(),layout:se.b.string()}),Wj=se.b.struct({windowId:Mr,paneId:Mr,windowIndex:vc,paneIndex:vc,paneUrl:Mr}),Yj=se.b.struct({source:se.b.u8(),title:Mr,body:se.b.string(),windowId:Mr,paneId:Mr,windowIndex:vc,paneIndex:vc,paneUrl:Mr}),bd=new Uint8Array([84,88]),Kj=1;function Zh(e,t,n,r=0,a=Kj){const o={magic:bd,version:a,kind:e,flags:r,seq:n,payload:t};return DM.serialize(o)}function tr(e,t){return e.serialize(t)}function Gj(e){if(e.length<12)throw new ti(ea,!1,"Envelope too small");if(e[0]!==bd[0]||e[1]!==bd[1])throw new ti(ea,!1,"Invalid magic bytes");try{return DM.deserialize(e)}catch(t){throw new ti(ea,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function _a(e,t){try{return e.deserialize(t)}catch(n){throw new ti(OM,!1,n instanceof Error?n.message:"Failed to decode payload")}}function Xj(e,t){const n=PM.serialize(e);return Zh(1281,n,t)}function Qj(e){return PM.deserialize(e)}function Zj(e){return e.length>=2&&e[0]===bd[0]&&e[1]===bd[1]}const Jj=5e3,LC=100,vv=1e3;class ez{constructor(){at(this,"streams",new Map);at(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>vv)throw new ti(ea,!1,`Too many chunks: ${t.totalChunks} > ${vv}`);if(t.chunkIndex>=t.totalChunks)throw new ti(ea,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=LC&&(this.cleanup(!0),this.streams.size>=LC))throw new ti(ea,!1,"Too many concurrent chunk streams");n={chunks:new Map,totalChunks:t.totalChunks,createdAt:Date.now(),originalKind:t.originalKind,originalSeq:t.originalSeq},this.streams.set(t.chunkStreamId,n)}if(n.totalChunks!==t.totalChunks)throw this.streams.delete(t.chunkStreamId),new ti(ea,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new ti(ea,!1,`Duplicate chunk index: ${t.chunkIndex}`);return n.chunks.set(t.chunkIndex,t),n.chunks.size===n.totalChunks?this.reassemble(t.chunkStreamId,n):null}reassemble(t,n){const r=[];let a=0;for(let c=0;c<n.totalChunks;c++){const f=n.chunks.get(c);if(!f)throw this.streams.delete(t),new ti(ea,!1,`Missing chunk index: ${c}`);r.push(f.data),a+=f.data.length}const o=new Uint8Array(a);let l=0;for(const c of r)o.set(c,l),l+=c.length;return this.streams.delete(t),{kind:n.originalKind,seq:n.originalSeq,payload:o}}cleanup(t=!1){const n=Date.now();if(!t&&n-this.lastCleanup<5e3)return;this.lastCleanup=n;const r=n-Jj;for(const[a,o]of this.streams)o.createdAt<r&&this.streams.delete(a)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function tz(e,t,n,r){const{maxFrameBytes:a,chunkStreamId:o}=r,l=16,c=18,f=a-l;if(f<=0)throw new ti(Qh,!1,`maxFrameBytes too small: ${a}`);if(e.length<=f)return{chunks:[],totalChunks:0};const d=a-l-c;if(d<=0)throw new ti(Qh,!1,`maxFrameBytes too small for chunking: ${a}`);const m=Math.ceil(e.length/d);if(m>vv)throw new ti(Qh,!1,`Too many chunks: ${m}`);const h=[];for(let y=0;y<m;y++){const g=y*d,w=Math.min(g+d,e.length);h.push({chunkStreamId:o,originalKind:t,originalSeq:n,totalChunks:m,chunkIndex:y,data:e.slice(g,w)})}return{chunks:h,totalChunks:m}}let Yy=1;function nz(){const e=Yy;return Yy=Yy%4294967295+1,e}const rz={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function iz(e){const t=fj.deserialize(e),n={1:"tmux-missing",2:"disconnected",3:"error",4:"reconnected"};return{deviceId:t.deviceId,type:n[t.eventType]??"error",errorType:t.errorType??void 0,message:t.message??void 0,rawMessage:t.rawMessage??void 0}}function az(e){const t=Sj.deserialize(e),r={1:"window-add",2:"window-close",3:"window-renamed",4:"window-active",5:"pane-add",6:"pane-close",7:"pane-active",8:"layout-change",9:"bell",10:"output",11:"notification"}[t.eventType];if(!r)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:r,data:oz(r,t.eventData)}}function oz(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return zj.deserialize(t);case"window-close":return Fj.deserialize(t);case"window-renamed":return Bj.deserialize(t);case"window-active":return Hj.deserialize(t);case"pane-add":return Uj.deserialize(t);case"pane-close":return qj.deserialize(t);case"pane-active":return Vj.deserialize(t);case"layout-change":return $j.deserialize(t);case"bell":{const n=Wj.deserialize(t);return{windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}case"notification":{const n=Yj.deserialize(t);return{source:rz[n.source]??"osc9",title:n.title??void 0,body:n.body,windowId:n.windowId??void 0,paneId:n.paneId??void 0,windowIndex:n.windowIndex??void 0,paneIndex:n.paneIndex??void 0,paneUrl:n.paneUrl??void 0}}default:return{}}}catch{return{}}}function sz(e){const t=Ij.deserialize(e);return{deviceId:t.deviceId,session:t.session?lz(t.session):null}}function lz(e){return{id:e.id,name:e.name,windows:e.windows.map(cz)}}function cz(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,panes:e.panes.map(uz)}}function uz(e){return{id:e.id,windowId:e.windowId,index:e.index,title:e.title??void 0,active:e.active,width:e.width,height:e.height}}var Ky={exports:{}},Du={},Gy={exports:{}},Xy={};/**
|
|
34
|
-
* @license React
|
|
35
|
-
* scheduler.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/var _C;function dz(){return _C||(_C=1,(function(e){function t(j,z){var H=j.length;j.push(z);e:for(;0<H;){var K=H-1>>>1,P=j[K];if(0<a(P,z))j[K]=z,j[H]=P,H=K;else break e}}function n(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var z=j[0],H=j.pop();if(H!==z){j[0]=H;e:for(var K=0,P=j.length,U=P>>>1;K<U;){var G=2*(K+1)-1,I=j[G],Q=G+1,le=j[Q];if(0>a(I,H))Q<P&&0>a(le,I)?(j[K]=le,j[Q]=H,K=Q):(j[K]=I,j[G]=H,K=G);else if(Q<P&&0>a(le,H))j[K]=le,j[Q]=H,K=Q;else break e}}return z}function a(j,z){var H=j.sortIndex-z.sortIndex;return H!==0?H:j.id-z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,c=l.now();e.unstable_now=function(){return l.now()-c}}var f=[],d=[],m=1,h=null,y=3,g=!1,w=!1,C=!1,R=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function M(j){for(var z=n(d);z!==null;){if(z.callback===null)r(d);else if(z.startTime<=j)r(d),z.sortIndex=z.expirationTime,t(f,z);else break;z=n(d)}}function D(j){if(C=!1,M(j),!w)if(n(f)!==null)w=!0,A||(A=!0,_());else{var z=n(d);z!==null&&B(D,z.startTime-j)}}var A=!1,N=-1,L=5,q=-1;function F(){return R?!0:!(e.unstable_now()-q<L)}function Y(){if(R=!1,A){var j=e.unstable_now();q=j;var z=!0;try{e:{w=!1,C&&(C=!1,T(N),N=-1),g=!0;var H=y;try{t:{for(M(j),h=n(f);h!==null&&!(h.expirationTime>j&&F());){var K=h.callback;if(typeof K=="function"){h.callback=null,y=h.priorityLevel;var P=K(h.expirationTime<=j);if(j=e.unstable_now(),typeof P=="function"){h.callback=P,M(j),z=!0;break t}h===n(f)&&r(f),M(j)}else r(f);h=n(f)}if(h!==null)z=!0;else{var U=n(d);U!==null&&B(D,U.startTime-j),z=!1}}break e}finally{h=null,y=H,g=!1}z=void 0}}finally{z?_():A=!1}}}var _;if(typeof k=="function")_=function(){k(Y)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,$=V.port2;V.port1.onmessage=Y,_=function(){$.postMessage(null)}}else _=function(){E(Y,0)};function B(j,z){N=E(function(){j(e.unstable_now())},z)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(j){j.callback=null},e.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"):L=0<j?Math.floor(1e3/j):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(j){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var H=y;y=z;try{return j()}finally{y=H}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(j,z){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var H=y;y=j;try{return z()}finally{y=H}},e.unstable_scheduleCallback=function(j,z,H){var K=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?K+H:K):H=K,j){case 1:var P=-1;break;case 2:P=250;break;case 5:P=1073741823;break;case 4:P=1e4;break;default:P=5e3}return P=H+P,j={id:m++,callback:z,priorityLevel:j,startTime:H,expirationTime:P,sortIndex:-1},H>K?(j.sortIndex=H,t(d,j),n(f)===null&&j===n(d)&&(C?(T(N),N=-1):C=!0,B(D,H-K))):(j.sortIndex=P,t(f,j),w||g||(w=!0,A||(A=!0,_()))),j},e.unstable_shouldYield=F,e.unstable_wrapCallback=function(j){var z=y;return function(){var H=y;y=z;try{return j.apply(this,arguments)}finally{y=H}}}})(Xy)),Xy}var jC;function fz(){return jC||(jC=1,Gy.exports=dz()),Gy.exports}var Qy={exports:{}},mr={};/**
|
|
42
|
-
* @license React
|
|
43
|
-
* react-dom.production.js
|
|
44
|
-
*
|
|
45
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
46
|
-
*
|
|
47
|
-
* This source code is licensed under the MIT license found in the
|
|
48
|
-
* LICENSE file in the root directory of this source tree.
|
|
49
|
-
*/var zC;function hz(){if(zC)return mr;zC=1;var e=jd();function t(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" 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(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,d,m){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:h==null?null:""+h,children:f,containerInfo:d,implementation:m}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return mr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,mr.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(t(299));return o(f,d,null,m)},mr.flushSync=function(f){var d=l.T,m=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=d,r.p=m,r.d.f()}},mr.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(f,d))},mr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},mr.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin),y=typeof d.integrity=="string"?d.integrity:void 0,g=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?r.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:y,fetchPriority:g}):m==="script"&&r.d.X(f,{crossOrigin:h,integrity:y,fetchPriority:g,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},mr.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=c(d.as,d.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(f)},mr.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,h=c(m,d.crossOrigin);r.d.L(f,m,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},mr.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=c(d.as,d.crossOrigin);r.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(f)},mr.requestFormReset=function(f){r.d.r(f)},mr.unstable_batchedUpdates=function(f,d){return f(d)},mr.useFormState=function(f,d,m){return l.H.useFormState(f,d,m)},mr.useFormStatus=function(){return l.H.useHostTransitionStatus()},mr.version="19.2.4",mr}var FC;function LM(){if(FC)return Qy.exports;FC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Qy.exports=hz(),Qy.exports}/**
|
|
50
|
-
* @license React
|
|
51
|
-
* react-dom-client.production.js
|
|
52
|
-
*
|
|
53
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
-
*
|
|
55
|
-
* This source code is licensed under the MIT license found in the
|
|
56
|
-
* LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/var BC;function pz(){if(BC)return Du;BC=1;var e=fz(),t=jd(),n=LM();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}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 o(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function l(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 c(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 f(i){if(o(i)!==i)throw Error(r(188))}function d(i){var s=i.alternate;if(!s){if(s=o(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,p=s;;){var b=u.return;if(b===null)break;var x=b.alternate;if(x===null){if(p=b.return,p!==null){u=p;continue}break}if(b.child===x.child){for(x=b.child;x;){if(x===u)return f(b),i;if(x===p)return f(b),s;x=x.sibling}throw Error(r(188))}if(u.return!==p.return)u=b,p=x;else{for(var O=!1,W=b.child;W;){if(W===u){O=!0,u=b,p=x;break}if(W===p){O=!0,p=b,u=x;break}W=W.sibling}if(!O){for(W=x.child;W;){if(W===u){O=!0,u=x,p=b;break}if(W===p){O=!0,p=x,u=b;break}W=W.sibling}if(!O)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var h=Object.assign,y=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),k=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function _(i){return i===null||typeof i!="object"?null:(i=Y&&i[Y]||i["@@iterator"],typeof i=="function"?i:null)}var V=Symbol.for("react.client.reference");function $(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===V?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case C:return"Fragment";case E:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case A:return"SuspenseList";case q:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case k:return i.displayName||"Context";case T:return(i._context.displayName||"Context")+".Consumer";case M:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case N:return s=i.displayName||null,s!==null?s:$(i.type)||"Memo";case L:s=i._payload,i=i._init;try{return $(i(s))}catch{}}return null}var B=Array.isArray,j=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},K=[],P=-1;function U(i){return{current:i}}function G(i){0>P||(i.current=K[P],K[P]=null,P--)}function I(i,s){P++,K[P]=i.current,i.current=s}var Q=U(null),le=U(null),ae=U(null),Z=U(null);function ue(i,s){switch(I(ae,s),I(le,i),I(Q,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?jE(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=jE(s),i=zE(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(Q),I(Q,i)}function ve(){G(Q),G(le),G(ae)}function Se(i){i.memoizedState!==null&&I(Z,i);var s=Q.current,u=zE(s,i.type);s!==u&&(I(le,i),I(Q,u))}function Le(i){le.current===i&&(G(Q),G(le)),Z.current===i&&(G(Z),ku._currentValue=H)}var te,he;function ye(i){if(te===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);te=s&&s[1]||"",he=-1<u.stack.indexOf(`
|
|
58
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
59
|
-
`+te+i+he}var _e=!1;function Ae(i,s){if(!i||_e)return"";_e=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var Ie=function(){throw Error()};if(Object.defineProperty(Ie.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ie,[])}catch(we){var be=we}Reflect.construct(i,[],Ie)}else{try{Ie.call()}catch(we){be=we}i.call(Ie.prototype)}}else{try{throw Error()}catch(we){be=we}(Ie=i())&&typeof Ie.catch=="function"&&Ie.catch(function(){})}}catch(we){if(we&&be&&typeof we.stack=="string")return[we.stack,be.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var b=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");b&&b.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=p.DetermineComponentFrameRoot(),O=x[0],W=x[1];if(O&&W){var ne=O.split(`
|
|
60
|
-
`),ge=W.split(`
|
|
61
|
-
`);for(b=p=0;p<ne.length&&!ne[p].includes("DetermineComponentFrameRoot");)p++;for(;b<ge.length&&!ge[b].includes("DetermineComponentFrameRoot");)b++;if(p===ne.length||b===ge.length)for(p=ne.length-1,b=ge.length-1;1<=p&&0<=b&&ne[p]!==ge[b];)b--;for(;1<=p&&0<=b;p--,b--)if(ne[p]!==ge[b]){if(p!==1||b!==1)do if(p--,b--,0>b||ne[p]!==ge[b]){var Me=`
|
|
62
|
-
`+ne[p].replace(" at new "," at ");return i.displayName&&Me.includes("<anonymous>")&&(Me=Me.replace("<anonymous>",i.displayName)),Me}while(1<=p&&0<=b);break}}}finally{_e=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?ye(u):""}function Ce(i,s){switch(i.tag){case 26:case 27:case 5:return ye(i.type);case 16:return ye("Lazy");case 13:return i.child!==s&&s!==null?ye("Suspense Fallback"):ye("Suspense");case 19:return ye("SuspenseList");case 0:case 15:return Ae(i.type,!1);case 11:return Ae(i.type.render,!1);case 1:return Ae(i.type,!0);case 31:return ye("Activity");default:return""}}function Te(i){try{var s="",u=null;do s+=Ce(i,u),u=i,i=i.return;while(i);return s}catch(p){return`
|
|
63
|
-
Error generating stack: `+p.message+`
|
|
64
|
-
`+p.stack}}var J=Object.prototype.hasOwnProperty,Ee=e.unstable_scheduleCallback,xe=e.unstable_cancelCallback,Be=e.unstable_shouldYield,Ve=e.unstable_requestPaint,De=e.unstable_now,ut=e.unstable_getCurrentPriorityLevel,pe=e.unstable_ImmediatePriority,Re=e.unstable_UserBlockingPriority,ee=e.unstable_NormalPriority,fe=e.unstable_LowPriority,Ne=e.unstable_IdlePriority,He=e.log,$e=e.unstable_setDisableYieldValue,et=null,ze=null;function Ze(i){if(typeof He=="function"&&$e(i),ze&&typeof ze.setStrictMode=="function")try{ze.setStrictMode(et,i)}catch{}}var tt=Math.clz32?Math.clz32:yt,Rt=Math.log,zt=Math.LN2;function yt(i){return i>>>=0,i===0?32:31-(Rt(i)/zt|0)|0}var Nt=256,it=262144,ft=4194304;function bt(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 Ke(i,s,u){var p=i.pendingLanes;if(p===0)return 0;var b=0,x=i.suspendedLanes,O=i.pingedLanes;i=i.warmLanes;var W=p&134217727;return W!==0?(p=W&~x,p!==0?b=bt(p):(O&=W,O!==0?b=bt(O):u||(u=W&~i,u!==0&&(b=bt(u))))):(W=p&~x,W!==0?b=bt(W):O!==0?b=bt(O):u||(u=p&~i,u!==0&&(b=bt(u)))),b===0?0:s!==0&&s!==b&&(s&x)===0&&(x=b&-b,u=s&-s,x>=u||x===32&&(u&4194048)!==0)?s:b}function kt(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function _t(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 Tt(){var i=ft;return ft<<=1,(ft&62914560)===0&&(ft=4194304),i}function dn(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ut(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Je(i,s,u,p,b,x){var O=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var W=i.entanglements,ne=i.expirationTimes,ge=i.hiddenUpdates;for(u=O&~u;0<u;){var Me=31-tt(u),Ie=1<<Me;W[Me]=0,ne[Me]=-1;var be=ge[Me];if(be!==null)for(ge[Me]=null,Me=0;Me<be.length;Me++){var we=be[Me];we!==null&&(we.lane&=-536870913)}u&=~Ie}p!==0&&Mt(i,p,0),x!==0&&b===0&&i.tag!==0&&(i.suspendedLanes|=x&~(O&~s))}function Mt(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-tt(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|u&261930}function X(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var p=31-tt(u),b=1<<p;b&s|i[p]&s&&(i[p]|=s),u&=~b}}function ie(i,s){var u=s&-s;return u=(u&42)!==0?1:de(u),(u&(i.suspendedLanes|s))!==0?0:u}function de(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 ke(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function je(){var i=z.p;return i!==0?i:(i=window.event,i===void 0?32:sC(i.type))}function rt(i,s){var u=z.p;try{return z.p=i,s()}finally{z.p=u}}var nt=Math.random().toString(36).slice(2),Ye="__reactFiber$"+nt,Xe="__reactProps$"+nt,ot="__reactContainer$"+nt,Et="__reactEvents$"+nt,ht="__reactListeners$"+nt,Lt="__reactHandles$"+nt,$t="__reactResources$"+nt,On="__reactMarker$"+nt;function Pn(i){delete i[Ye],delete i[Xe],delete i[Et],delete i[ht],delete i[Lt]}function Ln(i){var s=i[Ye];if(s)return s;for(var u=i.parentNode;u;){if(s=u[ot]||u[Ye]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=$E(i);i!==null;){if(u=i[Ye])return u;i=$E(i)}return s}i=u,u=i.parentNode}return null}function Zt(i){if(i=i[Ye]||i[ot]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function rr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function Ar(i){var s=i[$t];return s||(s=i[$t]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function An(i){i[On]=!0}var ki=new Set,$r={};function Mi(i,s){oi(i,s),oi(i+"Capture",s)}function oi(i,s){for($r[i]=s,i=0;i<s.length;i++)ki.add(s[i])}var ha=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]*$"),es={},ts={};function Jt(i){return J.call(ts,i)?!0:J.call(es,i)?!1:ha.test(i)?ts[i]=!0:(es[i]=!0,!1)}function Un(i,s,u){if(Jt(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Ai(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function lr(i,s,u,p){if(p===null)i.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+p)}}function en(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function ns(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function cf(i,s,u){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var b=p.get,x=p.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return b.call(this)},set:function(O){u=""+O,x.call(this,O)}}),Object.defineProperty(i,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(O){u=""+O},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function qc(i){if(!i._valueTracker){var s=ns(i)?"checked":"value";i._valueTracker=cf(i,s,""+i[s])}}function Nw(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return i&&(p=ns(i)?i.checked?"true":"false":i.value),i=p,i!==u?(s.setValue(i),!0):!1}function uf(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 KD=/[\n"\\]/g;function si(i){return i.replace(KD,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function _m(i,s,u,p,b,x,O,W){i.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.type=O:i.removeAttribute("type"),s!=null?O==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+en(s)):i.value!==""+en(s)&&(i.value=""+en(s)):O!=="submit"&&O!=="reset"||i.removeAttribute("value"),s!=null?jm(i,O,en(s)):u!=null?jm(i,O,en(u)):p!=null&&i.removeAttribute("value"),b==null&&x!=null&&(i.defaultChecked=!!x),b!=null&&(i.checked=b&&typeof b!="function"&&typeof b!="symbol"),W!=null&&typeof W!="function"&&typeof W!="symbol"&&typeof W!="boolean"?i.name=""+en(W):i.removeAttribute("name")}function Ow(i,s,u,p,b,x,O,W){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(i.type=x),s!=null||u!=null){if(!(x!=="submit"&&x!=="reset"||s!=null)){qc(i);return}u=u!=null?""+en(u):"",s=s!=null?""+en(s):u,W||s===i.value||(i.value=s),i.defaultValue=s}p=p??b,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=W?i.checked:!!p,i.defaultChecked=!!p,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(i.name=O),qc(i)}function jm(i,s,u){s==="number"&&uf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function al(i,s,u,p){if(i=i.options,s){s={};for(var b=0;b<u.length;b++)s["$"+u[b]]=!0;for(u=0;u<i.length;u++)b=s.hasOwnProperty("$"+i[u].value),i[u].selected!==b&&(i[u].selected=b),b&&p&&(i[u].defaultSelected=!0)}else{for(u=""+en(u),s=null,b=0;b<i.length;b++){if(i[b].value===u){i[b].selected=!0,p&&(i[b].defaultSelected=!0);return}s!==null||i[b].disabled||(s=i[b])}s!==null&&(s.selected=!0)}}function Dw(i,s,u){if(s!=null&&(s=""+en(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+en(u):""}function Iw(i,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(r(92));if(B(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=en(s),i.defaultValue=u,p=i.textContent,p===u&&p!==""&&p!==null&&(i.value=p),qc(i)}function ol(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var GD=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 Pw(i,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":p?i.setProperty(s,u):typeof u!="number"||u===0||GD.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function Lw(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var b in s)p=s[b],s.hasOwnProperty(b)&&u[b]!==p&&Pw(i,b,p)}else for(var x in s)s.hasOwnProperty(x)&&Pw(i,x,s[x])}function zm(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 XD=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"]]),QD=/^[\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 df(i){return QD.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function pa(){}var Fm=null;function Bm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var sl=null,ll=null;function _w(i){var s=Zt(i);if(s&&(i=s.stateNode)){var u=i[Xe]||null;e:switch(i=s.stateNode,s.type){case"input":if(_m(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+si(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==i&&p.form===i.form){var b=p[Xe]||null;if(!b)throw Error(r(90));_m(p,b.value,b.defaultValue,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===i.form&&Nw(p)}break e;case"textarea":Dw(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&al(i,!!u.multiple,s,!1)}}}var Hm=!1;function jw(i,s,u){if(Hm)return i(s,u);Hm=!0;try{var p=i(s);return p}finally{if(Hm=!1,(sl!==null||ll!==null)&&(Zf(),sl&&(s=sl,i=ll,ll=sl=null,_w(s),i)))for(s=0;s<i.length;s++)_w(i[s])}}function Vc(i,s){var u=i.stateNode;if(u===null)return null;var p=u[Xe]||null;if(p===null)return null;u=p[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":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var ma=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Um=!1;if(ma)try{var $c={};Object.defineProperty($c,"passive",{get:function(){Um=!0}}),window.addEventListener("test",$c,$c),window.removeEventListener("test",$c,$c)}catch{Um=!1}var Xa=null,qm=null,ff=null;function zw(){if(ff)return ff;var i,s=qm,u=s.length,p,b="value"in Xa?Xa.value:Xa.textContent,x=b.length;for(i=0;i<u&&s[i]===b[i];i++);var O=u-i;for(p=1;p<=O&&s[u-p]===b[x-p];p++);return ff=b.slice(i,1<p?1-p:void 0)}function hf(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 pf(){return!0}function Fw(){return!1}function Nr(i){function s(u,p,b,x,O){this._reactName=u,this._targetInst=b,this.type=p,this.nativeEvent=x,this.target=O,this.currentTarget=null;for(var W in i)i.hasOwnProperty(W)&&(u=i[W],this[W]=u?u(x):x[W]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?pf:Fw,this.isPropagationStopped=Fw,this}return h(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=pf)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=pf)},persist:function(){},isPersistent:pf}),s}var rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},mf=Nr(rs),Wc=h({},rs,{view:0,detail:0}),ZD=Nr(Wc),Vm,$m,Yc,gf=h({},Wc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ym,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!==Yc&&(Yc&&i.type==="mousemove"?(Vm=i.screenX-Yc.screenX,$m=i.screenY-Yc.screenY):$m=Vm=0,Yc=i),Vm)},movementY:function(i){return"movementY"in i?i.movementY:$m}}),Bw=Nr(gf),JD=h({},gf,{dataTransfer:0}),eI=Nr(JD),tI=h({},Wc,{relatedTarget:0}),Wm=Nr(tI),nI=h({},rs,{animationName:0,elapsedTime:0,pseudoElement:0}),rI=Nr(nI),iI=h({},rs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),aI=Nr(iI),oI=h({},rs,{data:0}),Hw=Nr(oI),sI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lI={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"},cI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uI(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=cI[i])?!!s[i]:!1}function Ym(){return uI}var dI=h({},Wc,{key:function(i){if(i.key){var s=sI[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=hf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?lI[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ym,charCode:function(i){return i.type==="keypress"?hf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?hf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),fI=Nr(dI),hI=h({},gf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Uw=Nr(hI),pI=h({},Wc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ym}),mI=Nr(pI),gI=h({},rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),yI=Nr(gI),bI=h({},gf,{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}),vI=Nr(bI),xI=h({},rs,{newState:0,oldState:0}),wI=Nr(xI),SI=[9,13,27,32],Km=ma&&"CompositionEvent"in window,Kc=null;ma&&"documentMode"in document&&(Kc=document.documentMode);var EI=ma&&"TextEvent"in window&&!Kc,qw=ma&&(!Km||Kc&&8<Kc&&11>=Kc),Vw=" ",$w=!1;function Ww(i,s){switch(i){case"keyup":return SI.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Yw(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var cl=!1;function CI(i,s){switch(i){case"compositionend":return Yw(s);case"keypress":return s.which!==32?null:($w=!0,Vw);case"textInput":return i=s.data,i===Vw&&$w?null:i;default:return null}}function RI(i,s){if(cl)return i==="compositionend"||!Km&&Ww(i,s)?(i=zw(),ff=qm=Xa=null,cl=!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 qw&&s.locale!=="ko"?null:s.data;default:return null}}var TI={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 Kw(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!TI[i.type]:s==="textarea"}function Gw(i,s,u,p){sl?ll?ll.push(p):ll=[p]:sl=p,s=ah(s,"onChange"),0<s.length&&(u=new mf("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var Gc=null,Xc=null;function kI(i){OE(i,0)}function yf(i){var s=rr(i);if(Nw(s))return i}function Xw(i,s){if(i==="change")return s}var Qw=!1;if(ma){var Gm;if(ma){var Xm="oninput"in document;if(!Xm){var Zw=document.createElement("div");Zw.setAttribute("oninput","return;"),Xm=typeof Zw.oninput=="function"}Gm=Xm}else Gm=!1;Qw=Gm&&(!document.documentMode||9<document.documentMode)}function Jw(){Gc&&(Gc.detachEvent("onpropertychange",eS),Xc=Gc=null)}function eS(i){if(i.propertyName==="value"&&yf(Xc)){var s=[];Gw(s,Xc,i,Bm(i)),jw(kI,s)}}function MI(i,s,u){i==="focusin"?(Jw(),Gc=s,Xc=u,Gc.attachEvent("onpropertychange",eS)):i==="focusout"&&Jw()}function AI(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return yf(Xc)}function NI(i,s){if(i==="click")return yf(s)}function OI(i,s){if(i==="input"||i==="change")return yf(s)}function DI(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Wr=typeof Object.is=="function"?Object.is:DI;function Qc(i,s){if(Wr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var b=u[p];if(!J.call(s,b)||!Wr(i[b],s[b]))return!1}return!0}function tS(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function nS(i,s){var u=tS(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=s&&p>=s)return{node:u,offset:s-i};i=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=tS(u)}}function rS(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?rS(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function iS(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=uf(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=uf(i.document)}return s}function Qm(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 II=ma&&"documentMode"in document&&11>=document.documentMode,ul=null,Zm=null,Zc=null,Jm=!1;function aS(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Jm||ul==null||ul!==uf(p)||(p=ul,"selectionStart"in p&&Qm(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Zc&&Qc(Zc,p)||(Zc=p,p=ah(Zm,"onSelect"),0<p.length&&(s=new mf("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=ul)))}function is(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var dl={animationend:is("Animation","AnimationEnd"),animationiteration:is("Animation","AnimationIteration"),animationstart:is("Animation","AnimationStart"),transitionrun:is("Transition","TransitionRun"),transitionstart:is("Transition","TransitionStart"),transitioncancel:is("Transition","TransitionCancel"),transitionend:is("Transition","TransitionEnd")},eg={},oS={};ma&&(oS=document.createElement("div").style,"AnimationEvent"in window||(delete dl.animationend.animation,delete dl.animationiteration.animation,delete dl.animationstart.animation),"TransitionEvent"in window||delete dl.transitionend.transition);function as(i){if(eg[i])return eg[i];if(!dl[i])return i;var s=dl[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in oS)return eg[i]=s[u];return i}var sS=as("animationend"),lS=as("animationiteration"),cS=as("animationstart"),PI=as("transitionrun"),LI=as("transitionstart"),_I=as("transitioncancel"),uS=as("transitionend"),dS=new Map,tg="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(" ");tg.push("scrollEnd");function Ni(i,s){dS.set(i,s),Mi(s,[i])}var bf=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)},li=[],fl=0,ng=0;function vf(){for(var i=fl,s=ng=fl=0;s<i;){var u=li[s];li[s++]=null;var p=li[s];li[s++]=null;var b=li[s];li[s++]=null;var x=li[s];if(li[s++]=null,p!==null&&b!==null){var O=p.pending;O===null?b.next=b:(b.next=O.next,O.next=b),p.pending=b}x!==0&&fS(u,b,x)}}function xf(i,s,u,p){li[fl++]=i,li[fl++]=s,li[fl++]=u,li[fl++]=p,ng|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function rg(i,s,u,p){return xf(i,s,u,p),wf(i)}function os(i,s){return xf(i,null,null,s),wf(i)}function fS(i,s,u){i.lanes|=u;var p=i.alternate;p!==null&&(p.lanes|=u);for(var b=!1,x=i.return;x!==null;)x.childLanes|=u,p=x.alternate,p!==null&&(p.childLanes|=u),x.tag===22&&(i=x.stateNode,i===null||i._visibility&1||(b=!0)),i=x,x=x.return;return i.tag===3?(x=i.stateNode,b&&s!==null&&(b=31-tt(u),i=x.hiddenUpdates,p=i[b],p===null?i[b]=[s]:p.push(s),s.lane=u|536870912),x):null}function wf(i){if(50<xu)throw xu=0,fy=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var hl={};function jI(i,s,u,p){this.tag=i,this.key=u,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=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(i,s,u,p){return new jI(i,s,u,p)}function ig(i){return i=i.prototype,!(!i||!i.isReactComponent)}function ga(i,s){var u=i.alternate;return u===null?(u=Yr(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function hS(i,s){i.flags&=65011714;var u=i.alternate;return u===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=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Sf(i,s,u,p,b,x){var O=0;if(p=i,typeof i=="function")ig(i)&&(O=1);else if(typeof i=="string")O=UP(i,u,Q.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case q:return i=Yr(31,u,s,b),i.elementType=q,i.lanes=x,i;case C:return ss(u.children,b,x,s);case R:O=8,b|=24;break;case E:return i=Yr(12,u,s,b|2),i.elementType=E,i.lanes=x,i;case D:return i=Yr(13,u,s,b),i.elementType=D,i.lanes=x,i;case A:return i=Yr(19,u,s,b),i.elementType=A,i.lanes=x,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case k:O=10;break e;case T:O=9;break e;case M:O=11;break e;case N:O=14;break e;case L:O=16,p=null;break e}O=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=Yr(O,u,s,b),s.elementType=i,s.type=p,s.lanes=x,s}function ss(i,s,u,p){return i=Yr(7,i,p,s),i.lanes=u,i}function ag(i,s,u){return i=Yr(6,i,null,s),i.lanes=u,i}function pS(i){var s=Yr(18,null,null,0);return s.stateNode=i,s}function og(i,s,u){return s=Yr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var mS=new WeakMap;function ci(i,s){if(typeof i=="object"&&i!==null){var u=mS.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Te(s)},mS.set(i,s),s)}return{value:i,source:s,stack:Te(s)}}var pl=[],ml=0,Ef=null,Jc=0,ui=[],di=0,Qa=null,$i=1,Wi="";function ya(i,s){pl[ml++]=Jc,pl[ml++]=Ef,Ef=i,Jc=s}function gS(i,s,u){ui[di++]=$i,ui[di++]=Wi,ui[di++]=Qa,Qa=i;var p=$i;i=Wi;var b=32-tt(p)-1;p&=~(1<<b),u+=1;var x=32-tt(s)+b;if(30<x){var O=b-b%5;x=(p&(1<<O)-1).toString(32),p>>=O,b-=O,$i=1<<32-tt(s)+b|u<<b|p,Wi=x+i}else $i=1<<x|u<<b|p,Wi=i}function sg(i){i.return!==null&&(ya(i,1),gS(i,1,0))}function lg(i){for(;i===Ef;)Ef=pl[--ml],pl[ml]=null,Jc=pl[--ml],pl[ml]=null;for(;i===Qa;)Qa=ui[--di],ui[di]=null,Wi=ui[--di],ui[di]=null,$i=ui[--di],ui[di]=null}function yS(i,s){ui[di++]=$i,ui[di++]=Wi,ui[di++]=Qa,$i=s.id,Wi=s.overflow,Qa=i}var cr=null,Rn=null,tn=!1,Za=null,fi=!1,cg=Error(r(519));function Ja(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw eu(ci(s,i)),cg}function bS(i){var s=i.stateNode,u=i.type,p=i.memoizedProps;switch(s[Ye]=i,s[Xe]=p,u){case"dialog":Yt("cancel",s),Yt("close",s);break;case"iframe":case"object":case"embed":Yt("load",s);break;case"video":case"audio":for(u=0;u<Su.length;u++)Yt(Su[u],s);break;case"source":Yt("error",s);break;case"img":case"image":case"link":Yt("error",s),Yt("load",s);break;case"details":Yt("toggle",s);break;case"input":Yt("invalid",s),Ow(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Yt("invalid",s);break;case"textarea":Yt("invalid",s),Iw(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||LE(s.textContent,u)?(p.popover!=null&&(Yt("beforetoggle",s),Yt("toggle",s)),p.onScroll!=null&&Yt("scroll",s),p.onScrollEnd!=null&&Yt("scrollend",s),p.onClick!=null&&(s.onclick=pa),s=!0):s=!1,s||Ja(i,!0)}function vS(i){for(cr=i.return;cr;)switch(cr.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:cr=cr.return}}function gl(i){if(i!==cr)return!1;if(!tn)return vS(i),tn=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||ky(i.type,i.memoizedProps)),u=!u),u&&Rn&&Ja(i),vS(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Rn=VE(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Rn=VE(i)}else s===27?(s=Rn,po(i.type)?(i=Dy,Dy=null,Rn=i):Rn=s):Rn=cr?pi(i.stateNode.nextSibling):null;return!0}function ls(){Rn=cr=null,tn=!1}function ug(){var i=Za;return i!==null&&(Pr===null?Pr=i:Pr.push.apply(Pr,i),Za=null),i}function eu(i){Za===null?Za=[i]:Za.push(i)}var dg=U(null),cs=null,ba=null;function eo(i,s,u){I(dg,s._currentValue),s._currentValue=u}function va(i){i._currentValue=dg.current,G(dg)}function fg(i,s,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===u)break;i=i.return}}function hg(i,s,u,p){var b=i.child;for(b!==null&&(b.return=i);b!==null;){var x=b.dependencies;if(x!==null){var O=b.child;x=x.firstContext;e:for(;x!==null;){var W=x;x=b;for(var ne=0;ne<s.length;ne++)if(W.context===s[ne]){x.lanes|=u,W=x.alternate,W!==null&&(W.lanes|=u),fg(x.return,u,i),p||(O=null);break e}x=W.next}}else if(b.tag===18){if(O=b.return,O===null)throw Error(r(341));O.lanes|=u,x=O.alternate,x!==null&&(x.lanes|=u),fg(O,u,i),O=null}else O=b.child;if(O!==null)O.return=b;else for(O=b;O!==null;){if(O===i){O=null;break}if(b=O.sibling,b!==null){b.return=O.return,O=b;break}O=O.return}b=O}}function yl(i,s,u,p){i=null;for(var b=s,x=!1;b!==null;){if(!x){if((b.flags&524288)!==0)x=!0;else if((b.flags&262144)!==0)break}if(b.tag===10){var O=b.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var W=b.type;Wr(b.pendingProps.value,O.value)||(i!==null?i.push(W):i=[W])}}else if(b===Z.current){if(O=b.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==b.memoizedState.memoizedState&&(i!==null?i.push(ku):i=[ku])}b=b.return}i!==null&&hg(s,i,u,p),s.flags|=262144}function Cf(i){for(i=i.firstContext;i!==null;){if(!Wr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function us(i){cs=i,ba=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function ur(i){return xS(cs,i)}function Rf(i,s){return cs===null&&us(i),xS(i,s)}function xS(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},ba===null){if(i===null)throw Error(r(308));ba=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else ba=ba.next=s;return u}var zI=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},FI=e.unstable_scheduleCallback,BI=e.unstable_NormalPriority,$n={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function pg(){return{controller:new zI,data:new Map,refCount:0}}function tu(i){i.refCount--,i.refCount===0&&FI(BI,function(){i.controller.abort()})}var nu=null,mg=0,bl=0,vl=null;function HI(i,s){if(nu===null){var u=nu=[];mg=0,bl=by(),vl={status:"pending",value:void 0,then:function(p){u.push(p)}}}return mg++,s.then(wS,wS),s}function wS(){if(--mg===0&&nu!==null){vl!==null&&(vl.status="fulfilled");var i=nu;nu=null,bl=0,vl=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function UI(i,s){var u=[],p={status:"pending",value:null,reason:null,then:function(b){u.push(b)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var b=0;b<u.length;b++)(0,u[b])(s)},function(b){for(p.status="rejected",p.reason=b,b=0;b<u.length;b++)(0,u[b])(void 0)}),p}var SS=j.S;j.S=function(i,s){aE=De(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&HI(i,s),SS!==null&&SS(i,s)};var ds=U(null);function gg(){var i=ds.current;return i!==null?i:wn.pooledCache}function Tf(i,s){s===null?I(ds,ds.current):I(ds,s.pool)}function ES(){var i=gg();return i===null?null:{parent:$n._currentValue,pool:i}}var xl=Error(r(460)),yg=Error(r(474)),kf=Error(r(542)),Mf={then:function(){}};function CS(i){return i=i.status,i==="fulfilled"||i==="rejected"}function RS(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(pa,pa),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,kS(i),i;default:if(typeof s.status=="string")s.then(pa,pa);else{if(i=wn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(p){if(s.status==="pending"){var b=s;b.status="fulfilled",b.value=p}},function(p){if(s.status==="pending"){var b=s;b.status="rejected",b.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,kS(i),i}throw hs=s,xl}}function fs(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(hs=u,xl):u}}var hs=null;function TS(){if(hs===null)throw Error(r(459));var i=hs;return hs=null,i}function kS(i){if(i===xl||i===kf)throw Error(r(483))}var wl=null,ru=0;function Af(i){var s=ru;return ru+=1,wl===null&&(wl=[]),RS(wl,i,s)}function iu(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Nf(i,s){throw s.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function MS(i){function s(ce,oe){if(i){var me=ce.deletions;me===null?(ce.deletions=[oe],ce.flags|=16):me.push(oe)}}function u(ce,oe){if(!i)return null;for(;oe!==null;)s(ce,oe),oe=oe.sibling;return null}function p(ce){for(var oe=new Map;ce!==null;)ce.key!==null?oe.set(ce.key,ce):oe.set(ce.index,ce),ce=ce.sibling;return oe}function b(ce,oe){return ce=ga(ce,oe),ce.index=0,ce.sibling=null,ce}function x(ce,oe,me){return ce.index=me,i?(me=ce.alternate,me!==null?(me=me.index,me<oe?(ce.flags|=67108866,oe):me):(ce.flags|=67108866,oe)):(ce.flags|=1048576,oe)}function O(ce){return i&&ce.alternate===null&&(ce.flags|=67108866),ce}function W(ce,oe,me,Oe){return oe===null||oe.tag!==6?(oe=ag(me,ce.mode,Oe),oe.return=ce,oe):(oe=b(oe,me),oe.return=ce,oe)}function ne(ce,oe,me,Oe){var mt=me.type;return mt===C?Me(ce,oe,me.props.children,Oe,me.key):oe!==null&&(oe.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===L&&fs(mt)===oe.type)?(oe=b(oe,me.props),iu(oe,me),oe.return=ce,oe):(oe=Sf(me.type,me.key,me.props,null,ce.mode,Oe),iu(oe,me),oe.return=ce,oe)}function ge(ce,oe,me,Oe){return oe===null||oe.tag!==4||oe.stateNode.containerInfo!==me.containerInfo||oe.stateNode.implementation!==me.implementation?(oe=og(me,ce.mode,Oe),oe.return=ce,oe):(oe=b(oe,me.children||[]),oe.return=ce,oe)}function Me(ce,oe,me,Oe,mt){return oe===null||oe.tag!==7?(oe=ss(me,ce.mode,Oe,mt),oe.return=ce,oe):(oe=b(oe,me),oe.return=ce,oe)}function Ie(ce,oe,me){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return oe=ag(""+oe,ce.mode,me),oe.return=ce,oe;if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case g:return me=Sf(oe.type,oe.key,oe.props,null,ce.mode,me),iu(me,oe),me.return=ce,me;case w:return oe=og(oe,ce.mode,me),oe.return=ce,oe;case L:return oe=fs(oe),Ie(ce,oe,me)}if(B(oe)||_(oe))return oe=ss(oe,ce.mode,me,null),oe.return=ce,oe;if(typeof oe.then=="function")return Ie(ce,Af(oe),me);if(oe.$$typeof===k)return Ie(ce,Rf(ce,oe),me);Nf(ce,oe)}return null}function be(ce,oe,me,Oe){var mt=oe!==null?oe.key:null;if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return mt!==null?null:W(ce,oe,""+me,Oe);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case g:return me.key===mt?ne(ce,oe,me,Oe):null;case w:return me.key===mt?ge(ce,oe,me,Oe):null;case L:return me=fs(me),be(ce,oe,me,Oe)}if(B(me)||_(me))return mt!==null?null:Me(ce,oe,me,Oe,null);if(typeof me.then=="function")return be(ce,oe,Af(me),Oe);if(me.$$typeof===k)return be(ce,oe,Rf(ce,me),Oe);Nf(ce,me)}return null}function we(ce,oe,me,Oe,mt){if(typeof Oe=="string"&&Oe!==""||typeof Oe=="number"||typeof Oe=="bigint")return ce=ce.get(me)||null,W(oe,ce,""+Oe,mt);if(typeof Oe=="object"&&Oe!==null){switch(Oe.$$typeof){case g:return ce=ce.get(Oe.key===null?me:Oe.key)||null,ne(oe,ce,Oe,mt);case w:return ce=ce.get(Oe.key===null?me:Oe.key)||null,ge(oe,ce,Oe,mt);case L:return Oe=fs(Oe),we(ce,oe,me,Oe,mt)}if(B(Oe)||_(Oe))return ce=ce.get(me)||null,Me(oe,ce,Oe,mt,null);if(typeof Oe.then=="function")return we(ce,oe,me,Af(Oe),mt);if(Oe.$$typeof===k)return we(ce,oe,me,Rf(oe,Oe),mt);Nf(oe,Oe)}return null}function st(ce,oe,me,Oe){for(var mt=null,ln=null,dt=oe,Ft=oe=0,Xt=null;dt!==null&&Ft<me.length;Ft++){dt.index>Ft?(Xt=dt,dt=null):Xt=dt.sibling;var cn=be(ce,dt,me[Ft],Oe);if(cn===null){dt===null&&(dt=Xt);break}i&&dt&&cn.alternate===null&&s(ce,dt),oe=x(cn,oe,Ft),ln===null?mt=cn:ln.sibling=cn,ln=cn,dt=Xt}if(Ft===me.length)return u(ce,dt),tn&&ya(ce,Ft),mt;if(dt===null){for(;Ft<me.length;Ft++)dt=Ie(ce,me[Ft],Oe),dt!==null&&(oe=x(dt,oe,Ft),ln===null?mt=dt:ln.sibling=dt,ln=dt);return tn&&ya(ce,Ft),mt}for(dt=p(dt);Ft<me.length;Ft++)Xt=we(dt,ce,Ft,me[Ft],Oe),Xt!==null&&(i&&Xt.alternate!==null&&dt.delete(Xt.key===null?Ft:Xt.key),oe=x(Xt,oe,Ft),ln===null?mt=Xt:ln.sibling=Xt,ln=Xt);return i&&dt.forEach(function(vo){return s(ce,vo)}),tn&&ya(ce,Ft),mt}function wt(ce,oe,me,Oe){if(me==null)throw Error(r(151));for(var mt=null,ln=null,dt=oe,Ft=oe=0,Xt=null,cn=me.next();dt!==null&&!cn.done;Ft++,cn=me.next()){dt.index>Ft?(Xt=dt,dt=null):Xt=dt.sibling;var vo=be(ce,dt,cn.value,Oe);if(vo===null){dt===null&&(dt=Xt);break}i&&dt&&vo.alternate===null&&s(ce,dt),oe=x(vo,oe,Ft),ln===null?mt=vo:ln.sibling=vo,ln=vo,dt=Xt}if(cn.done)return u(ce,dt),tn&&ya(ce,Ft),mt;if(dt===null){for(;!cn.done;Ft++,cn=me.next())cn=Ie(ce,cn.value,Oe),cn!==null&&(oe=x(cn,oe,Ft),ln===null?mt=cn:ln.sibling=cn,ln=cn);return tn&&ya(ce,Ft),mt}for(dt=p(dt);!cn.done;Ft++,cn=me.next())cn=we(dt,ce,Ft,cn.value,Oe),cn!==null&&(i&&cn.alternate!==null&&dt.delete(cn.key===null?Ft:cn.key),oe=x(cn,oe,Ft),ln===null?mt=cn:ln.sibling=cn,ln=cn);return i&&dt.forEach(function(JP){return s(ce,JP)}),tn&&ya(ce,Ft),mt}function xn(ce,oe,me,Oe){if(typeof me=="object"&&me!==null&&me.type===C&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case g:e:{for(var mt=me.key;oe!==null;){if(oe.key===mt){if(mt=me.type,mt===C){if(oe.tag===7){u(ce,oe.sibling),Oe=b(oe,me.props.children),Oe.return=ce,ce=Oe;break e}}else if(oe.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===L&&fs(mt)===oe.type){u(ce,oe.sibling),Oe=b(oe,me.props),iu(Oe,me),Oe.return=ce,ce=Oe;break e}u(ce,oe);break}else s(ce,oe);oe=oe.sibling}me.type===C?(Oe=ss(me.props.children,ce.mode,Oe,me.key),Oe.return=ce,ce=Oe):(Oe=Sf(me.type,me.key,me.props,null,ce.mode,Oe),iu(Oe,me),Oe.return=ce,ce=Oe)}return O(ce);case w:e:{for(mt=me.key;oe!==null;){if(oe.key===mt)if(oe.tag===4&&oe.stateNode.containerInfo===me.containerInfo&&oe.stateNode.implementation===me.implementation){u(ce,oe.sibling),Oe=b(oe,me.children||[]),Oe.return=ce,ce=Oe;break e}else{u(ce,oe);break}else s(ce,oe);oe=oe.sibling}Oe=og(me,ce.mode,Oe),Oe.return=ce,ce=Oe}return O(ce);case L:return me=fs(me),xn(ce,oe,me,Oe)}if(B(me))return st(ce,oe,me,Oe);if(_(me)){if(mt=_(me),typeof mt!="function")throw Error(r(150));return me=mt.call(me),wt(ce,oe,me,Oe)}if(typeof me.then=="function")return xn(ce,oe,Af(me),Oe);if(me.$$typeof===k)return xn(ce,oe,Rf(ce,me),Oe);Nf(ce,me)}return typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint"?(me=""+me,oe!==null&&oe.tag===6?(u(ce,oe.sibling),Oe=b(oe,me),Oe.return=ce,ce=Oe):(u(ce,oe),Oe=ag(me,ce.mode,Oe),Oe.return=ce,ce=Oe),O(ce)):u(ce,oe)}return function(ce,oe,me,Oe){try{ru=0;var mt=xn(ce,oe,me,Oe);return wl=null,mt}catch(dt){if(dt===xl||dt===kf)throw dt;var ln=Yr(29,dt,null,ce.mode);return ln.lanes=Oe,ln.return=ce,ln}finally{}}}var ps=MS(!0),AS=MS(!1),to=!1;function bg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function vg(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 no(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function ro(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(fn&2)!==0){var b=p.pending;return b===null?s.next=s:(s.next=b.next,b.next=s),p.pending=s,s=wf(i),fS(i,null,u),s}return xf(i,p,s,u),wf(i)}function au(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}function xg(i,s){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var b=null,x=null;if(u=u.firstBaseUpdate,u!==null){do{var O={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};x===null?b=x=O:x=x.next=O,u=u.next}while(u!==null);x===null?b=x=s:x=x.next=s}else b=x=s;u={baseState:p.baseState,firstBaseUpdate:b,lastBaseUpdate:x,shared:p.shared,callbacks:p.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var wg=!1;function ou(){if(wg){var i=vl;if(i!==null)throw i}}function su(i,s,u,p){wg=!1;var b=i.updateQueue;to=!1;var x=b.firstBaseUpdate,O=b.lastBaseUpdate,W=b.shared.pending;if(W!==null){b.shared.pending=null;var ne=W,ge=ne.next;ne.next=null,O===null?x=ge:O.next=ge,O=ne;var Me=i.alternate;Me!==null&&(Me=Me.updateQueue,W=Me.lastBaseUpdate,W!==O&&(W===null?Me.firstBaseUpdate=ge:W.next=ge,Me.lastBaseUpdate=ne))}if(x!==null){var Ie=b.baseState;O=0,Me=ge=ne=null,W=x;do{var be=W.lane&-536870913,we=be!==W.lane;if(we?(Gt&be)===be:(p&be)===be){be!==0&&be===bl&&(wg=!0),Me!==null&&(Me=Me.next={lane:0,tag:W.tag,payload:W.payload,callback:null,next:null});e:{var st=i,wt=W;be=s;var xn=u;switch(wt.tag){case 1:if(st=wt.payload,typeof st=="function"){Ie=st.call(xn,Ie,be);break e}Ie=st;break e;case 3:st.flags=st.flags&-65537|128;case 0:if(st=wt.payload,be=typeof st=="function"?st.call(xn,Ie,be):st,be==null)break e;Ie=h({},Ie,be);break e;case 2:to=!0}}be=W.callback,be!==null&&(i.flags|=64,we&&(i.flags|=8192),we=b.callbacks,we===null?b.callbacks=[be]:we.push(be))}else we={lane:be,tag:W.tag,payload:W.payload,callback:W.callback,next:null},Me===null?(ge=Me=we,ne=Ie):Me=Me.next=we,O|=be;if(W=W.next,W===null){if(W=b.shared.pending,W===null)break;we=W,W=we.next,we.next=null,b.lastBaseUpdate=we,b.shared.pending=null}}while(!0);Me===null&&(ne=Ie),b.baseState=ne,b.firstBaseUpdate=ge,b.lastBaseUpdate=Me,x===null&&(b.shared.lanes=0),lo|=O,i.lanes=O,i.memoizedState=Ie}}function NS(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function OS(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)NS(u[i],s)}var Sl=U(null),Of=U(0);function DS(i,s){i=Ma,I(Of,i),I(Sl,s),Ma=i|s.baseLanes}function Sg(){I(Of,Ma),I(Sl,Sl.current)}function Eg(){Ma=Of.current,G(Sl),G(Of)}var Kr=U(null),hi=null;function io(i){var s=i.alternate;I(qn,qn.current&1),I(Kr,i),hi===null&&(s===null||Sl.current!==null||s.memoizedState!==null)&&(hi=i)}function Cg(i){I(qn,qn.current),I(Kr,i),hi===null&&(hi=i)}function IS(i){i.tag===22?(I(qn,qn.current),I(Kr,i),hi===null&&(hi=i)):ao()}function ao(){I(qn,qn.current),I(Kr,Kr.current)}function Gr(i){G(Kr),hi===i&&(hi=null),G(qn)}var qn=U(0);function Df(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Ny(u)||Oy(u)))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 xa=0,jt=null,bn=null,Wn=null,If=!1,El=!1,ms=!1,Pf=0,lu=0,Cl=null,qI=0;function _n(){throw Error(r(321))}function Rg(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Wr(i[u],s[u]))return!1;return!0}function Tg(i,s,u,p,b,x){return xa=x,jt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,j.H=i===null||i.memoizedState===null?g1:Hg,ms=!1,x=u(p,b),ms=!1,El&&(x=LS(s,u,p,b)),PS(i),x}function PS(i){j.H=du;var s=bn!==null&&bn.next!==null;if(xa=0,Wn=bn=jt=null,If=!1,lu=0,Cl=null,s)throw Error(r(300));i===null||Yn||(i=i.dependencies,i!==null&&Cf(i)&&(Yn=!0))}function LS(i,s,u,p){jt=i;var b=0;do{if(El&&(Cl=null),lu=0,El=!1,25<=b)throw Error(r(301));if(b+=1,Wn=bn=null,i.updateQueue!=null){var x=i.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}j.H=y1,x=s(u,p)}while(El);return x}function VI(){var i=j.H,s=i.useState()[0];return s=typeof s.then=="function"?cu(s):s,i=i.useState()[0],(bn!==null?bn.memoizedState:null)!==i&&(jt.flags|=1024),s}function kg(){var i=Pf!==0;return Pf=0,i}function Mg(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Ag(i){if(If){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}If=!1}xa=0,Wn=bn=jt=null,El=!1,lu=Pf=0,Cl=null}function Sr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wn===null?jt.memoizedState=Wn=i:Wn=Wn.next=i,Wn}function Vn(){if(bn===null){var i=jt.alternate;i=i!==null?i.memoizedState:null}else i=bn.next;var s=Wn===null?jt.memoizedState:Wn.next;if(s!==null)Wn=s,bn=i;else{if(i===null)throw jt.alternate===null?Error(r(467)):Error(r(310));bn=i,i={memoizedState:bn.memoizedState,baseState:bn.baseState,baseQueue:bn.baseQueue,queue:bn.queue,next:null},Wn===null?jt.memoizedState=Wn=i:Wn=Wn.next=i}return Wn}function Lf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function cu(i){var s=lu;return lu+=1,Cl===null&&(Cl=[]),i=RS(Cl,i,s),s=jt,(Wn===null?s.memoizedState:Wn.next)===null&&(s=s.alternate,j.H=s===null||s.memoizedState===null?g1:Hg),i}function _f(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return cu(i);if(i.$$typeof===k)return ur(i)}throw Error(r(438,String(i)))}function Ng(i){var s=null,u=jt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=jt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(b){return b.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Lf(),jt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),p=0;p<i;p++)u[p]=F;return s.index++,u}function wa(i,s){return typeof s=="function"?s(i):s}function jf(i){var s=Vn();return Og(s,bn,i)}function Og(i,s,u){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var b=i.baseQueue,x=p.pending;if(x!==null){if(b!==null){var O=b.next;b.next=x.next,x.next=O}s.baseQueue=b=x,p.pending=null}if(x=i.baseState,b===null)i.memoizedState=x;else{s=b.next;var W=O=null,ne=null,ge=s,Me=!1;do{var Ie=ge.lane&-536870913;if(Ie!==ge.lane?(Gt&Ie)===Ie:(xa&Ie)===Ie){var be=ge.revertLane;if(be===0)ne!==null&&(ne=ne.next={lane:0,revertLane:0,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null}),Ie===bl&&(Me=!0);else if((xa&be)===be){ge=ge.next,be===bl&&(Me=!0);continue}else Ie={lane:0,revertLane:ge.revertLane,gesture:null,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(W=ne=Ie,O=x):ne=ne.next=Ie,jt.lanes|=be,lo|=be;Ie=ge.action,ms&&u(x,Ie),x=ge.hasEagerState?ge.eagerState:u(x,Ie)}else be={lane:Ie,revertLane:ge.revertLane,gesture:ge.gesture,action:ge.action,hasEagerState:ge.hasEagerState,eagerState:ge.eagerState,next:null},ne===null?(W=ne=be,O=x):ne=ne.next=be,jt.lanes|=Ie,lo|=Ie;ge=ge.next}while(ge!==null&&ge!==s);if(ne===null?O=x:ne.next=W,!Wr(x,i.memoizedState)&&(Yn=!0,Me&&(u=vl,u!==null)))throw u;i.memoizedState=x,i.baseState=O,i.baseQueue=ne,p.lastRenderedState=x}return b===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function Dg(i){var s=Vn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=u.dispatch,b=u.pending,x=s.memoizedState;if(b!==null){u.pending=null;var O=b=b.next;do x=i(x,O.action),O=O.next;while(O!==b);Wr(x,s.memoizedState)||(Yn=!0),s.memoizedState=x,s.baseQueue===null&&(s.baseState=x),u.lastRenderedState=x}return[x,p]}function _S(i,s,u){var p=jt,b=Vn(),x=tn;if(x){if(u===void 0)throw Error(r(407));u=u()}else u=s();var O=!Wr((bn||b).memoizedState,u);if(O&&(b.memoizedState=u,Yn=!0),b=b.queue,Lg(FS.bind(null,p,b,i),[i]),b.getSnapshot!==s||O||Wn!==null&&Wn.memoizedState.tag&1){if(p.flags|=2048,Rl(9,{destroy:void 0},zS.bind(null,p,b,u,s),null),wn===null)throw Error(r(349));x||(xa&127)!==0||jS(p,s,u)}return u}function jS(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=jt.updateQueue,s===null?(s=Lf(),jt.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function zS(i,s,u,p){s.value=u,s.getSnapshot=p,BS(s)&&HS(i)}function FS(i,s,u){return u(function(){BS(s)&&HS(i)})}function BS(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Wr(i,u)}catch{return!0}}function HS(i){var s=os(i,2);s!==null&&Lr(s,i,2)}function Ig(i){var s=Sr();if(typeof i=="function"){var u=i;if(i=u(),ms){Ze(!0);try{u()}finally{Ze(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:i},s}function US(i,s,u,p){return i.baseState=u,Og(i,bn,typeof p=="function"?p:wa)}function $I(i,s,u,p,b){if(Bf(i))throw Error(r(485));if(i=s.action,i!==null){var x={payload:b,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){x.listeners.push(O)}};j.T!==null?u(!0):x.isTransition=!1,p(x),u=s.pending,u===null?(x.next=s.pending=x,qS(s,x)):(x.next=u.next,s.pending=u.next=x)}}function qS(i,s){var u=s.action,p=s.payload,b=i.state;if(s.isTransition){var x=j.T,O={};j.T=O;try{var W=u(b,p),ne=j.S;ne!==null&&ne(O,W),VS(i,s,W)}catch(ge){Pg(i,s,ge)}finally{x!==null&&O.types!==null&&(x.types=O.types),j.T=x}}else try{x=u(b,p),VS(i,s,x)}catch(ge){Pg(i,s,ge)}}function VS(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){$S(i,s,p)},function(p){return Pg(i,s,p)}):$S(i,s,u)}function $S(i,s,u){s.status="fulfilled",s.value=u,WS(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,qS(i,u)))}function Pg(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,WS(s),s=s.next;while(s!==p)}i.action=null}function WS(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function YS(i,s){return s}function KS(i,s){if(tn){var u=wn.formState;if(u!==null){e:{var p=jt;if(tn){if(Rn){t:{for(var b=Rn,x=fi;b.nodeType!==8;){if(!x){b=null;break t}if(b=pi(b.nextSibling),b===null){b=null;break t}}x=b.data,b=x==="F!"||x==="F"?b:null}if(b){Rn=pi(b.nextSibling),p=b.data==="F!";break e}}Ja(p)}p=!1}p&&(s=u[0])}}return u=Sr(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:YS,lastRenderedState:s},u.queue=p,u=h1.bind(null,jt,p),p.dispatch=u,p=Ig(!1),x=Bg.bind(null,jt,!1,p.queue),p=Sr(),b={state:s,dispatch:null,action:i,pending:null},p.queue=b,u=$I.bind(null,jt,b,x,u),b.dispatch=u,p.memoizedState=i,[s,u,!1]}function GS(i){var s=Vn();return XS(s,bn,i)}function XS(i,s,u){if(s=Og(i,s,YS)[0],i=jf(wa)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=cu(s)}catch(O){throw O===xl?kf:O}else p=s;s=Vn();var b=s.queue,x=b.dispatch;return u!==s.memoizedState&&(jt.flags|=2048,Rl(9,{destroy:void 0},WI.bind(null,b,u),null)),[p,x,i]}function WI(i,s){i.action=s}function QS(i){var s=Vn(),u=bn;if(u!==null)return XS(s,u,i);Vn(),s=s.memoizedState,u=Vn();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function Rl(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=jt.updateQueue,s===null&&(s=Lf(),jt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,s.lastEffect=i),i}function ZS(){return Vn().memoizedState}function zf(i,s,u,p){var b=Sr();jt.flags|=i,b.memoizedState=Rl(1|s,{destroy:void 0},u,p===void 0?null:p)}function Ff(i,s,u,p){var b=Vn();p=p===void 0?null:p;var x=b.memoizedState.inst;bn!==null&&p!==null&&Rg(p,bn.memoizedState.deps)?b.memoizedState=Rl(s,x,u,p):(jt.flags|=i,b.memoizedState=Rl(1|s,x,u,p))}function JS(i,s){zf(8390656,8,i,s)}function Lg(i,s){Ff(2048,8,i,s)}function YI(i){jt.flags|=4;var s=jt.updateQueue;if(s===null)s=Lf(),jt.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function e1(i){var s=Vn().memoizedState;return YI({ref:s,nextImpl:i}),function(){if((fn&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function t1(i,s){return Ff(4,2,i,s)}function n1(i,s){return Ff(4,4,i,s)}function r1(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function i1(i,s,u){u=u!=null?u.concat([i]):null,Ff(4,4,r1.bind(null,s,i),u)}function _g(){}function a1(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&Rg(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function o1(i,s){var u=Vn();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&Rg(s,p[1]))return p[0];if(p=i(),ms){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p}function jg(i,s,u){return u===void 0||(xa&1073741824)!==0&&(Gt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=sE(),jt.lanes|=i,lo|=i,u)}function s1(i,s,u,p){return Wr(u,s)?u:Sl.current!==null?(i=jg(i,u,p),Wr(i,s)||(Yn=!0),i):(xa&42)===0||(xa&1073741824)!==0&&(Gt&261930)===0?(Yn=!0,i.memoizedState=u):(i=sE(),jt.lanes|=i,lo|=i,s)}function l1(i,s,u,p,b){var x=z.p;z.p=x!==0&&8>x?x:8;var O=j.T,W={};j.T=W,Bg(i,!1,s,u);try{var ne=b(),ge=j.S;if(ge!==null&&ge(W,ne),ne!==null&&typeof ne=="object"&&typeof ne.then=="function"){var Me=UI(ne,p);uu(i,s,Me,Zr(i))}else uu(i,s,p,Zr(i))}catch(Ie){uu(i,s,{then:function(){},status:"rejected",reason:Ie},Zr())}finally{z.p=x,O!==null&&W.types!==null&&(O.types=W.types),j.T=O}}function KI(){}function zg(i,s,u,p){if(i.tag!==5)throw Error(r(476));var b=c1(i).queue;l1(i,b,s,H,u===null?KI:function(){return u1(i),u(p)})}function c1(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:H},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function u1(i){var s=c1(i);s.next===null&&(s=i.alternate.memoizedState),uu(i,s.next.queue,{},Zr())}function Fg(){return ur(ku)}function d1(){return Vn().memoizedState}function f1(){return Vn().memoizedState}function GI(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=Zr();i=no(u);var p=ro(s,i,u);p!==null&&(Lr(p,s,u),au(p,s,u)),s={cache:pg()},i.payload=s;return}s=s.return}}function XI(i,s,u){var p=Zr();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Bf(i)?p1(s,u):(u=rg(i,s,u,p),u!==null&&(Lr(u,i,p),m1(u,s,p)))}function h1(i,s,u){var p=Zr();uu(i,s,u,p)}function uu(i,s,u,p){var b={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Bf(i))p1(s,b);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=s.lastRenderedReducer,x!==null))try{var O=s.lastRenderedState,W=x(O,u);if(b.hasEagerState=!0,b.eagerState=W,Wr(W,O))return xf(i,s,b,0),wn===null&&vf(),!1}catch{}finally{}if(u=rg(i,s,b,p),u!==null)return Lr(u,i,p),m1(u,s,p),!0}return!1}function Bg(i,s,u,p){if(p={lane:2,revertLane:by(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Bf(i)){if(s)throw Error(r(479))}else s=rg(i,u,p,2),s!==null&&Lr(s,i,2)}function Bf(i){var s=i.alternate;return i===jt||s!==null&&s===jt}function p1(i,s){El=If=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function m1(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,X(i,u)}}var du={readContext:ur,use:_f,useCallback:_n,useContext:_n,useEffect:_n,useImperativeHandle:_n,useLayoutEffect:_n,useInsertionEffect:_n,useMemo:_n,useReducer:_n,useRef:_n,useState:_n,useDebugValue:_n,useDeferredValue:_n,useTransition:_n,useSyncExternalStore:_n,useId:_n,useHostTransitionStatus:_n,useFormState:_n,useActionState:_n,useOptimistic:_n,useMemoCache:_n,useCacheRefresh:_n};du.useEffectEvent=_n;var g1={readContext:ur,use:_f,useCallback:function(i,s){return Sr().memoizedState=[i,s===void 0?null:s],i},useContext:ur,useEffect:JS,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,zf(4194308,4,r1.bind(null,s,i),u)},useLayoutEffect:function(i,s){return zf(4194308,4,i,s)},useInsertionEffect:function(i,s){zf(4,2,i,s)},useMemo:function(i,s){var u=Sr();s=s===void 0?null:s;var p=i();if(ms){Ze(!0);try{i()}finally{Ze(!1)}}return u.memoizedState=[p,s],p},useReducer:function(i,s,u){var p=Sr();if(u!==void 0){var b=u(s);if(ms){Ze(!0);try{u(s)}finally{Ze(!1)}}}else b=s;return p.memoizedState=p.baseState=b,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:b},p.queue=i,i=i.dispatch=XI.bind(null,jt,i),[p.memoizedState,i]},useRef:function(i){var s=Sr();return i={current:i},s.memoizedState=i},useState:function(i){i=Ig(i);var s=i.queue,u=h1.bind(null,jt,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:_g,useDeferredValue:function(i,s){var u=Sr();return jg(u,i,s)},useTransition:function(){var i=Ig(!1);return i=l1.bind(null,jt,i.queue,!0,!1),Sr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=jt,b=Sr();if(tn){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),wn===null)throw Error(r(349));(Gt&127)!==0||jS(p,s,u)}b.memoizedState=u;var x={value:u,getSnapshot:s};return b.queue=x,JS(FS.bind(null,p,x,i),[i]),p.flags|=2048,Rl(9,{destroy:void 0},zS.bind(null,p,x,u,s),null),u},useId:function(){var i=Sr(),s=wn.identifierPrefix;if(tn){var u=Wi,p=$i;u=(p&~(1<<32-tt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Pf++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=qI++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Fg,useFormState:KS,useActionState:KS,useOptimistic:function(i){var s=Sr();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Bg.bind(null,jt,!0,u),u.dispatch=s,[i,s]},useMemoCache:Ng,useCacheRefresh:function(){return Sr().memoizedState=GI.bind(null,jt)},useEffectEvent:function(i){var s=Sr(),u={impl:i};return s.memoizedState=u,function(){if((fn&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Hg={readContext:ur,use:_f,useCallback:a1,useContext:ur,useEffect:Lg,useImperativeHandle:i1,useInsertionEffect:t1,useLayoutEffect:n1,useMemo:o1,useReducer:jf,useRef:ZS,useState:function(){return jf(wa)},useDebugValue:_g,useDeferredValue:function(i,s){var u=Vn();return s1(u,bn.memoizedState,i,s)},useTransition:function(){var i=jf(wa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:cu(i),s]},useSyncExternalStore:_S,useId:d1,useHostTransitionStatus:Fg,useFormState:GS,useActionState:GS,useOptimistic:function(i,s){var u=Vn();return US(u,bn,i,s)},useMemoCache:Ng,useCacheRefresh:f1};Hg.useEffectEvent=e1;var y1={readContext:ur,use:_f,useCallback:a1,useContext:ur,useEffect:Lg,useImperativeHandle:i1,useInsertionEffect:t1,useLayoutEffect:n1,useMemo:o1,useReducer:Dg,useRef:ZS,useState:function(){return Dg(wa)},useDebugValue:_g,useDeferredValue:function(i,s){var u=Vn();return bn===null?jg(u,i,s):s1(u,bn.memoizedState,i,s)},useTransition:function(){var i=Dg(wa)[0],s=Vn().memoizedState;return[typeof i=="boolean"?i:cu(i),s]},useSyncExternalStore:_S,useId:d1,useHostTransitionStatus:Fg,useFormState:QS,useActionState:QS,useOptimistic:function(i,s){var u=Vn();return bn!==null?US(u,bn,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Ng,useCacheRefresh:f1};y1.useEffectEvent=e1;function Ug(i,s,u,p){s=i.memoizedState,u=u(p,s),u=u==null?s:h({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var qg={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=Zr(),b=no(p);b.payload=s,u!=null&&(b.callback=u),s=ro(i,b,p),s!==null&&(Lr(s,i,p),au(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=Zr(),b=no(p);b.tag=1,b.payload=s,u!=null&&(b.callback=u),s=ro(i,b,p),s!==null&&(Lr(s,i,p),au(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Zr(),p=no(u);p.tag=2,s!=null&&(p.callback=s),s=ro(i,p,u),s!==null&&(Lr(s,i,u),au(s,i,u))}};function b1(i,s,u,p,b,x,O){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,x,O):s.prototype&&s.prototype.isPureReactComponent?!Qc(u,p)||!Qc(b,x):!0}function v1(i,s,u,p){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==i&&qg.enqueueReplaceState(s,s.state,null)}function gs(i,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(i=i.defaultProps){u===s&&(u=h({},u));for(var b in i)u[b]===void 0&&(u[b]=i[b])}return u}function x1(i){bf(i)}function w1(i){console.error(i)}function S1(i){bf(i)}function Hf(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function E1(i,s,u){try{var p=i.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(b){setTimeout(function(){throw b})}}function Vg(i,s,u){return u=no(u),u.tag=3,u.payload={element:null},u.callback=function(){Hf(i,s)},u}function C1(i){return i=no(i),i.tag=3,i}function R1(i,s,u,p){var b=u.type.getDerivedStateFromError;if(typeof b=="function"){var x=p.value;i.payload=function(){return b(x)},i.callback=function(){E1(s,u,p)}}var O=u.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(i.callback=function(){E1(s,u,p),typeof b!="function"&&(co===null?co=new Set([this]):co.add(this));var W=p.stack;this.componentDidCatch(p.value,{componentStack:W!==null?W:""})})}function QI(i,s,u,p,b){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&yl(s,u,b,!0),u=Kr.current,u!==null){switch(u.tag){case 31:case 13:return hi===null?Jf():u.alternate===null&&jn===0&&(jn=3),u.flags&=-257,u.flags|=65536,u.lanes=b,p===Mf?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),my(i,p,b)),!1;case 22:return u.flags|=65536,p===Mf?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),my(i,p,b)),!1}throw Error(r(435,u.tag))}return my(i,p,b),Jf(),!1}if(tn)return s=Kr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=b,p!==cg&&(i=Error(r(422),{cause:p}),eu(ci(i,u)))):(p!==cg&&(s=Error(r(423),{cause:p}),eu(ci(s,u))),i=i.current.alternate,i.flags|=65536,b&=-b,i.lanes|=b,p=ci(p,u),b=Vg(i.stateNode,p,b),xg(i,b),jn!==4&&(jn=2)),!1;var x=Error(r(520),{cause:p});if(x=ci(x,u),vu===null?vu=[x]:vu.push(x),jn!==4&&(jn=2),s===null)return!0;p=ci(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=b&-b,u.lanes|=i,i=Vg(u.stateNode,p,i),xg(u,i),!1;case 1:if(s=u.type,x=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(co===null||!co.has(x))))return u.flags|=65536,b&=-b,u.lanes|=b,b=C1(b),R1(b,i,u,p),xg(u,b),!1}u=u.return}while(u!==null);return!1}var $g=Error(r(461)),Yn=!1;function dr(i,s,u,p){s.child=i===null?AS(s,null,u,p):ps(s,i.child,u,p)}function T1(i,s,u,p,b){u=u.render;var x=s.ref;if("ref"in p){var O={};for(var W in p)W!=="ref"&&(O[W]=p[W])}else O=p;return us(s),p=Tg(i,s,u,O,x,b),W=kg(),i!==null&&!Yn?(Mg(i,s,b),Sa(i,s,b)):(tn&&W&&sg(s),s.flags|=1,dr(i,s,p,b),s.child)}function k1(i,s,u,p,b){if(i===null){var x=u.type;return typeof x=="function"&&!ig(x)&&x.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=x,M1(i,s,x,p,b)):(i=Sf(u.type,null,p,s,s.mode,b),i.ref=s.ref,i.return=s,s.child=i)}if(x=i.child,!Jg(i,b)){var O=x.memoizedProps;if(u=u.compare,u=u!==null?u:Qc,u(O,p)&&i.ref===s.ref)return Sa(i,s,b)}return s.flags|=1,i=ga(x,p),i.ref=s.ref,i.return=s,s.child=i}function M1(i,s,u,p,b){if(i!==null){var x=i.memoizedProps;if(Qc(x,p)&&i.ref===s.ref)if(Yn=!1,s.pendingProps=p=x,Jg(i,b))(i.flags&131072)!==0&&(Yn=!0);else return s.lanes=i.lanes,Sa(i,s,b)}return Wg(i,s,u,p,b)}function A1(i,s,u,p){var b=p.children,x=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(x=x!==null?x.baseLanes|u:u,i!==null){for(p=s.child=i.child,b=0;p!==null;)b=b|p.lanes|p.childLanes,p=p.sibling;p=b&~x}else p=0,s.child=null;return N1(i,s,x,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&Tf(s,x!==null?x.cachePool:null),x!==null?DS(s,x):Sg(),IS(s);else return p=s.lanes=536870912,N1(i,s,x!==null?x.baseLanes|u:u,u,p)}else x!==null?(Tf(s,x.cachePool),DS(s,x),ao(),s.memoizedState=null):(i!==null&&Tf(s,null),Sg(),ao());return dr(i,s,b,u),s.child}function fu(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function N1(i,s,u,p,b){var x=gg();return x=x===null?null:{parent:$n._currentValue,pool:x},s.memoizedState={baseLanes:u,cachePool:x},i!==null&&Tf(s,null),Sg(),IS(s),i!==null&&yl(i,s,p,!0),s.childLanes=b,null}function Uf(i,s){return s=Vf({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function O1(i,s,u){return ps(s,i.child,null,u),i=Uf(s,s.pendingProps),i.flags|=2,Gr(s),s.memoizedState=null,i}function ZI(i,s,u){var p=s.pendingProps,b=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(tn){if(p.mode==="hidden")return i=Uf(s,p),s.lanes=536870912,fu(null,i);if(Cg(s),(i=Rn)?(i=qE(i,fi),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Qa!==null?{id:$i,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},u=pS(i),u.return=s,s.child=u,cr=s,Rn=null)):i=null,i===null)throw Ja(s);return s.lanes=536870912,null}return Uf(s,p)}var x=i.memoizedState;if(x!==null){var O=x.dehydrated;if(Cg(s),b)if(s.flags&256)s.flags&=-257,s=O1(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(Yn||yl(i,s,u,!1),b=(u&i.childLanes)!==0,Yn||b){if(p=wn,p!==null&&(O=ie(p,u),O!==0&&O!==x.retryLane))throw x.retryLane=O,os(i,O),Lr(p,i,O),$g;Jf(),s=O1(i,s,u)}else i=x.treeContext,Rn=pi(O.nextSibling),cr=s,tn=!0,Za=null,fi=!1,i!==null&&yS(s,i),s=Uf(s,p),s.flags|=4096;return s}return i=ga(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function qf(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function Wg(i,s,u,p,b){return us(s),u=Tg(i,s,u,p,void 0,b),p=kg(),i!==null&&!Yn?(Mg(i,s,b),Sa(i,s,b)):(tn&&p&&sg(s),s.flags|=1,dr(i,s,u,b),s.child)}function D1(i,s,u,p,b,x){return us(s),s.updateQueue=null,u=LS(s,p,u,b),PS(i),p=kg(),i!==null&&!Yn?(Mg(i,s,x),Sa(i,s,x)):(tn&&p&&sg(s),s.flags|=1,dr(i,s,u,x),s.child)}function I1(i,s,u,p,b){if(us(s),s.stateNode===null){var x=hl,O=u.contextType;typeof O=="object"&&O!==null&&(x=ur(O)),x=new u(p,x),s.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=qg,s.stateNode=x,x._reactInternals=s,x=s.stateNode,x.props=p,x.state=s.memoizedState,x.refs={},bg(s),O=u.contextType,x.context=typeof O=="object"&&O!==null?ur(O):hl,x.state=s.memoizedState,O=u.getDerivedStateFromProps,typeof O=="function"&&(Ug(s,u,O,p),x.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(O=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),O!==x.state&&qg.enqueueReplaceState(x,x.state,null),su(s,p,x,b),ou(),x.state=s.memoizedState),typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(i===null){x=s.stateNode;var W=s.memoizedProps,ne=gs(u,W);x.props=ne;var ge=x.context,Me=u.contextType;O=hl,typeof Me=="object"&&Me!==null&&(O=ur(Me));var Ie=u.getDerivedStateFromProps;Me=typeof Ie=="function"||typeof x.getSnapshotBeforeUpdate=="function",W=s.pendingProps!==W,Me||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(W||ge!==O)&&v1(s,x,p,O),to=!1;var be=s.memoizedState;x.state=be,su(s,p,x,b),ou(),ge=s.memoizedState,W||be!==ge||to?(typeof Ie=="function"&&(Ug(s,u,Ie,p),ge=s.memoizedState),(ne=to||b1(s,u,ne,p,be,ge,O))?(Me||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=ge),x.props=p,x.state=ge,x.context=O,p=ne):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{x=s.stateNode,vg(i,s),O=s.memoizedProps,Me=gs(u,O),x.props=Me,Ie=s.pendingProps,be=x.context,ge=u.contextType,ne=hl,typeof ge=="object"&&ge!==null&&(ne=ur(ge)),W=u.getDerivedStateFromProps,(ge=typeof W=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(O!==Ie||be!==ne)&&v1(s,x,p,ne),to=!1,be=s.memoizedState,x.state=be,su(s,p,x,b),ou();var we=s.memoizedState;O!==Ie||be!==we||to||i!==null&&i.dependencies!==null&&Cf(i.dependencies)?(typeof W=="function"&&(Ug(s,u,W,p),we=s.memoizedState),(Me=to||b1(s,u,Me,p,be,we,ne)||i!==null&&i.dependencies!==null&&Cf(i.dependencies))?(ge||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(p,we,ne),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(p,we,ne)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=we),x.props=p,x.state=we,x.context=ne,p=Me):(typeof x.componentDidUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||O===i.memoizedProps&&be===i.memoizedState||(s.flags|=1024),p=!1)}return x=p,qf(i,s),p=(s.flags&128)!==0,x||p?(x=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:x.render(),s.flags|=1,i!==null&&p?(s.child=ps(s,i.child,null,b),s.child=ps(s,null,u,b)):dr(i,s,u,b),s.memoizedState=x.state,i=s.child):i=Sa(i,s,b),i}function P1(i,s,u,p){return ls(),s.flags|=256,dr(i,s,u,p),s.child}var Yg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Kg(i){return{baseLanes:i,cachePool:ES()}}function Gg(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Qr),i}function L1(i,s,u){var p=s.pendingProps,b=!1,x=(s.flags&128)!==0,O;if((O=x)||(O=i!==null&&i.memoizedState===null?!1:(qn.current&2)!==0),O&&(b=!0,s.flags&=-129),O=(s.flags&32)!==0,s.flags&=-33,i===null){if(tn){if(b?io(s):ao(),(i=Rn)?(i=qE(i,fi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Qa!==null?{id:$i,overflow:Wi}:null,retryLane:536870912,hydrationErrors:null},u=pS(i),u.return=s,s.child=u,cr=s,Rn=null)):i=null,i===null)throw Ja(s);return Oy(i)?s.lanes=32:s.lanes=536870912,null}var W=p.children;return p=p.fallback,b?(ao(),b=s.mode,W=Vf({mode:"hidden",children:W},b),p=ss(p,b,u,null),W.return=s,p.return=s,W.sibling=p,s.child=W,p=s.child,p.memoizedState=Kg(u),p.childLanes=Gg(i,O,u),s.memoizedState=Yg,fu(null,p)):(io(s),Xg(s,W))}var ne=i.memoizedState;if(ne!==null&&(W=ne.dehydrated,W!==null)){if(x)s.flags&256?(io(s),s.flags&=-257,s=Qg(i,s,u)):s.memoizedState!==null?(ao(),s.child=i.child,s.flags|=128,s=null):(ao(),W=p.fallback,b=s.mode,p=Vf({mode:"visible",children:p.children},b),W=ss(W,b,u,null),W.flags|=2,p.return=s,W.return=s,p.sibling=W,s.child=p,ps(s,i.child,null,u),p=s.child,p.memoizedState=Kg(u),p.childLanes=Gg(i,O,u),s.memoizedState=Yg,s=fu(null,p));else if(io(s),Oy(W)){if(O=W.nextSibling&&W.nextSibling.dataset,O)var ge=O.dgst;O=ge,p=Error(r(419)),p.stack="",p.digest=O,eu({value:p,source:null,stack:null}),s=Qg(i,s,u)}else if(Yn||yl(i,s,u,!1),O=(u&i.childLanes)!==0,Yn||O){if(O=wn,O!==null&&(p=ie(O,u),p!==0&&p!==ne.retryLane))throw ne.retryLane=p,os(i,p),Lr(O,i,p),$g;Ny(W)||Jf(),s=Qg(i,s,u)}else Ny(W)?(s.flags|=192,s.child=i.child,s=null):(i=ne.treeContext,Rn=pi(W.nextSibling),cr=s,tn=!0,Za=null,fi=!1,i!==null&&yS(s,i),s=Xg(s,p.children),s.flags|=4096);return s}return b?(ao(),W=p.fallback,b=s.mode,ne=i.child,ge=ne.sibling,p=ga(ne,{mode:"hidden",children:p.children}),p.subtreeFlags=ne.subtreeFlags&65011712,ge!==null?W=ga(ge,W):(W=ss(W,b,u,null),W.flags|=2),W.return=s,p.return=s,p.sibling=W,s.child=p,fu(null,p),p=s.child,W=i.child.memoizedState,W===null?W=Kg(u):(b=W.cachePool,b!==null?(ne=$n._currentValue,b=b.parent!==ne?{parent:ne,pool:ne}:b):b=ES(),W={baseLanes:W.baseLanes|u,cachePool:b}),p.memoizedState=W,p.childLanes=Gg(i,O,u),s.memoizedState=Yg,fu(i.child,p)):(io(s),u=i.child,i=u.sibling,u=ga(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,i!==null&&(O=s.deletions,O===null?(s.deletions=[i],s.flags|=16):O.push(i)),s.child=u,s.memoizedState=null,u)}function Xg(i,s){return s=Vf({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Vf(i,s){return i=Yr(22,i,null,s),i.lanes=0,i}function Qg(i,s,u){return ps(s,i.child,null,u),i=Xg(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function _1(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),fg(i.return,s,u)}function Zg(i,s,u,p,b,x){var O=i.memoizedState;O===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:b,treeForkCount:x}:(O.isBackwards=s,O.rendering=null,O.renderingStartTime=0,O.last=p,O.tail=u,O.tailMode=b,O.treeForkCount=x)}function j1(i,s,u){var p=s.pendingProps,b=p.revealOrder,x=p.tail;p=p.children;var O=qn.current,W=(O&2)!==0;if(W?(O=O&1|2,s.flags|=128):O&=1,I(qn,O),dr(i,s,p,u),p=tn?Jc:0,!W&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&_1(i,u,s);else if(i.tag===19)_1(i,u,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(b){case"forwards":for(u=s.child,b=null;u!==null;)i=u.alternate,i!==null&&Df(i)===null&&(b=u),u=u.sibling;u=b,u===null?(b=s.child,s.child=null):(b=u.sibling,u.sibling=null),Zg(s,!1,b,u,x,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,b=s.child,s.child=null;b!==null;){if(i=b.alternate,i!==null&&Df(i)===null){s.child=b;break}i=b.sibling,b.sibling=u,u=b,b=i}Zg(s,!0,u,null,x,p);break;case"together":Zg(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Sa(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),lo|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(yl(i,s,u,!1),(u&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,u=ga(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=ga(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function Jg(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Cf(i)))}function JI(i,s,u){switch(s.tag){case 3:ue(s,s.stateNode.containerInfo),eo(s,$n,i.memoizedState.cache),ls();break;case 27:case 5:Se(s);break;case 4:ue(s,s.stateNode.containerInfo);break;case 10:eo(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Cg(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(io(s),s.flags|=128,null):(u&s.child.childLanes)!==0?L1(i,s,u):(io(s),i=Sa(i,s,u),i!==null?i.sibling:null);io(s);break;case 19:var b=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(yl(i,s,u,!1),p=(u&s.childLanes)!==0),b){if(p)return j1(i,s,u);s.flags|=128}if(b=s.memoizedState,b!==null&&(b.rendering=null,b.tail=null,b.lastEffect=null),I(qn,qn.current),p)break;return null;case 22:return s.lanes=0,A1(i,s,u,s.pendingProps);case 24:eo(s,$n,i.memoizedState.cache)}return Sa(i,s,u)}function z1(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Yn=!0;else{if(!Jg(i,u)&&(s.flags&128)===0)return Yn=!1,JI(i,s,u);Yn=(i.flags&131072)!==0}else Yn=!1,tn&&(s.flags&1048576)!==0&&gS(s,Jc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(i=fs(s.elementType),s.type=i,typeof i=="function")ig(i)?(p=gs(i,p),s.tag=1,s=I1(null,s,i,p,u)):(s.tag=0,s=Wg(null,s,i,p,u));else{if(i!=null){var b=i.$$typeof;if(b===M){s.tag=11,s=T1(null,s,i,p,u);break e}else if(b===N){s.tag=14,s=k1(null,s,i,p,u);break e}}throw s=$(i)||i,Error(r(306,s,""))}}return s;case 0:return Wg(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,b=gs(p,s.pendingProps),I1(i,s,p,b,u);case 3:e:{if(ue(s,s.stateNode.containerInfo),i===null)throw Error(r(387));p=s.pendingProps;var x=s.memoizedState;b=x.element,vg(i,s),su(s,p,null,u);var O=s.memoizedState;if(p=O.cache,eo(s,$n,p),p!==x.cache&&hg(s,[$n],u,!0),ou(),p=O.element,x.isDehydrated)if(x={element:p,isDehydrated:!1,cache:O.cache},s.updateQueue.baseState=x,s.memoizedState=x,s.flags&256){s=P1(i,s,p,u);break e}else if(p!==b){b=ci(Error(r(424)),s),eu(b),s=P1(i,s,p,u);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(Rn=pi(i.firstChild),cr=s,tn=!0,Za=null,fi=!0,u=AS(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ls(),p===b){s=Sa(i,s,u);break e}dr(i,s,p,u)}s=s.child}return s;case 26:return qf(i,s),i===null?(u=GE(s.type,null,s.pendingProps,null))?s.memoizedState=u:tn||(u=s.type,i=s.pendingProps,p=oh(ae.current).createElement(u),p[Ye]=s,p[Xe]=i,fr(p,u,i),An(p),s.stateNode=p):s.memoizedState=GE(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Se(s),i===null&&tn&&(p=s.stateNode=WE(s.type,s.pendingProps,ae.current),cr=s,fi=!0,b=Rn,po(s.type)?(Dy=b,Rn=pi(p.firstChild)):Rn=b),dr(i,s,s.pendingProps.children,u),qf(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&tn&&((b=p=Rn)&&(p=AP(p,s.type,s.pendingProps,fi),p!==null?(s.stateNode=p,cr=s,Rn=pi(p.firstChild),fi=!1,b=!0):b=!1),b||Ja(s)),Se(s),b=s.type,x=s.pendingProps,O=i!==null?i.memoizedProps:null,p=x.children,ky(b,x)?p=null:O!==null&&ky(b,O)&&(s.flags|=32),s.memoizedState!==null&&(b=Tg(i,s,VI,null,null,u),ku._currentValue=b),qf(i,s),dr(i,s,p,u),s.child;case 6:return i===null&&tn&&((i=u=Rn)&&(u=NP(u,s.pendingProps,fi),u!==null?(s.stateNode=u,cr=s,Rn=null,i=!0):i=!1),i||Ja(s)),null;case 13:return L1(i,s,u);case 4:return ue(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=ps(s,null,p,u):dr(i,s,p,u),s.child;case 11:return T1(i,s,s.type,s.pendingProps,u);case 7:return dr(i,s,s.pendingProps,u),s.child;case 8:return dr(i,s,s.pendingProps.children,u),s.child;case 12:return dr(i,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,eo(s,s.type,p.value),dr(i,s,p.children,u),s.child;case 9:return b=s.type._context,p=s.pendingProps.children,us(s),b=ur(b),p=p(b),s.flags|=1,dr(i,s,p,u),s.child;case 14:return k1(i,s,s.type,s.pendingProps,u);case 15:return M1(i,s,s.type,s.pendingProps,u);case 19:return j1(i,s,u);case 31:return ZI(i,s,u);case 22:return A1(i,s,u,s.pendingProps);case 24:return us(s),p=ur($n),i===null?(b=gg(),b===null&&(b=wn,x=pg(),b.pooledCache=x,x.refCount++,x!==null&&(b.pooledCacheLanes|=u),b=x),s.memoizedState={parent:p,cache:b},bg(s),eo(s,$n,b)):((i.lanes&u)!==0&&(vg(i,s),su(s,null,null,u),ou()),b=i.memoizedState,x=s.memoizedState,b.parent!==p?(b={parent:p,cache:p},s.memoizedState=b,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=b),eo(s,$n,p)):(p=x.cache,eo(s,$n,p),p!==b.cache&&hg(s,[$n],u,!0))),dr(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Ea(i){i.flags|=4}function ey(i,s,u,p,b){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(b&335544128)===b)if(i.stateNode.complete)i.flags|=8192;else if(dE())i.flags|=8192;else throw hs=Mf,yg}else i.flags&=-16777217}function F1(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!eC(s))if(dE())i.flags|=8192;else throw hs=Mf,yg}function $f(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Tt():536870912,i.lanes|=s,Al|=s)}function hu(i,s){if(!tn)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function Tn(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(s)for(var b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags&65011712,p|=b.flags&65011712,b.return=i,b=b.sibling;else for(b=i.child;b!==null;)u|=b.lanes|b.childLanes,p|=b.subtreeFlags,p|=b.flags,b.return=i,b=b.sibling;return i.subtreeFlags|=p,i.childLanes=u,s}function eP(i,s,u){var p=s.pendingProps;switch(lg(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(s),null;case 1:return Tn(s),null;case 3:return u=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),va($n),ve(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(gl(s)?Ea(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,ug())),Tn(s),null;case 26:var b=s.type,x=s.memoizedState;return i===null?(Ea(s),x!==null?(Tn(s),F1(s,x)):(Tn(s),ey(s,b,null,p,u))):x?x!==i.memoizedState?(Ea(s),Tn(s),F1(s,x)):(Tn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&Ea(s),Tn(s),ey(s,b,i,p,u)),null;case 27:if(Le(s),u=ae.current,b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ea(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Tn(s),null}i=Q.current,gl(s)?bS(s):(i=WE(b,p,u),s.stateNode=i,Ea(s))}return Tn(s),null;case 5:if(Le(s),b=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Ea(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Tn(s),null}if(x=Q.current,gl(s))bS(s);else{var O=oh(ae.current);switch(x){case 1:x=O.createElementNS("http://www.w3.org/2000/svg",b);break;case 2:x=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;default:switch(b){case"svg":x=O.createElementNS("http://www.w3.org/2000/svg",b);break;case"math":x=O.createElementNS("http://www.w3.org/1998/Math/MathML",b);break;case"script":x=O.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof p.is=="string"?O.createElement("select",{is:p.is}):O.createElement("select"),p.multiple?x.multiple=!0:p.size&&(x.size=p.size);break;default:x=typeof p.is=="string"?O.createElement(b,{is:p.is}):O.createElement(b)}}x[Ye]=s,x[Xe]=p;e:for(O=s.child;O!==null;){if(O.tag===5||O.tag===6)x.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===s)break e;for(;O.sibling===null;){if(O.return===null||O.return===s)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}s.stateNode=x;e:switch(fr(x,b,p),b){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Ea(s)}}return Tn(s),ey(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&Ea(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=ae.current,gl(s)){if(i=s.stateNode,u=s.memoizedProps,p=null,b=cr,b!==null)switch(b.tag){case 27:case 5:p=b.memoizedProps}i[Ye]=s,i=!!(i.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||LE(i.nodeValue,u)),i||Ja(s,!0)}else i=oh(i).createTextNode(p),i[Ye]=s,s.stateNode=i}return Tn(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(p=gl(s),u!==null){if(i===null){if(!p)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Ye]=s}else ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Tn(s),i=!1}else u=ug(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Gr(s),s):(Gr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Tn(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(b=gl(s),p!==null&&p.dehydrated!==null){if(i===null){if(!b)throw Error(r(318));if(b=s.memoizedState,b=b!==null?b.dehydrated:null,!b)throw Error(r(317));b[Ye]=s}else ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Tn(s),b=!1}else b=ug(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=b),b=!0;if(!b)return s.flags&256?(Gr(s),s):(Gr(s),null)}return Gr(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,i=i!==null&&i.memoizedState!==null,u&&(p=s.child,b=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(b=p.alternate.memoizedState.cachePool.pool),x=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(x=p.memoizedState.cachePool.pool),x!==b&&(p.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),$f(s,s.updateQueue),Tn(s),null);case 4:return ve(),i===null&&Sy(s.stateNode.containerInfo),Tn(s),null;case 10:return va(s.type),Tn(s),null;case 19:if(G(qn),p=s.memoizedState,p===null)return Tn(s),null;if(b=(s.flags&128)!==0,x=p.rendering,x===null)if(b)hu(p,!1);else{if(jn!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(x=Df(i),x!==null){for(s.flags|=128,hu(p,!1),i=x.updateQueue,s.updateQueue=i,$f(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)hS(u,i),u=u.sibling;return I(qn,qn.current&1|2),tn&&ya(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&De()>Xf&&(s.flags|=128,b=!0,hu(p,!1),s.lanes=4194304)}else{if(!b)if(i=Df(x),i!==null){if(s.flags|=128,b=!0,i=i.updateQueue,s.updateQueue=i,$f(s,i),hu(p,!0),p.tail===null&&p.tailMode==="hidden"&&!x.alternate&&!tn)return Tn(s),null}else 2*De()-p.renderingStartTime>Xf&&u!==536870912&&(s.flags|=128,b=!0,hu(p,!1),s.lanes=4194304);p.isBackwards?(x.sibling=s.child,s.child=x):(i=p.last,i!==null?i.sibling=x:s.child=x,p.last=x)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=De(),i.sibling=null,u=qn.current,I(qn,b?u&1|2:u&1),tn&&ya(s,p.treeForkCount),i):(Tn(s),null);case 22:case 23:return Gr(s),Eg(),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(Tn(s),s.subtreeFlags&6&&(s.flags|=8192)):Tn(s),u=s.updateQueue,u!==null&&$f(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),i!==null&&G(ds),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),va($n),Tn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function tP(i,s){switch(lg(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return va($n),ve(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Le(s),null;case 31:if(s.memoizedState!==null){if(Gr(s),s.alternate===null)throw Error(r(340));ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(Gr(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return G(qn),null;case 4:return ve(),null;case 10:return va(s.type),null;case 22:case 23:return Gr(s),Eg(),i!==null&&G(ds),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return va($n),null;case 25:return null;default:return null}}function B1(i,s){switch(lg(s),s.tag){case 3:va($n),ve();break;case 26:case 27:case 5:Le(s);break;case 4:ve();break;case 31:s.memoizedState!==null&&Gr(s);break;case 13:Gr(s);break;case 19:G(qn);break;case 10:va(s.type);break;case 22:case 23:Gr(s),Eg(),i!==null&&G(ds);break;case 24:va($n)}}function pu(i,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var b=p.next;u=b;do{if((u.tag&i)===i){p=void 0;var x=u.create,O=u.inst;p=x(),O.destroy=p}u=u.next}while(u!==b)}}catch(W){yn(s,s.return,W)}}function oo(i,s,u){try{var p=s.updateQueue,b=p!==null?p.lastEffect:null;if(b!==null){var x=b.next;p=x;do{if((p.tag&i)===i){var O=p.inst,W=O.destroy;if(W!==void 0){O.destroy=void 0,b=s;var ne=u,ge=W;try{ge()}catch(Me){yn(b,ne,Me)}}}p=p.next}while(p!==x)}}catch(Me){yn(s,s.return,Me)}}function H1(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{OS(s,u)}catch(p){yn(i,i.return,p)}}}function U1(i,s,u){u.props=gs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){yn(i,s,p)}}function mu(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof u=="function"?i.refCleanup=u(p):u.current=p}}catch(b){yn(i,s,b)}}function Yi(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(b){yn(i,s,b)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(b){yn(i,s,b)}else u.current=null}function q1(i){var s=i.type,u=i.memoizedProps,p=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(b){yn(i,i.return,b)}}function ty(i,s,u){try{var p=i.stateNode;EP(p,i.type,u,s),p[Xe]=s}catch(b){yn(i,i.return,b)}}function V1(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&po(i.type)||i.tag===4}function ny(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||V1(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&&po(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 ry(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=pa));else if(p!==4&&(p===27&&po(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(ry(i,s,u),i=i.sibling;i!==null;)ry(i,s,u),i=i.sibling}function Wf(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(p!==4&&(p===27&&po(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Wf(i,s,u),i=i.sibling;i!==null;)Wf(i,s,u),i=i.sibling}function $1(i){var s=i.stateNode,u=i.memoizedProps;try{for(var p=i.type,b=s.attributes;b.length;)s.removeAttributeNode(b[0]);fr(s,p,u),s[Ye]=i,s[Xe]=u}catch(x){yn(i,i.return,x)}}var Ca=!1,Kn=!1,iy=!1,W1=typeof WeakSet=="function"?WeakSet:Set,ir=null;function nP(i,s){if(i=i.containerInfo,Ry=hh,i=iS(i),Qm(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var b=p.anchorOffset,x=p.focusNode;p=p.focusOffset;try{u.nodeType,x.nodeType}catch{u=null;break e}var O=0,W=-1,ne=-1,ge=0,Me=0,Ie=i,be=null;t:for(;;){for(var we;Ie!==u||b!==0&&Ie.nodeType!==3||(W=O+b),Ie!==x||p!==0&&Ie.nodeType!==3||(ne=O+p),Ie.nodeType===3&&(O+=Ie.nodeValue.length),(we=Ie.firstChild)!==null;)be=Ie,Ie=we;for(;;){if(Ie===i)break t;if(be===u&&++ge===b&&(W=O),be===x&&++Me===p&&(ne=O),(we=Ie.nextSibling)!==null)break;Ie=be,be=Ie.parentNode}Ie=we}u=W===-1||ne===-1?null:{start:W,end:ne}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ty={focusedElem:i,selectionRange:u},hh=!1,ir=s;ir!==null;)if(s=ir,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,ir=i;else for(;ir!==null;){switch(s=ir,x=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(u=0;u<i.length;u++)b=i[u],b.ref.impl=b.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&x!==null){i=void 0,u=s,b=x.memoizedProps,x=x.memoizedState,p=u.stateNode;try{var st=gs(u.type,b);i=p.getSnapshotBeforeUpdate(st,x),p.__reactInternalSnapshotBeforeUpdate=i}catch(wt){yn(u,u.return,wt)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Ay(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Ay(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,ir=i;break}ir=s.return}}function Y1(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:Ta(i,u),p&4&&pu(5,u);break;case 1:if(Ta(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(O){yn(u,u.return,O)}else{var b=gs(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(b,s,i.__reactInternalSnapshotBeforeUpdate)}catch(O){yn(u,u.return,O)}}p&64&&H1(u),p&512&&mu(u,u.return);break;case 3:if(Ta(i,u),p&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{OS(i,s)}catch(O){yn(u,u.return,O)}}break;case 27:s===null&&p&4&&$1(u);case 26:case 5:Ta(i,u),s===null&&p&4&&q1(u),p&512&&mu(u,u.return);break;case 12:Ta(i,u);break;case 31:Ta(i,u),p&4&&X1(i,u);break;case 13:Ta(i,u),p&4&&Q1(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=dP.bind(null,u),OP(i,u))));break;case 22:if(p=u.memoizedState!==null||Ca,!p){s=s!==null&&s.memoizedState!==null||Kn,b=Ca;var x=Kn;Ca=p,(Kn=s)&&!x?ka(i,u,(u.subtreeFlags&8772)!==0):Ta(i,u),Ca=b,Kn=x}break;case 30:break;default:Ta(i,u)}}function K1(i){var s=i.alternate;s!==null&&(i.alternate=null,K1(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Pn(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 Nn=null,Or=!1;function Ra(i,s,u){for(u=u.child;u!==null;)G1(i,s,u),u=u.sibling}function G1(i,s,u){if(ze&&typeof ze.onCommitFiberUnmount=="function")try{ze.onCommitFiberUnmount(et,u)}catch{}switch(u.tag){case 26:Kn||Yi(u,s),Ra(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Kn||Yi(u,s);var p=Nn,b=Or;po(u.type)&&(Nn=u.stateNode,Or=!1),Ra(i,s,u),Cu(u.stateNode),Nn=p,Or=b;break;case 5:Kn||Yi(u,s);case 6:if(p=Nn,b=Or,Nn=null,Ra(i,s,u),Nn=p,Or=b,Nn!==null)if(Or)try{(Nn.nodeType===9?Nn.body:Nn.nodeName==="HTML"?Nn.ownerDocument.body:Nn).removeChild(u.stateNode)}catch(x){yn(u,s,x)}else try{Nn.removeChild(u.stateNode)}catch(x){yn(u,s,x)}break;case 18:Nn!==null&&(Or?(i=Nn,HE(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),jl(i)):HE(Nn,u.stateNode));break;case 4:p=Nn,b=Or,Nn=u.stateNode.containerInfo,Or=!0,Ra(i,s,u),Nn=p,Or=b;break;case 0:case 11:case 14:case 15:oo(2,u,s),Kn||oo(4,u,s),Ra(i,s,u);break;case 1:Kn||(Yi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&U1(u,s,p)),Ra(i,s,u);break;case 21:Ra(i,s,u);break;case 22:Kn=(p=Kn)||u.memoizedState!==null,Ra(i,s,u),Kn=p;break;default:Ra(i,s,u)}}function X1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{jl(i)}catch(u){yn(s,s.return,u)}}}function Q1(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{jl(i)}catch(u){yn(s,s.return,u)}}function rP(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new W1),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new W1),s;default:throw Error(r(435,i.tag))}}function Yf(i,s){var u=rP(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var b=fP.bind(null,i,p);p.then(b,b)}})}function Dr(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var b=u[p],x=i,O=s,W=O;e:for(;W!==null;){switch(W.tag){case 27:if(po(W.type)){Nn=W.stateNode,Or=!1;break e}break;case 5:Nn=W.stateNode,Or=!1;break e;case 3:case 4:Nn=W.stateNode.containerInfo,Or=!0;break e}W=W.return}if(Nn===null)throw Error(r(160));G1(x,O,b),Nn=null,Or=!1,x=b.alternate,x!==null&&(x.return=null),b.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Z1(s,i),s=s.sibling}var Oi=null;function Z1(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Dr(s,i),Ir(i),p&4&&(oo(3,i,i.return),pu(3,i),oo(5,i,i.return));break;case 1:Dr(s,i),Ir(i),p&512&&(Kn||u===null||Yi(u,u.return)),p&64&&Ca&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var b=Oi;if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||Yi(u,u.return)),p&4){var x=u!==null?u.memoizedState:null;if(p=i.memoizedState,u===null)if(p===null)if(i.stateNode===null){e:{p=i.type,u=i.memoizedProps,b=b.ownerDocument||b;t:switch(p){case"title":x=b.getElementsByTagName("title")[0],(!x||x[On]||x[Ye]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=b.createElement(p),b.head.insertBefore(x,b.querySelector("head > title"))),fr(x,p,u),x[Ye]=i,An(x),p=x;break e;case"link":var O=ZE("link","href",b).get(p+(u.href||""));if(O){for(var W=0;W<O.length;W++)if(x=O[W],x.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&x.getAttribute("rel")===(u.rel==null?null:u.rel)&&x.getAttribute("title")===(u.title==null?null:u.title)&&x.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){O.splice(W,1);break t}}x=b.createElement(p),fr(x,p,u),b.head.appendChild(x);break;case"meta":if(O=ZE("meta","content",b).get(p+(u.content||""))){for(W=0;W<O.length;W++)if(x=O[W],x.getAttribute("content")===(u.content==null?null:""+u.content)&&x.getAttribute("name")===(u.name==null?null:u.name)&&x.getAttribute("property")===(u.property==null?null:u.property)&&x.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&x.getAttribute("charset")===(u.charSet==null?null:u.charSet)){O.splice(W,1);break t}}x=b.createElement(p),fr(x,p,u),b.head.appendChild(x);break;default:throw Error(r(468,p))}x[Ye]=i,An(x),p=x}i.stateNode=p}else JE(b,i.type,i.stateNode);else i.stateNode=QE(b,p,i.memoizedProps);else x!==p?(x===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):x.count--,p===null?JE(b,i.type,i.stateNode):QE(b,p,i.memoizedProps)):p===null&&i.stateNode!==null&&ty(i,i.memoizedProps,u.memoizedProps)}break;case 27:Dr(s,i),Ir(i),p&512&&(Kn||u===null||Yi(u,u.return)),u!==null&&p&4&&ty(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Dr(s,i),Ir(i),p&512&&(Kn||u===null||Yi(u,u.return)),i.flags&32){b=i.stateNode;try{ol(b,"")}catch(st){yn(i,i.return,st)}}p&4&&i.stateNode!=null&&(b=i.memoizedProps,ty(i,b,u!==null?u.memoizedProps:b)),p&1024&&(iy=!0);break;case 6:if(Dr(s,i),Ir(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,u=i.stateNode;try{u.nodeValue=p}catch(st){yn(i,i.return,st)}}break;case 3:if(ch=null,b=Oi,Oi=sh(s.containerInfo),Dr(s,i),Oi=b,Ir(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{jl(s.containerInfo)}catch(st){yn(i,i.return,st)}iy&&(iy=!1,J1(i));break;case 4:p=Oi,Oi=sh(i.stateNode.containerInfo),Dr(s,i),Ir(i),Oi=p;break;case 12:Dr(s,i),Ir(i);break;case 31:Dr(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Yf(i,p)));break;case 13:Dr(s,i),Ir(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Gf=De()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Yf(i,p)));break;case 22:b=i.memoizedState!==null;var ne=u!==null&&u.memoizedState!==null,ge=Ca,Me=Kn;if(Ca=ge||b,Kn=Me||ne,Dr(s,i),Kn=Me,Ca=ge,Ir(i),p&8192)e:for(s=i.stateNode,s._visibility=b?s._visibility&-2:s._visibility|1,b&&(u===null||ne||Ca||Kn||ys(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){ne=u=s;try{if(x=ne.stateNode,b)O=x.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{W=ne.stateNode;var Ie=ne.memoizedProps.style,be=Ie!=null&&Ie.hasOwnProperty("display")?Ie.display:null;W.style.display=be==null||typeof be=="boolean"?"":(""+be).trim()}}catch(st){yn(ne,ne.return,st)}}}else if(s.tag===6){if(u===null){ne=s;try{ne.stateNode.nodeValue=b?"":ne.memoizedProps}catch(st){yn(ne,ne.return,st)}}}else if(s.tag===18){if(u===null){ne=s;try{var we=ne.stateNode;b?UE(we,!0):UE(ne.stateNode,!1)}catch(st){yn(ne,ne.return,st)}}}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;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=i.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Yf(i,u))));break;case 19:Dr(s,i),Ir(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Yf(i,p)));break;case 30:break;case 21:break;default:Dr(s,i),Ir(i)}}function Ir(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(V1(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var b=u.stateNode,x=ny(i);Wf(i,x,b);break;case 5:var O=u.stateNode;u.flags&32&&(ol(O,""),u.flags&=-33);var W=ny(i);Wf(i,W,O);break;case 3:case 4:var ne=u.stateNode.containerInfo,ge=ny(i);ry(i,ge,ne);break;default:throw Error(r(161))}}catch(Me){yn(i,i.return,Me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function J1(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;J1(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Ta(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Y1(i,s.alternate,s),s=s.sibling}function ys(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:oo(4,s,s.return),ys(s);break;case 1:Yi(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&U1(s,s.return,u),ys(s);break;case 27:Cu(s.stateNode);case 26:case 5:Yi(s,s.return),ys(s);break;case 22:s.memoizedState===null&&ys(s);break;case 30:ys(s);break;default:ys(s)}i=i.sibling}}function ka(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,b=i,x=s,O=x.flags;switch(x.tag){case 0:case 11:case 15:ka(b,x,u),pu(4,x);break;case 1:if(ka(b,x,u),p=x,b=p.stateNode,typeof b.componentDidMount=="function")try{b.componentDidMount()}catch(ge){yn(p,p.return,ge)}if(p=x,b=p.updateQueue,b!==null){var W=p.stateNode;try{var ne=b.shared.hiddenCallbacks;if(ne!==null)for(b.shared.hiddenCallbacks=null,b=0;b<ne.length;b++)NS(ne[b],W)}catch(ge){yn(p,p.return,ge)}}u&&O&64&&H1(x),mu(x,x.return);break;case 27:$1(x);case 26:case 5:ka(b,x,u),u&&p===null&&O&4&&q1(x),mu(x,x.return);break;case 12:ka(b,x,u);break;case 31:ka(b,x,u),u&&O&4&&X1(b,x);break;case 13:ka(b,x,u),u&&O&4&&Q1(b,x);break;case 22:x.memoizedState===null&&ka(b,x,u),mu(x,x.return);break;case 30:break;default:ka(b,x,u)}s=s.sibling}}function ay(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&tu(u))}function oy(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&tu(i))}function Di(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)eE(i,s,u,p),s=s.sibling}function eE(i,s,u,p){var b=s.flags;switch(s.tag){case 0:case 11:case 15:Di(i,s,u,p),b&2048&&pu(9,s);break;case 1:Di(i,s,u,p);break;case 3:Di(i,s,u,p),b&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&tu(i)));break;case 12:if(b&2048){Di(i,s,u,p),i=s.stateNode;try{var x=s.memoizedProps,O=x.id,W=x.onPostCommit;typeof W=="function"&&W(O,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(ne){yn(s,s.return,ne)}}else Di(i,s,u,p);break;case 31:Di(i,s,u,p);break;case 13:Di(i,s,u,p);break;case 23:break;case 22:x=s.stateNode,O=s.alternate,s.memoizedState!==null?x._visibility&2?Di(i,s,u,p):gu(i,s):x._visibility&2?Di(i,s,u,p):(x._visibility|=2,Tl(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),b&2048&&ay(O,s);break;case 24:Di(i,s,u,p),b&2048&&oy(s.alternate,s);break;default:Di(i,s,u,p)}}function Tl(i,s,u,p,b){for(b=b&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var x=i,O=s,W=u,ne=p,ge=O.flags;switch(O.tag){case 0:case 11:case 15:Tl(x,O,W,ne,b),pu(8,O);break;case 23:break;case 22:var Me=O.stateNode;O.memoizedState!==null?Me._visibility&2?Tl(x,O,W,ne,b):gu(x,O):(Me._visibility|=2,Tl(x,O,W,ne,b)),b&&ge&2048&&ay(O.alternate,O);break;case 24:Tl(x,O,W,ne,b),b&&ge&2048&&oy(O.alternate,O);break;default:Tl(x,O,W,ne,b)}s=s.sibling}}function gu(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,p=s,b=p.flags;switch(p.tag){case 22:gu(u,p),b&2048&&ay(p.alternate,p);break;case 24:gu(u,p),b&2048&&oy(p.alternate,p);break;default:gu(u,p)}s=s.sibling}}var yu=8192;function kl(i,s,u){if(i.subtreeFlags&yu)for(i=i.child;i!==null;)tE(i,s,u),i=i.sibling}function tE(i,s,u){switch(i.tag){case 26:kl(i,s,u),i.flags&yu&&i.memoizedState!==null&&qP(u,Oi,i.memoizedState,i.memoizedProps);break;case 5:kl(i,s,u);break;case 3:case 4:var p=Oi;Oi=sh(i.stateNode.containerInfo),kl(i,s,u),Oi=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=yu,yu=16777216,kl(i,s,u),yu=p):kl(i,s,u));break;default:kl(i,s,u)}}function nE(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 bu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];ir=p,iE(p,i)}nE(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)rE(i),i=i.sibling}function rE(i){switch(i.tag){case 0:case 11:case 15:bu(i),i.flags&2048&&oo(9,i,i.return);break;case 3:bu(i);break;case 12:bu(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Kf(i)):bu(i);break;default:bu(i)}}function Kf(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];ir=p,iE(p,i)}nE(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:oo(8,s,s.return),Kf(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Kf(s));break;default:Kf(s)}i=i.sibling}}function iE(i,s){for(;ir!==null;){var u=ir;switch(u.tag){case 0:case 11:case 15:oo(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:tu(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,ir=p;else e:for(u=i;ir!==null;){p=ir;var b=p.sibling,x=p.return;if(K1(p),p===u){ir=null;break e}if(b!==null){b.return=x,ir=b;break e}ir=x}}}var iP={getCacheForType:function(i){var s=ur($n),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return ur($n).controller.signal}},aP=typeof WeakMap=="function"?WeakMap:Map,fn=0,wn=null,Wt=null,Gt=0,gn=0,Xr=null,so=!1,Ml=!1,sy=!1,Ma=0,jn=0,lo=0,bs=0,ly=0,Qr=0,Al=0,vu=null,Pr=null,cy=!1,Gf=0,aE=0,Xf=1/0,Qf=null,co=null,Zn=0,uo=null,Nl=null,Aa=0,uy=0,dy=null,oE=null,xu=0,fy=null;function Zr(){return(fn&2)!==0&&Gt!==0?Gt&-Gt:j.T!==null?by():je()}function sE(){if(Qr===0)if((Gt&536870912)===0||tn){var i=it;it<<=1,(it&3932160)===0&&(it=262144),Qr=i}else Qr=536870912;return i=Kr.current,i!==null&&(i.flags|=32),Qr}function Lr(i,s,u){(i===wn&&(gn===2||gn===9)||i.cancelPendingCommit!==null)&&(Ol(i,0),fo(i,Gt,Qr,!1)),Ut(i,u),((fn&2)===0||i!==wn)&&(i===wn&&((fn&2)===0&&(bs|=u),jn===4&&fo(i,Gt,Qr,!1)),Ki(i))}function lE(i,s,u){if((fn&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||kt(i,s),b=p?lP(i,s):py(i,s,!0),x=p;do{if(b===0){Ml&&!p&&fo(i,s,0,!1);break}else{if(u=i.current.alternate,x&&!oP(u)){b=py(i,s,!1),x=!1;continue}if(b===2){if(x=s,i.errorRecoveryDisabledLanes&x)var O=0;else O=i.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){s=O;e:{var W=i;b=vu;var ne=W.current.memoizedState.isDehydrated;if(ne&&(Ol(W,O).flags|=256),O=py(W,O,!1),O!==2){if(sy&&!ne){W.errorRecoveryDisabledLanes|=x,bs|=x,b=4;break e}x=Pr,Pr=b,x!==null&&(Pr===null?Pr=x:Pr.push.apply(Pr,x))}b=O}if(x=!1,b!==2)continue}}if(b===1){Ol(i,0),fo(i,s,0,!0);break}e:{switch(p=i,x=b,x){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:fo(p,s,Qr,!so);break e;case 2:Pr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(b=Gf+300-De(),10<b)){if(fo(p,s,Qr,!so),Ke(p,0,!0)!==0)break e;Aa=s,p.timeoutHandle=FE(cE.bind(null,p,u,Pr,Qf,cy,s,Qr,bs,Al,so,x,"Throttled",-0,0),b);break e}cE(p,u,Pr,Qf,cy,s,Qr,bs,Al,so,x,null,-0,0)}}break}while(!0);Ki(i)}function cE(i,s,u,p,b,x,O,W,ne,ge,Me,Ie,be,we){if(i.timeoutHandle=-1,Ie=s.subtreeFlags,Ie&8192||(Ie&16785408)===16785408){Ie={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pa},tE(s,x,Ie);var st=(x&62914560)===x?Gf-De():(x&4194048)===x?aE-De():0;if(st=VP(Ie,st),st!==null){Aa=x,i.cancelPendingCommit=st(yE.bind(null,i,s,x,u,p,b,O,W,ne,Me,Ie,null,be,we)),fo(i,x,O,!ge);return}}yE(i,s,x,u,p,b,O,W,ne)}function oP(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var b=u[p],x=b.getSnapshot;b=b.value;try{if(!Wr(x(),b))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;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 fo(i,s,u,p){s&=~ly,s&=~bs,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var b=s;0<b;){var x=31-tt(b),O=1<<x;p[x]=-1,b&=~O}u!==0&&Mt(i,u,s)}function Zf(){return(fn&6)===0?(wu(0),!1):!0}function hy(){if(Wt!==null){if(gn===0)var i=Wt.return;else i=Wt,ba=cs=null,Ag(i),wl=null,ru=0,i=Wt;for(;i!==null;)B1(i.alternate,i),i=i.return;Wt=null}}function Ol(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,TP(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Aa=0,hy(),wn=i,Wt=u=ga(i.current,null),Gt=s,gn=0,Xr=null,so=!1,Ml=kt(i,s),sy=!1,Al=Qr=ly=bs=lo=jn=0,Pr=vu=null,cy=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var b=31-tt(p),x=1<<b;s|=i[b],p&=~x}return Ma=s,vf(),u}function uE(i,s){jt=null,j.H=du,s===xl||s===kf?(s=TS(),gn=3):s===yg?(s=TS(),gn=4):gn=s===$g?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Xr=s,Wt===null&&(jn=1,Hf(i,ci(s,i.current)))}function dE(){var i=Kr.current;return i===null?!0:(Gt&4194048)===Gt?hi===null:(Gt&62914560)===Gt||(Gt&536870912)!==0?i===hi:!1}function fE(){var i=j.H;return j.H=du,i===null?du:i}function hE(){var i=j.A;return j.A=iP,i}function Jf(){jn=4,so||(Gt&4194048)!==Gt&&Kr.current!==null||(Ml=!0),(lo&134217727)===0&&(bs&134217727)===0||wn===null||fo(wn,Gt,Qr,!1)}function py(i,s,u){var p=fn;fn|=2;var b=fE(),x=hE();(wn!==i||Gt!==s)&&(Qf=null,Ol(i,s)),s=!1;var O=jn;e:do try{if(gn!==0&&Wt!==null){var W=Wt,ne=Xr;switch(gn){case 8:hy(),O=6;break e;case 3:case 2:case 9:case 6:Kr.current===null&&(s=!0);var ge=gn;if(gn=0,Xr=null,Dl(i,W,ne,ge),u&&Ml){O=0;break e}break;default:ge=gn,gn=0,Xr=null,Dl(i,W,ne,ge)}}sP(),O=jn;break}catch(Me){uE(i,Me)}while(!0);return s&&i.shellSuspendCounter++,ba=cs=null,fn=p,j.H=b,j.A=x,Wt===null&&(wn=null,Gt=0,vf()),O}function sP(){for(;Wt!==null;)pE(Wt)}function lP(i,s){var u=fn;fn|=2;var p=fE(),b=hE();wn!==i||Gt!==s?(Qf=null,Xf=De()+500,Ol(i,s)):Ml=kt(i,s);e:do try{if(gn!==0&&Wt!==null){s=Wt;var x=Xr;t:switch(gn){case 1:gn=0,Xr=null,Dl(i,s,x,1);break;case 2:case 9:if(CS(x)){gn=0,Xr=null,mE(s);break}s=function(){gn!==2&&gn!==9||wn!==i||(gn=7),Ki(i)},x.then(s,s);break e;case 3:gn=7;break e;case 4:gn=5;break e;case 7:CS(x)?(gn=0,Xr=null,mE(s)):(gn=0,Xr=null,Dl(i,s,x,7));break;case 5:var O=null;switch(Wt.tag){case 26:O=Wt.memoizedState;case 5:case 27:var W=Wt;if(O?eC(O):W.stateNode.complete){gn=0,Xr=null;var ne=W.sibling;if(ne!==null)Wt=ne;else{var ge=W.return;ge!==null?(Wt=ge,eh(ge)):Wt=null}break t}}gn=0,Xr=null,Dl(i,s,x,5);break;case 6:gn=0,Xr=null,Dl(i,s,x,6);break;case 8:hy(),jn=6;break e;default:throw Error(r(462))}}cP();break}catch(Me){uE(i,Me)}while(!0);return ba=cs=null,j.H=p,j.A=b,fn=u,Wt!==null?0:(wn=null,Gt=0,vf(),jn)}function cP(){for(;Wt!==null&&!Be();)pE(Wt)}function pE(i){var s=z1(i.alternate,i,Ma);i.memoizedProps=i.pendingProps,s===null?eh(i):Wt=s}function mE(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=D1(u,s,s.pendingProps,s.type,void 0,Gt);break;case 11:s=D1(u,s,s.pendingProps,s.type.render,s.ref,Gt);break;case 5:Ag(s);default:B1(u,s),s=Wt=hS(s,Ma),s=z1(u,s,Ma)}i.memoizedProps=i.pendingProps,s===null?eh(i):Wt=s}function Dl(i,s,u,p){ba=cs=null,Ag(s),wl=null,ru=0;var b=s.return;try{if(QI(i,b,s,u,Gt)){jn=1,Hf(i,ci(u,i.current)),Wt=null;return}}catch(x){if(b!==null)throw Wt=b,x;jn=1,Hf(i,ci(u,i.current)),Wt=null;return}s.flags&32768?(tn||p===1?i=!0:Ml||(Gt&536870912)!==0?i=!1:(so=i=!0,(p===2||p===9||p===3||p===6)&&(p=Kr.current,p!==null&&p.tag===13&&(p.flags|=16384))),gE(s,i)):eh(s)}function eh(i){var s=i;do{if((s.flags&32768)!==0){gE(s,so);return}i=s.return;var u=eP(s.alternate,s,Ma);if(u!==null){Wt=u;return}if(s=s.sibling,s!==null){Wt=s;return}Wt=s=i}while(s!==null);jn===0&&(jn=5)}function gE(i,s){do{var u=tP(i.alternate,i);if(u!==null){u.flags&=32767,Wt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Wt=i;return}Wt=i=u}while(i!==null);jn=6,Wt=null}function yE(i,s,u,p,b,x,O,W,ne){i.cancelPendingCommit=null;do th();while(Zn!==0);if((fn&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(x=s.lanes|s.childLanes,x|=ng,Je(i,u,x,O,W,ne),i===wn&&(Wt=wn=null,Gt=0),Nl=s,uo=i,Aa=u,uy=x,dy=b,oE=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,hP(ee,function(){return SE(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=j.T,j.T=null,b=z.p,z.p=2,O=fn,fn|=4;try{nP(i,s,u)}finally{fn=O,z.p=b,j.T=p}}Zn=1,bE(),vE(),xE()}}function bE(){if(Zn===1){Zn=0;var i=uo,s=Nl,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=j.T,j.T=null;var p=z.p;z.p=2;var b=fn;fn|=4;try{Z1(s,i);var x=Ty,O=iS(i.containerInfo),W=x.focusedElem,ne=x.selectionRange;if(O!==W&&W&&W.ownerDocument&&rS(W.ownerDocument.documentElement,W)){if(ne!==null&&Qm(W)){var ge=ne.start,Me=ne.end;if(Me===void 0&&(Me=ge),"selectionStart"in W)W.selectionStart=ge,W.selectionEnd=Math.min(Me,W.value.length);else{var Ie=W.ownerDocument||document,be=Ie&&Ie.defaultView||window;if(be.getSelection){var we=be.getSelection(),st=W.textContent.length,wt=Math.min(ne.start,st),xn=ne.end===void 0?wt:Math.min(ne.end,st);!we.extend&&wt>xn&&(O=xn,xn=wt,wt=O);var ce=nS(W,wt),oe=nS(W,xn);if(ce&&oe&&(we.rangeCount!==1||we.anchorNode!==ce.node||we.anchorOffset!==ce.offset||we.focusNode!==oe.node||we.focusOffset!==oe.offset)){var me=Ie.createRange();me.setStart(ce.node,ce.offset),we.removeAllRanges(),wt>xn?(we.addRange(me),we.extend(oe.node,oe.offset)):(me.setEnd(oe.node,oe.offset),we.addRange(me))}}}}for(Ie=[],we=W;we=we.parentNode;)we.nodeType===1&&Ie.push({element:we,left:we.scrollLeft,top:we.scrollTop});for(typeof W.focus=="function"&&W.focus(),W=0;W<Ie.length;W++){var Oe=Ie[W];Oe.element.scrollLeft=Oe.left,Oe.element.scrollTop=Oe.top}}hh=!!Ry,Ty=Ry=null}finally{fn=b,z.p=p,j.T=u}}i.current=s,Zn=2}}function vE(){if(Zn===2){Zn=0;var i=uo,s=Nl,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=j.T,j.T=null;var p=z.p;z.p=2;var b=fn;fn|=4;try{Y1(i,s.alternate,s)}finally{fn=b,z.p=p,j.T=u}}Zn=3}}function xE(){if(Zn===4||Zn===3){Zn=0,Ve();var i=uo,s=Nl,u=Aa,p=oE;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Zn=5:(Zn=0,Nl=uo=null,wE(i,i.pendingLanes));var b=i.pendingLanes;if(b===0&&(co=null),ke(u),s=s.stateNode,ze&&typeof ze.onCommitFiberRoot=="function")try{ze.onCommitFiberRoot(et,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=j.T,b=z.p,z.p=2,j.T=null;try{for(var x=i.onRecoverableError,O=0;O<p.length;O++){var W=p[O];x(W.value,{componentStack:W.stack})}}finally{j.T=s,z.p=b}}(Aa&3)!==0&&th(),Ki(i),b=i.pendingLanes,(u&261930)!==0&&(b&42)!==0?i===fy?xu++:(xu=0,fy=i):xu=0,wu(0)}}function wE(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,tu(s)))}function th(){return bE(),vE(),xE(),SE()}function SE(){if(Zn!==5)return!1;var i=uo,s=uy;uy=0;var u=ke(Aa),p=j.T,b=z.p;try{z.p=32>u?32:u,j.T=null,u=dy,dy=null;var x=uo,O=Aa;if(Zn=0,Nl=uo=null,Aa=0,(fn&6)!==0)throw Error(r(331));var W=fn;if(fn|=4,rE(x.current),eE(x,x.current,O,u),fn=W,wu(0,!1),ze&&typeof ze.onPostCommitFiberRoot=="function")try{ze.onPostCommitFiberRoot(et,x)}catch{}return!0}finally{z.p=b,j.T=p,wE(i,s)}}function EE(i,s,u){s=ci(u,s),s=Vg(i.stateNode,s,2),i=ro(i,s,2),i!==null&&(Ut(i,2),Ki(i))}function yn(i,s,u){if(i.tag===3)EE(i,i,u);else for(;s!==null;){if(s.tag===3){EE(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(co===null||!co.has(p))){i=ci(u,i),u=C1(2),p=ro(s,u,2),p!==null&&(R1(u,p,s,i),Ut(p,2),Ki(p));break}}s=s.return}}function my(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new aP;var b=new Set;p.set(s,b)}else b=p.get(s),b===void 0&&(b=new Set,p.set(s,b));b.has(u)||(sy=!0,b.add(u),i=uP.bind(null,i,s,u),s.then(i,i))}function uP(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,wn===i&&(Gt&u)===u&&(jn===4||jn===3&&(Gt&62914560)===Gt&&300>De()-Gf?(fn&2)===0&&Ol(i,0):ly|=u,Al===Gt&&(Al=0)),Ki(i)}function CE(i,s){s===0&&(s=Tt()),i=os(i,s),i!==null&&(Ut(i,s),Ki(i))}function dP(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),CE(i,u)}function fP(i,s){var u=0;switch(i.tag){case 31:case 13:var p=i.stateNode,b=i.memoizedState;b!==null&&(u=b.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(s),CE(i,u)}function hP(i,s){return Ee(i,s)}var nh=null,Il=null,gy=!1,rh=!1,yy=!1,ho=0;function Ki(i){i!==Il&&i.next===null&&(Il===null?nh=Il=i:Il=Il.next=i),rh=!0,gy||(gy=!0,mP())}function wu(i,s){if(!yy&&rh){yy=!0;do for(var u=!1,p=nh;p!==null;){if(i!==0){var b=p.pendingLanes;if(b===0)var x=0;else{var O=p.suspendedLanes,W=p.pingedLanes;x=(1<<31-tt(42|i)+1)-1,x&=b&~(O&~W),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(u=!0,ME(p,x))}else x=Gt,x=Ke(p,p===wn?x:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(x&3)===0||kt(p,x)||(u=!0,ME(p,x));p=p.next}while(u);yy=!1}}function pP(){RE()}function RE(){rh=gy=!1;var i=0;ho!==0&&RP()&&(i=ho);for(var s=De(),u=null,p=nh;p!==null;){var b=p.next,x=TE(p,s);x===0?(p.next=null,u===null?nh=b:u.next=b,b===null&&(Il=u)):(u=p,(i!==0||(x&3)!==0)&&(rh=!0)),p=b}Zn!==0&&Zn!==5||wu(i),ho!==0&&(ho=0)}function TE(i,s){for(var u=i.suspendedLanes,p=i.pingedLanes,b=i.expirationTimes,x=i.pendingLanes&-62914561;0<x;){var O=31-tt(x),W=1<<O,ne=b[O];ne===-1?((W&u)===0||(W&p)!==0)&&(b[O]=_t(W,s)):ne<=s&&(i.expiredLanes|=W),x&=~W}if(s=wn,u=Gt,u=Ke(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(gn===2||gn===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&xe(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||kt(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(p!==null&&xe(p),ke(u)){case 2:case 8:u=Re;break;case 32:u=ee;break;case 268435456:u=Ne;break;default:u=ee}return p=kE.bind(null,i),u=Ee(u,p),i.callbackPriority=s,i.callbackNode=u,s}return p!==null&&p!==null&&xe(p),i.callbackPriority=2,i.callbackNode=null,2}function kE(i,s){if(Zn!==0&&Zn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(th()&&i.callbackNode!==u)return null;var p=Gt;return p=Ke(i,i===wn?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(lE(i,p,s),TE(i,De()),i.callbackNode!=null&&i.callbackNode===u?kE.bind(null,i):null)}function ME(i,s){if(th())return null;lE(i,s,!0)}function mP(){kP(function(){(fn&6)!==0?Ee(pe,pP):RE()})}function by(){if(ho===0){var i=bl;i===0&&(i=Nt,Nt<<=1,(Nt&261888)===0&&(Nt=256)),ho=i}return ho}function AE(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:df(""+i)}function NE(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function gP(i,s,u,p,b){if(s==="submit"&&u&&u.stateNode===b){var x=AE((b[Xe]||null).action),O=p.submitter;O&&(s=(s=O[Xe]||null)?AE(s.formAction):O.getAttribute("formAction"),s!==null&&(x=s,O=null));var W=new mf("action","action",null,p,b);i.push({event:W,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(ho!==0){var ne=O?NE(b,O):new FormData(b);zg(u,{pending:!0,data:ne,method:b.method,action:x},null,ne)}}else typeof x=="function"&&(W.preventDefault(),ne=O?NE(b,O):new FormData(b),zg(u,{pending:!0,data:ne,method:b.method,action:x},x,ne))},currentTarget:b}]})}}for(var vy=0;vy<tg.length;vy++){var xy=tg[vy],yP=xy.toLowerCase(),bP=xy[0].toUpperCase()+xy.slice(1);Ni(yP,"on"+bP)}Ni(sS,"onAnimationEnd"),Ni(lS,"onAnimationIteration"),Ni(cS,"onAnimationStart"),Ni("dblclick","onDoubleClick"),Ni("focusin","onFocus"),Ni("focusout","onBlur"),Ni(PI,"onTransitionRun"),Ni(LI,"onTransitionStart"),Ni(_I,"onTransitionCancel"),Ni(uS,"onTransitionEnd"),oi("onMouseEnter",["mouseout","mouseover"]),oi("onMouseLeave",["mouseout","mouseover"]),oi("onPointerEnter",["pointerout","pointerover"]),oi("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Su="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(" "),vP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Su));function OE(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],b=p.event;p=p.listeners;e:{var x=void 0;if(s)for(var O=p.length-1;0<=O;O--){var W=p[O],ne=W.instance,ge=W.currentTarget;if(W=W.listener,ne!==x&&b.isPropagationStopped())break e;x=W,b.currentTarget=ge;try{x(b)}catch(Me){bf(Me)}b.currentTarget=null,x=ne}else for(O=0;O<p.length;O++){if(W=p[O],ne=W.instance,ge=W.currentTarget,W=W.listener,ne!==x&&b.isPropagationStopped())break e;x=W,b.currentTarget=ge;try{x(b)}catch(Me){bf(Me)}b.currentTarget=null,x=ne}}}}function Yt(i,s){var u=s[Et];u===void 0&&(u=s[Et]=new Set);var p=i+"__bubble";u.has(p)||(DE(s,i,2,!1),u.add(p))}function wy(i,s,u){var p=0;s&&(p|=4),DE(u,i,p,s)}var ih="_reactListening"+Math.random().toString(36).slice(2);function Sy(i){if(!i[ih]){i[ih]=!0,ki.forEach(function(u){u!=="selectionchange"&&(vP.has(u)||wy(u,!1,i),wy(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[ih]||(s[ih]=!0,wy("selectionchange",!1,s))}}function DE(i,s,u,p){switch(sC(s)){case 2:var b=YP;break;case 8:b=KP;break;default:b=jy}u=b.bind(null,s,u,i),b=void 0,!Um||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(b=!0),p?b!==void 0?i.addEventListener(s,u,{capture:!0,passive:b}):i.addEventListener(s,u,!0):b!==void 0?i.addEventListener(s,u,{passive:b}):i.addEventListener(s,u,!1)}function Ey(i,s,u,p,b){var x=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var O=p.tag;if(O===3||O===4){var W=p.stateNode.containerInfo;if(W===b)break;if(O===4)for(O=p.return;O!==null;){var ne=O.tag;if((ne===3||ne===4)&&O.stateNode.containerInfo===b)return;O=O.return}for(;W!==null;){if(O=Ln(W),O===null)return;if(ne=O.tag,ne===5||ne===6||ne===26||ne===27){p=x=O;continue e}W=W.parentNode}}p=p.return}jw(function(){var ge=x,Me=Bm(u),Ie=[];e:{var be=dS.get(i);if(be!==void 0){var we=mf,st=i;switch(i){case"keypress":if(hf(u)===0)break e;case"keydown":case"keyup":we=fI;break;case"focusin":st="focus",we=Wm;break;case"focusout":st="blur",we=Wm;break;case"beforeblur":case"afterblur":we=Wm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=Bw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=eI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=mI;break;case sS:case lS:case cS:we=rI;break;case uS:we=yI;break;case"scroll":case"scrollend":we=ZD;break;case"wheel":we=vI;break;case"copy":case"cut":case"paste":we=aI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=Uw;break;case"toggle":case"beforetoggle":we=wI}var wt=(s&4)!==0,xn=!wt&&(i==="scroll"||i==="scrollend"),ce=wt?be!==null?be+"Capture":null:be;wt=[];for(var oe=ge,me;oe!==null;){var Oe=oe;if(me=Oe.stateNode,Oe=Oe.tag,Oe!==5&&Oe!==26&&Oe!==27||me===null||ce===null||(Oe=Vc(oe,ce),Oe!=null&&wt.push(Eu(oe,Oe,me))),xn)break;oe=oe.return}0<wt.length&&(be=new we(be,st,null,u,Me),Ie.push({event:be,listeners:wt}))}}if((s&7)===0){e:{if(be=i==="mouseover"||i==="pointerover",we=i==="mouseout"||i==="pointerout",be&&u!==Fm&&(st=u.relatedTarget||u.fromElement)&&(Ln(st)||st[ot]))break e;if((we||be)&&(be=Me.window===Me?Me:(be=Me.ownerDocument)?be.defaultView||be.parentWindow:window,we?(st=u.relatedTarget||u.toElement,we=ge,st=st?Ln(st):null,st!==null&&(xn=o(st),wt=st.tag,st!==xn||wt!==5&&wt!==27&&wt!==6)&&(st=null)):(we=null,st=ge),we!==st)){if(wt=Bw,Oe="onMouseLeave",ce="onMouseEnter",oe="mouse",(i==="pointerout"||i==="pointerover")&&(wt=Uw,Oe="onPointerLeave",ce="onPointerEnter",oe="pointer"),xn=we==null?be:rr(we),me=st==null?be:rr(st),be=new wt(Oe,oe+"leave",we,u,Me),be.target=xn,be.relatedTarget=me,Oe=null,Ln(Me)===ge&&(wt=new wt(ce,oe+"enter",st,u,Me),wt.target=me,wt.relatedTarget=xn,Oe=wt),xn=Oe,we&&st)t:{for(wt=xP,ce=we,oe=st,me=0,Oe=ce;Oe;Oe=wt(Oe))me++;Oe=0;for(var mt=oe;mt;mt=wt(mt))Oe++;for(;0<me-Oe;)ce=wt(ce),me--;for(;0<Oe-me;)oe=wt(oe),Oe--;for(;me--;){if(ce===oe||oe!==null&&ce===oe.alternate){wt=ce;break t}ce=wt(ce),oe=wt(oe)}wt=null}else wt=null;we!==null&&IE(Ie,be,we,wt,!1),st!==null&&xn!==null&&IE(Ie,xn,st,wt,!0)}}e:{if(be=ge?rr(ge):window,we=be.nodeName&&be.nodeName.toLowerCase(),we==="select"||we==="input"&&be.type==="file")var ln=Xw;else if(Kw(be))if(Qw)ln=OI;else{ln=AI;var dt=MI}else we=be.nodeName,!we||we.toLowerCase()!=="input"||be.type!=="checkbox"&&be.type!=="radio"?ge&&zm(ge.elementType)&&(ln=Xw):ln=NI;if(ln&&(ln=ln(i,ge))){Gw(Ie,ln,u,Me);break e}dt&&dt(i,be,ge),i==="focusout"&&ge&&be.type==="number"&&ge.memoizedProps.value!=null&&jm(be,"number",be.value)}switch(dt=ge?rr(ge):window,i){case"focusin":(Kw(dt)||dt.contentEditable==="true")&&(ul=dt,Zm=ge,Zc=null);break;case"focusout":Zc=Zm=ul=null;break;case"mousedown":Jm=!0;break;case"contextmenu":case"mouseup":case"dragend":Jm=!1,aS(Ie,u,Me);break;case"selectionchange":if(II)break;case"keydown":case"keyup":aS(Ie,u,Me)}var Ft;if(Km)e:{switch(i){case"compositionstart":var Xt="onCompositionStart";break e;case"compositionend":Xt="onCompositionEnd";break e;case"compositionupdate":Xt="onCompositionUpdate";break e}Xt=void 0}else cl?Ww(i,u)&&(Xt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Xt="onCompositionStart");Xt&&(qw&&u.locale!=="ko"&&(cl||Xt!=="onCompositionStart"?Xt==="onCompositionEnd"&&cl&&(Ft=zw()):(Xa=Me,qm="value"in Xa?Xa.value:Xa.textContent,cl=!0)),dt=ah(ge,Xt),0<dt.length&&(Xt=new Hw(Xt,i,null,u,Me),Ie.push({event:Xt,listeners:dt}),Ft?Xt.data=Ft:(Ft=Yw(u),Ft!==null&&(Xt.data=Ft)))),(Ft=EI?CI(i,u):RI(i,u))&&(Xt=ah(ge,"onBeforeInput"),0<Xt.length&&(dt=new Hw("onBeforeInput","beforeinput",null,u,Me),Ie.push({event:dt,listeners:Xt}),dt.data=Ft)),gP(Ie,i,ge,u,Me)}OE(Ie,s)})}function Eu(i,s,u){return{instance:i,listener:s,currentTarget:u}}function ah(i,s){for(var u=s+"Capture",p=[];i!==null;){var b=i,x=b.stateNode;if(b=b.tag,b!==5&&b!==26&&b!==27||x===null||(b=Vc(i,u),b!=null&&p.unshift(Eu(i,b,x)),b=Vc(i,s),b!=null&&p.push(Eu(i,b,x))),i.tag===3)return p;i=i.return}return[]}function xP(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function IE(i,s,u,p,b){for(var x=s._reactName,O=[];u!==null&&u!==p;){var W=u,ne=W.alternate,ge=W.stateNode;if(W=W.tag,ne!==null&&ne===p)break;W!==5&&W!==26&&W!==27||ge===null||(ne=ge,b?(ge=Vc(u,x),ge!=null&&O.unshift(Eu(u,ge,ne))):b||(ge=Vc(u,x),ge!=null&&O.push(Eu(u,ge,ne)))),u=u.return}O.length!==0&&i.push({event:s,listeners:O})}var wP=/\r\n?/g,SP=/\u0000|\uFFFD/g;function PE(i){return(typeof i=="string"?i:""+i).replace(wP,`
|
|
65
|
-
`).replace(SP,"")}function LE(i,s){return s=PE(s),PE(i)===s}function vn(i,s,u,p,b,x){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||ol(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&ol(i,""+p);break;case"className":Ai(i,"class",p);break;case"tabIndex":Ai(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Ai(i,u,p);break;case"style":Lw(i,p,x);break;case"data":if(s!=="object"){Ai(i,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=df(""+p),i.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(u,"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 x=="function"&&(u==="formAction"?(s!=="input"&&vn(i,s,"name",b.name,b,null),vn(i,s,"formEncType",b.formEncType,b,null),vn(i,s,"formMethod",b.formMethod,b,null),vn(i,s,"formTarget",b.formTarget,b,null)):(vn(i,s,"encType",b.encType,b,null),vn(i,s,"method",b.method,b,null),vn(i,s,"target",b.target,b,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=df(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=pa);break;case"onScroll":p!=null&&Yt("scroll",i);break;case"onScrollEnd":p!=null&&Yt("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}u=df(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""+p):i.removeAttribute(u);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":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":p===!0?i.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,p):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(u,p):i.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(u):i.setAttribute(u,p);break;case"popover":Yt("beforetoggle",i),Yt("toggle",i),Un(i,"popover",p);break;case"xlinkActuate":lr(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":lr(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":lr(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":lr(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":lr(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":lr(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":lr(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":lr(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":lr(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Un(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=XD.get(u)||u,Un(i,u,p))}}function Cy(i,s,u,p,b,x){switch(u){case"style":Lw(i,p,x);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(b.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof p=="string"?ol(i,p):(typeof p=="number"||typeof p=="bigint")&&ol(i,""+p);break;case"onScroll":p!=null&&Yt("scroll",i);break;case"onScrollEnd":p!=null&&Yt("scrollend",i);break;case"onClick":p!=null&&(i.onclick=pa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!$r.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(b=u.endsWith("Capture"),s=u.slice(2,b?u.length-7:void 0),x=i[Xe]||null,x=x!=null?x[u]:null,typeof x=="function"&&i.removeEventListener(s,x,b),typeof p=="function")){typeof x!="function"&&x!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,p,b);break e}u in i?i[u]=p:p===!0?i.setAttribute(u,""):Un(i,u,p)}}}function fr(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yt("error",i),Yt("load",i);var p=!1,b=!1,x;for(x in u)if(u.hasOwnProperty(x)){var O=u[x];if(O!=null)switch(x){case"src":p=!0;break;case"srcSet":b=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:vn(i,s,x,O,u,null)}}b&&vn(i,s,"srcSet",u.srcSet,u,null),p&&vn(i,s,"src",u.src,u,null);return;case"input":Yt("invalid",i);var W=x=O=b=null,ne=null,ge=null;for(p in u)if(u.hasOwnProperty(p)){var Me=u[p];if(Me!=null)switch(p){case"name":b=Me;break;case"type":O=Me;break;case"checked":ne=Me;break;case"defaultChecked":ge=Me;break;case"value":x=Me;break;case"defaultValue":W=Me;break;case"children":case"dangerouslySetInnerHTML":if(Me!=null)throw Error(r(137,s));break;default:vn(i,s,p,Me,u,null)}}Ow(i,x,W,ne,ge,O,b,!1);return;case"select":Yt("invalid",i),p=O=x=null;for(b in u)if(u.hasOwnProperty(b)&&(W=u[b],W!=null))switch(b){case"value":x=W;break;case"defaultValue":O=W;break;case"multiple":p=W;default:vn(i,s,b,W,u,null)}s=x,u=O,i.multiple=!!p,s!=null?al(i,!!p,s,!1):u!=null&&al(i,!!p,u,!0);return;case"textarea":Yt("invalid",i),x=b=p=null;for(O in u)if(u.hasOwnProperty(O)&&(W=u[O],W!=null))switch(O){case"value":p=W;break;case"defaultValue":b=W;break;case"children":x=W;break;case"dangerouslySetInnerHTML":if(W!=null)throw Error(r(91));break;default:vn(i,s,O,W,u,null)}Iw(i,p,b,x);return;case"option":for(ne in u)if(u.hasOwnProperty(ne)&&(p=u[ne],p!=null))switch(ne){case"selected":i.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:vn(i,s,ne,p,u,null)}return;case"dialog":Yt("beforetoggle",i),Yt("toggle",i),Yt("cancel",i),Yt("close",i);break;case"iframe":case"object":Yt("load",i);break;case"video":case"audio":for(p=0;p<Su.length;p++)Yt(Su[p],i);break;case"image":Yt("error",i),Yt("load",i);break;case"details":Yt("toggle",i);break;case"embed":case"source":case"link":Yt("error",i),Yt("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(ge in u)if(u.hasOwnProperty(ge)&&(p=u[ge],p!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:vn(i,s,ge,p,u,null)}return;default:if(zm(s)){for(Me in u)u.hasOwnProperty(Me)&&(p=u[Me],p!==void 0&&Cy(i,s,Me,p,u,void 0));return}}for(W in u)u.hasOwnProperty(W)&&(p=u[W],p!=null&&vn(i,s,W,p,u,null))}function EP(i,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var b=null,x=null,O=null,W=null,ne=null,ge=null,Me=null;for(we in u){var Ie=u[we];if(u.hasOwnProperty(we)&&Ie!=null)switch(we){case"checked":break;case"value":break;case"defaultValue":ne=Ie;default:p.hasOwnProperty(we)||vn(i,s,we,null,p,Ie)}}for(var be in p){var we=p[be];if(Ie=u[be],p.hasOwnProperty(be)&&(we!=null||Ie!=null))switch(be){case"type":x=we;break;case"name":b=we;break;case"checked":ge=we;break;case"defaultChecked":Me=we;break;case"value":O=we;break;case"defaultValue":W=we;break;case"children":case"dangerouslySetInnerHTML":if(we!=null)throw Error(r(137,s));break;default:we!==Ie&&vn(i,s,be,we,p,Ie)}}_m(i,O,W,ne,ge,Me,x,b);return;case"select":we=O=W=be=null;for(x in u)if(ne=u[x],u.hasOwnProperty(x)&&ne!=null)switch(x){case"value":break;case"multiple":we=ne;default:p.hasOwnProperty(x)||vn(i,s,x,null,p,ne)}for(b in p)if(x=p[b],ne=u[b],p.hasOwnProperty(b)&&(x!=null||ne!=null))switch(b){case"value":be=x;break;case"defaultValue":W=x;break;case"multiple":O=x;default:x!==ne&&vn(i,s,b,x,p,ne)}s=W,u=O,p=we,be!=null?al(i,!!u,be,!1):!!p!=!!u&&(s!=null?al(i,!!u,s,!0):al(i,!!u,u?[]:"",!1));return;case"textarea":we=be=null;for(W in u)if(b=u[W],u.hasOwnProperty(W)&&b!=null&&!p.hasOwnProperty(W))switch(W){case"value":break;case"children":break;default:vn(i,s,W,null,p,b)}for(O in p)if(b=p[O],x=u[O],p.hasOwnProperty(O)&&(b!=null||x!=null))switch(O){case"value":be=b;break;case"defaultValue":we=b;break;case"children":break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:b!==x&&vn(i,s,O,b,p,x)}Dw(i,be,we);return;case"option":for(var st in u)if(be=u[st],u.hasOwnProperty(st)&&be!=null&&!p.hasOwnProperty(st))switch(st){case"selected":i.selected=!1;break;default:vn(i,s,st,null,p,be)}for(ne in p)if(be=p[ne],we=u[ne],p.hasOwnProperty(ne)&&be!==we&&(be!=null||we!=null))switch(ne){case"selected":i.selected=be&&typeof be!="function"&&typeof be!="symbol";break;default:vn(i,s,ne,be,p,we)}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 wt in u)be=u[wt],u.hasOwnProperty(wt)&&be!=null&&!p.hasOwnProperty(wt)&&vn(i,s,wt,null,p,be);for(ge in p)if(be=p[ge],we=u[ge],p.hasOwnProperty(ge)&&be!==we&&(be!=null||we!=null))switch(ge){case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(r(137,s));break;default:vn(i,s,ge,be,p,we)}return;default:if(zm(s)){for(var xn in u)be=u[xn],u.hasOwnProperty(xn)&&be!==void 0&&!p.hasOwnProperty(xn)&&Cy(i,s,xn,void 0,p,be);for(Me in p)be=p[Me],we=u[Me],!p.hasOwnProperty(Me)||be===we||be===void 0&&we===void 0||Cy(i,s,Me,be,p,we);return}}for(var ce in u)be=u[ce],u.hasOwnProperty(ce)&&be!=null&&!p.hasOwnProperty(ce)&&vn(i,s,ce,null,p,be);for(Ie in p)be=p[Ie],we=u[Ie],!p.hasOwnProperty(Ie)||be===we||be==null&&we==null||vn(i,s,Ie,be,p,we)}function _E(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function CP(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var b=u[p],x=b.transferSize,O=b.initiatorType,W=b.duration;if(x&&W&&_E(O)){for(O=0,W=b.responseEnd,p+=1;p<u.length;p++){var ne=u[p],ge=ne.startTime;if(ge>W)break;var Me=ne.transferSize,Ie=ne.initiatorType;Me&&_E(Ie)&&(ne=ne.responseEnd,O+=Me*(ne<W?1:(W-ge)/(ne-ge)))}if(--p,s+=8*(x+O)/(b.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 Ry=null,Ty=null;function oh(i){return i.nodeType===9?i:i.ownerDocument}function jE(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 zE(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 ky(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 My=null;function RP(){var i=window.event;return i&&i.type==="popstate"?i===My?!1:(My=i,!0):(My=null,!1)}var FE=typeof setTimeout=="function"?setTimeout:void 0,TP=typeof clearTimeout=="function"?clearTimeout:void 0,BE=typeof Promise=="function"?Promise:void 0,kP=typeof queueMicrotask=="function"?queueMicrotask:typeof BE<"u"?function(i){return BE.resolve(null).then(i).catch(MP)}:FE;function MP(i){setTimeout(function(){throw i})}function po(i){return i==="head"}function HE(i,s){var u=s,p=0;do{var b=u.nextSibling;if(i.removeChild(u),b&&b.nodeType===8)if(u=b.data,u==="/$"||u==="/&"){if(p===0){i.removeChild(b),jl(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Cu(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Cu(u);for(var x=u.firstChild;x;){var O=x.nextSibling,W=x.nodeName;x[On]||W==="SCRIPT"||W==="STYLE"||W==="LINK"&&x.rel.toLowerCase()==="stylesheet"||u.removeChild(x),x=O}}else u==="body"&&Cu(i.ownerDocument.body);u=b}while(u);jl(s)}function UE(i,s){var u=i;i=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=p}while(u)}function Ay(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Ay(u),Pn(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function AP(i,s,u,p){for(;i.nodeType===1;){var b=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[On])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(x=i.getAttribute("rel"),x==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(x!==b.rel||i.getAttribute("href")!==(b.href==null||b.href===""?null:b.href)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin)||i.getAttribute("title")!==(b.title==null?null:b.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(x=i.getAttribute("src"),(x!==(b.src==null?null:b.src)||i.getAttribute("type")!==(b.type==null?null:b.type)||i.getAttribute("crossorigin")!==(b.crossOrigin==null?null:b.crossOrigin))&&x&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var x=b.name==null?null:""+b.name;if(b.type==="hidden"&&i.getAttribute("name")===x)return i}else return i;if(i=pi(i.nextSibling),i===null)break}return null}function NP(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=pi(i.nextSibling),i===null))return null;return i}function qE(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=pi(i.nextSibling),i===null))return null;return i}function Ny(i){return i.data==="$?"||i.data==="$~"}function Oy(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function OP(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function pi(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 Dy=null;function VE(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return pi(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function $E(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function WE(i,s,u){switch(s=oh(u),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 Cu(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Pn(i)}var mi=new Map,YE=new Set;function sh(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Na=z.d;z.d={f:DP,r:IP,D:PP,C:LP,L:_P,m:jP,X:FP,S:zP,M:BP};function DP(){var i=Na.f(),s=Zf();return i||s}function IP(i){var s=Zt(i);s!==null&&s.tag===5&&s.type==="form"?u1(s):Na.r(i)}var Pl=typeof document>"u"?null:document;function KE(i,s,u){var p=Pl;if(p&&typeof s=="string"&&s){var b=si(s);b='link[rel="'+i+'"][href="'+b+'"]',typeof u=="string"&&(b+='[crossorigin="'+u+'"]'),YE.has(b)||(YE.add(b),i={rel:i,crossOrigin:u,href:s},p.querySelector(b)===null&&(s=p.createElement("link"),fr(s,"link",i),An(s),p.head.appendChild(s)))}}function PP(i){Na.D(i),KE("dns-prefetch",i,null)}function LP(i,s){Na.C(i,s),KE("preconnect",i,s)}function _P(i,s,u){Na.L(i,s,u);var p=Pl;if(p&&i&&s){var b='link[rel="preload"][as="'+si(s)+'"]';s==="image"&&u&&u.imageSrcSet?(b+='[imagesrcset="'+si(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(b+='[imagesizes="'+si(u.imageSizes)+'"]')):b+='[href="'+si(i)+'"]';var x=b;switch(s){case"style":x=Ll(i);break;case"script":x=_l(i)}mi.has(x)||(i=h({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),mi.set(x,i),p.querySelector(b)!==null||s==="style"&&p.querySelector(Ru(x))||s==="script"&&p.querySelector(Tu(x))||(s=p.createElement("link"),fr(s,"link",i),An(s),p.head.appendChild(s)))}}function jP(i,s){Na.m(i,s);var u=Pl;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",b='link[rel="modulepreload"][as="'+si(p)+'"][href="'+si(i)+'"]',x=b;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=_l(i)}if(!mi.has(x)&&(i=h({rel:"modulepreload",href:i},s),mi.set(x,i),u.querySelector(b)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Tu(x)))return}p=u.createElement("link"),fr(p,"link",i),An(p),u.head.appendChild(p)}}}function zP(i,s,u){Na.S(i,s,u);var p=Pl;if(p&&i){var b=Ar(p).hoistableStyles,x=Ll(i);s=s||"default";var O=b.get(x);if(!O){var W={loading:0,preload:null};if(O=p.querySelector(Ru(x)))W.loading=5;else{i=h({rel:"stylesheet",href:i,"data-precedence":s},u),(u=mi.get(x))&&Iy(i,u);var ne=O=p.createElement("link");An(ne),fr(ne,"link",i),ne._p=new Promise(function(ge,Me){ne.onload=ge,ne.onerror=Me}),ne.addEventListener("load",function(){W.loading|=1}),ne.addEventListener("error",function(){W.loading|=2}),W.loading|=4,lh(O,s,p)}O={type:"stylesheet",instance:O,count:1,state:W},b.set(x,O)}}}function FP(i,s){Na.X(i,s);var u=Pl;if(u&&i){var p=Ar(u).hoistableScripts,b=_l(i),x=p.get(b);x||(x=u.querySelector(Tu(b)),x||(i=h({src:i,async:!0},s),(s=mi.get(b))&&Py(i,s),x=u.createElement("script"),An(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function BP(i,s){Na.M(i,s);var u=Pl;if(u&&i){var p=Ar(u).hoistableScripts,b=_l(i),x=p.get(b);x||(x=u.querySelector(Tu(b)),x||(i=h({src:i,async:!0,type:"module"},s),(s=mi.get(b))&&Py(i,s),x=u.createElement("script"),An(x),fr(x,"link",i),u.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},p.set(b,x))}}function GE(i,s,u,p){var b=(b=ae.current)?sh(b):null;if(!b)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=Ll(u.href),u=Ar(b).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=Ll(u.href);var x=Ar(b).hoistableStyles,O=x.get(i);if(O||(b=b.ownerDocument||b,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(i,O),(x=b.querySelector(Ru(i)))&&!x._p&&(O.instance=x,O.state.loading=5),mi.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},mi.set(i,u),x||HP(b,i,u,O.state))),s&&p===null)throw Error(r(528,""));return O}if(s&&p!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=_l(u),u=Ar(b).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function Ll(i){return'href="'+si(i)+'"'}function Ru(i){return'link[rel="stylesheet"]['+i+"]"}function XE(i){return h({},i,{"data-precedence":i.precedence,precedence:null})}function HP(i,s,u,p){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=i.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),fr(s,"link",u),An(s),i.head.appendChild(s))}function _l(i){return'[src="'+si(i)+'"]'}function Tu(i){return"script[async]"+i}function QE(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+si(u.href)+'"]');if(p)return s.instance=p,An(p),p;var b=h({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),An(p),fr(p,"style",b),lh(p,u.precedence,i),s.instance=p;case"stylesheet":b=Ll(u.href);var x=i.querySelector(Ru(b));if(x)return s.state.loading|=4,s.instance=x,An(x),x;p=XE(u),(b=mi.get(b))&&Iy(p,b),x=(i.ownerDocument||i).createElement("link"),An(x);var O=x;return O._p=new Promise(function(W,ne){O.onload=W,O.onerror=ne}),fr(x,"link",p),s.state.loading|=4,lh(x,u.precedence,i),s.instance=x;case"script":return x=_l(u.src),(b=i.querySelector(Tu(x)))?(s.instance=b,An(b),b):(p=u,(b=mi.get(x))&&(p=h({},u),Py(p,b)),i=i.ownerDocument||i,b=i.createElement("script"),An(b),fr(b,"link",p),i.head.appendChild(b),s.instance=b);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,lh(p,u.precedence,i));return s.instance}function lh(i,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),b=p.length?p[p.length-1]:null,x=b,O=0;O<p.length;O++){var W=p[O];if(W.dataset.precedence===s)x=W;else if(x!==b)break}x?x.parentNode.insertBefore(i,x.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Iy(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Py(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var ch=null;function ZE(i,s,u){if(ch===null){var p=new Map,b=ch=new Map;b.set(u,p)}else b=ch,p=b.get(u),p||(p=new Map,b.set(u,p));if(p.has(i))return p;for(p.set(i,null),u=u.getElementsByTagName(i),b=0;b<u.length;b++){var x=u[b];if(!(x[On]||x[Ye]||i==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var O=x.getAttribute(s)||"";O=i+O;var W=p.get(O);W?W.push(x):p.set(O,[x])}}return p}function JE(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function UP(i,s,u){if(u===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 eC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function qP(i,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var b=Ll(p.href),x=s.querySelector(Ru(b));if(x){s=x._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=uh.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=x,An(x);return}x=s.ownerDocument||s,p=XE(p),(b=mi.get(b))&&Iy(p,b),x=x.createElement("link"),An(x);var O=x;O._p=new Promise(function(W,ne){O.onload=W,O.onerror=ne}),fr(x,"link",p),u.instance=x}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=uh.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Ly=0;function VP(i,s){return i.stylesheets&&i.count===0&&fh(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend){var x=i.unsuspend;i.unsuspend=null,x()}},6e4+s);0<i.imgBytes&&Ly===0&&(Ly=62500*CP());var b=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&fh(i,i.stylesheets),i.unsuspend)){var x=i.unsuspend;i.unsuspend=null,x()}},(i.imgBytes>Ly?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(b)}}:null}function uh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)fh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var dh=null;function fh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,dh=new Map,s.forEach($P,i),dh=null,uh.call(i))}function $P(i,s){if(!(s.state.loading&4)){var u=dh.get(i);if(u)var p=u.get(null);else{u=new Map,dh.set(i,u);for(var b=i.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<b.length;x++){var O=b[x];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(u.set(O.dataset.precedence,O),p=O)}p&&u.set(null,p)}b=s.instance,O=b.getAttribute("data-precedence"),x=u.get(O)||p,x===p&&u.set(null,b),u.set(O,b),this.count++,p=uh.bind(this),b.addEventListener("load",p),b.addEventListener("error",p),x?x.parentNode.insertBefore(b,x.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(b,i.firstChild)),s.state.loading|=4}}var ku={$$typeof:k,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function WP(i,s,u,p,b,x,O,W,ne){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=dn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dn(0),this.hiddenUpdates=dn(null),this.identifierPrefix=p,this.onUncaughtError=b,this.onCaughtError=x,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ne,this.incompleteTransitions=new Map}function tC(i,s,u,p,b,x,O,W,ne,ge,Me,Ie){return i=new WP(i,s,u,O,ne,ge,Me,Ie,W),s=1,x===!0&&(s|=24),x=Yr(3,null,null,s),i.current=x,x.stateNode=i,s=pg(),s.refCount++,i.pooledCache=s,s.refCount++,x.memoizedState={element:p,isDehydrated:u,cache:s},bg(x),i}function nC(i){return i?(i=hl,i):hl}function rC(i,s,u,p,b,x){b=nC(b),p.context===null?p.context=b:p.pendingContext=b,p=no(s),p.payload={element:u},x=x===void 0?null:x,x!==null&&(p.callback=x),u=ro(i,p,s),u!==null&&(Lr(u,i,s),au(u,i,s))}function iC(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function _y(i,s){iC(i,s),(i=i.alternate)&&iC(i,s)}function aC(i){if(i.tag===13||i.tag===31){var s=os(i,67108864);s!==null&&Lr(s,i,67108864),_y(i,67108864)}}function oC(i){if(i.tag===13||i.tag===31){var s=Zr();s=de(s);var u=os(i,s);u!==null&&Lr(u,i,s),_y(i,s)}}var hh=!0;function YP(i,s,u,p){var b=j.T;j.T=null;var x=z.p;try{z.p=2,jy(i,s,u,p)}finally{z.p=x,j.T=b}}function KP(i,s,u,p){var b=j.T;j.T=null;var x=z.p;try{z.p=8,jy(i,s,u,p)}finally{z.p=x,j.T=b}}function jy(i,s,u,p){if(hh){var b=zy(p);if(b===null)Ey(i,s,p,ph,u),lC(i,p);else if(XP(b,i,s,u,p))p.stopPropagation();else if(lC(i,p),s&4&&-1<GP.indexOf(i)){for(;b!==null;){var x=Zt(b);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var O=bt(x.pendingLanes);if(O!==0){var W=x;for(W.pendingLanes|=2,W.entangledLanes|=2;O;){var ne=1<<31-tt(O);W.entanglements[1]|=ne,O&=~ne}Ki(x),(fn&6)===0&&(Xf=De()+500,wu(0))}}break;case 31:case 13:W=os(x,2),W!==null&&Lr(W,x,2),Zf(),_y(x,2)}if(x=zy(p),x===null&&Ey(i,s,p,ph,u),x===b)break;b=x}b!==null&&p.stopPropagation()}else Ey(i,s,p,null,u)}}function zy(i){return i=Bm(i),Fy(i)}var ph=null;function Fy(i){if(ph=null,i=Ln(i),i!==null){var s=o(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=l(s),i!==null)return i;i=null}else if(u===31){if(i=c(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return ph=i,null}function sC(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(ut()){case pe:return 2;case Re:return 8;case ee:case fe:return 32;case Ne:return 268435456;default:return 32}default:return 32}}var By=!1,mo=null,go=null,yo=null,Mu=new Map,Au=new Map,bo=[],GP="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 lC(i,s){switch(i){case"focusin":case"focusout":mo=null;break;case"dragenter":case"dragleave":go=null;break;case"mouseover":case"mouseout":yo=null;break;case"pointerover":case"pointerout":Mu.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Au.delete(s.pointerId)}}function Nu(i,s,u,p,b,x){return i===null||i.nativeEvent!==x?(i={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:x,targetContainers:[b]},s!==null&&(s=Zt(s),s!==null&&aC(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,b!==null&&s.indexOf(b)===-1&&s.push(b),i)}function XP(i,s,u,p,b){switch(s){case"focusin":return mo=Nu(mo,i,s,u,p,b),!0;case"dragenter":return go=Nu(go,i,s,u,p,b),!0;case"mouseover":return yo=Nu(yo,i,s,u,p,b),!0;case"pointerover":var x=b.pointerId;return Mu.set(x,Nu(Mu.get(x)||null,i,s,u,p,b)),!0;case"gotpointercapture":return x=b.pointerId,Au.set(x,Nu(Au.get(x)||null,i,s,u,p,b)),!0}return!1}function cC(i){var s=Ln(i.target);if(s!==null){var u=o(s);if(u!==null){if(s=u.tag,s===13){if(s=l(u),s!==null){i.blockedOn=s,rt(i.priority,function(){oC(u)});return}}else if(s===31){if(s=c(u),s!==null){i.blockedOn=s,rt(i.priority,function(){oC(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function mh(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=zy(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);Fm=p,u.target.dispatchEvent(p),Fm=null}else return s=Zt(u),s!==null&&aC(s),i.blockedOn=u,!1;s.shift()}return!0}function uC(i,s,u){mh(i)&&u.delete(s)}function QP(){By=!1,mo!==null&&mh(mo)&&(mo=null),go!==null&&mh(go)&&(go=null),yo!==null&&mh(yo)&&(yo=null),Mu.forEach(uC),Au.forEach(uC)}function gh(i,s){i.blockedOn===s&&(i.blockedOn=null,By||(By=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,QP)))}var yh=null;function dC(i){yh!==i&&(yh=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){yh===i&&(yh=null);for(var s=0;s<i.length;s+=3){var u=i[s],p=i[s+1],b=i[s+2];if(typeof p!="function"){if(Fy(p||u)===null)continue;break}var x=Zt(u);x!==null&&(i.splice(s,3),s-=3,zg(x,{pending:!0,data:b,method:u.method,action:p},p,b))}}))}function jl(i){function s(ne){return gh(ne,i)}mo!==null&&gh(mo,i),go!==null&&gh(go,i),yo!==null&&gh(yo,i),Mu.forEach(s),Au.forEach(s);for(var u=0;u<bo.length;u++){var p=bo[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<bo.length&&(u=bo[0],u.blockedOn===null);)cC(u),u.blockedOn===null&&bo.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var b=u[p],x=u[p+1],O=b[Xe]||null;if(typeof x=="function")O||dC(u);else if(O){var W=null;if(x&&x.hasAttribute("formAction")){if(b=x,O=x[Xe]||null)W=O.formAction;else if(Fy(b)!==null)continue}else W=O.action;typeof W=="function"?u[p+1]=W:(u.splice(p,3),p-=3),dC(u)}}}function fC(){function i(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(O){return b=O})},focusReset:"manual",scroll:"manual"})}function s(){b!==null&&(b(),b=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,b=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),b!==null&&(b(),b=null)}}}function Hy(i){this._internalRoot=i}bh.prototype.render=Hy.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=Zr();rC(u,p,i,s,null,null)},bh.prototype.unmount=Hy.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;rC(i.current,2,null,i,null,null),Zf(),s[ot]=null}};function bh(i){this._internalRoot=i}bh.prototype.unstable_scheduleHydration=function(i){if(i){var s=je();i={blockedOn:null,target:i,priority:s};for(var u=0;u<bo.length&&s!==0&&s<bo[u].priority;u++);bo.splice(u,0,i),u===0&&cC(i)}};var hC=t.version;if(hC!=="19.2.4")throw Error(r(527,hC,"19.2.4"));z.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=d(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var ZP={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:j,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var vh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!vh.isDisabled&&vh.supportsFiber)try{et=vh.inject(ZP),ze=vh}catch{}}return Du.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,p="",b=x1,x=w1,O=S1;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(b=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(O=s.onRecoverableError)),s=tC(i,1,!1,null,null,u,p,null,b,x,O,fC),i[ot]=s.current,Sy(i),new Hy(s)},Du.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var p=!1,b="",x=x1,O=w1,W=S1,ne=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(b=u.identifierPrefix),u.onUncaughtError!==void 0&&(x=u.onUncaughtError),u.onCaughtError!==void 0&&(O=u.onCaughtError),u.onRecoverableError!==void 0&&(W=u.onRecoverableError),u.formState!==void 0&&(ne=u.formState)),s=tC(i,1,!0,s,u??null,p,b,ne,x,O,W,fC),s.context=nC(null),u=s.current,p=Zr(),p=de(p),b=no(p),b.callback=null,ro(u,b,p),u=p,s.current.lanes=u,Ut(s,u),Ki(s),i[ot]=s.current,Sy(i),new bh(s)},Du.version="19.2.4",Du}var HC;function mz(){if(HC)return Ky.exports;HC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ky.exports=pz(),Ky.exports}var gz=mz();/**
|
|
66
|
-
* react-router v7.13.0
|
|
67
|
-
*
|
|
68
|
-
* Copyright (c) Remix Software Inc.
|
|
69
|
-
*
|
|
70
|
-
* This source code is licensed under the MIT license found in the
|
|
71
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
72
|
-
*
|
|
73
|
-
* @license MIT
|
|
74
|
-
*/var _M=e=>{throw TypeError(e)},yz=(e,t,n)=>t.has(e)||_M("Cannot "+n),Zy=(e,t,n)=>(yz(e,t,"read from private field"),n?n.call(e):t.get(e)),bz=(e,t,n)=>t.has(e)?_M("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),UC="popstate";function vz(e={}){function t(r,a){let{pathname:o,search:l,hash:c}=r.location;return vd("",{pathname:o,search:l,hash:c},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:aa(a)}return wz(t,n,null,e)}function Vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Qn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function xz(){return Math.random().toString(36).substring(2,10)}function qC(e,t){return{usr:e.state,key:e.key,idx:t}}function vd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Wo(t):t,state:n,key:t&&t.key||r||xz()}}function aa({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Wo(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function wz(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,c="POP",f=null,d=m();d==null&&(d=0,l.replaceState({...l.state,idx:d},""));function m(){return(l.state||{idx:null}).idx}function h(){c="POP";let R=m(),E=R==null?null:R-d;d=R,f&&f({action:c,location:C.location,delta:E})}function y(R,E){c="PUSH";let T=vd(C.location,R,E);d=m()+1;let k=qC(T,d),M=C.createHref(T);try{l.pushState(k,"",M)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;a.location.assign(M)}o&&f&&f({action:c,location:C.location,delta:1})}function g(R,E){c="REPLACE";let T=vd(C.location,R,E);d=m();let k=qC(T,d),M=C.createHref(T);l.replaceState(k,"",M),o&&f&&f({action:c,location:C.location,delta:0})}function w(R){return jM(R)}let C={get action(){return c},get location(){return e(a,l)},listen(R){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(UC,h),f=R,()=>{a.removeEventListener(UC,h),f=null}},createHref(R){return t(a,R)},createURL:w,encodeLocation(R){let E=w(R);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:g,go(R){return l.go(R)}};return C}function jM(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:aa(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Ku,VC=class{constructor(e){if(bz(this,Ku,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Zy(this,Ku).has(e))return Zy(this,Ku).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Zy(this,Ku).set(e,t)}};Ku=new WeakMap;var Sz=new Set(["lazy","caseSensitive","path","id","index","children"]);function Ez(e){return Sz.has(e)}var Cz=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function Rz(e){return Cz.has(e)}function Tz(e){return e.index===!0}function xd(e,t,n=[],r={},a=!1){return e.map((o,l)=>{let c=[...n,String(l)],f=typeof o.id=="string"?o.id:c.join("-");if(Vt(o.index!==!0||!o.children,"Cannot specify children on an index route"),Vt(a||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),Tz(o)){let d={...o,id:f};return r[f]=$C(d,t(d)),d}else{let d={...o,id:f,children:void 0};return r[f]=$C(d,t(d)),o.children&&(d.children=xd(o.children,t,c,r,a)),d}})}function $C(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function Ro(e,t,n="/"){return Gu(e,t,n,!1)}function Gu(e,t,n,r){let a=typeof t=="string"?Wo(t):t,o=Ci(a.pathname||"/",n);if(o==null)return null;let l=zM(e);Mz(l);let c=null;for(let f=0;c==null&&f<l.length;++f){let d=BM(o);c=jz(l[f],d,r)}return c}function kz(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function zM(e,t=[],n=[],r="",a=!1){let o=(l,c,f=a,d)=>{let m={relativePath:d===void 0?l.path||"":d,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;Vt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let h=na([r,m.relativePath]),y=n.concat(m);l.children&&l.children.length>0&&(Vt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${h}".`),zM(l.children,t,y,h,f)),!(l.path==null&&!l.index)&&t.push({path:h,score:Lz(h,l.index),routesMeta:y})};return e.forEach((l,c)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))o(l,c);else for(let d of FM(l.path))o(l,c,!0,d)}),t}function FM(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=FM(r.join("/")),c=[];return c.push(...l.map(f=>f===""?o:[o,f].join("/"))),a&&c.push(...l),c.map(f=>e.startsWith("/")&&f===""?"/":f)}function Mz(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:_z(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Az=/^:[\w-]+$/,Nz=3,Oz=2,Dz=1,Iz=10,Pz=-2,WC=e=>e==="*";function Lz(e,t){let n=e.split("/"),r=n.length;return n.some(WC)&&(r+=Pz),t&&(r+=Oz),n.filter(a=>!WC(a)).reduce((a,o)=>a+(Az.test(o)?Nz:o===""?Dz:Iz),r)}function _z(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function jz(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let c=0;c<r.length;++c){let f=r[c],d=c===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",h=Us({path:f.relativePath,caseSensitive:f.caseSensitive,end:d},m),y=f.route;if(!h&&d&&n&&!r[r.length-1].route.index&&(h=Us({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!h)return null;Object.assign(a,h.params),l.push({params:a,pathname:na([o,h.pathname]),pathnameBase:Hz(na([o,h.pathnameBase])),route:y}),h.pathnameBase!=="/"&&(o=na([o,h.pathnameBase]))}return l}function Us(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=zz(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),c=a.slice(1);return{params:r.reduce((d,{paramName:m,isOptional:h},y)=>{if(m==="*"){let w=c[y]||"";l=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const g=c[y];return h&&!g?d[m]=void 0:d[m]=(g||"").replace(/%2F/g,"/"),d},{}),pathname:o,pathnameBase:l,pattern:e}}function zz(e,t=!1,n=!0){Qn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,f)=>(r.push({paramName:c,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function BM(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Qn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ci(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function Fz({basename:e,pathname:t}){return t==="/"?e:na([e,t])}var HM=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_x=e=>HM.test(e);function Bz(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Wo(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=YC(n.substring(1),"/"):o=YC(n,t)):o=t,{pathname:o,search:Uz(r),hash:qz(a)}}function YC(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Jy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function UM(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function jx(e){let t=UM(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function zx(e,t,n,r=!1){let a;typeof e=="string"?a=Wo(e):(a={...e},Vt(!a.pathname||!a.pathname.includes("?"),Jy("?","pathname","search",a)),Vt(!a.pathname||!a.pathname.includes("#"),Jy("#","pathname","hash",a)),Vt(!a.search||!a.search.includes("#"),Jy("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,c;if(l==null)c=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),h-=1;a.pathname=y.join("/")}c=h>=0?t[h]:"/"}let f=Bz(a,c),d=l&&l!=="/"&&l.endsWith("/"),m=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(d||m)&&(f.pathname+="/"),f}var na=e=>e.join("/").replace(/\/\/+/g,"/"),Hz=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Uz=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,qz=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,zd=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function wd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Fd(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var qM=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function VM(e,t){let n=e;if(typeof n!="string"||!HM.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(qM)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),c=Ci(l.pathname,t);l.origin===o.origin&&c!=null?n=c+l.search+l.hash:a=!0}catch{Qn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:a,to:n}}var _o=Symbol("Uninstrumented");function Vz(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(a=>a({id:t.id,index:t.index,path:t.path,instrument(o){let l=Object.keys(n);for(let c of l)o[c]&&n[c].push(o[c])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let a=Kl(n.lazy,t.lazy,()=>{});a&&(r.lazy=a)}if(typeof t.lazy=="object"){let a=t.lazy;["middleware","loader","action"].forEach(o=>{let l=a[o],c=n[`lazy.${o}`];if(typeof l=="function"&&c.length>0){let f=Kl(c,l,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[o]:f}))}})}return["loader","action"].forEach(a=>{let o=t[a];if(typeof o=="function"&&n[a].length>0){let l=o[_o]??o,c=Kl(n[a],l,(...f)=>KC(f[0]));c&&(a==="loader"&&l.hydrate===!0&&(c.hydrate=!0),c[_o]=l,r[a]=c)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(a=>{let o=a[_o]??a,l=Kl(n.middleware,o,(...c)=>KC(c[0]));return l?(l[_o]=o,l):a})),r}function $z(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(a){let o=Object.keys(a);for(let l of o)a[l]&&n[l].push(a[l])}})),n.navigate.length>0){let r=e.navigate[_o]??e.navigate,a=Kl(n.navigate,r,(...o)=>{let[l,c]=o;return{to:typeof l=="number"||typeof l=="string"?l:l?aa(l):".",...GC(e,c??{})}});a&&(a[_o]=r,e.navigate=a)}if(n.fetch.length>0){let r=e.fetch[_o]??e.fetch,a=Kl(n.fetch,r,(...o)=>{let[l,,c,f]=o;return{href:c??".",fetcherKey:l,...GC(e,f??{})}});a&&(a[_o]=r,e.fetch=a)}return e}function Kl(e,t,n){return e.length===0?null:async(...r)=>{let a=await $M(e,n(...r),()=>t(...r),e.length-1);if(a.type==="error")throw a.value;return a.value}}async function $M(e,t,n,r){let a=e[r],o;if(a){let l,c=async()=>(l?console.error("You cannot call instrumented handlers more than once"):l=$M(e,t,n,r-1),o=await l,Vt(o,"Expected a result"),o.type==="error"&&o.value instanceof Error?{status:"error",error:o.value}:{status:"success",error:void 0});try{await a(c,t)}catch(f){console.error("An instrumentation function threw an error:",f)}l||await c(),await l}else try{o={type:"success",value:await n()}}catch(l){o={type:"error",value:l}}return o||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function KC(e){let{request:t,context:n,params:r,unstable_pattern:a}=e;return{request:Wz(t),params:{...r},unstable_pattern:a,context:Yz(n)}}function GC(e,t){return{currentUrl:aa(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function Wz(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function Yz(e){if(Gz(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var Kz=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Gz(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===Kz}var WM=["POST","PUT","PATCH","DELETE"],Xz=new Set(WM),Qz=["GET",...WM],Zz=new Set(Qz),YM=new Set([301,302,303,307,308]),Jz=new Set([307,308]),eb={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},e4={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Iu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},t4=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),KM="remix-router-transitions",GM=Symbol("ResetLoaderData");function n4(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";Vt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||t4,o=a;if(e.unstable_instrumentations){let X=e.unstable_instrumentations;o=ie=>({...a(ie),...Vz(X.map(de=>de.route).filter(Boolean),ie)})}let l={},c=xd(e.routes,o,void 0,l),f,d=e.basename||"/";d.startsWith("/")||(d=`/${d}`);let m=e.dataStrategy||s4,h={...e.future},y=null,g=new Set,w=null,C=null,R=null,E=e.hydrationData!=null,T=Ro(c,e.history.location,d),k=!1,M=null,D;if(T==null&&!e.patchRoutesOnNavigation){let X=yi(404,{pathname:e.history.location.pathname}),{matches:ie,route:de}=Sh(c);D=!0,T=ie,M={[de.id]:X}}else if(T&&!e.hydrationData&&Tt(T,c,e.history.location.pathname).active&&(T=null),T)if(T.some(X=>X.route.lazy))D=!1;else if(!T.some(X=>Fx(X.route)))D=!0;else{let X=e.hydrationData?e.hydrationData.loaderData:null,ie=e.hydrationData?e.hydrationData.errors:null;if(ie){let de=T.findIndex(ke=>ie[ke.route.id]!==void 0);D=T.slice(0,de+1).every(ke=>!wv(ke.route,X,ie))}else D=T.every(de=>!wv(de.route,X,ie))}else{D=!1,T=[];let X=Tt(null,c,e.history.location.pathname);X.active&&X.matches&&(k=!0,T=X.matches)}let A,N={historyAction:e.history.action,location:e.history.location,matches:T,initialized:D,navigation:eb,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||M,fetchers:new Map,blockers:new Map},L="POP",q=null,F=!1,Y,_=!1,V=new Map,$=null,B=!1,j=!1,z=new Set,H=new Map,K=0,P=-1,U=new Map,G=new Set,I=new Map,Q=new Map,le=new Set,ae=new Map,Z,ue=null;function ve(){if(y=e.history.listen(({action:X,location:ie,delta:de})=>{if(Z){Z(),Z=void 0;return}Qn(ae.size===0||de!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let ke=it({currentLocation:N.location,nextLocation:ie,historyAction:X});if(ke&&de!=null){let je=new Promise(rt=>{Z=rt});e.history.go(de*-1),Nt(ke,{state:"blocked",location:ie,proceed(){Nt(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:ie}),je.then(()=>e.history.go(de))},reset(){let rt=new Map(N.blockers);rt.set(ke,Iu),te({blockers:rt})}}),q==null||q.resolve(),q=null;return}return Ae(X,ie)}),n){R4(t,V);let X=()=>T4(t,V);t.addEventListener("pagehide",X),$=()=>t.removeEventListener("pagehide",X)}return N.initialized||Ae("POP",N.location,{initialHydration:!0}),A}function Se(){y&&y(),$&&$(),g.clear(),Y&&Y.abort(),N.fetchers.forEach((X,ie)=>$e(ie)),N.blockers.forEach((X,ie)=>yt(ie))}function Le(X){return g.add(X),()=>g.delete(X)}function te(X,ie={}){X.matches&&(X.matches=X.matches.map(je=>{let rt=l[je.route.id],nt=je.route;return nt.element!==rt.element||nt.errorElement!==rt.errorElement||nt.hydrateFallbackElement!==rt.hydrateFallbackElement?{...je,route:rt}:je})),N={...N,...X};let de=[],ke=[];N.fetchers.forEach((je,rt)=>{je.state==="idle"&&(le.has(rt)?de.push(rt):ke.push(rt))}),le.forEach(je=>{!N.fetchers.has(je)&&!H.has(je)&&de.push(je)}),[...g].forEach(je=>je(N,{deletedFetchers:de,newErrors:X.errors??null,viewTransitionOpts:ie.viewTransitionOpts,flushSync:ie.flushSync===!0})),de.forEach(je=>$e(je)),ke.forEach(je=>N.fetchers.delete(je))}function he(X,ie,{flushSync:de}={}){var Et,ht;let ke=N.actionData!=null&&N.navigation.formMethod!=null&&yr(N.navigation.formMethod)&&N.navigation.state==="loading"&&((Et=X.state)==null?void 0:Et._isRedirect)!==!0,je;ie.actionData?Object.keys(ie.actionData).length>0?je=ie.actionData:je=null:ke?je=N.actionData:je=null;let rt=ie.loaderData?aR(N.loaderData,ie.loaderData,ie.matches||[],ie.errors):N.loaderData,nt=N.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((Lt,$t)=>nt.set($t,Iu)));let Ye=B?!1:_t(X,ie.matches||N.matches),Xe=F===!0||N.navigation.formMethod!=null&&yr(N.navigation.formMethod)&&((ht=X.state)==null?void 0:ht._isRedirect)!==!0;f&&(c=f,f=void 0),B||L==="POP"||(L==="PUSH"?e.history.push(X,X.state):L==="REPLACE"&&e.history.replace(X,X.state));let ot;if(L==="POP"){let Lt=V.get(N.location.pathname);Lt&&Lt.has(X.pathname)?ot={currentLocation:N.location,nextLocation:X}:V.has(X.pathname)&&(ot={currentLocation:X,nextLocation:N.location})}else if(_){let Lt=V.get(N.location.pathname);Lt?Lt.add(X.pathname):(Lt=new Set([X.pathname]),V.set(N.location.pathname,Lt)),ot={currentLocation:N.location,nextLocation:X}}te({...ie,actionData:je,loaderData:rt,historyAction:L,location:X,initialized:!0,navigation:eb,revalidation:"idle",restoreScrollPosition:Ye,preventScrollReset:Xe,blockers:nt},{viewTransitionOpts:ot,flushSync:de===!0}),L="POP",F=!1,_=!1,B=!1,j=!1,q==null||q.resolve(),q=null,ue==null||ue.resolve(),ue=null}async function ye(X,ie){if(q==null||q.resolve(),q=null,typeof X=="number"){q||(q=cR());let $t=q.promise;return e.history.go(X),$t}let de=xv(N.location,N.matches,d,X,ie==null?void 0:ie.fromRouteId,ie==null?void 0:ie.relative),{path:ke,submission:je,error:rt}=XC(!1,de,ie),nt=N.location,Ye=vd(N.location,ke,ie&&ie.state);Ye={...Ye,...e.history.encodeLocation(Ye)};let Xe=ie&&ie.replace!=null?ie.replace:void 0,ot="PUSH";Xe===!0?ot="REPLACE":Xe===!1||je!=null&&yr(je.formMethod)&&je.formAction===N.location.pathname+N.location.search&&(ot="REPLACE");let Et=ie&&"preventScrollReset"in ie?ie.preventScrollReset===!0:void 0,ht=(ie&&ie.flushSync)===!0,Lt=it({currentLocation:nt,nextLocation:Ye,historyAction:ot});if(Lt){Nt(Lt,{state:"blocked",location:Ye,proceed(){Nt(Lt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ye}),ye(X,ie)},reset(){let $t=new Map(N.blockers);$t.set(Lt,Iu),te({blockers:$t})}});return}await Ae(ot,Ye,{submission:je,pendingError:rt,preventScrollReset:Et,replace:ie&&ie.replace,enableViewTransition:ie&&ie.viewTransition,flushSync:ht,callSiteDefaultShouldRevalidate:ie&&ie.unstable_defaultShouldRevalidate})}function _e(){ue||(ue=cR()),Re(),te({revalidation:"loading"});let X=ue.promise;return N.navigation.state==="submitting"?X:N.navigation.state==="idle"?(Ae(N.historyAction,N.location,{startUninterruptedRevalidation:!0}),X):(Ae(L||N.historyAction,N.navigation.location,{overrideNavigation:N.navigation,enableViewTransition:_===!0}),X)}async function Ae(X,ie,de){Y&&Y.abort(),Y=null,L=X,B=(de&&de.startUninterruptedRevalidation)===!0,kt(N.location,N.matches),F=(de&&de.preventScrollReset)===!0,_=(de&&de.enableViewTransition)===!0;let ke=f||c,je=de&&de.overrideNavigation,rt=de!=null&&de.initialHydration&&N.matches&&N.matches.length>0&&!k?N.matches:Ro(ke,ie,d),nt=(de&&de.flushSync)===!0;if(rt&&N.initialized&&!j&&m4(N.location,ie)&&!(de&&de.submission&&yr(de.submission.formMethod))){he(ie,{matches:rt},{flushSync:nt});return}let Ye=Tt(rt,ke,ie.pathname);if(Ye.active&&Ye.matches&&(rt=Ye.matches),!rt){let{error:Pn,notFoundMatches:Ln,route:Zt}=ft(ie.pathname);he(ie,{matches:Ln,loaderData:{},errors:{[Zt.id]:Pn}},{flushSync:nt});return}Y=new AbortController;let Xe=$l(e.history,ie,Y.signal,de&&de.submission),ot=e.getContext?await e.getContext():new VC,Et;if(de&&de.pendingError)Et=[To(rt).route.id,{type:"error",error:de.pendingError}];else if(de&&de.submission&&yr(de.submission.formMethod)){let Pn=await Ce(Xe,ie,de.submission,rt,ot,Ye.active,de&&de.initialHydration===!0,{replace:de.replace,flushSync:nt});if(Pn.shortCircuited)return;if(Pn.pendingActionResult){let[Ln,Zt]=Pn.pendingActionResult;if(ei(Zt)&&wd(Zt.error)&&Zt.error.status===404){Y=null,he(ie,{matches:Pn.matches,loaderData:{},errors:{[Ln]:Zt.error}});return}}rt=Pn.matches||rt,Et=Pn.pendingActionResult,je=tb(ie,de.submission),nt=!1,Ye.active=!1,Xe=$l(e.history,Xe.url,Xe.signal)}let{shortCircuited:ht,matches:Lt,loaderData:$t,errors:On}=await Te(Xe,ie,rt,ot,Ye.active,je,de&&de.submission,de&&de.fetcherSubmission,de&&de.replace,de&&de.initialHydration===!0,nt,Et,de&&de.callSiteDefaultShouldRevalidate);ht||(Y=null,he(ie,{matches:Lt||rt,...oR(Et),loaderData:$t,errors:On}))}async function Ce(X,ie,de,ke,je,rt,nt,Ye={}){Re();let Xe=E4(ie,de);if(te({navigation:Xe},{flushSync:Ye.flushSync===!0}),rt){let ht=await dn(ke,ie.pathname,X.signal);if(ht.type==="aborted")return{shortCircuited:!0};if(ht.type==="error"){if(ht.partialMatches.length===0){let{matches:$t,route:On}=Sh(c);return{matches:$t,pendingActionResult:[On.id,{type:"error",error:ht.error}]}}let Lt=To(ht.partialMatches).route.id;return{matches:ht.partialMatches,pendingActionResult:[Lt,{type:"error",error:ht.error}]}}else if(ht.matches)ke=ht.matches;else{let{notFoundMatches:Lt,error:$t,route:On}=ft(ie.pathname);return{matches:Lt,pendingActionResult:[On.id,{type:"error",error:$t}]}}}let ot,Et=Jh(ke,ie);if(!Et.route.action&&!Et.route.lazy)ot={type:"error",error:yi(405,{method:X.method,pathname:ie.pathname,routeId:Et.route.id})};else{let ht=Xl(o,l,X,ke,Et,nt?[]:r,je),Lt=await ut(X,ht,je,null);if(ot=Lt[Et.route.id],!ot){for(let $t of ke)if(Lt[$t.route.id]){ot=Lt[$t.route.id];break}}if(X.signal.aborted)return{shortCircuited:!0}}if(Rs(ot)){let ht;return Ye&&Ye.replace!=null?ht=Ye.replace:ht=nR(ot.response.headers.get("Location"),new URL(X.url),d,e.history)===N.location.pathname+N.location.search,await De(X,ot,!0,{submission:de,replace:ht}),{shortCircuited:!0}}if(ei(ot)){let ht=To(ke,Et.route.id);return(Ye&&Ye.replace)!==!0&&(L="PUSH"),{matches:ke,pendingActionResult:[ht.route.id,ot,Et.route.id]}}return{matches:ke,pendingActionResult:[Et.route.id,ot]}}async function Te(X,ie,de,ke,je,rt,nt,Ye,Xe,ot,Et,ht,Lt){let $t=rt||tb(ie,nt),On=nt||Ye||lR($t),Pn=!B&&!ot;if(je){if(Pn){let Un=J(ht);te({navigation:$t,...Un!==void 0?{actionData:Un}:{}},{flushSync:Et})}let Jt=await dn(de,ie.pathname,X.signal);if(Jt.type==="aborted")return{shortCircuited:!0};if(Jt.type==="error"){if(Jt.partialMatches.length===0){let{matches:Ai,route:lr}=Sh(c);return{matches:Ai,loaderData:{},errors:{[lr.id]:Jt.error}}}let Un=To(Jt.partialMatches).route.id;return{matches:Jt.partialMatches,loaderData:{},errors:{[Un]:Jt.error}}}else if(Jt.matches)de=Jt.matches;else{let{error:Un,notFoundMatches:Ai,route:lr}=ft(ie.pathname);return{matches:Ai,loaderData:{},errors:{[lr.id]:Un}}}}let Ln=f||c,{dsMatches:Zt,revalidatingFetchers:rr}=QC(X,ke,o,l,e.history,N,de,On,ie,ot?[]:r,ot===!0,j,z,le,I,G,Ln,d,e.patchRoutesOnNavigation!=null,ht,Lt);if(P=++K,!e.dataStrategy&&!Zt.some(Jt=>Jt.shouldLoad)&&!Zt.some(Jt=>Jt.route.middleware&&Jt.route.middleware.length>0)&&rr.length===0){let Jt=tt();return he(ie,{matches:de,loaderData:{},errors:ht&&ei(ht[1])?{[ht[0]]:ht[1].error}:null,...oR(ht),...Jt?{fetchers:new Map(N.fetchers)}:{}},{flushSync:Et}),{shortCircuited:!0}}if(Pn){let Jt={};if(!je){Jt.navigation=$t;let Un=J(ht);Un!==void 0&&(Jt.actionData=Un)}rr.length>0&&(Jt.fetchers=Ee(rr)),te(Jt,{flushSync:Et})}rr.forEach(Jt=>{ze(Jt.key),Jt.controller&&H.set(Jt.key,Jt.controller)});let Ar=()=>rr.forEach(Jt=>ze(Jt.key));Y&&Y.signal.addEventListener("abort",Ar);let{loaderResults:An,fetcherResults:ki}=await pe(Zt,rr,X,ke);if(X.signal.aborted)return{shortCircuited:!0};Y&&Y.signal.removeEventListener("abort",Ar),rr.forEach(Jt=>H.delete(Jt.key));let $r=Eh(An);if($r)return await De(X,$r.result,!0,{replace:Xe}),{shortCircuited:!0};if($r=Eh(ki),$r)return G.add($r.key),await De(X,$r.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:Mi,errors:oi}=iR(N,de,An,ht,rr,ki);ot&&N.errors&&(oi={...N.errors,...oi});let ha=tt(),es=Rt(P),ts=ha||es||rr.length>0;return{matches:de,loaderData:Mi,errors:oi,...ts?{fetchers:new Map(N.fetchers)}:{}}}function J(X){if(X&&!ei(X[1]))return{[X[0]]:X[1].data};if(N.actionData)return Object.keys(N.actionData).length===0?null:N.actionData}function Ee(X){return X.forEach(ie=>{let de=N.fetchers.get(ie.key),ke=Pu(void 0,de?de.data:void 0);N.fetchers.set(ie.key,ke)}),new Map(N.fetchers)}async function xe(X,ie,de,ke){ze(X);let je=(ke&&ke.flushSync)===!0,rt=f||c,nt=xv(N.location,N.matches,d,de,ie,ke==null?void 0:ke.relative),Ye=Ro(rt,nt,d),Xe=Tt(Ye,rt,nt);if(Xe.active&&Xe.matches&&(Ye=Xe.matches),!Ye){fe(X,ie,yi(404,{pathname:nt}),{flushSync:je});return}let{path:ot,submission:Et,error:ht}=XC(!0,nt,ke);if(ht){fe(X,ie,ht,{flushSync:je});return}let Lt=e.getContext?await e.getContext():new VC,$t=(ke&&ke.preventScrollReset)===!0;if(Et&&yr(Et.formMethod)){await Be(X,ie,ot,Ye,Lt,Xe.active,je,$t,Et,ke&&ke.unstable_defaultShouldRevalidate);return}I.set(X,{routeId:ie,path:ot}),await Ve(X,ie,ot,Ye,Lt,Xe.active,je,$t,Et)}async function Be(X,ie,de,ke,je,rt,nt,Ye,Xe,ot){Re(),I.delete(X);let Et=N.fetchers.get(X);ee(X,C4(Xe,Et),{flushSync:nt});let ht=new AbortController,Lt=$l(e.history,de,ht.signal,Xe);if(rt){let en=await dn(ke,new URL(Lt.url).pathname,Lt.signal,X);if(en.type==="aborted")return;if(en.type==="error"){fe(X,ie,en.error,{flushSync:nt});return}else if(en.matches)ke=en.matches;else{fe(X,ie,yi(404,{pathname:de}),{flushSync:nt});return}}let $t=Jh(ke,de);if(!$t.route.action&&!$t.route.lazy){let en=yi(405,{method:Xe.formMethod,pathname:de,routeId:ie});fe(X,ie,en,{flushSync:nt});return}H.set(X,ht);let On=K,Pn=Xl(o,l,Lt,ke,$t,r,je),Ln=await ut(Lt,Pn,je,X),Zt=Ln[$t.route.id];if(!Zt){for(let en of Pn)if(Ln[en.route.id]){Zt=Ln[en.route.id];break}}if(Lt.signal.aborted){H.get(X)===ht&&H.delete(X);return}if(le.has(X)){if(Rs(Zt)||ei(Zt)){ee(X,Ia(void 0));return}}else{if(Rs(Zt))if(H.delete(X),P>On){ee(X,Ia(void 0));return}else return G.add(X),ee(X,Pu(Xe)),De(Lt,Zt,!1,{fetcherSubmission:Xe,preventScrollReset:Ye});if(ei(Zt)){fe(X,ie,Zt.error);return}}let rr=N.navigation.location||N.location,Ar=$l(e.history,rr,ht.signal),An=f||c,ki=N.navigation.state!=="idle"?Ro(An,N.navigation.location,d):N.matches;Vt(ki,"Didn't find any matches after fetcher action");let $r=++K;U.set(X,$r);let Mi=Pu(Xe,Zt.data);N.fetchers.set(X,Mi);let{dsMatches:oi,revalidatingFetchers:ha}=QC(Ar,je,o,l,e.history,N,ki,Xe,rr,r,!1,j,z,le,I,G,An,d,e.patchRoutesOnNavigation!=null,[$t.route.id,Zt],ot);ha.filter(en=>en.key!==X).forEach(en=>{let ns=en.key,cf=N.fetchers.get(ns),qc=Pu(void 0,cf?cf.data:void 0);N.fetchers.set(ns,qc),ze(ns),en.controller&&H.set(ns,en.controller)}),te({fetchers:new Map(N.fetchers)});let es=()=>ha.forEach(en=>ze(en.key));ht.signal.addEventListener("abort",es);let{loaderResults:ts,fetcherResults:Jt}=await pe(oi,ha,Ar,je);if(ht.signal.aborted)return;if(ht.signal.removeEventListener("abort",es),U.delete(X),H.delete(X),ha.forEach(en=>H.delete(en.key)),N.fetchers.has(X)){let en=Ia(Zt.data);N.fetchers.set(X,en)}let Un=Eh(ts);if(Un)return De(Ar,Un.result,!1,{preventScrollReset:Ye});if(Un=Eh(Jt),Un)return G.add(Un.key),De(Ar,Un.result,!1,{preventScrollReset:Ye});let{loaderData:Ai,errors:lr}=iR(N,ki,ts,void 0,ha,Jt);Rt($r),N.navigation.state==="loading"&&$r>P?(Vt(L,"Expected pending action"),Y&&Y.abort(),he(N.navigation.location,{matches:ki,loaderData:Ai,errors:lr,fetchers:new Map(N.fetchers)})):(te({errors:lr,loaderData:aR(N.loaderData,Ai,ki,lr),fetchers:new Map(N.fetchers)}),j=!1)}async function Ve(X,ie,de,ke,je,rt,nt,Ye,Xe){let ot=N.fetchers.get(X);ee(X,Pu(Xe,ot?ot.data:void 0),{flushSync:nt});let Et=new AbortController,ht=$l(e.history,de,Et.signal);if(rt){let Zt=await dn(ke,new URL(ht.url).pathname,ht.signal,X);if(Zt.type==="aborted")return;if(Zt.type==="error"){fe(X,ie,Zt.error,{flushSync:nt});return}else if(Zt.matches)ke=Zt.matches;else{fe(X,ie,yi(404,{pathname:de}),{flushSync:nt});return}}let Lt=Jh(ke,de);H.set(X,Et);let $t=K,On=Xl(o,l,ht,ke,Lt,r,je),Ln=(await ut(ht,On,je,X))[Lt.route.id];if(H.get(X)===Et&&H.delete(X),!ht.signal.aborted){if(le.has(X)){ee(X,Ia(void 0));return}if(Rs(Ln))if(P>$t){ee(X,Ia(void 0));return}else{G.add(X),await De(ht,Ln,!1,{preventScrollReset:Ye});return}if(ei(Ln)){fe(X,ie,Ln.error);return}ee(X,Ia(Ln.data))}}async function De(X,ie,de,{submission:ke,fetcherSubmission:je,preventScrollReset:rt,replace:nt}={}){de||(q==null||q.resolve(),q=null),ie.response.headers.has("X-Remix-Revalidate")&&(j=!0);let Ye=ie.response.headers.get("Location");Vt(Ye,"Expected a Location header on the redirect Response"),Ye=nR(Ye,new URL(X.url),d,e.history);let Xe=vd(N.location,Ye,{_isRedirect:!0});if(n){let On=!1;if(ie.response.headers.has("X-Remix-Reload-Document"))On=!0;else if(_x(Ye)){const Pn=jM(Ye,!0);On=Pn.origin!==t.location.origin||Ci(Pn.pathname,d)==null}if(On){nt?t.location.replace(Ye):t.location.assign(Ye);return}}Y=null;let ot=nt===!0||ie.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Et,formAction:ht,formEncType:Lt}=N.navigation;!ke&&!je&&Et&&ht&&Lt&&(ke=lR(N.navigation));let $t=ke||je;if(Jz.has(ie.response.status)&&$t&&yr($t.formMethod))await Ae(ot,Xe,{submission:{...$t,formAction:Ye},preventScrollReset:rt||F,enableViewTransition:de?_:void 0});else{let On=tb(Xe,ke);await Ae(ot,Xe,{overrideNavigation:On,fetcherSubmission:je,preventScrollReset:rt||F,enableViewTransition:de?_:void 0})}}async function ut(X,ie,de,ke){var nt;let je,rt={};try{je=await c4(m,X,ie,ke,de,!1)}catch(Ye){return ie.filter(Xe=>Xe.shouldLoad).forEach(Xe=>{rt[Xe.route.id]={type:"error",error:Ye}}),rt}if(X.signal.aborted)return rt;if(!yr(X.method))for(let Ye of ie){if(((nt=je[Ye.route.id])==null?void 0:nt.type)==="error")break;!je.hasOwnProperty(Ye.route.id)&&!N.loaderData.hasOwnProperty(Ye.route.id)&&(!N.errors||!N.errors.hasOwnProperty(Ye.route.id))&&Ye.shouldCallHandler()&&(je[Ye.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ye.route.id}`)})}for(let[Ye,Xe]of Object.entries(je))if(v4(Xe)){let ot=Xe.result;rt[Ye]={type:"redirect",response:h4(ot,X,Ye,ie,d)}}else rt[Ye]=await f4(Xe);return rt}async function pe(X,ie,de,ke){let je=ut(de,X,ke,null),rt=Promise.all(ie.map(async Xe=>{if(Xe.matches&&Xe.match&&Xe.request&&Xe.controller){let Et=(await ut(Xe.request,Xe.matches,ke,Xe.key))[Xe.match.route.id];return{[Xe.key]:Et}}else return Promise.resolve({[Xe.key]:{type:"error",error:yi(404,{pathname:Xe.path})}})})),nt=await je,Ye=(await rt).reduce((Xe,ot)=>Object.assign(Xe,ot),{});return{loaderResults:nt,fetcherResults:Ye}}function Re(){j=!0,I.forEach((X,ie)=>{H.has(ie)&&z.add(ie),ze(ie)})}function ee(X,ie,de={}){N.fetchers.set(X,ie),te({fetchers:new Map(N.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function fe(X,ie,de,ke={}){let je=To(N.matches,ie);$e(X),te({errors:{[je.route.id]:de},fetchers:new Map(N.fetchers)},{flushSync:(ke&&ke.flushSync)===!0})}function Ne(X){return Q.set(X,(Q.get(X)||0)+1),le.has(X)&&le.delete(X),N.fetchers.get(X)||e4}function He(X,ie){ze(X,ie==null?void 0:ie.reason),ee(X,Ia(null))}function $e(X){let ie=N.fetchers.get(X);H.has(X)&&!(ie&&ie.state==="loading"&&U.has(X))&&ze(X),I.delete(X),U.delete(X),G.delete(X),le.delete(X),z.delete(X),N.fetchers.delete(X)}function et(X){let ie=(Q.get(X)||0)-1;ie<=0?(Q.delete(X),le.add(X)):Q.set(X,ie),te({fetchers:new Map(N.fetchers)})}function ze(X,ie){let de=H.get(X);de&&(de.abort(ie),H.delete(X))}function Ze(X){for(let ie of X){let de=Ne(ie),ke=Ia(de.data);N.fetchers.set(ie,ke)}}function tt(){let X=[],ie=!1;for(let de of G){let ke=N.fetchers.get(de);Vt(ke,`Expected fetcher: ${de}`),ke.state==="loading"&&(G.delete(de),X.push(de),ie=!0)}return Ze(X),ie}function Rt(X){let ie=[];for(let[de,ke]of U)if(ke<X){let je=N.fetchers.get(de);Vt(je,`Expected fetcher: ${de}`),je.state==="loading"&&(ze(de),U.delete(de),ie.push(de))}return Ze(ie),ie.length>0}function zt(X,ie){let de=N.blockers.get(X)||Iu;return ae.get(X)!==ie&&ae.set(X,ie),de}function yt(X){N.blockers.delete(X),ae.delete(X)}function Nt(X,ie){let de=N.blockers.get(X)||Iu;Vt(de.state==="unblocked"&&ie.state==="blocked"||de.state==="blocked"&&ie.state==="blocked"||de.state==="blocked"&&ie.state==="proceeding"||de.state==="blocked"&&ie.state==="unblocked"||de.state==="proceeding"&&ie.state==="unblocked",`Invalid blocker state transition: ${de.state} -> ${ie.state}`);let ke=new Map(N.blockers);ke.set(X,ie),te({blockers:ke})}function it({currentLocation:X,nextLocation:ie,historyAction:de}){if(ae.size===0)return;ae.size>1&&Qn(!1,"A router only supports one blocker at a time");let ke=Array.from(ae.entries()),[je,rt]=ke[ke.length-1],nt=N.blockers.get(je);if(!(nt&&nt.state==="proceeding")&&rt({currentLocation:X,nextLocation:ie,historyAction:de}))return je}function ft(X){let ie=yi(404,{pathname:X}),de=f||c,{matches:ke,route:je}=Sh(de);return{notFoundMatches:ke,route:je,error:ie}}function bt(X,ie,de){if(w=X,R=ie,C=de||null,!E&&N.navigation===eb){E=!0;let ke=_t(N.location,N.matches);ke!=null&&te({restoreScrollPosition:ke})}return()=>{w=null,R=null,C=null}}function Ke(X,ie){return C&&C(X,ie.map(ke=>kz(ke,N.loaderData)))||X.key}function kt(X,ie){if(w&&R){let de=Ke(X,ie);w[de]=R()}}function _t(X,ie){if(w){let de=Ke(X,ie),ke=w[de];if(typeof ke=="number")return ke}return null}function Tt(X,ie,de){if(e.patchRoutesOnNavigation)if(X){if(Object.keys(X[0].params).length>0)return{active:!0,matches:Gu(ie,de,d,!0)}}else return{active:!0,matches:Gu(ie,de,d,!0)||[]};return{active:!1,matches:null}}async function dn(X,ie,de,ke){if(!e.patchRoutesOnNavigation)return{type:"success",matches:X};let je=X;for(;;){let rt=f==null,nt=f||c,Ye=l;try{await e.patchRoutesOnNavigation({signal:de,path:ie,matches:je,fetcherKey:ke,patch:(Et,ht)=>{de.aborted||ZC(Et,ht,nt,Ye,o,!1)}})}catch(Et){return{type:"error",error:Et,partialMatches:je}}finally{rt&&!de.aborted&&(c=[...c])}if(de.aborted)return{type:"aborted"};let Xe=Ro(nt,ie,d),ot=null;if(Xe){if(Object.keys(Xe[0].params).length===0)return{type:"success",matches:Xe};if(ot=Gu(nt,ie,d,!0),!(ot&&je.length<ot.length&&Ut(je,ot.slice(0,je.length))))return{type:"success",matches:Xe}}if(ot||(ot=Gu(nt,ie,d,!0)),!ot||Ut(je,ot))return{type:"success",matches:null};je=ot}}function Ut(X,ie){return X.length===ie.length&&X.every((de,ke)=>de.route.id===ie[ke].route.id)}function Je(X){l={},f=xd(X,o,void 0,l)}function Mt(X,ie,de=!1){let ke=f==null;ZC(X,ie,f||c,l,o,de),ke&&(c=[...c],te({}))}return A={get basename(){return d},get future(){return h},get state(){return N},get routes(){return c},get window(){return t},initialize:ve,subscribe:Le,enableScrollRestoration:bt,navigate:ye,fetch:xe,revalidate:_e,createHref:X=>e.history.createHref(X),encodeLocation:X=>e.history.encodeLocation(X),getFetcher:Ne,resetFetcher:He,deleteFetcher:et,dispose:Se,getBlocker:zt,deleteBlocker:yt,patchRoutes:Mt,_internalFetchControllers:H,_internalSetRoutes:Je,_internalSetStateDoNotUseOrYouWillBreakYourApp(X){te(X)}},e.unstable_instrumentations&&(A=$z(A,e.unstable_instrumentations.map(X=>X.router).filter(Boolean))),A}function r4(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function xv(e,t,n,r,a,o){let l,c;if(a){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let f=zx(r||".",jx(l),Ci(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&c){let d=Hx(f.search);if(c.route.index&&!d)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!c.route.index&&d){let m=new URLSearchParams(f.search),h=m.getAll("index");m.delete("index"),h.filter(g=>g).forEach(g=>m.append("index",g));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=Fz({basename:n,pathname:f.pathname})),aa(f)}function XC(e,t,n){if(!n||!r4(n))return{path:t};if(n.formMethod&&!S4(n.formMethod))return{path:t,error:yi(405,{method:n.formMethod})};let r=()=>({path:t,error:yi(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),l=t2(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!yr(o))return r();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[g,w])=>`${y}${g}=${w}
|
|
75
|
-
`,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!yr(o))return r();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return r()}}}Vt(typeof FormData=="function","FormData is not available in this environment");let c,f;if(n.formData)c=Ev(n.formData),f=n.formData;else if(n.body instanceof FormData)c=Ev(n.body),f=n.body;else if(n.body instanceof URLSearchParams)c=n.body,f=rR(c);else if(n.body==null)c=new URLSearchParams,f=new FormData;else try{c=new URLSearchParams(n.body),f=rR(c)}catch{return r()}let d={formMethod:o,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(yr(d.formMethod))return{path:t,submission:d};let m=Wo(t);return e&&m.search&&Hx(m.search)&&c.append("index",""),m.search=`?${c}`,{path:aa(m),submission:d}}function QC(e,t,n,r,a,o,l,c,f,d,m,h,y,g,w,C,R,E,T,k,M){var B;let D=k?ei(k[1])?k[1].error:k[1].data:void 0,A=a.createURL(o.location),N=a.createURL(f),L;if(m&&o.errors){let j=Object.keys(o.errors)[0];L=l.findIndex(z=>z.route.id===j)}else if(k&&ei(k[1])){let j=k[0];L=l.findIndex(z=>z.route.id===j)-1}let q=k?k[1].statusCode:void 0,F=q&&q>=400,Y={currentUrl:A,currentParams:((B=o.matches[0])==null?void 0:B.params)||{},nextUrl:N,nextParams:l[0].params,...c,actionResult:D,actionStatus:q},_=Fd(l),V=l.map((j,z)=>{let{route:H}=j,K=null;if(L!=null&&z>L?K=!1:H.lazy?K=!0:Fx(H)?m?K=wv(H,o.loaderData,o.errors):i4(o.loaderData,o.matches[z],j)&&(K=!0):K=!1,K!==null)return Sv(n,r,e,_,j,d,t,K);let P=!1;typeof M=="boolean"?P=M:F?P=!1:(h||A.pathname+A.search===N.pathname+N.search||A.search!==N.search||a4(o.matches[z],j))&&(P=!0);let U={...Y,defaultShouldRevalidate:P},G=ed(j,U);return Sv(n,r,e,_,j,d,t,G,U,M)}),$=[];return w.forEach((j,z)=>{if(m||!l.some(le=>le.route.id===j.routeId)||g.has(z))return;let H=o.fetchers.get(z),K=H&&H.state!=="idle"&&H.data===void 0,P=Ro(R,j.path,E);if(!P){if(T&&K)return;$.push({key:z,routeId:j.routeId,path:j.path,matches:null,match:null,request:null,controller:null});return}if(C.has(z))return;let U=Jh(P,j.path),G=new AbortController,I=$l(a,j.path,G.signal),Q=null;if(y.has(z))y.delete(z),Q=Xl(n,r,I,P,U,d,t);else if(K)h&&(Q=Xl(n,r,I,P,U,d,t));else{let le;typeof M=="boolean"?le=M:F?le=!1:le=h;let ae={...Y,defaultShouldRevalidate:le};ed(U,ae)&&(Q=Xl(n,r,I,P,U,d,t,ae))}Q&&$.push({key:z,routeId:j.routeId,path:j.path,matches:Q,match:U,request:I,controller:G})}),{dsMatches:V,revalidatingFetchers:$}}function Fx(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function wv(e,t,n){if(e.lazy)return!0;if(!Fx(e))return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function i4(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function a4(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ed(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function ZC(e,t,n,r,a,o){let l;if(e){let d=r[e];Vt(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),l=d.children}else l=n;let c=[],f=[];if(t.forEach(d=>{let m=l.find(h=>XM(d,h));m?f.push({existingRoute:m,newRoute:d}):c.push(d)}),c.length>0){let d=xd(c,a,[e||"_","patch",String((l==null?void 0:l.length)||"0")],r);l.push(...d)}if(o&&f.length>0)for(let d=0;d<f.length;d++){let{existingRoute:m,newRoute:h}=f[d],y=m,[g]=xd([h],a,[],{},!0);Object.assign(y,{element:g.element?g.element:y.element,errorElement:g.errorElement?g.errorElement:y.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:y.hydrateFallbackElement})}}function XM(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(o=>XM(n,o))}):!1}var JC=new WeakMap,QM=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(Vt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let l=JC.get(a);l||(l={},JC.set(a,l));let c=l[e];if(c)return c;let f=(async()=>{let d=Ez(e),h=a[e]!==void 0&&e!=="hasErrorBoundary";if(d)Qn(!d,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(h)Qn(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await o();y!=null&&(Object.assign(a,{[e]:y}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(y=>y===void 0)&&(a.lazy=void 0))})();return l[e]=f,f},eR=new WeakMap;function o4(e,t,n,r,a){let o=n[e.id];if(Vt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=eR.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let h=(async()=>{Vt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),g={};for(let w in y){let C=y[w];if(C===void 0)continue;let R=Rz(w),T=o[w]!==void 0&&w!=="hasErrorBoundary";R?Qn(!R,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?Qn(!T,`Route "${o.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):g[w]=C}Object.assign(o,g),Object.assign(o,{...r(o),lazy:void 0})})();return eR.set(o,h),h.catch(()=>{}),{lazyRoutePromise:h,lazyHandlerPromise:h}}let l=Object.keys(e.lazy),c=[],f;for(let m of l){if(a&&a.includes(m))continue;let h=QM({key:m,route:e,manifest:n,mapRouteProperties:r});h&&(c.push(h),m===t&&(f=h))}let d=c.length>0?Promise.all(c).then(()=>{}):void 0;return d==null||d.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:f}}async function tR(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{n[t[o].route.id]=a}),n}async function s4(e){return e.matches.some(t=>t.route.middleware)?ZM(e,()=>tR(e)):tR(e)}function ZM(e,t){return l4(e,t,r=>{if(w4(r))throw r;return r},y4,n);function n(r,a,o){if(o)return Promise.resolve(Object.assign(o.value,{[a]:{type:"error",result:r}}));{let{matches:l}=e,c=Math.min(Math.max(l.findIndex(d=>d.route.id===a),0),Math.max(l.findIndex(d=>d.shouldCallHandler()),0)),f=To(l,l[c].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function l4(e,t,n,r,a){let{matches:o,request:l,params:c,context:f,unstable_pattern:d}=e,m=o.flatMap(y=>y.route.middleware?y.route.middleware.map(g=>[y.route.id,g]):[]);return await JM({request:l,params:c,context:f,unstable_pattern:d},m,t,n,r,a)}async function JM(e,t,n,r,a,o,l=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason??new Error(`Request aborted: ${c.method} ${c.url}`);let f=t[l];if(!f)return await n();let[d,m]=f,h,y=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");try{return h={value:await JM(e,t,n,r,a,o,l+1)},h.value}catch(g){return h={value:await o(g,d,h)},h.value}};try{let g=await m(e,y),w=g!=null?r(g):void 0;return a(w)?w:h?w??h.value:(h={value:await y()},h.value)}catch(g){return await o(g,d,h)}}function e2(e,t,n,r,a){let o=QM({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),l=o4(r.route,yr(n.method)?"action":"loader",t,e,a);return{middleware:o,route:l.lazyRoutePromise,handler:l.lazyHandlerPromise}}function Sv(e,t,n,r,a,o,l,c,f=null,d){let m=!1,h=e2(e,t,n,a,o);return{...a,_lazyPromises:h,shouldLoad:c,shouldRevalidateArgs:f,shouldCallHandler(y){return m=!0,f?typeof d=="boolean"?ed(a,{...f,defaultShouldRevalidate:d}):typeof y=="boolean"?ed(a,{...f,defaultShouldRevalidate:y}):ed(a,f):c},resolve(y){let{lazy:g,loader:w,middleware:C}=a.route,R=m||c||y&&!yr(n.method)&&(g||w),E=C&&C.length>0&&!w&&!g;return R&&(yr(n.method)||!E)?u4({request:n,unstable_pattern:r,match:a,lazyHandlerPromise:h==null?void 0:h.handler,lazyRoutePromise:h==null?void 0:h.route,handlerOverride:y,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Xl(e,t,n,r,a,o,l,c=null){return r.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,shouldRevalidateArgs:c,shouldCallHandler:()=>!1,_lazyPromises:e2(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Sv(e,t,n,Fd(r),f,o,l,!0,c))}async function c4(e,t,n,r,a,o){n.some(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(d=>{var m;return(m=d._lazyPromises)==null?void 0:m.middleware}));let l={request:t,unstable_pattern:Fd(n),params:n[0].params,context:a,matches:n},f=await e({...l,fetcherKey:r,runClientMiddleware:d=>{let m=l;return ZM(m,()=>d({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(d=>{var m,h;return[(m=d._lazyPromises)==null?void 0:m.handler,(h=d._lazyPromises)==null?void 0:h.route]}))}catch{}return f}async function u4({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:a,handlerOverride:o,scopedContext:l}){let c,f,d=yr(e.method),m=d?"action":"loader",h=y=>{let g,w=new Promise((E,T)=>g=T);f=()=>g(),e.signal.addEventListener("abort",f);let C=E=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:l},...E!==void 0?[E]:[]),R=(async()=>{try{return{type:"data",result:await(o?o(T=>C(T)):C())}}catch(E){return{type:"error",result:E}}})();return Promise.race([R,w])};try{let y=d?n.route.action:n.route.loader;if(r||a)if(y){let g,[w]=await Promise.all([h(y).catch(C=>{g=C}),r,a]);if(g!==void 0)throw g;c=w}else{await r;let g=d?n.route.action:n.route.loader;if(g)[c]=await Promise.all([h(g),a]);else if(m==="action"){let w=new URL(e.url),C=w.pathname+w.search;throw yi(405,{method:e.method,pathname:C,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)c=await h(y);else{let g=new URL(e.url),w=g.pathname+g.search;throw yi(404,{pathname:w})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return c}async function d4(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function f4(e){var r,a,o,l,c;let{result:t,type:n}=e;if(Bx(t)){let f;try{f=await d4(t)}catch(d){return{type:"error",error:d}}return n==="error"?{type:"error",error:new zd(t.status,t.statusText,f),statusCode:t.status,headers:t.headers}:{type:"data",data:f,statusCode:t.status,headers:t.headers}}return n==="error"?sR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:g4(t),statusCode:wd(t)?t.status:void 0,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:wd(t)?t.status:void 0}:sR(t)?{type:"data",data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function h4(e,t,n,r,a){let o=e.headers.get("Location");if(Vt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!_x(o)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);o=xv(new URL(t.url),l,a,o),e.headers.set("Location",o)}return e}function nR(e,t,n,r){let a=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(_x(e)){let o=e,l=o.startsWith("//")?new URL(t.protocol+o):new URL(o);if(a.includes(l.protocol))throw new Error("Invalid redirect location");let c=Ci(l.pathname,n)!=null;if(l.origin===t.origin&&c)return l.pathname+l.search+l.hash}try{let o=r.createURL(e);if(a.includes(o.protocol))throw new Error("Invalid redirect location")}catch{}return e}function $l(e,t,n,r){let a=e.createURL(t2(t)).toString(),o={signal:n};if(r&&yr(r.formMethod)){let{formMethod:l,formEncType:c}=r;o.method=l.toUpperCase(),c==="application/json"?(o.headers=new Headers({"Content-Type":c}),o.body=JSON.stringify(r.json)):c==="text/plain"?o.body=r.text:c==="application/x-www-form-urlencoded"&&r.formData?o.body=Ev(r.formData):o.body=r.formData}return new Request(a,o)}function Ev(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function rR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function p4(e,t,n,r=!1,a=!1){let o={},l=null,c,f=!1,d={},m=n&&ei(n[1])?n[1].error:void 0;return e.forEach(h=>{if(!(h.route.id in t))return;let y=h.route.id,g=t[y];if(Vt(!Rs(g),"Cannot handle redirect results in processLoaderData"),ei(g)){let w=g.error;if(m!==void 0&&(w=m,m=void 0),l=l||{},a)l[y]=w;else{let C=To(e,y);l[C.route.id]==null&&(l[C.route.id]=w)}r||(o[y]=GM),f||(f=!0,c=wd(g.error)?g.error.status:500),g.headers&&(d[y]=g.headers)}else o[y]=g.data,g.statusCode&&g.statusCode!==200&&!f&&(c=g.statusCode),g.headers&&(d[y]=g.headers)}),m!==void 0&&n&&(l={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:l,statusCode:c||200,loaderHeaders:d}}function iR(e,t,n,r,a,o){let{loaderData:l,errors:c}=p4(t,n,r);return a.filter(f=>!f.matches||f.matches.some(d=>d.shouldLoad)).forEach(f=>{let{key:d,match:m,controller:h}=f;if(h&&h.signal.aborted)return;let y=o[d];if(Vt(y,"Did not find corresponding fetcher result"),ei(y)){let g=To(e.matches,m==null?void 0:m.route.id);c&&c[g.route.id]||(c={...c,[g.route.id]:y.error}),e.fetchers.delete(d)}else if(Rs(y))Vt(!1,"Unhandled fetcher revalidation redirect");else{let g=Ia(y.data);e.fetchers.set(d,g)}}),{loaderData:l,errors:c}}function aR(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==GM).reduce((o,[l,c])=>(o[l]=c,o),{});for(let o of n){let l=o.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&o.route.loader&&(a[l]=e[l]),r&&r.hasOwnProperty(l))break}return a}function oR(e){return e?ei(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function To(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Sh(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function yi(e,{pathname:t,routeId:n,method:r,type:a,message:o}={}){let l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",r&&t&&n?c=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",c=`No route matches URL "${t}"`):e===405&&(l="Method Not Allowed",r&&t&&n?c=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(c=`Invalid request method "${r.toUpperCase()}"`)),new zd(e||500,l,new Error(c),!0)}function Eh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(Rs(a))return{key:r,result:a}}}function t2(e){let t=typeof e=="string"?Wo(e):e;return aa({...t,hash:""})}function m4(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function g4(e){var t,n;return new zd(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function y4(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&b4(n))}function b4(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function v4(e){return Bx(e.result)&&YM.has(e.result.status)}function ei(e){return e.type==="error"}function Rs(e){return(e&&e.type)==="redirect"}function sR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Bx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function x4(e){return YM.has(e)}function w4(e){return Bx(e)&&x4(e.status)&&e.headers.has("Location")}function S4(e){return Zz.has(e.toUpperCase())}function yr(e){return Xz.has(e.toUpperCase())}function Hx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Jh(e,t){let n=typeof t=="string"?Wo(t).search:t.search;if(e[e.length-1].route.index&&Hx(n||""))return e[e.length-1];let r=UM(e);return r[r.length-1]}function lR(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:l}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function tb(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function E4(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Pu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function C4(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Ia(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function R4(e,t){try{let n=e.sessionStorage.getItem(KM);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function T4(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(KM,JSON.stringify(n))}catch(r){Qn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function cR(){let e,t,n=new Promise((r,a)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{a(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var tl=v.createContext(null);tl.displayName="DataRouter";var Bd=v.createContext(null);Bd.displayName="DataRouterState";var n2=v.createContext(!1);function k4(){return v.useContext(n2)}var Ux=v.createContext({isTransitioning:!1});Ux.displayName="ViewTransition";var r2=v.createContext(new Map);r2.displayName="Fetchers";var M4=v.createContext(null);M4.displayName="Await";var Ti=v.createContext(null);Ti.displayName="Navigation";var Xp=v.createContext(null);Xp.displayName="Location";var Ui=v.createContext({outlet:null,matches:[],isDataRoute:!1});Ui.displayName="Route";var qx=v.createContext(null);qx.displayName="RouteError";var i2="REACT_ROUTER_ERROR",A4="REDIRECT",N4="ROUTE_ERROR_RESPONSE";function O4(e){if(e.startsWith(`${i2}:${A4}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function D4(e){if(e.startsWith(`${i2}:${N4}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new zd(t.status,t.statusText,t.data)}catch{}}function I4(e,{relative:t}={}){Vt(Ac(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(Ti),{hash:a,pathname:o,search:l}=Ud(e,{relative:t}),c=o;return n!=="/"&&(c=o==="/"?n:na([n,o])),r.createHref({pathname:c,search:l,hash:a})}function Ac(){return v.useContext(Xp)!=null}function qi(){return Vt(Ac(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Xp).location}function P4(e){Vt(Ac(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=qi();return v.useMemo(()=>Us(e,BM(t)),[t,e])}var a2="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function o2(e){v.useContext(Ti).static||v.useLayoutEffect(e)}function Hd(){let{isDataRoute:e}=v.useContext(Ui);return e?X4():L4()}function L4(){Vt(Ac(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(tl),{basename:t,navigator:n}=v.useContext(Ti),{matches:r}=v.useContext(Ui),{pathname:a}=qi(),o=JSON.stringify(jx(r)),l=v.useRef(!1);return o2(()=>{l.current=!0}),v.useCallback((f,d={})=>{if(Qn(l.current,a2),!l.current)return;if(typeof f=="number"){n.go(f);return}let m=zx(f,JSON.parse(o),a,d.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:na([t,m.pathname])),(d.replace?n.replace:n.push)(m,d.state,d)},[t,n,o,a,e])}var _4=v.createContext(null);function j4(e){let t=v.useContext(Ui).outlet;return v.useMemo(()=>t&&v.createElement(_4.Provider,{value:e},t),[t,e])}function z4(){let{matches:e}=v.useContext(Ui),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=v.useContext(Ui),{pathname:r}=qi(),a=JSON.stringify(jx(n));return v.useMemo(()=>zx(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function F4(e,t,n,r,a){Vt(Ac(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o}=v.useContext(Ti),{matches:l}=v.useContext(Ui),c=l[l.length-1],f=c?c.params:{},d=c?c.pathname:"/",m=c?c.pathnameBase:"/",h=c&&c.route;{let T=h&&h.path||"";l2(d,!h||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
76
|
-
|
|
77
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let y=qi(),g;g=y;let w=g.pathname||"/",C=w;if(m!=="/"){let T=m.replace(/^\//,"").split("/");C="/"+w.replace(/^\//,"").split("/").slice(T.length).join("/")}let R=Ro(e,{pathname:C});return Qn(h||R!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Qn(R==null||R[R.length-1].route.element!==void 0||R[R.length-1].route.Component!==void 0||R[R.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),V4(R&&R.map(T=>Object.assign({},T,{params:Object.assign({},f,T.params),pathname:na([m,o.encodeLocation?o.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:na([m,o.encodeLocation?o.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),l,n,r,a)}function B4(){let e=G4(),t=wd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:o},"ErrorBoundary")," or"," ",v.createElement("code",{style:o},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:a},n):null,l)}var H4=v.createElement(B4,null),s2=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=D4(e.digest);n&&(e=n)}let t=e!==void 0?v.createElement(Ui.Provider,{value:this.props.routeContext},v.createElement(qx.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?v.createElement(U4,{error:e},t):t}};s2.contextType=n2;var nb=new WeakMap;function U4({children:e,error:t}){let{basename:n}=v.useContext(Ti);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=O4(t.digest);if(r){let a=nb.get(t);if(a)throw a;let o=VM(r.location,n);if(qM&&!nb.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw nb.set(t,l),l}return v.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function q4({routeContext:e,match:t,children:n}){let r=v.useContext(tl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Ui.Provider,{value:e},n)}function V4(e,t=[],n=null,r=null,a=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let o=e,l=n==null?void 0:n.errors;if(l!=null){let m=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);Vt(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(l).join(",")}`),o=o.slice(0,Math.min(o.length,m+1))}let c=!1,f=-1;if(n)for(let m=0;m<o.length;m++){let h=o[m];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(f=m),h.route.id){let{loaderData:y,errors:g}=n,w=h.route.loader&&!y.hasOwnProperty(h.route.id)&&(!g||g[h.route.id]===void 0);if(h.route.lazy||w){c=!0,f>=0?o=o.slice(0,f+1):o=[o[0]];break}}}let d=n&&r?(m,h)=>{var y,g;r(m,{location:n.location,params:((g=(y=n.matches)==null?void 0:y[0])==null?void 0:g.params)??{},unstable_pattern:Fd(n.matches),errorInfo:h})}:void 0;return o.reduceRight((m,h,y)=>{let g,w=!1,C=null,R=null;n&&(g=l&&h.route.id?l[h.route.id]:void 0,C=h.route.errorElement||H4,c&&(f<0&&y===0?(l2("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):f===y&&(w=!0,R=h.route.hydrateFallbackElement||null)));let E=t.concat(o.slice(0,y+1)),T=()=>{let k;return g?k=C:w?k=R:h.route.Component?k=v.createElement(h.route.Component,null):h.route.element?k=h.route.element:k=m,v.createElement(q4,{match:h,routeContext:{outlet:m,matches:E,isDataRoute:n!=null},children:k})};return n&&(h.route.ErrorBoundary||h.route.errorElement||y===0)?v.createElement(s2,{location:n.location,revalidation:n.revalidation,component:C,error:g,children:T(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:d}):T()},null)}function Vx(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function $4(e){let t=v.useContext(tl);return Vt(t,Vx(e)),t}function W4(e){let t=v.useContext(Bd);return Vt(t,Vx(e)),t}function Y4(e){let t=v.useContext(Ui);return Vt(t,Vx(e)),t}function $x(e){let t=Y4(e),n=t.matches[t.matches.length-1];return Vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function K4(){return $x("useRouteId")}function G4(){var r;let e=v.useContext(qx),t=W4("useRouteError"),n=$x("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function X4(){let{router:e}=$4("useNavigate"),t=$x("useNavigate"),n=v.useRef(!1);return o2(()=>{n.current=!0}),v.useCallback(async(a,o={})=>{Qn(n.current,a2),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var uR={};function l2(e,t,n){!t&&!uR[e]&&(uR[e]=!0,Qn(!1,n))}var dR={};function fR(e,t){!e&&!dR[t]&&(dR[t]=!0,console.warn(t))}var Q4="useOptimistic",hR=Px[Q4],Z4=()=>{};function J4(e){return hR?hR(e):[e,Z4]}function e3(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Qn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Qn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Qn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var t3=["HydrateFallback","hydrateFallbackElement"],n3=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function r3({router:e,flushSync:t,onError:n,unstable_useTransitions:r}){r=k4()||r;let[o,l]=v.useState(e.state),[c,f]=J4(o),[d,m]=v.useState(),[h,y]=v.useState({isTransitioning:!1}),[g,w]=v.useState(),[C,R]=v.useState(),[E,T]=v.useState(),k=v.useRef(new Map),M=v.useCallback((L,{deletedFetchers:q,newErrors:F,flushSync:Y,viewTransitionOpts:_})=>{F&&n&&Object.values(F).forEach($=>{var B;return n($,{location:L.location,params:((B=L.matches[0])==null?void 0:B.params)??{},unstable_pattern:Fd(L.matches)})}),L.fetchers.forEach(($,B)=>{$.data!==void 0&&k.current.set(B,$.data)}),q.forEach($=>k.current.delete($)),fR(Y===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let V=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(fR(_==null||V,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!V){t&&Y?t(()=>l(L)):r===!1?l(L):v.startTransition(()=>{r===!0&&f($=>pR($,L)),l(L)});return}if(t&&Y){t(()=>{C&&(g==null||g.resolve(),C.skipTransition()),y({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let $=e.window.document.startViewTransition(()=>{t(()=>l(L))});$.finished.finally(()=>{t(()=>{w(void 0),R(void 0),m(void 0),y({isTransitioning:!1})})}),t(()=>R($));return}C?(g==null||g.resolve(),C.skipTransition(),T({state:L,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(m(L),y({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,C,g,r,f,n]);v.useLayoutEffect(()=>e.subscribe(M),[e,M]),v.useEffect(()=>{h.isTransitioning&&!h.flushSync&&w(new n3)},[h]),v.useEffect(()=>{if(g&&d&&e.window){let L=d,q=g.promise,F=e.window.document.startViewTransition(async()=>{r===!1?l(L):v.startTransition(()=>{r===!0&&f(Y=>pR(Y,L)),l(L)}),await q});F.finished.finally(()=>{w(void 0),R(void 0),m(void 0),y({isTransitioning:!1})}),R(F)}},[d,g,e.window,r,f]),v.useEffect(()=>{g&&d&&c.location.key===d.location.key&&g.resolve()},[g,C,c.location,d]),v.useEffect(()=>{!h.isTransitioning&&E&&(m(E.state),y({isTransitioning:!0,flushSync:!1,currentLocation:E.currentLocation,nextLocation:E.nextLocation}),T(void 0))},[h.isTransitioning,E]);let D=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:L=>e.navigate(L),push:(L,q,F)=>e.navigate(L,{state:q,preventScrollReset:F==null?void 0:F.preventScrollReset}),replace:(L,q,F)=>e.navigate(L,{replace:!0,state:q,preventScrollReset:F==null?void 0:F.preventScrollReset})}),[e]),A=e.basename||"/",N=v.useMemo(()=>({router:e,navigator:D,static:!1,basename:A,onError:n}),[e,D,A,n]);return v.createElement(v.Fragment,null,v.createElement(tl.Provider,{value:N},v.createElement(Bd.Provider,{value:c},v.createElement(r2.Provider,{value:k.current},v.createElement(Ux.Provider,{value:h},v.createElement(s3,{basename:A,location:c.location,navigationType:c.historyAction,navigator:D,unstable_useTransitions:r},v.createElement(i3,{routes:e.routes,future:e.future,state:c,onError:n})))))),null)}function pR(e,t){return{...e,navigation:t.navigation.state!=="idle"?t.navigation:e.navigation,revalidation:t.revalidation!=="idle"?t.revalidation:e.revalidation,actionData:t.navigation.state!=="submitting"?t.actionData:e.actionData,fetchers:t.fetchers}}var i3=v.memo(a3);function a3({routes:e,future:t,state:n,onError:r}){return F4(e,void 0,n,r,t)}function o3(e){return j4(e.context)}function s3({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){Vt(!Ac(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),f=v.useMemo(()=>({basename:c,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[c,a,o,l]);typeof n=="string"&&(n=Wo(n));let{pathname:d="/",search:m="",hash:h="",state:y=null,key:g="default"}=n,w=v.useMemo(()=>{let C=Ci(d,c);return C==null?null:{location:{pathname:C,search:m,hash:h,state:y,key:g},navigationType:r}},[c,d,m,h,y,g,r]);return Qn(w!=null,`<Router basename="${c}"> is not able to match the URL "${d}${m}${h}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:v.createElement(Ti.Provider,{value:f},v.createElement(Xp.Provider,{children:t,value:w}))}var ep="get",tp="application/x-www-form-urlencoded";function Qp(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function l3(e){return Qp(e)&&e.tagName.toLowerCase()==="button"}function c3(e){return Qp(e)&&e.tagName.toLowerCase()==="form"}function u3(e){return Qp(e)&&e.tagName.toLowerCase()==="input"}function d3(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function f3(e,t){return e.button===0&&(!t||t==="_self")&&!d3(e)}var Ch=null;function h3(){if(Ch===null)try{new FormData(document.createElement("form"),0),Ch=!1}catch{Ch=!0}return Ch}var p3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function rb(e){return e!=null&&!p3.has(e)?(Qn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${tp}"`),null):e}function m3(e,t){let n,r,a,o,l;if(c3(e)){let c=e.getAttribute("action");r=c?Ci(c,t):null,n=e.getAttribute("method")||ep,a=rb(e.getAttribute("enctype"))||tp,o=new FormData(e)}else if(l3(e)||u3(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||c.getAttribute("action");if(r=f?Ci(f,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||ep,a=rb(e.getAttribute("formenctype"))||rb(c.getAttribute("enctype"))||tp,o=new FormData(c,e),!h3()){let{name:d,type:m,value:h}=e;if(m==="image"){let y=d?`${d}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else d&&o.append(d,h)}}else{if(Qp(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ep,r=null,a=tp,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Wx(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function g3(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&Ci(a.pathname,t)==="/"?a.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:a.pathname=`${a.pathname.replace(/\/$/,"")}.${r}`,a}async function y3(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function b3(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function v3(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await y3(o,n);return l.links?l.links():[]}return[]}));return E3(r.flat(1).filter(b3).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function mR(e,t,n,r,a,o){let l=(f,d)=>n[d]?f.route.id!==n[d].route.id:!0,c=(f,d)=>{var m;return n[d].pathname!==f.pathname||((m=n[d].route.path)==null?void 0:m.endsWith("*"))&&n[d].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,d)=>l(f,d)||c(f,d)):o==="data"?t.filter((f,d)=>{var h;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(l(f,d)||c(f,d))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((h=n[0])==null?void 0:h.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function x3(e,t,{includeHydrateFallback:n}={}){return w3(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function w3(e){return[...new Set(e)]}function S3(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function E3(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(S3(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function c2(){let e=v.useContext(tl);return Wx(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function C3(){let e=v.useContext(Bd);return Wx(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yx=v.createContext(void 0);Yx.displayName="FrameworkContext";function u2(){let e=v.useContext(Yx);return Wx(e,"You must render this element inside a <HydratedRouter> element"),e}function R3(e,t){let n=v.useContext(Yx),[r,a]=v.useState(!1),[o,l]=v.useState(!1),{onFocus:c,onBlur:f,onMouseEnter:d,onMouseLeave:m,onTouchStart:h}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let C=E=>{E.forEach(T=>{l(T.isIntersecting)})},R=new IntersectionObserver(C,{threshold:.5});return y.current&&R.observe(y.current),()=>{R.disconnect()}}},[e]),v.useEffect(()=>{if(r){let C=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(C)}}},[r]);let g=()=>{a(!0)},w=()=>{a(!1),l(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Lu(c,g),onBlur:Lu(f,w),onMouseEnter:Lu(d,g),onMouseLeave:Lu(m,w),onTouchStart:Lu(h,g)}]:[!1,y,{}]}function Lu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function T3({page:e,...t}){let{router:n}=c2(),r=v.useMemo(()=>Ro(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(M3,{page:e,matches:r,...t}):null}function k3(e){let{manifest:t,routeModules:n}=u2(),[r,a]=v.useState([]);return v.useEffect(()=>{let o=!1;return v3(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function M3({page:e,matches:t,...n}){let r=qi(),{future:a,manifest:o,routeModules:l}=u2(),{basename:c}=c2(),{loaderData:f,matches:d}=C3(),m=v.useMemo(()=>mR(e,t,d,o,r,"data"),[e,t,d,o,r]),h=v.useMemo(()=>mR(e,t,d,o,r,"assets"),[e,t,d,o,r]),y=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,R=!1;if(t.forEach(T=>{var M;let k=o.routes[T.route.id];!k||!k.hasLoader||(!m.some(D=>D.route.id===T.route.id)&&T.route.id in f&&((M=l[T.route.id])!=null&&M.shouldRevalidate)||k.hasClientLoader?R=!0:C.add(T.route.id))}),C.size===0)return[];let E=g3(e,c,a.unstable_trailingSlashAwareDataRequests,"data");return R&&C.size>0&&E.searchParams.set("_routes",t.filter(T=>C.has(T.route.id)).map(T=>T.route.id).join(",")),[E.pathname+E.search]},[c,a.unstable_trailingSlashAwareDataRequests,f,r,o,m,t,e,l]),g=v.useMemo(()=>x3(h,o),[h,o]),w=k3(h);return v.createElement(v.Fragment,null,y.map(C=>v.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...n})),g.map(C=>v.createElement("link",{key:C,rel:"modulepreload",href:C,...n})),w.map(({key:C,link:R})=>v.createElement("link",{key:C,nonce:n.nonce,...R,crossOrigin:R.crossOrigin??n.crossOrigin})))}function A3(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var N3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{N3&&(window.__reactRouterVersion="7.13.0")}catch{}function O3(e,t){return n4({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:vz({window:t==null?void 0:t.window}),hydrationData:D3(),routes:e,mapRouteProperties:e3,hydrationRouteProperties:t3,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window,unstable_instrumentations:t==null?void 0:t.unstable_instrumentations}).initialize()}function D3(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:I3(e.errors)}),e}function I3(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new zd(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let l=new o(a.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}var d2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kx=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:l,state:c,target:f,to:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},w){let{basename:C,unstable_useTransitions:R}=v.useContext(Ti),E=typeof d=="string"&&d2.test(d),T=VM(d,C);d=T.to;let k=I4(d,{relative:a}),[M,D,A]=R3(r,g),N=j3(d,{replace:l,state:c,target:f,preventScrollReset:m,relative:a,viewTransition:h,unstable_defaultShouldRevalidate:y,unstable_useTransitions:R});function L(F){t&&t(F),F.defaultPrevented||N(F)}let q=v.createElement("a",{...g,...A,href:T.absoluteURL||k,onClick:T.isExternal||o?t:L,ref:A3(w,D),target:f,"data-discover":!E&&n==="render"?"true":void 0});return M&&!E?v.createElement(v.Fragment,null,q,v.createElement(T3,{page:k})):q});Kx.displayName="Link";var P3=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:l,viewTransition:c,children:f,...d},m){let h=Ud(l,{relative:d.relative}),y=qi(),g=v.useContext(Bd),{navigator:w,basename:C}=v.useContext(Ti),R=g!=null&&U3(h)&&c===!0,E=w.encodeLocation?w.encodeLocation(h).pathname:h.pathname,T=y.pathname,k=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(T=T.toLowerCase(),k=k?k.toLowerCase():null,E=E.toLowerCase()),k&&C&&(k=Ci(k,C)||k);const M=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=T===E||!a&&T.startsWith(E)&&T.charAt(M)==="/",A=k!=null&&(k===E||!a&&k.startsWith(E)&&k.charAt(E.length)==="/"),N={isActive:D,isPending:A,isTransitioning:R},L=D?t:void 0,q;typeof r=="function"?q=r(N):q=[r,D?"active":null,A?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(N):o;return v.createElement(Kx,{...d,"aria-current":L,className:q,ref:m,style:F,to:l,viewTransition:c},typeof f=="function"?f(N):f)});P3.displayName="NavLink";var L3=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=ep,action:c,onSubmit:f,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y,...g},w)=>{let{unstable_useTransitions:C}=v.useContext(Ti),R=B3(),E=H3(c,{relative:d}),T=l.toLowerCase()==="get"?"get":"post",k=typeof c=="string"&&d2.test(c),M=D=>{if(f&&f(D),D.defaultPrevented)return;D.preventDefault();let A=D.nativeEvent.submitter,N=(A==null?void 0:A.getAttribute("formmethod"))||l,L=()=>R(A||D.currentTarget,{fetcherKey:t,method:N,navigate:n,replace:a,state:o,relative:d,preventScrollReset:m,viewTransition:h,unstable_defaultShouldRevalidate:y});C&&n!==!1?v.startTransition(()=>L()):L()};return v.createElement("form",{ref:w,method:T,action:E,onSubmit:r?f:M,...g,"data-discover":!k&&e==="render"?"true":void 0})});L3.displayName="Form";function _3(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function f2(e){let t=v.useContext(tl);return Vt(t,_3(e)),t}function j3(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c,unstable_useTransitions:f}={}){let d=Hd(),m=qi(),h=Ud(e,{relative:o});return v.useCallback(y=>{if(f3(y,t)){y.preventDefault();let g=n!==void 0?n:aa(m)===aa(h),w=()=>d(e,{replace:g,state:r,preventScrollReset:a,relative:o,viewTransition:l,unstable_defaultShouldRevalidate:c});f?v.startTransition(()=>w()):w()}},[m,d,h,n,r,t,e,a,o,l,c,f])}var z3=0,F3=()=>`__${String(++z3)}__`;function B3(){let{router:e}=f2("useSubmit"),{basename:t}=v.useContext(Ti),n=K4(),r=e.fetch,a=e.navigate;return v.useCallback(async(o,l={})=>{let{action:c,method:f,encType:d,formData:m,body:h}=m3(o,t);if(l.navigate===!1){let y=l.fetcherKey||F3();await r(y,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,flushSync:l.flushSync})}else await a(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:h,formMethod:l.method||f,formEncType:l.encType||d,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function H3(e,{relative:t}={}){let{basename:n}=v.useContext(Ti),r=v.useContext(Ui);Vt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Ud(e||".",{relative:t})},l=qi();if(e==null){o.search=l.search;let c=new URLSearchParams(o.search),f=c.getAll("index");if(f.some(m=>m==="")){c.delete("index"),f.filter(h=>h).forEach(h=>c.append("index",h));let m=c.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:na([n,o.pathname])),aa(o)}function U3(e,{relative:t}={}){let n=v.useContext(Ux);Vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=f2("useViewTransitionState"),a=Ud(e,{relative:t});if(!n.isTransitioning)return!1;let o=Ci(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Ci(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Us(a.pathname,l)!=null||Us(a.pathname,o)!=null}var pr=LM();const q3=Gp(pr);function V3(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const $3=e=>{switch(e){case"success":return K3;case"info":return X3;case"warning":return G3;case"error":return Q3;default:return null}},W3=Array(12).fill(0),Y3=({visible:e,className:t})=>Fe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Fe.createElement("div",{className:"sonner-spinner"},W3.map((n,r)=>Fe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${r}`})))),K3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),G3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),X3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Q3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Fe.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Z3=Fe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Fe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Fe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),J3=()=>{const[e,t]=Fe.useState(document.hidden);return Fe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Cv=1;class e5{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:r,...a}=t,o=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Cv++,l=this.toasts.find(f=>f.id===o),c=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),l?this.toasts=this.toasts.map(f=>f.id===o?(this.publish({...f,...t,id:o,title:r}),{...f,...t,id:o,dismissible:c,title:r}):f):this.addToast({title:r,...a,dismissible:c,id:o}),o},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const a=Promise.resolve(t instanceof Function?t():t);let o=r!==void 0,l;const c=a.then(async d=>{if(l=["resolve",d],Fe.isValidElement(d))o=!1,this.create({id:r,type:"default",message:d});else if(n5(d)&&!d.ok){o=!1;const h=typeof n.error=="function"?await n.error(`HTTP error! status: ${d.status}`):n.error,y=typeof n.description=="function"?await n.description(`HTTP error! status: ${d.status}`):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...w})}else if(d instanceof Error){o=!1;const h=typeof n.error=="function"?await n.error(d):n.error,y=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"error",description:y,...w})}else if(n.success!==void 0){o=!1;const h=typeof n.success=="function"?await n.success(d):n.success,y=typeof n.description=="function"?await n.description(d):n.description,w=typeof h=="object"&&!Fe.isValidElement(h)?h:{message:h};this.create({id:r,type:"success",description:y,...w})}}).catch(async d=>{if(l=["reject",d],n.error!==void 0){o=!1;const m=typeof n.error=="function"?await n.error(d):n.error,h=typeof n.description=="function"?await n.description(d):n.description,g=typeof m=="object"&&!Fe.isValidElement(m)?m:{message:m};this.create({id:r,type:"error",description:h,...g})}}).finally(()=>{o&&(this.dismiss(r),r=void 0),n.finally==null||n.finally.call(n)}),f=()=>new Promise((d,m)=>c.then(()=>l[0]==="reject"?m(l[1]):d(l[1])).catch(m));return typeof r!="string"&&typeof r!="number"?{unwrap:f}:Object.assign(r,{unwrap:f})},this.custom=(t,n)=>{const r=(n==null?void 0:n.id)||Cv++;return this.create({jsx:t(r),id:r,...n}),r},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Fr=new e5,t5=(e,t)=>{const n=(t==null?void 0:t.id)||Cv++;return Fr.addToast({title:e,...t,id:n}),n},n5=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",r5=t5,i5=()=>Fr.toasts,a5=()=>Fr.getActiveToasts(),sn=Object.assign(r5,{success:Fr.success,info:Fr.info,warning:Fr.warning,error:Fr.error,custom:Fr.custom,message:Fr.message,promise:Fr.promise,dismiss:Fr.dismiss,loading:Fr.loading},{getHistory:i5,getToasts:a5});V3("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");function Rh(e){return e.label!==void 0}const o5=3,s5="24px",l5="16px",gR=4e3,c5=356,u5=14,d5=45,f5=200;function Gi(...e){return e.filter(Boolean).join(" ")}function h5(e){const[t,n]=e.split("-"),r=[];return t&&r.push(t),n&&r.push(n),r}const p5=e=>{var t,n,r,a,o,l,c,f,d;const{invert:m,toast:h,unstyled:y,interacting:g,setHeights:w,visibleToasts:C,heights:R,index:E,toasts:T,expanded:k,removeToast:M,defaultRichColors:D,closeButton:A,style:N,cancelButtonStyle:L,actionButtonStyle:q,className:F="",descriptionClassName:Y="",duration:_,position:V,gap:$,expandByDefault:B,classNames:j,icons:z,closeButtonAriaLabel:H="Close toast"}=e,[K,P]=Fe.useState(null),[U,G]=Fe.useState(null),[I,Q]=Fe.useState(!1),[le,ae]=Fe.useState(!1),[Z,ue]=Fe.useState(!1),[ve,Se]=Fe.useState(!1),[Le,te]=Fe.useState(!1),[he,ye]=Fe.useState(0),[_e,Ae]=Fe.useState(0),Ce=Fe.useRef(h.duration||_||gR),Te=Fe.useRef(null),J=Fe.useRef(null),Ee=E===0,xe=E+1<=C,Be=h.type,Ve=h.dismissible!==!1,De=h.className||"",ut=h.descriptionClassName||"",pe=Fe.useMemo(()=>R.findIndex(Ke=>Ke.toastId===h.id)||0,[R,h.id]),Re=Fe.useMemo(()=>{var Ke;return(Ke=h.closeButton)!=null?Ke:A},[h.closeButton,A]),ee=Fe.useMemo(()=>h.duration||_||gR,[h.duration,_]),fe=Fe.useRef(0),Ne=Fe.useRef(0),He=Fe.useRef(0),$e=Fe.useRef(null),[et,ze]=V.split("-"),Ze=Fe.useMemo(()=>R.reduce((Ke,kt,_t)=>_t>=pe?Ke:Ke+kt.height,0),[R,pe]),tt=J3(),Rt=h.invert||m,zt=Be==="loading";Ne.current=Fe.useMemo(()=>pe*$+Ze,[pe,Ze]),Fe.useEffect(()=>{Ce.current=ee},[ee]),Fe.useEffect(()=>{Q(!0)},[]),Fe.useEffect(()=>{const Ke=J.current;if(Ke){const kt=Ke.getBoundingClientRect().height;return Ae(kt),w(_t=>[{toastId:h.id,height:kt,position:h.position},..._t]),()=>w(_t=>_t.filter(Tt=>Tt.toastId!==h.id))}},[w,h.id]),Fe.useLayoutEffect(()=>{if(!I)return;const Ke=J.current,kt=Ke.style.height;Ke.style.height="auto";const _t=Ke.getBoundingClientRect().height;Ke.style.height=kt,Ae(_t),w(Tt=>Tt.find(Ut=>Ut.toastId===h.id)?Tt.map(Ut=>Ut.toastId===h.id?{...Ut,height:_t}:Ut):[{toastId:h.id,height:_t,position:h.position},...Tt])},[I,h.title,h.description,w,h.id,h.jsx,h.action,h.cancel]);const yt=Fe.useCallback(()=>{ae(!0),ye(Ne.current),w(Ke=>Ke.filter(kt=>kt.toastId!==h.id)),setTimeout(()=>{M(h)},f5)},[h,M,w,Ne]);Fe.useEffect(()=>{if(h.promise&&Be==="loading"||h.duration===1/0||h.type==="loading")return;let Ke;return k||g||tt?(()=>{if(He.current<fe.current){const Tt=new Date().getTime()-fe.current;Ce.current=Ce.current-Tt}He.current=new Date().getTime()})():(()=>{Ce.current!==1/0&&(fe.current=new Date().getTime(),Ke=setTimeout(()=>{h.onAutoClose==null||h.onAutoClose.call(h,h),yt()},Ce.current))})(),()=>clearTimeout(Ke)},[k,g,h,Be,tt,yt]),Fe.useEffect(()=>{h.delete&&(yt(),h.onDismiss==null||h.onDismiss.call(h,h))},[yt,h.delete]);function Nt(){var Ke;if(z!=null&&z.loading){var kt;return Fe.createElement("div",{className:Gi(j==null?void 0:j.loader,h==null||(kt=h.classNames)==null?void 0:kt.loader,"sonner-loader"),"data-visible":Be==="loading"},z.loading)}return Fe.createElement(Y3,{className:Gi(j==null?void 0:j.loader,h==null||(Ke=h.classNames)==null?void 0:Ke.loader),visible:Be==="loading"})}const it=h.icon||(z==null?void 0:z[Be])||$3(Be);var ft,bt;return Fe.createElement("li",{tabIndex:0,ref:J,className:Gi(F,De,j==null?void 0:j.toast,h==null||(t=h.classNames)==null?void 0:t.toast,j==null?void 0:j.default,j==null?void 0:j[Be],h==null||(n=h.classNames)==null?void 0:n[Be]),"data-sonner-toast":"","data-rich-colors":(ft=h.richColors)!=null?ft:D,"data-styled":!(h.jsx||h.unstyled||y),"data-mounted":I,"data-promise":!!h.promise,"data-swiped":Le,"data-removed":le,"data-visible":xe,"data-y-position":et,"data-x-position":ze,"data-index":E,"data-front":Ee,"data-swiping":Z,"data-dismissible":Ve,"data-type":Be,"data-invert":Rt,"data-swipe-out":ve,"data-swipe-direction":U,"data-expanded":!!(k||B&&I),"data-testid":h.testId,style:{"--index":E,"--toasts-before":E,"--z-index":T.length-E,"--offset":`${le?he:Ne.current}px`,"--initial-height":B?"auto":`${_e}px`,...N,...h.style},onDragEnd:()=>{ue(!1),P(null),$e.current=null},onPointerDown:Ke=>{Ke.button!==2&&(zt||!Ve||(Te.current=new Date,ye(Ne.current),Ke.target.setPointerCapture(Ke.pointerId),Ke.target.tagName!=="BUTTON"&&(ue(!0),$e.current={x:Ke.clientX,y:Ke.clientY})))},onPointerUp:()=>{var Ke,kt,_t;if(ve||!Ve)return;$e.current=null;const Tt=Number(((Ke=J.current)==null?void 0:Ke.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),dn=Number(((kt=J.current)==null?void 0:kt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Ut=new Date().getTime()-((_t=Te.current)==null?void 0:_t.getTime()),Je=K==="x"?Tt:dn,Mt=Math.abs(Je)/Ut;if(Math.abs(Je)>=d5||Mt>.11){ye(Ne.current),h.onDismiss==null||h.onDismiss.call(h,h),G(K==="x"?Tt>0?"right":"left":dn>0?"down":"up"),yt(),Se(!0);return}else{var X,ie;(X=J.current)==null||X.style.setProperty("--swipe-amount-x","0px"),(ie=J.current)==null||ie.style.setProperty("--swipe-amount-y","0px")}te(!1),ue(!1),P(null)},onPointerMove:Ke=>{var kt,_t,Tt;if(!$e.current||!Ve||((kt=window.getSelection())==null?void 0:kt.toString().length)>0)return;const Ut=Ke.clientY-$e.current.y,Je=Ke.clientX-$e.current.x;var Mt;const X=(Mt=e.swipeDirections)!=null?Mt:h5(V);!K&&(Math.abs(Je)>1||Math.abs(Ut)>1)&&P(Math.abs(Je)>Math.abs(Ut)?"x":"y");let ie={x:0,y:0};const de=ke=>1/(1.5+Math.abs(ke)/20);if(K==="y"){if(X.includes("top")||X.includes("bottom"))if(X.includes("top")&&Ut<0||X.includes("bottom")&&Ut>0)ie.y=Ut;else{const ke=Ut*de(Ut);ie.y=Math.abs(ke)<Math.abs(Ut)?ke:Ut}}else if(K==="x"&&(X.includes("left")||X.includes("right")))if(X.includes("left")&&Je<0||X.includes("right")&&Je>0)ie.x=Je;else{const ke=Je*de(Je);ie.x=Math.abs(ke)<Math.abs(Je)?ke:Je}(Math.abs(ie.x)>0||Math.abs(ie.y)>0)&&te(!0),(_t=J.current)==null||_t.style.setProperty("--swipe-amount-x",`${ie.x}px`),(Tt=J.current)==null||Tt.style.setProperty("--swipe-amount-y",`${ie.y}px`)}},Re&&!h.jsx&&Be!=="loading"?Fe.createElement("button",{"aria-label":H,"data-disabled":zt,"data-close-button":!0,onClick:zt||!Ve?()=>{}:()=>{yt(),h.onDismiss==null||h.onDismiss.call(h,h)},className:Gi(j==null?void 0:j.closeButton,h==null||(r=h.classNames)==null?void 0:r.closeButton)},(bt=z==null?void 0:z.close)!=null?bt:Z3):null,(Be||h.icon||h.promise)&&h.icon!==null&&((z==null?void 0:z[Be])!==null||h.icon)?Fe.createElement("div",{"data-icon":"",className:Gi(j==null?void 0:j.icon,h==null||(a=h.classNames)==null?void 0:a.icon)},h.promise||h.type==="loading"&&!h.icon?h.icon||Nt():null,h.type!=="loading"?it:null):null,Fe.createElement("div",{"data-content":"",className:Gi(j==null?void 0:j.content,h==null||(o=h.classNames)==null?void 0:o.content)},Fe.createElement("div",{"data-title":"",className:Gi(j==null?void 0:j.title,h==null||(l=h.classNames)==null?void 0:l.title)},h.jsx?h.jsx:typeof h.title=="function"?h.title():h.title),h.description?Fe.createElement("div",{"data-description":"",className:Gi(Y,ut,j==null?void 0:j.description,h==null||(c=h.classNames)==null?void 0:c.description)},typeof h.description=="function"?h.description():h.description):null),Fe.isValidElement(h.cancel)?h.cancel:h.cancel&&Rh(h.cancel)?Fe.createElement("button",{"data-button":!0,"data-cancel":!0,style:h.cancelButtonStyle||L,onClick:Ke=>{Rh(h.cancel)&&Ve&&(h.cancel.onClick==null||h.cancel.onClick.call(h.cancel,Ke),yt())},className:Gi(j==null?void 0:j.cancelButton,h==null||(f=h.classNames)==null?void 0:f.cancelButton)},h.cancel.label):null,Fe.isValidElement(h.action)?h.action:h.action&&Rh(h.action)?Fe.createElement("button",{"data-button":!0,"data-action":!0,style:h.actionButtonStyle||q,onClick:Ke=>{Rh(h.action)&&(h.action.onClick==null||h.action.onClick.call(h.action,Ke),!Ke.defaultPrevented&&yt())},className:Gi(j==null?void 0:j.actionButton,h==null||(d=h.classNames)==null?void 0:d.actionButton)},h.action.label):null)};function yR(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function m5(e,t){const n={};return[e,t].forEach((r,a)=>{const o=a===1,l=o?"--mobile-offset":"--offset",c=o?l5:s5;function f(d){["top","right","bottom","left"].forEach(m=>{n[`${l}-${m}`]=typeof d=="number"?`${d}px`:d})}typeof r=="number"||typeof r=="string"?f(r):typeof r=="object"?["top","right","bottom","left"].forEach(d=>{r[d]===void 0?n[`${l}-${d}`]=c:n[`${l}-${d}`]=typeof r[d]=="number"?`${r[d]}px`:r[d]}):f(c)}),n}const g5=Fe.forwardRef(function(t,n){const{id:r,invert:a,position:o="bottom-right",hotkey:l=["altKey","KeyT"],expand:c,closeButton:f,className:d,offset:m,mobileOffset:h,theme:y="light",richColors:g,duration:w,style:C,visibleToasts:R=o5,toastOptions:E,dir:T=yR(),gap:k=u5,icons:M,containerAriaLabel:D="Notifications"}=t,[A,N]=Fe.useState([]),L=Fe.useMemo(()=>r?A.filter(I=>I.toasterId===r):A.filter(I=>!I.toasterId),[A,r]),q=Fe.useMemo(()=>Array.from(new Set([o].concat(L.filter(I=>I.position).map(I=>I.position)))),[L,o]),[F,Y]=Fe.useState([]),[_,V]=Fe.useState(!1),[$,B]=Fe.useState(!1),[j,z]=Fe.useState(y!=="system"?y:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),H=Fe.useRef(null),K=l.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Fe.useRef(null),U=Fe.useRef(!1),G=Fe.useCallback(I=>{N(Q=>{var le;return(le=Q.find(ae=>ae.id===I.id))!=null&&le.delete||Fr.dismiss(I.id),Q.filter(({id:ae})=>ae!==I.id)})},[]);return Fe.useEffect(()=>Fr.subscribe(I=>{if(I.dismiss){requestAnimationFrame(()=>{N(Q=>Q.map(le=>le.id===I.id?{...le,delete:!0}:le))});return}setTimeout(()=>{q3.flushSync(()=>{N(Q=>{const le=Q.findIndex(ae=>ae.id===I.id);return le!==-1?[...Q.slice(0,le),{...Q[le],...I},...Q.slice(le+1)]:[I,...Q]})})})}),[A]),Fe.useEffect(()=>{if(y!=="system"){z(y);return}if(y==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;const I=window.matchMedia("(prefers-color-scheme: dark)");try{I.addEventListener("change",({matches:Q})=>{z(Q?"dark":"light")})}catch{I.addListener(({matches:le})=>{try{z(le?"dark":"light")}catch(ae){console.error(ae)}})}},[y]),Fe.useEffect(()=>{A.length<=1&&V(!1)},[A]),Fe.useEffect(()=>{const I=Q=>{var le;if(l.every(ue=>Q[ue]||Q.code===ue)){var Z;V(!0),(Z=H.current)==null||Z.focus()}Q.code==="Escape"&&(document.activeElement===H.current||(le=H.current)!=null&&le.contains(document.activeElement))&&V(!1)};return document.addEventListener("keydown",I),()=>document.removeEventListener("keydown",I)},[l]),Fe.useEffect(()=>{if(H.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,U.current=!1)}},[H.current]),Fe.createElement("section",{ref:n,"aria-label":`${D} ${K}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},q.map((I,Q)=>{var le;const[ae,Z]=I.split("-");return L.length?Fe.createElement("ol",{key:I,dir:T==="auto"?yR():T,tabIndex:-1,ref:H,className:d,"data-sonner-toaster":!0,"data-sonner-theme":j,"data-y-position":ae,"data-x-position":Z,style:{"--front-toast-height":`${((le=F[0])==null?void 0:le.height)||0}px`,"--width":`${c5}px`,"--gap":`${k}px`,...C,...m5(m,h)},onBlur:ue=>{U.current&&!ue.currentTarget.contains(ue.relatedTarget)&&(U.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||U.current||(U.current=!0,P.current=ue.relatedTarget)},onMouseEnter:()=>V(!0),onMouseMove:()=>V(!0),onMouseLeave:()=>{$||V(!1)},onDragEnd:()=>V(!1),onPointerDown:ue=>{ue.target instanceof HTMLElement&&ue.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},L.filter(ue=>!ue.position&&Q===0||ue.position===I).map((ue,ve)=>{var Se,Le;return Fe.createElement(p5,{key:ue.id,icons:M,index:ve,toast:ue,defaultRichColors:g,duration:(Se=E==null?void 0:E.duration)!=null?Se:w,className:E==null?void 0:E.className,descriptionClassName:E==null?void 0:E.descriptionClassName,invert:a,visibleToasts:R,closeButton:(Le=E==null?void 0:E.closeButton)!=null?Le:f,interacting:$,position:I,style:E==null?void 0:E.style,unstyled:E==null?void 0:E.unstyled,classNames:E==null?void 0:E.classNames,cancelButtonStyle:E==null?void 0:E.cancelButtonStyle,actionButtonStyle:E==null?void 0:E.actionButtonStyle,closeButtonAriaLabel:E==null?void 0:E.closeButtonAriaLabel,removeToast:G,toasts:L.filter(te=>te.position==ue.position),heights:F.filter(te=>te.position==ue.position),setHeights:Y,expandByDefault:c,gap:k,expanded:_,swipeDirections:t.swipeDirections})})):null}))}),At=e=>typeof e=="string",_u=()=>{let e,t;const n=new Promise((r,a)=>{e=r,t=a});return n.resolve=e,n.reject=t,n},bR=e=>e==null?"":""+e,y5=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},b5=/###/g,vR=e=>e&&e.indexOf("###")>-1?e.replace(b5,"."):e,xR=e=>!e||At(e),td=(e,t,n)=>{const r=At(t)?t.split("."):t;let a=0;for(;a<r.length-1;){if(xR(e))return{};const o=vR(r[a]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++a}return xR(e)?{}:{obj:e,k:vR(r[a])}},wR=(e,t,n)=>{const{obj:r,k:a}=td(e,t,Object);if(r!==void 0||t.length===1){r[a]=n;return}let o=t[t.length-1],l=t.slice(0,t.length-1),c=td(e,l,Object);for(;c.obj===void 0&&l.length;)o=`${l[l.length-1]}.${o}`,l=l.slice(0,l.length-1),c=td(e,l,Object),c!=null&&c.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},v5=(e,t,n,r)=>{const{obj:a,k:o}=td(e,t,Object);a[o]=a[o]||[],a[o].push(n)},bp=(e,t)=>{const{obj:n,k:r}=td(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},x5=(e,t,n)=>{const r=bp(e,n);return r!==void 0?r:bp(t,n)},h2=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?At(e[r])||e[r]instanceof String||At(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):h2(e[r],t[r],n):e[r]=t[r]);return e},zl=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var w5={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const S5=e=>At(e)?e.replace(/[&<>"'\/]/g,t=>w5[t]):e;class E5{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const C5=[" ",",","?","!",";"],R5=new E5(20),T5=(e,t,n)=>{t=t||"",n=n||"";const r=C5.filter(l=>t.indexOf(l)<0&&n.indexOf(l)<0);if(r.length===0)return!0;const a=R5.getRegExp(`(${r.map(l=>l==="?"?"\\?":l).join("|")})`);let o=!a.test(e);if(!o){const l=e.indexOf(n);l>0&&!a.test(e.substring(0,l))&&(o=!0)}return o},Rv=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let a=e;for(let o=0;o<r.length;){if(!a||typeof a!="object")return;let l,c="";for(let f=o;f<r.length;++f)if(f!==o&&(c+=n),c+=r[f],l=a[c],l!==void 0){if(["string","number","boolean"].indexOf(typeof l)>-1&&f<r.length-1)continue;o+=f-o+1;break}a=l}return a},Sd=e=>e==null?void 0:e.replace("_","-"),k5={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class vp{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||k5,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,a){return a&&!this.debug?null:(At(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new vp(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new vp(this.logger,t)}}var ta=new vp;class Zp{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([a,o])=>{for(let l=0;l<o;l++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,o])=>{for(let l=0;l<o;l++)a.apply(a,[t,...n])})}}class SR extends Zp{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,a={}){var d,m;const o=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,l=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):At(r)&&o?c.push(...r.split(o)):c.push(r)));const f=bp(this.data,c);return!f&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),f||!l||!At(r)?f:Rv((m=(d=this.data)==null?void 0:d[t])==null?void 0:m[n],r,o)}addResource(t,n,r,a,o={silent:!1}){const l=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(l?r.split(l):r)),t.indexOf(".")>-1&&(c=t.split("."),a=n,n=c[1]),this.addNamespaces(n),wR(this.data,c,a),o.silent||this.emit("added",t,n,r,a)}addResources(t,n,r,a={silent:!1}){for(const o in r)(At(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});a.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,a,o,l={silent:!1,skipCopy:!1}){let c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),a=r,r=n,n=c[1]),this.addNamespaces(n);let f=bp(this.data,c)||{};l.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?h2(f,r,o):f={...f,...r},wR(this.data,c,f),l.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var p2={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,a){return e.forEach(o=>{var l;t=((l=this.processors[o])==null?void 0:l.process(t,n,r,a))??t}),t}};const m2=Symbol("i18next/PATH_KEY");function M5(){const e=[],t=Object.create(null);let n;return t.get=(r,a)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),a===m2?e:(e.push(a),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Tv(e,t){const{[m2]:n}=e(M5());return n.join((t==null?void 0:t.keySeparator)??".")}const ER={},ib=e=>!At(e)&&typeof e!="boolean"&&typeof e!="number";class xp extends Zp{constructor(t,n={}){super(),y5(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=ta.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const a=this.resolve(t,r);if((a==null?void 0:a.res)===void 0)return!1;const o=ib(a.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const l=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!T5(t,r,a);if(l&&!c){const f=t.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:t,namespaces:At(o)?[o]:o};const d=t.split(r);(r!==a||r===a&&this.options.ns.indexOf(d[0])>-1)&&(o=d.shift()),t=d.join(a)}return{key:t,namespaces:At(o)?[o]:o}}translate(t,n,r){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),t==null)return"";typeof t=="function"&&(t=Tv(t,{...this.options,...a})),Array.isArray(t)||(t=[String(t)]);const o=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:c,namespaces:f}=this.extractFromKey(t[t.length-1],a),d=f[f.length-1];let m=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;m===void 0&&(m=":");const h=a.lng||this.language,y=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return y?o?{res:`${d}${m}${c}`,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:`${d}${m}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:h,usedNS:d,usedParams:this.getUsedParamsDetails(a)}:c;const g=this.resolve(t,a);let w=g==null?void 0:g.res;const C=(g==null?void 0:g.usedKey)||c,R=(g==null?void 0:g.exactUsedKey)||c,E=["[object Number]","[object Function]","[object RegExp]"],T=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,k=!this.i18nFormat||this.i18nFormat.handleAsObject,M=a.count!==void 0&&!At(a.count),D=xp.hasDefaultValue(a),A=M?this.pluralResolver.getSuffix(h,a.count,a):"",N=a.ordinal&&M?this.pluralResolver.getSuffix(h,a.count,{ordinal:!1}):"",L=M&&!a.ordinal&&a.count===0,q=L&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${A}`]||a[`defaultValue${N}`]||a.defaultValue;let F=w;k&&!w&&D&&(F=q);const Y=ib(F),_=Object.prototype.toString.apply(F);if(k&&F&&Y&&E.indexOf(_)<0&&!(At(T)&&Array.isArray(F))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const V=this.options.returnedObjectHandler?this.options.returnedObjectHandler(C,F,{...a,ns:f}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(g.res=V,g.usedParams=this.getUsedParamsDetails(a),g):V}if(l){const V=Array.isArray(F),$=V?[]:{},B=V?R:C;for(const j in F)if(Object.prototype.hasOwnProperty.call(F,j)){const z=`${B}${l}${j}`;D&&!w?$[j]=this.translate(z,{...a,defaultValue:ib(q)?q[j]:void 0,joinArrays:!1,ns:f}):$[j]=this.translate(z,{...a,joinArrays:!1,ns:f}),$[j]===z&&($[j]=F[j])}w=$}}else if(k&&At(T)&&Array.isArray(w))w=w.join(T),w&&(w=this.extendTranslation(w,t,a,r));else{let V=!1,$=!1;!this.isValidLookup(w)&&D&&(V=!0,w=q),this.isValidLookup(w)||($=!0,w=c);const j=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&$?void 0:w,z=D&&q!==w&&this.options.updateMissing;if($||V||z){if(this.logger.log(z?"updateKey":"missingKey",h,d,c,z?q:w),l){const U=this.resolve(c,{...a,keySeparator:!1});U&&U.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let H=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let U=0;U<K.length;U++)H.push(K[U]);else this.options.saveMissingTo==="all"?H=this.languageUtils.toResolveHierarchy(a.lng||this.language):H.push(a.lng||this.language);const P=(U,G,I)=>{var le;const Q=D&&I!==w?I:j;this.options.missingKeyHandler?this.options.missingKeyHandler(U,d,G,Q,z,a):(le=this.backendConnector)!=null&&le.saveMissing&&this.backendConnector.saveMissing(U,d,G,Q,z,a),this.emit("missingKey",U,d,G,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&M?H.forEach(U=>{const G=this.pluralResolver.getSuffixes(U,a);L&&a[`defaultValue${this.options.pluralSeparator}zero`]&&G.indexOf(`${this.options.pluralSeparator}zero`)<0&&G.push(`${this.options.pluralSeparator}zero`),G.forEach(I=>{P([U],c+I,a[`defaultValue${I}`]||q)})}):P(H,c,q))}w=this.extendTranslation(w,t,a,g,r),$&&w===c&&this.options.appendNamespaceToMissingKey&&(w=`${d}${m}${c}`),($||V)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${d}${m}${c}`:c,V?w:void 0,a))}return o?(g.res=w,g.usedParams=this.getUsedParamsDetails(a),g):w}extendTranslation(t,n,r,a,o){var f,d;if((f=this.i18nFormat)!=null&&f.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const m=At(t)&&(((d=r==null?void 0:r.interpolation)==null?void 0:d.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(m){const g=t.match(this.interpolator.nestingRegexp);h=g&&g.length}let y=r.replace&&!At(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(y={...this.options.interpolation.defaultVariables,...y}),t=this.interpolator.interpolate(t,y,r.lng||this.language||a.usedLng,r),m){const g=t.match(this.interpolator.nestingRegexp),w=g&&g.length;h<w&&(r.nest=!1)}!r.lng&&a&&a.res&&(r.lng=this.language||a.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>(o==null?void 0:o[0])===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const l=r.postProcess||this.options.postProcess,c=At(l)?[l]:l;return t!=null&&(c!=null&&c.length)&&r.applyPostProcessor!==!1&&(t=p2.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,a,o,l,c;return At(t)&&(t=[t]),t.forEach(f=>{if(this.isValidLookup(r))return;const d=this.extractFromKey(f,n),m=d.key;a=m;let h=d.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const y=n.count!==void 0&&!At(n.count),g=y&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(At(n.context)||typeof n.context=="number")&&n.context!=="",C=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(R=>{var E,T;this.isValidLookup(r)||(c=R,!ER[`${C[0]}-${R}`]&&((E=this.utils)!=null&&E.hasLoadedNamespace)&&!((T=this.utils)!=null&&T.hasLoadedNamespace(c))&&(ER[`${C[0]}-${R}`]=!0,this.logger.warn(`key "${a}" for languages "${C.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),C.forEach(k=>{var A;if(this.isValidLookup(r))return;l=k;const M=[m];if((A=this.i18nFormat)!=null&&A.addLookupKeys)this.i18nFormat.addLookupKeys(M,m,k,R,n);else{let N;y&&(N=this.pluralResolver.getSuffix(k,n.count,n));const L=`${this.options.pluralSeparator}zero`,q=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&N.indexOf(q)===0&&M.push(m+N.replace(q,this.options.pluralSeparator)),M.push(m+N),g&&M.push(m+L)),w){const F=`${m}${this.options.contextSeparator||"_"}${n.context}`;M.push(F),y&&(n.ordinal&&N.indexOf(q)===0&&M.push(F+N.replace(q,this.options.pluralSeparator)),M.push(F+N),g&&M.push(F+L))}}let D;for(;D=M.pop();)this.isValidLookup(r)||(o=D,r=this.getResource(k,R,D,n))}))})}),{res:r,usedKey:a,exactUsedKey:o,usedLng:l,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,a={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,a):this.resourceStore.getResource(t,n,r,a)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!At(t.replace);let a=r?t.replace:t;if(r&&typeof t.count<"u"&&(a.count=t.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const o of n)delete a[o]}return a}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class CR{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ta.create("languageUtils")}getScriptPartFromCode(t){if(t=Sd(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=Sd(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(At(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const a=this.getScriptPartFromCode(r);if(this.isSupportedCode(a))return n=a;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(l=>{if(l===o)return l;if(!(l.indexOf("-")<0&&o.indexOf("-")<0)&&(l.indexOf("-")>0&&o.indexOf("-")<0&&l.substring(0,l.indexOf("-"))===o||l.indexOf(o)===0&&o.length>1))return l})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),At(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),a=[],o=l=>{l&&(this.isSupportedCode(l)?a.push(l):this.logger.warn(`rejecting language code not found in supportedLngs: ${l}`))};return At(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):At(t)&&o(this.formatLanguageCode(t)),r.forEach(l=>{a.indexOf(l)<0&&o(this.formatLanguageCode(l))}),a}}const RR={zero:0,one:1,two:2,few:3,many:4,other:5},TR={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class A5{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=ta.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=Sd(t==="dev"?"en":t),a=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:a});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let l;try{l=new Intl.PluralRules(r,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),TR;if(!t.match(/-|_/))return TR;const f=this.languageUtils.getLanguagePartFromCode(t);l=this.getRule(f,n)}return this.pluralRulesCache[o]=l,l}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(a=>`${n}${a}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((a,o)=>RR[a]-RR[o]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(t,n,r={}){const a=this.getRule(t,r);return a?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const kR=(e,t,n,r=".",a=!0)=>{let o=x5(e,t,n);return!o&&a&&At(n)&&(o=Rv(e,n,r),o===void 0&&(o=Rv(t,n,r))),o},ab=e=>e.replace(/\$/g,"$$$$");class MR{constructor(t={}){var n;this.logger=ta.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:a,prefix:o,prefixEscaped:l,suffix:c,suffixEscaped:f,formatSeparator:d,unescapeSuffix:m,unescapePrefix:h,nestingPrefix:y,nestingPrefixEscaped:g,nestingSuffix:w,nestingSuffixEscaped:C,nestingOptionsSeparator:R,maxReplaces:E,alwaysFormat:T}=t.interpolation;this.escape=n!==void 0?n:S5,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=o?zl(o):l||"{{",this.suffix=c?zl(c):f||"}}",this.formatSeparator=d||",",this.unescapePrefix=m?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":m||"",this.nestingPrefix=y?zl(y):g||zl("$t("),this.nestingSuffix=w?zl(w):C||zl(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=E||1e3,this.alwaysFormat=T!==void 0?T:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,a){var g;let o,l,c;const f=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=w=>{if(w.indexOf(this.formatSeparator)<0){const T=kR(n,f,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(T,void 0,r,{...a,...n,interpolationkey:w}):T}const C=w.split(this.formatSeparator),R=C.shift().trim(),E=C.join(this.formatSeparator).trim();return this.format(kR(n,f,R,this.options.keySeparator,this.options.ignoreJSONStructure),E,r,{...a,...n,interpolationkey:R})};this.resetRegExp();const m=(a==null?void 0:a.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((g=a==null?void 0:a.interpolation)==null?void 0:g.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>ab(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?ab(this.escape(w)):ab(w)}].forEach(w=>{for(c=0;o=w.regex.exec(t);){const C=o[1].trim();if(l=d(C),l===void 0)if(typeof m=="function"){const E=m(t,o,a);l=At(E)?E:""}else if(a&&Object.prototype.hasOwnProperty.call(a,C))l="";else if(h){l=o[0];continue}else this.logger.warn(`missed to pass in variable ${C} for interpolating ${t}`),l="";else!At(l)&&!this.useRawValueToEscape&&(l=bR(l));const R=w.safeValue(l);if(t=t.replace(o[0],R),h?(w.regex.lastIndex+=l.length,w.regex.lastIndex-=o[0].length):w.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n,r={}){let a,o,l;const c=(f,d)=>{const m=this.nestingOptionsSeparator;if(f.indexOf(m)<0)return f;const h=f.split(new RegExp(`${m}[ ]*{`));let y=`{${h[1]}`;f=h[0],y=this.interpolate(y,l);const g=y.match(/'/g),w=y.match(/"/g);(((g==null?void 0:g.length)??0)%2===0&&!w||w.length%2!==0)&&(y=y.replace(/'/g,'"'));try{l=JSON.parse(y),d&&(l={...d,...l})}catch(C){return this.logger.warn(`failed parsing options string in nesting for key ${f}`,C),`${f}${m}${y}`}return l.defaultValue&&l.defaultValue.indexOf(this.prefix)>-1&&delete l.defaultValue,f};for(;a=this.nestingRegexp.exec(t);){let f=[];l={...r},l=l.replace&&!At(l.replace)?l.replace:l,l.applyPostProcessor=!1,delete l.defaultValue;const d=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(d!==-1&&(f=a[1].slice(d).split(this.formatSeparator).map(m=>m.trim()).filter(Boolean),a[1]=a[1].slice(0,d)),o=n(c.call(this,a[1].trim(),l),l),o&&a[0]===t&&!At(o))return o;At(o)||(o=bR(o)),o||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${t}`),o=""),f.length&&(o=f.reduce((m,h)=>this.format(m,h,r.lng,{...r,interpolationkey:a[1].trim()}),o.trim())),t=t.replace(a[0],o),this.regexp.lastIndex=0}return t}}const N5=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);t==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):t==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(l=>{if(l){const[c,...f]=l.split(":"),d=f.join(":").trim().replace(/^'+|'+$/g,""),m=c.trim();n[m]||(n[m]=d),d==="false"&&(n[m]=!1),d==="true"&&(n[m]=!0),isNaN(d)||(n[m]=parseInt(d,10))}})}return{formatName:t,formatOptions:n}},AR=e=>{const t={};return(n,r,a)=>{let o=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(o={...o,[a.interpolationkey]:void 0});const l=r+JSON.stringify(o);let c=t[l];return c||(c=e(Sd(r),a),t[l]=c),c(n)}},O5=e=>(t,n,r)=>e(Sd(n),r)(t);class D5{constructor(t={}){this.logger=ta.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?AR:O5;this.formats={number:r((a,o)=>{const l=new Intl.NumberFormat(a,{...o});return c=>l.format(c)}),currency:r((a,o)=>{const l=new Intl.NumberFormat(a,{...o,style:"currency"});return c=>l.format(c)}),datetime:r((a,o)=>{const l=new Intl.DateTimeFormat(a,{...o});return c=>l.format(c)}),relativetime:r((a,o)=>{const l=new Intl.RelativeTimeFormat(a,{...o});return c=>l.format(c,o.range||"day")}),list:r((a,o)=>{const l=new Intl.ListFormat(a,{...o});return c=>l.format(c)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=AR(n)}format(t,n,r,a={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(f=>f.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,f)=>{var h;const{formatName:d,formatOptions:m}=N5(f);if(this.formats[d]){let y=c;try{const g=((h=a==null?void 0:a.formatParams)==null?void 0:h[a.interpolationkey])||{},w=g.locale||g.lng||a.locale||a.lng||r;y=this.formats[d](c,w,{...m,...a,...g})}catch(g){this.logger.warn(g)}return y}else this.logger.warn(`there was no format function for ${d}`);return c},t)}}const I5=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class P5 extends Zp{constructor(t,n,r,a={}){var o,l;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=ta.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],(l=(o=this.backend)==null?void 0:o.init)==null||l.call(o,r,a.backend,a)}queueLoad(t,n,r,a){const o={},l={},c={},f={};return t.forEach(d=>{let m=!0;n.forEach(h=>{const y=`${d}|${h}`;!r.reload&&this.store.hasResourceBundle(d,h)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?l[y]===void 0&&(l[y]=!0):(this.state[y]=1,m=!1,l[y]===void 0&&(l[y]=!0),o[y]===void 0&&(o[y]=!0),f[h]===void 0&&(f[h]=!0)))}),m||(c[d]=!0)}),(Object.keys(o).length||Object.keys(l).length)&&this.queue.push({pending:l,pendingCount:Object.keys(l).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(o),pending:Object.keys(l),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(f)}}loaded(t,n,r){const a=t.split("|"),o=a[0],l=a[1];n&&this.emit("failedLoading",o,l,n),!n&&r&&this.store.addResourceBundle(o,l,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(f=>{v5(f.loaded,[o],l),I5(f,t),n&&f.errors.push(n),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(d=>{c[d]||(c[d]={});const m=f.loaded[d];m.length&&m.forEach(h=>{c[d][h]===void 0&&(c[d][h]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(f=>!f.done)}read(t,n,r,a=0,o=this.retryTimeout,l){if(!t.length)return l(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:a,wait:o,callback:l});return}this.readingCalls++;const c=(d,m)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(d&&m&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,a+1,o*2,l)},o);return}l(d,m)},f=this.backend[r].bind(this.backend);if(f.length===2){try{const d=f(t,n);d&&typeof d.then=="function"?d.then(m=>c(null,m)).catch(c):c(null,d)}catch(d){c(d)}return}return f(t,n,c)}prepareLoading(t,n,r={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();At(t)&&(t=this.languageUtils.toResolveHierarchy(t)),At(n)&&(n=[n]);const o=this.queueLoad(t,n,r,a);if(!o.toLoad.length)return o.pending.length||a(),null;o.toLoad.forEach(l=>{this.loadOne(l)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),a=r[0],o=r[1];this.read(a,o,"read",void 0,void 0,(l,c)=>{l&&this.logger.warn(`${n}loading namespace ${o} for language ${a} failed`,l),!l&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${a}`,c),this.loaded(t,l,c)})}saveMissing(t,n,r,a,o,l={},c=()=>{}){var f,d,m,h,y;if((d=(f=this.services)==null?void 0:f.utils)!=null&&d.hasLoadedNamespace&&!((h=(m=this.services)==null?void 0:m.utils)!=null&&h.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((y=this.backend)!=null&&y.create){const g={...l,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let C;w.length===5?C=w(t,n,r,a,g):C=w(t,n,r,a),C&&typeof C.then=="function"?C.then(R=>c(null,R)).catch(c):c(null,C)}catch(C){c(C)}else w(t,n,r,a,c,g)}!t||!t[0]||this.store.addResource(t[0],n,r,a)}}}const ob=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),At(e[1])&&(t.defaultValue=e[1]),At(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),NR=e=>{var t,n;return At(e.ns)&&(e.ns=[e.ns]),At(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),At(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},Th=()=>{},L5=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},_5=e=>{var t,n,r,a,o,l,c,f,d;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((c=(l=(o=(a=e==null?void 0:e.modules)==null?void 0:a.backend)==null?void 0:o.constructor)==null?void 0:l.name)==null?void 0:c.indexOf("Locize"))>0||(d=(f=e==null?void 0:e.options)==null?void 0:f.backend)!=null&&d.backends&&e.options.backend.backends.some(m=>{var h,y,g;return((h=m==null?void 0:m.name)==null?void 0:h.indexOf("Locize"))>0||((g=(y=m==null?void 0:m.constructor)==null?void 0:y.name)==null?void 0:g.indexOf("Locize"))>0}))};class nd extends Zp{constructor(t={},n){if(super(),this.options=NR(t),this.services={},this.logger=ta,this.modules={external:[]},L5(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(At(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=ob();this.options={...r,...this.options,...NR(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!_5(this)&&typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙");const a=d=>d?typeof d=="function"?new d:d:null;if(!this.options.isClone){this.modules.logger?ta.init(a(this.modules.logger),this.options):ta.init(null,this.options);let d;this.modules.formatter?d=this.modules.formatter:d=D5;const m=new CR(this.options);this.store=new SR(this.options.resources,this.options);const h=this.services;h.logger=ta,h.resourceStore=this.store,h.languageUtils=m,h.pluralResolver=new A5(m,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),d&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(h.formatter=a(d),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new MR(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new P5(a(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(g,...w)=>{this.emit(g,...w)}),this.modules.languageDetector&&(h.languageDetector=a(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=a(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new xp(this.services,this.options),this.translator.on("*",(g,...w)=>{this.emit(g,...w)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Th),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const d=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);d.length>0&&d[0]!=="dev"&&(this.options.lng=d[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(d=>{this[d]=(...m)=>this.store[d](...m)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(d=>{this[d]=(...m)=>(this.store[d](...m),this)});const c=_u(),f=()=>{const d=(m,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(h),n(m,h)};if(this.languages&&!this.isInitialized)return d(null,this.t.bind(this));this.changeLanguage(this.options.lng,d)};return this.options.resources||!this.options.initAsync?f():setTimeout(f,0),c}loadResources(t,n=Th){var o,l;let r=n;const a=At(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((a==null?void 0:a.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const c=[],f=d=>{if(!d||d==="cimode")return;this.services.languageUtils.toResolveHierarchy(d).forEach(h=>{h!=="cimode"&&c.indexOf(h)<0&&c.push(h)})};a?f(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>f(m)),(l=(o=this.options.preload)==null?void 0:o.forEach)==null||l.call(o,d=>f(d)),this.services.backendConnector.load(c,this.options.ns,d=>{!d&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(d)})}else r(null)}reloadResources(t,n,r){const a=_u();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Th),this.services.backendConnector.reload(t,n,o=>{a.resolve(),r(o)}),a}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&p2.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=_u();this.emit("languageChanging",t);const a=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,f)=>{f?this.isLanguageChangingTo===t&&(a(f),this.translator.changeLanguage(f),this.isLanguageChangingTo=void 0,this.emit("languageChanged",f),this.logger.log("languageChanged",f)):this.isLanguageChangingTo=void 0,r.resolve((...d)=>this.t(...d)),n&&n(c,(...d)=>this.t(...d))},l=c=>{var m,h;!t&&!c&&this.services.languageDetector&&(c=[]);const f=At(c)?c:c&&c[0],d=this.store.hasLanguageSomeTranslations(f)?f:this.services.languageUtils.getBestMatchFromCodes(At(c)?[c]:c);d&&(this.language||a(d),this.translator.language||this.translator.changeLanguage(d),(h=(m=this.services.languageDetector)==null?void 0:m.cacheUserLanguage)==null||h.call(m,d)),this.loadResources(d,y=>{o(y,d)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(t),r}getFixedT(t,n,r){const a=(o,l,...c)=>{let f;typeof l!="object"?f=this.options.overloadTranslationOptionHandler([o,l].concat(c)):f={...l},f.lng=f.lng||a.lng,f.lngs=f.lngs||a.lngs,f.ns=f.ns||a.ns,f.keyPrefix!==""&&(f.keyPrefix=f.keyPrefix||r||a.keyPrefix);const d=this.options.keySeparator||".";let m;return f.keyPrefix&&Array.isArray(o)?m=o.map(h=>(typeof h=="function"&&(h=Tv(h,{...this.options,...l})),`${f.keyPrefix}${d}${h}`)):(typeof o=="function"&&(o=Tv(o,{...this.options,...l})),m=f.keyPrefix?`${f.keyPrefix}${d}${o}`:o),this.t(m,f)};return At(t)?a.lng=t:a.lngs=t,a.ns=n,a.keyPrefix=r,a}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const l=(c,f)=>{const d=this.services.backendConnector.state[`${c}|${f}`];return d===-1||d===0||d===2};if(n.precheck){const c=n.precheck(this,l);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||l(r,t)&&(!a||l(o,t)))}loadNamespaces(t,n){const r=_u();return this.options.ns?(At(t)&&(t=[t]),t.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=_u();At(t)&&(t=[t]);const a=this.options.preload||[],o=t.filter(l=>a.indexOf(l)<0&&this.services.languageUtils.isSupportedCode(l));return o.length?(this.options.preload=a.concat(o),this.loadResources(l=>{r.resolve(),n&&n(l)}),r):(n&&n(),Promise.resolve())}dir(t){var a,o;if(t||(t=this.resolvedLanguage||(((a=this.languages)==null?void 0:a.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const l=new Intl.Locale(t);if(l&&l.getTextInfo){const c=l.getTextInfo();if(c&&c.direction)return c.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new CR(ob());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new nd(t,n);return r.createInstance=nd.createInstance,r}cloneInstance(t={},n=Th){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const a={...this.options,...t,isClone:!0},o=new nd(a);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const c=Object.keys(this.store.data).reduce((f,d)=>(f[d]={...this.store.data[d]},f[d]=Object.keys(f[d]).reduce((m,h)=>(m[h]={...f[d][h]},m),f[d]),f),{});o.store=new SR(c,a),o.services.resourceStore=o.store}if(t.interpolation){const f={...ob().interpolation,...this.options.interpolation,...t.interpolation},d={...a,interpolation:f};o.services.interpolator=new MR(d)}return o.translator=new xp(o.services,a),o.translator.on("*",(c,...f)=>{o.emit(c,...f)}),o.init(a,n),o.translator.options=a,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const hn=nd.createInstance();hn.createInstance;hn.dir;hn.init;hn.loadResources;hn.reloadResources;hn.use;hn.changeLanguage;hn.getFixedT;hn.t;hn.exists;hn.setDefaultNamespace;hn.hasLoadedNamespace;hn.loadNamespaces;hn.loadLanguages;const j5=(e,t,n,r)=>{var o,l,c,f;const a=[n,{code:t,...r||{}}];if((l=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&l.forward)return e.services.logger.forward(a,"warn","react-i18next::",!0);qs(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(f=(c=e==null?void 0:e.services)==null?void 0:c.logger)!=null&&f.warn?e.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},OR={},g2=(e,t,n,r)=>{qs(n)&&OR[n]||(qs(n)&&(OR[n]=new Date),j5(e,t,n,r))},y2=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},kv=(e,t,n)=>{e.loadNamespaces(t,y2(e,n))},DR=(e,t,n,r)=>{if(qs(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return kv(e,n,r);n.forEach(a=>{e.options.ns.indexOf(a)<0&&e.options.ns.push(a)}),e.loadLanguages(t,y2(e,r))},z5=(e,t,n={})=>!t.languages||!t.languages.length?(g2(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,e))return!1}}),qs=e=>typeof e=="string",F5=e=>typeof e=="object"&&e!==null,B5=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,H5={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},U5=e=>H5[e],q5=e=>e.replace(B5,U5);let Mv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:q5,transDefaultProps:void 0};const V5=(e={})=>{Mv={...Mv,...e}},$5=()=>Mv;let b2;const W5=e=>{b2=e},Y5=()=>b2,K5={type:"3rdParty",init(e){V5(e.options.react),W5(e)}},G5=v.createContext();class X5{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var sb={exports:{}},lb={};/**
|
|
78
|
-
* @license React
|
|
79
|
-
* use-sync-external-store-shim.production.js
|
|
80
|
-
*
|
|
81
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the MIT license found in the
|
|
84
|
-
* LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var IR;function Q5(){if(IR)return lb;IR=1;var e=jd();function t(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function c(h,y){var g=y(),w=r({inst:{value:g,getSnapshot:y}}),C=w[0].inst,R=w[1];return o(function(){C.value=g,C.getSnapshot=y,f(C)&&R({inst:C})},[h,g,y]),a(function(){return f(C)&&R({inst:C}),h(function(){f(C)&&R({inst:C})})},[h]),l(g),g}function f(h){var y=h.getSnapshot;h=h.value;try{var g=y();return!n(h,g)}catch{return!0}}function d(h,y){return y()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return lb.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:m,lb}var PR;function v2(){return PR||(PR=1,sb.exports=Q5()),sb.exports}var Gx=v2();const Z5=(e,t)=>qs(t)?t:F5(t)&&qs(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,J5={t:Z5,ready:!1},eF=()=>()=>{},mn=(e,t={})=>{var q,F,Y;const{i18n:n}=t,{i18n:r,defaultNS:a}=v.useContext(G5)||{},o=n||r||Y5();o&&!o.reportNamespaces&&(o.reportNamespaces=new X5),o||g2(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const l=v.useMemo(()=>{var _;return{...$5(),...(_=o==null?void 0:o.options)==null?void 0:_.react,...t}},[o,t]),{useSuspense:c,keyPrefix:f}=l,d=a||((q=o==null?void 0:o.options)==null?void 0:q.defaultNS),m=qs(d)?[d]:d||["translation"],h=v.useMemo(()=>m,m);(Y=(F=o==null?void 0:o.reportNamespaces)==null?void 0:F.addUsedNamespaces)==null||Y.call(F,h);const y=v.useRef(0),g=v.useCallback(_=>{if(!o)return eF;const{bindI18n:V,bindI18nStore:$}=l,B=()=>{y.current+=1,_()};return V&&o.on(V,B),$&&o.store.on($,B),()=>{V&&V.split(" ").forEach(j=>o.off(j,B)),$&&$.split(" ").forEach(j=>o.store.off(j,B))}},[o,l]),w=v.useRef(),C=v.useCallback(()=>{if(!o)return J5;const _=!!(o.isInitialized||o.initializedStoreOnce)&&h.every(H=>z5(H,o,l)),V=t.lng||o.language,$=y.current,B=w.current;if(B&&B.ready===_&&B.lng===V&&B.keyPrefix===f&&B.revision===$)return B;const z={t:o.getFixedT(V,l.nsMode==="fallback"?h:h[0],f),ready:_,lng:V,keyPrefix:f,revision:$};return w.current=z,z},[o,h,f,l,t.lng]),[R,E]=v.useState(0),{t:T,ready:k}=Gx.useSyncExternalStore(g,C,C);v.useEffect(()=>{if(o&&!k&&!c){const _=()=>E(V=>V+1);t.lng?DR(o,t.lng,h,_):kv(o,h,_)}},[o,t.lng,h,k,c,R]);const M=o||{},D=v.useRef(null),A=v.useRef(),N=_=>{const V=Object.getOwnPropertyDescriptors(_);V.__original&&delete V.__original;const $=Object.create(Object.getPrototypeOf(_),V);if(!Object.prototype.hasOwnProperty.call($,"__original"))try{Object.defineProperty($,"__original",{value:_,writable:!1,enumerable:!1,configurable:!1})}catch{}return $},L=v.useMemo(()=>{const _=M,V=_==null?void 0:_.language;let $=_;_&&(D.current&&D.current.__original===_?A.current!==V?($=N(_),D.current=$,A.current=V):$=D.current:($=N(_),D.current=$,A.current=V));const B=[T,$,k];return B.t=T,B.i18n=$,B.ready=k,B},[T,M,k,M.resolvedLanguage,M.language,M.languages]);if(o&&c&&!k)throw new Promise(_=>{const V=()=>_();t.lng?DR(o,t.lng,h,V):kv(o,h,V)});return L};function tF(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Lx}hn.use(K5).init({resources:$L,lng:tF(),fallbackLng:Lx,interpolation:{escapeValue:!1},returnNull:!1});function Av(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const rd={};function Ri(e,t,n,r,a){let o={...Nv(e,rd)};return t&&(o=Xu(o,t)),n&&(o=Xu(o,n)),r&&(o=Xu(o,r)),a&&(o=Xu(o,a)),o}function nF(e){if(e.length===0)return rd;if(e.length===1)return Nv(e[0],rd);let t={...Nv(e[0],rd)};for(let n=1;n<e.length;n+=1)t=Xu(t,e[n]);return t}function Xu(e,t){return x2(t)?t(e):rF(e,t)}function rF(e,t){if(!t)return e;for(const n in t){const r=t[n];switch(n){case"style":{e[n]=Av(e.style,r);break}case"className":{e[n]=w2(e.className,r);break}default:iF(n,r)?e[n]=aF(e[n],r):e[n]=r}}return e}function iF(e,t){const n=e.charCodeAt(0),r=e.charCodeAt(1),a=e.charCodeAt(2);return n===111&&r===110&&a>=65&&a<=90&&(typeof t=="function"||typeof t>"u")}function x2(e){return typeof e=="function"}function Nv(e,t){return x2(e)?e(t):e??rd}function aF(e,t){return t?e?n=>{if(oF(n)){const a=n;Ov(a);const o=t(a);return a.baseUIHandlerPrevented||e==null||e(a),o}const r=t(n);return e==null||e(n),r}:t:e}function Ov(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function w2(e,t){return t?e?t+" "+e:t:e}function oF(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function Cn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(r=>n.searchParams.append("args[]",r)),`Base UI error #${e}; visit ${n} for the full message.`}const LR={};function nr(e,t){const n=v.useRef(LR);return n.current===LR&&(n.current=e(t)),n}function zi(e,t,n,r){const a=nr(S2).current;return lF(a,e,t,n,r)&&E2(a,[e,t,n,r]),a.callback}function sF(e){const t=nr(S2).current;return cF(t,e)&&E2(t,e),t.callback}function S2(){return{callback:null,cleanup:null,refs:[]}}function lF(e,t,n,r,a){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==a}function cF(e,t){return e.refs.length!==t.length||e.refs.some((n,r)=>n!==t[r])}function E2(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const r=Array(t.length).fill(null);for(let a=0;a<t.length;a+=1){const o=t[a];if(o!=null)switch(typeof o){case"function":{const l=o(n);typeof l=="function"&&(r[a]=l);break}case"object":{o.current=n;break}}}e.cleanup=()=>{for(let a=0;a<t.length;a+=1){const o=t[a];if(o!=null)switch(typeof o){case"function":{const l=r[a];typeof l=="function"?l():o(null);break}case"object":{o.current=null;break}}}}}}}const uF=parseInt(v.version,10);function Xx(e){return uF>=e}function _R(e){if(!v.isValidElement(e))return null;const t=e,n=t.props;return(Xx(19)?n==null?void 0:n.ref:t.ref)??null}function dF(e,t){const n={};for(const r in e){const a=e[r];if(t!=null&&t.hasOwnProperty(r)){const o=t[r](a);o!=null&&Object.assign(n,o);continue}a===!0?n[`data-${r.toLowerCase()}`]="":a&&(n[`data-${r.toLowerCase()}`]=a.toString())}return n}function fF(e,t){return typeof e=="function"?e(t):e}function hF(e,t){return typeof e=="function"?e(t):e}function Br(){}const Vo=Object.freeze([]),In=Object.freeze({}),pF=500,mF=500,gF={style:{transition:"none"}},yF="data-base-ui-click-trigger",C2={fallbackAxisSide:"none"},R2={fallbackAxisSide:"end"},bF={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function It(e,t,n={}){const r=t.render,a=vF(t,n);if(n.enabled===!1)return null;const o=n.state??In;return wF(e,r,a,o)}function vF(e,t={}){const{className:n,style:r,render:a}=e,{state:o=In,ref:l,props:c,stateAttributesMapping:f,enabled:d=!0}=t,m=d?fF(n,o):void 0,h=d?hF(r,o):void 0,y=d?dF(o,f):In,g=d?Av(y,Array.isArray(c)?nF(c):c)??In:In;return typeof document<"u"&&(d?Array.isArray(l)?g.ref=sF([g.ref,_R(a),...l]):g.ref=zi(g.ref,_R(a),l):zi(null,null)),d?(m!==void 0&&(g.className=w2(g.className,m)),h!==void 0&&(g.style=Av(g.style,h)),g):In}const xF=Symbol.for("react.lazy");function wF(e,t,n,r){if(t){if(typeof t=="function")return t(n,r);const a=Ri(n,t.props);a.ref=n.ref;let o=t;return(o==null?void 0:o.$$typeof)===xF&&(o=v.Children.toArray(t)[0]),v.cloneElement(o,a)}if(e&&typeof e=="string")return SF(e,n);throw new Error(Cn(8))}function SF(e,t){return e==="button"?v.createElement("button",{type:"button",...t,key:t.key}):e==="img"?v.createElement("img",{alt:"",...t,key:t.key}):v.createElement(e,t)}function Jp(e){return It(e.defaultTagName??"div",e,e)}function T2(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=T2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function k2(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=T2(e))&&(r&&(r+=" "),r+=t);return r}const jR=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,zR=k2,em=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return zR(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(d=>{const m=n==null?void 0:n[d],h=o==null?void 0:o[d];if(m===null)return null;const y=jR(m)||jR(h);return a[d][y]}),c=n&&Object.entries(n).reduce((d,m)=>{let[h,y]=m;return y===void 0||(d[h]=y),d},{}),f=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((d,m)=>{let{class:h,className:y,...g}=m;return Object.entries(g).every(w=>{let[C,R]=w;return Array.isArray(R)?R.includes({...o,...c}[C]):{...o,...c}[C]===R})?[...d,h,y]:d},[]);return zR(e,l,f,n==null?void 0:n.class,n==null?void 0:n.className)},cb=768;function EF(){const[e,t]=v.useState(void 0);return v.useEffect(()=>{const n=window.matchMedia(`(max-width: ${cb-1}px)`),r=()=>{t(window.innerWidth<cb)};return n.addEventListener("change",r),t(window.innerWidth<cb),()=>n.removeEventListener("change",r)},[]),!!e}const CF=(e,t)=>{const n=new Array(e.length+t.length);for(let r=0;r<e.length;r++)n[r]=e[r];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},RF=(e,t)=>({classGroupId:e,validator:t}),M2=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),wp="-",FR=[],TF="arbitrary..",kF=e=>{const t=AF(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return MF(l);const c=l.split(wp),f=c[0]===""&&c.length>1?1:0;return A2(c,f,t)},getConflictingClassGroupIds:(l,c)=>{if(c){const f=r[l],d=n[l];return f?d?CF(d,f):f:d||FR}return n[l]||FR}}},A2=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const d=A2(e,t+1,o);if(d)return d}const l=n.validators;if(l===null)return;const c=t===0?e.join(wp):e.slice(t).join(wp),f=l.length;for(let d=0;d<f;d++){const m=l[d];if(m.validator(c))return m.classGroupId}},MF=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?TF+r:void 0})(),AF=e=>{const{theme:t,classGroups:n}=e;return NF(n,t)},NF=(e,t)=>{const n=M2();for(const r in e){const a=e[r];Qx(a,n,r,t)}return n},Qx=(e,t,n,r)=>{const a=e.length;for(let o=0;o<a;o++){const l=e[o];OF(l,t,n,r)}},OF=(e,t,n,r)=>{if(typeof e=="string"){DF(e,t,n);return}if(typeof e=="function"){IF(e,t,n,r);return}PF(e,t,n,r)},DF=(e,t,n)=>{const r=e===""?t:N2(t,e);r.classGroupId=n},IF=(e,t,n,r)=>{if(LF(e)){Qx(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(RF(n,e))},PF=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l<o;l++){const[c,f]=a[l];Qx(f,N2(t,c),n,r)}},N2=(e,t)=>{let n=e;const r=t.split(wp),a=r.length;for(let o=0;o<a;o++){const l=r[o];let c=n.nextPart.get(l);c||(c=M2(),n.nextPart.set(l,c)),n=c}return n},LF=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,_F=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},Dv="!",BR=":",jF=[],HR=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),zF=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,c=0,f=0,d;const m=a.length;for(let C=0;C<m;C++){const R=a[C];if(l===0&&c===0){if(R===BR){o.push(a.slice(f,C)),f=C+1;continue}if(R==="/"){d=C;continue}}R==="["?l++:R==="]"?l--:R==="("?c++:R===")"&&c--}const h=o.length===0?a:a.slice(f);let y=h,g=!1;h.endsWith(Dv)?(y=h.slice(0,-1),g=!0):h.startsWith(Dv)&&(y=h.slice(1),g=!0);const w=d&&d>f?d-f:void 0;return HR(o,g,y,w)};if(t){const a=t+BR,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):HR(jF,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},FF=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o<n.length;o++){const l=n[o],c=l[0]==="[",f=t.has(l);c||f?(a.length>0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},BF=e=>({cache:_F(e.cacheSize),parseClassName:zF(e),sortModifiers:FF(e),...kF(e)}),HF=/\s+/,UF=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],c=e.trim().split(HF);let f="";for(let d=c.length-1;d>=0;d-=1){const m=c[d],{isExternal:h,modifiers:y,hasImportantModifier:g,baseClassName:w,maybePostfixModifierPosition:C}=n(m);if(h){f=m+(f.length>0?" "+f:f);continue}let R=!!C,E=r(R?w.substring(0,C):w);if(!E){if(!R){f=m+(f.length>0?" "+f:f);continue}if(E=r(w),!E){f=m+(f.length>0?" "+f:f);continue}R=!1}const T=y.length===0?"":y.length===1?y[0]:o(y).join(":"),k=g?T+Dv:T,M=k+E;if(l.indexOf(M)>-1)continue;l.push(M);const D=a(E,R);for(let A=0;A<D.length;++A){const N=D[A];l.push(k+N)}f=m+(f.length>0?" "+f:f)}return f},qF=(...e)=>{let t=0,n,r,a="";for(;t<e.length;)(n=e[t++])&&(r=O2(n))&&(a&&(a+=" "),a+=r);return a},O2=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=O2(e[r]))&&(n&&(n+=" "),n+=t);return n},VF=(e,...t)=>{let n,r,a,o;const l=f=>{const d=t.reduce((m,h)=>h(m),e());return n=BF(d),r=n.cache.get,a=n.cache.set,o=c,c(f)},c=f=>{const d=r(f);if(d)return d;const m=UF(f,n);return a(f,m),m};return o=l,(...f)=>o(qF(...f))},$F=[],Jn=e=>{const t=n=>n[e]||$F;return t.isThemeGetter=!0,t},D2=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,I2=/^\((?:(\w[\w-]*):)?(.+)\)$/i,WF=/^\d+\/\d+$/,YF=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,KF=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,GF=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,XF=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,QF=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Fl=e=>WF.test(e),qt=e=>!!e&&!Number.isNaN(Number(e)),xo=e=>!!e&&Number.isInteger(Number(e)),ub=e=>e.endsWith("%")&&qt(e.slice(0,-1)),Oa=e=>YF.test(e),ZF=()=>!0,JF=e=>KF.test(e)&&!GF.test(e),P2=()=>!1,eB=e=>XF.test(e),tB=e=>QF.test(e),nB=e=>!lt(e)&&!ct(e),rB=e=>Nc(e,j2,P2),lt=e=>D2.test(e),ws=e=>Nc(e,z2,JF),db=e=>Nc(e,lB,qt),UR=e=>Nc(e,L2,P2),iB=e=>Nc(e,_2,tB),kh=e=>Nc(e,F2,eB),ct=e=>I2.test(e),ju=e=>Oc(e,z2),aB=e=>Oc(e,cB),qR=e=>Oc(e,L2),oB=e=>Oc(e,j2),sB=e=>Oc(e,_2),Mh=e=>Oc(e,F2,!0),Nc=(e,t,n)=>{const r=D2.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Oc=(e,t,n=!1)=>{const r=I2.exec(e);return r?r[1]?t(r[1]):n:!1},L2=e=>e==="position"||e==="percentage",_2=e=>e==="image"||e==="url",j2=e=>e==="length"||e==="size"||e==="bg-size",z2=e=>e==="length",lB=e=>e==="number",cB=e=>e==="family-name",F2=e=>e==="shadow",uB=()=>{const e=Jn("color"),t=Jn("font"),n=Jn("text"),r=Jn("font-weight"),a=Jn("tracking"),o=Jn("leading"),l=Jn("breakpoint"),c=Jn("container"),f=Jn("spacing"),d=Jn("radius"),m=Jn("shadow"),h=Jn("inset-shadow"),y=Jn("text-shadow"),g=Jn("drop-shadow"),w=Jn("blur"),C=Jn("perspective"),R=Jn("aspect"),E=Jn("ease"),T=Jn("animate"),k=()=>["auto","avoid","all","avoid-page","page","left","right","column"],M=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...M(),ct,lt],A=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto","contain","none"],L=()=>[ct,lt,f],q=()=>[Fl,"full","auto",...L()],F=()=>[xo,"none","subgrid",ct,lt],Y=()=>["auto",{span:["full",xo,ct,lt]},xo,ct,lt],_=()=>[xo,"auto",ct,lt],V=()=>["auto","min","max","fr",ct,lt],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],j=()=>["auto",...L()],z=()=>[Fl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],H=()=>[e,ct,lt],K=()=>[...M(),qR,UR,{position:[ct,lt]}],P=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",oB,rB,{size:[ct,lt]}],G=()=>[ub,ju,ws],I=()=>["","none","full",d,ct,lt],Q=()=>["",qt,ju,ws],le=()=>["solid","dashed","dotted","double"],ae=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Z=()=>[qt,ub,qR,UR],ue=()=>["","none",w,ct,lt],ve=()=>["none",qt,ct,lt],Se=()=>["none",qt,ct,lt],Le=()=>[qt,ct,lt],te=()=>[Fl,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Oa],breakpoint:[Oa],color:[ZF],container:[Oa],"drop-shadow":[Oa],ease:["in","out","in-out"],font:[nB],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Oa],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Oa],shadow:[Oa],spacing:["px",qt],text:[Oa],"text-shadow":[Oa],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Fl,lt,ct,R]}],container:["container"],columns:[{columns:[qt,lt,ct,c]}],"break-after":[{"break-after":k()}],"break-before":[{"break-before":k()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:D()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:N()}],"overscroll-x":[{"overscroll-x":N()}],"overscroll-y":[{"overscroll-y":N()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{start:q()}],end:[{end:q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[xo,"auto",ct,lt]}],basis:[{basis:[Fl,"full","auto",c,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qt,Fl,"auto","initial","none",lt]}],grow:[{grow:["",qt,ct,lt]}],shrink:[{shrink:["",qt,ct,lt]}],order:[{order:[xo,"first","last","none",ct,lt]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:Y()}],"col-start":[{"col-start":_()}],"col-end":[{"col-end":_()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:Y()}],"row-start":[{"row-start":_()}],"row-end":[{"row-end":_()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[c,"screen",...z()]}],"min-w":[{"min-w":[c,"screen","none",...z()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",n,ju,ws]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ct,db]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ub,lt]}],"font-family":[{font:[aB,lt,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,ct,lt]}],"line-clamp":[{"line-clamp":[qt,"none",ct,db]}],leading:[{leading:[o,...L()]}],"list-image":[{"list-image":["none",ct,lt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ct,lt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[qt,"from-font","auto",ct,ws]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[qt,"auto",ct,lt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:L()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ct,lt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",ct,lt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:K()}],"bg-repeat":[{bg:P()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xo,ct,lt],radial:["",ct,lt],conic:[xo,ct,lt]},sB,iB]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:G()}],"gradient-via-pos":[{via:G()}],"gradient-to-pos":[{to:G()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:I()}],"rounded-s":[{"rounded-s":I()}],"rounded-e":[{"rounded-e":I()}],"rounded-t":[{"rounded-t":I()}],"rounded-r":[{"rounded-r":I()}],"rounded-b":[{"rounded-b":I()}],"rounded-l":[{"rounded-l":I()}],"rounded-ss":[{"rounded-ss":I()}],"rounded-se":[{"rounded-se":I()}],"rounded-ee":[{"rounded-ee":I()}],"rounded-es":[{"rounded-es":I()}],"rounded-tl":[{"rounded-tl":I()}],"rounded-tr":[{"rounded-tr":I()}],"rounded-br":[{"rounded-br":I()}],"rounded-bl":[{"rounded-bl":I()}],"border-w":[{border:Q()}],"border-w-x":[{"border-x":Q()}],"border-w-y":[{"border-y":Q()}],"border-w-s":[{"border-s":Q()}],"border-w-e":[{"border-e":Q()}],"border-w-t":[{"border-t":Q()}],"border-w-r":[{"border-r":Q()}],"border-w-b":[{"border-b":Q()}],"border-w-l":[{"border-l":Q()}],"divide-x":[{"divide-x":Q()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Q()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qt,ct,lt]}],"outline-w":[{outline:["",qt,ju,ws]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",m,Mh,kh]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",h,Mh,kh]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:Q()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[qt,ws]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":Q()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",y,Mh,kh]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[qt,ct,lt]}],"mix-blend":[{"mix-blend":[...ae(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ae()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[qt]}],"mask-image-linear-from-pos":[{"mask-linear-from":Z()}],"mask-image-linear-to-pos":[{"mask-linear-to":Z()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Z()}],"mask-image-t-to-pos":[{"mask-t-to":Z()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Z()}],"mask-image-r-to-pos":[{"mask-r-to":Z()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Z()}],"mask-image-b-to-pos":[{"mask-b-to":Z()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Z()}],"mask-image-l-to-pos":[{"mask-l-to":Z()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Z()}],"mask-image-x-to-pos":[{"mask-x-to":Z()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Z()}],"mask-image-y-to-pos":[{"mask-y-to":Z()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[ct,lt]}],"mask-image-radial-from-pos":[{"mask-radial-from":Z()}],"mask-image-radial-to-pos":[{"mask-radial-to":Z()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":M()}],"mask-image-conic-pos":[{"mask-conic":[qt]}],"mask-image-conic-from-pos":[{"mask-conic-from":Z()}],"mask-image-conic-to-pos":[{"mask-conic-to":Z()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:K()}],"mask-repeat":[{mask:P()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ct,lt]}],filter:[{filter:["","none",ct,lt]}],blur:[{blur:ue()}],brightness:[{brightness:[qt,ct,lt]}],contrast:[{contrast:[qt,ct,lt]}],"drop-shadow":[{"drop-shadow":["","none",g,Mh,kh]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",qt,ct,lt]}],"hue-rotate":[{"hue-rotate":[qt,ct,lt]}],invert:[{invert:["",qt,ct,lt]}],saturate:[{saturate:[qt,ct,lt]}],sepia:[{sepia:["",qt,ct,lt]}],"backdrop-filter":[{"backdrop-filter":["","none",ct,lt]}],"backdrop-blur":[{"backdrop-blur":ue()}],"backdrop-brightness":[{"backdrop-brightness":[qt,ct,lt]}],"backdrop-contrast":[{"backdrop-contrast":[qt,ct,lt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qt,ct,lt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qt,ct,lt]}],"backdrop-invert":[{"backdrop-invert":["",qt,ct,lt]}],"backdrop-opacity":[{"backdrop-opacity":[qt,ct,lt]}],"backdrop-saturate":[{"backdrop-saturate":[qt,ct,lt]}],"backdrop-sepia":[{"backdrop-sepia":["",qt,ct,lt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ct,lt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qt,"initial",ct,lt]}],ease:[{ease:["linear","initial",E,ct,lt]}],delay:[{delay:[qt,ct,lt]}],animate:[{animate:["none",T,ct,lt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[C,ct,lt]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:ve()}],"rotate-x":[{"rotate-x":ve()}],"rotate-y":[{"rotate-y":ve()}],"rotate-z":[{"rotate-z":ve()}],scale:[{scale:Se()}],"scale-x":[{"scale-x":Se()}],"scale-y":[{"scale-y":Se()}],"scale-z":[{"scale-z":Se()}],"scale-3d":["scale-3d"],skew:[{skew:Le()}],"skew-x":[{"skew-x":Le()}],"skew-y":[{"skew-y":Le()}],transform:[{transform:[ct,lt,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:te()}],"translate-x":[{"translate-x":te()}],"translate-y":[{"translate-y":te()}],"translate-z":[{"translate-z":te()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",ct,lt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",ct,lt]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[qt,ju,ws,db]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},dB=VF(uB);function Pe(...e){return dB(k2(e))}function tm(){return typeof window<"u"}function Yo(e){return Zx(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ca(e){var t;return(t=(Zx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Zx(e){return tm()?e instanceof Node||e instanceof Hn(e).Node:!1}function un(e){return tm()?e instanceof Element||e instanceof Hn(e).Element:!1}function Mn(e){return tm()?e instanceof HTMLElement||e instanceof Hn(e).HTMLElement:!1}function Iv(e){return!tm()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}const fB=new Set(["inline","contents"]);function Ko(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ai(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!fB.has(a)}const hB=new Set(["table","td","th"]);function pB(e){return hB.has(Yo(e))}const mB=[":popover-open",":modal"];function nm(e){return mB.some(t=>{try{return e.matches(t)}catch{return!1}})}const gB=["transform","translate","scale","rotate","perspective"],yB=["transform","translate","scale","rotate","perspective","filter"],bB=["paint","layout","strict","content"];function Jx(e){const t=rm(),n=un(e)?ai(e):e;return gB.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||yB.some(r=>(n.willChange||"").includes(r))||bB.some(r=>(n.contain||"").includes(r))}function vB(e){let t=oa(e);for(;Mn(t)&&!ra(t);){if(Jx(t))return t;if(nm(t))return null;t=oa(t)}return null}function rm(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const xB=new Set(["html","body","#document"]);function ra(e){return xB.has(Yo(e))}function ai(e){return Hn(e).getComputedStyle(e)}function im(e){return un(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oa(e){if(Yo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Iv(e)&&e.host||ca(e);return Iv(t)?t.host:t}function B2(e){const t=oa(e);return ra(t)?e.ownerDocument?e.ownerDocument.body:e.body:Mn(t)&&Ko(t)?t:B2(t)}function Bo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=B2(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=Hn(a);if(o){const c=Pv(l);return t.concat(l,l.visualViewport||[],Ko(a)?a:[],c&&n?Bo(c):[])}return t.concat(a,Bo(a,[],n))}function Pv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const fb=Px[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],wB=fb&&fb!==v.useLayoutEffect?fb:e=>e();function We(e){const t=nr(SB).current;return t.next=e,wB(t.effect),t.trampoline}function SB(){const e={next:void 0,callback:EB,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function EB(){}const CB={...Px},RB=()=>{},qe=typeof document<"u"?v.useLayoutEffect:RB,H2=v.createContext(void 0);function e0(e=!1){const t=v.useContext(H2);if(t===void 0&&!e)throw new Error(Cn(16));return t}function TB(e){const{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,l=r&&t!==!1,c=r&&t===!1;return{props:v.useMemo(()=>{const d={onKeyDown(m){n&&t&&m.key!=="Tab"&&m.preventDefault()}};return r||(d.tabIndex=a,!o&&n&&(d.tabIndex=t?a:-1)),(o&&(t||l)||!o&&n)&&(d["aria-disabled"]=n),o&&(!t||c)&&(d.disabled=n),d},[r,n,t,l,c,o,a])}}function $a(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0}=e,o=v.useRef(null),l=e0(!0)!==void 0,c=We(()=>{const y=o.current;return!!((y==null?void 0:y.tagName)==="A"&&(y!=null&&y.href))}),{props:f}=TB({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=v.useCallback(()=>{const y=o.current;kB(y)&&l&&t&&f.disabled===void 0&&y.disabled&&(y.disabled=!1)},[t,f.disabled,l]);qe(d,[d]);const m=v.useCallback((y={})=>{const{onClick:g,onMouseDown:w,onKeyUp:C,onKeyDown:R,onPointerDown:E,...T}=y;return Ri({type:a?"button":void 0,onClick(M){if(t){M.preventDefault();return}g==null||g(M)},onMouseDown(M){t||w==null||w(M)},onKeyDown(M){if(t||(Ov(M),R==null||R(M)),M.baseUIHandlerPrevented)return;const D=M.target===M.currentTarget&&!a&&!c()&&!t,A=M.key==="Enter",N=M.key===" ";D&&((N||A)&&M.preventDefault(),A&&(g==null||g(M)))},onKeyUp(M){t||(Ov(M),C==null||C(M)),!M.baseUIHandlerPrevented&&M.target===M.currentTarget&&!a&&!t&&M.key===" "&&(g==null||g(M))},onPointerDown(M){if(t){M.preventDefault();return}E==null||E(M)}},a?void 0:{role:"button"},f,T)},[t,f,a,c]),h=We(y=>{o.current=y,d()});return{getButtonProps:m,buttonRef:h}}function kB(e){return Mn(e)&&e.tagName==="BUTTON"}const MB=v.forwardRef(function(t,n){const{render:r,className:a,disabled:o=!1,focusableWhenDisabled:l=!1,nativeButton:c=!0,...f}=t,{getButtonProps:d,buttonRef:m}=$a({disabled:o,focusableWhenDisabled:l,native:c});return It("button",t,{state:{disabled:o},ref:[n,m],props:[f,d]})}),AB=em("focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 rounded-lg border border-transparent bg-clip-padding text-sm font-medium focus-visible:ring-3 aria-invalid:ring-3 [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50 aria-expanded:bg-muted aria-expanded:text-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",destructive:"bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function Ht({className:e,variant:t="default",size:n="default",...r}){return S.jsx(MB,{"data-slot":"button",className:Pe(AB({variant:t,size:n,className:e})),...r})}let VR=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const NB={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},t0={valid(e){return e===null?null:e?{[VR.valid]:""}:{[VR.invalid]:""}}},OB=v.createContext({invalid:void 0,name:void 0,validityData:{state:NB,errors:[],error:"",value:"",initialValue:null},setValidityData:Br,disabled:void 0,touched:!1,setTouched:Br,dirty:!1,setDirty:Br,filled:!1,setFilled:Br,focused:!1,setFocused:Br,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=In)=>e,getInputValidationProps:(e=In)=>e,inputRef:{current:null},commit:async()=>{}}});function Dc(e=!0){const t=v.useContext(OB);if(t.setValidityData===Br&&!e)throw new Error(Cn(28));return t}const DB=v.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Br,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function n0(){return v.useContext(DB)}let $R=0;function IB(e,t="mui"){const[n,r]=v.useState(e),a=e||n;return v.useEffect(()=>{n==null&&($R+=1,r(`${t}-${$R}`))},[n,t]),a}const WR=CB.useId;function nl(e,t){if(WR!==void 0){const n=WR();return e??(t?`${t}-${n}`:n)}return IB(e,t)}function Vi(e){return nl(e,"base-ui")}const PB=v.createContext({controlId:void 0,registerControlId:Br,labelId:void 0,setLabelId:Br,messageIds:[],setMessageIds:Br,getDescriptionProps:e=>e});function am(){return v.useContext(PB)}const LB=[];function om(e){v.useEffect(e,LB)}const zu=0;class sa{constructor(){at(this,"currentId",zu);at(this,"clear",()=>{this.currentId!==zu&&(clearTimeout(this.currentId),this.currentId=zu)});at(this,"disposeEffect",()=>this.clear)}static create(){return new sa}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=zu,n()},t)}isStarted(){return this.currentId!==zu}}function Bn(){const e=nr(sa.create).current;return om(e.disposeEffect),e}function _B(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function Qt(e){return(e==null?void 0:e.ownerDocument)||document}const Ic=typeof navigator<"u",hb=zB(),U2=BB(),q2=FB(),sm=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),V2=hb.platform==="MacIntel"&&hb.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(hb.platform),$2=Ic&&/apple/i.test(navigator.vendor),Lv=Ic&&/android/i.test(U2)||/android/i.test(q2),jB=Ic&&U2.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,W2=q2.includes("jsdom/");function zB(){if(!Ic)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e!=null&&e.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function FB(){if(!Ic)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function BB(){if(!Ic)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const _v="data-base-ui-focusable",Y2="active",K2="selected",G2="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",Ho="ArrowLeft",Uo="ArrowRight",r0="ArrowUp",qd="ArrowDown";function ni(e){var n;let t=e.activeElement;for(;((n=t==null?void 0:t.shadowRoot)==null?void 0:n.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}function Dt(e,t){var r;if(!e||!t)return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e.contains(t))return!0;if(n&&Iv(n)){let a=t;for(;a;){if(e===a)return!0;a=a.parentNode||a.host}}return!1}function Sp(e,t){if(!un(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(Dt(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function Tr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Ii(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function HB(e){return e.matches("html,body")}function lm(e){return Mn(e)&&e.matches(G2)}function jv(e){return e?e.getAttribute("role")==="combobox"&&lm(e):!1}function UB(e){if(!e||W2)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Ed(e){return e?e.hasAttribute(_v)?e:e.querySelector(`[${_v}]`)||e:null}function js(e,t,n=!0){return e.filter(a=>{var o;return a.parentId===t&&(!n||((o=a.context)==null?void 0:o.open))}).flatMap(a=>[a,...js(e,a.id,n)])}function YR(e,t){var a;let n=[],r=(a=e.find(o=>o.id===t))==null?void 0:a.parentId;for(;r;){const o=e.find(l=>l.id===r);r=o==null?void 0:o.parentId,o&&(n=n.concat(o))}return n}function br(e){e.preventDefault(),e.stopPropagation()}function qB(e){return"nativeEvent"in e}function X2(e){return e.pointerType===""&&e.isTrusted?!0:Lv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Q2(e){return W2?!1:!Lv&&e.width===0&&e.height===0||Lv&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Vs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Z2(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const VB=["top","right","bottom","left"],xc=Math.min,ri=Math.max,Ep=Math.round,Gl=Math.floor,ia=e=>({x:e,y:e}),$B={left:"right",right:"left",bottom:"top",top:"bottom"},WB={start:"end",end:"start"};function zv(e,t,n){return ri(e,xc(t,n))}function qa(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Go(e){return e.split("-")[1]}function i0(e){return e==="x"?"y":"x"}function a0(e){return e==="y"?"height":"width"}const YB=new Set(["top","bottom"]);function wi(e){return YB.has(Hr(e))?"y":"x"}function o0(e){return i0(wi(e))}function KB(e,t,n){n===void 0&&(n=!1);const r=Go(e),a=o0(e),o=a0(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=Cp(l)),[l,Cp(l)]}function GB(e){const t=Cp(e);return[Fv(e),t,Fv(t)]}function Fv(e){return e.replace(/start|end/g,t=>WB[t])}const KR=["left","right"],GR=["right","left"],XB=["top","bottom"],QB=["bottom","top"];function ZB(e,t,n){switch(e){case"top":case"bottom":return n?t?GR:KR:t?KR:GR;case"left":case"right":return t?XB:QB;default:return[]}}function JB(e,t,n,r){const a=Go(e);let o=ZB(Hr(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(Fv)))),o}function Cp(e){return e.replace(/left|right|bottom|top/g,t=>$B[t])}function eH(e){return{top:0,right:0,bottom:0,left:0,...e}}function J2(e){return typeof e!="number"?eH(e):{top:e,right:e,bottom:e,left:e}}function Rp(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function Ah(e,t,n){return Math.floor(e/t)!==n}function Ql(e,t){return t<0||t>=e.current.length}function np(e,t){return hr(e,{disabledIndices:t})}function Bv(e,t){return hr(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function hr(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:a=1}={}){let o=t;do o+=n?-a:a;while(o>=0&&o<=e.current.length-1&&qo(e,o,r));return o}function eA(e,{event:t,orientation:n,loopFocus:r,rtl:a,cols:o,disabledIndices:l,minIndex:c,maxIndex:f,prevIndex:d,stopEvent:m=!1}){let h=d;const y=[],g={};let w=!1;{let E=null,T=-1;e.current.forEach((k,M)=>{if(k==null)return;const D=k.closest('[role="row"]');D&&(w=!0),(D!==E||T===-1)&&(E=D,T+=1,y[T]=[]),y[T].push(M),g[M]=T})}const C=w&&y.length>0&&y.some(E=>E.length!==o);function R(E){if(!C||d===-1)return;const T=g[d];if(T==null)return;const k=y[T].indexOf(d);let M=E==="up"?T-1:T+1;r&&(M<0?M=y.length-1:M>=y.length&&(M=0));const D=new Set;for(;M>=0&&M<y.length&&!D.has(M);){D.add(M);const A=y[M];if(A.length===0){M=E==="up"?M-1:M+1;continue}const N=Math.min(k,A.length-1);for(let L=N;L>=0;L-=1){const q=A[L];if(!qo(e,q,l))return q}M=E==="up"?M-1:M+1,r&&(M<0?M=y.length-1:M>=y.length&&(M=0))}}if(t.key===r0){const E=R("up");if(E!==void 0)m&&br(t),h=E;else{if(m&&br(t),d===-1)h=f;else if(h=hr(e,{startingIndex:h,amount:o,decrement:!0,disabledIndices:l}),r&&(d-o<c||h<0)){const T=d%o,k=f%o,M=f-(k-T);k===T?h=f:h=k>T?M:M-o}Ql(e,h)&&(h=d)}}if(t.key===qd){const E=R("down");E!==void 0?(m&&br(t),h=E):(m&&br(t),d===-1?h=c:(h=hr(e,{startingIndex:d,amount:o,disabledIndices:l}),r&&d+o>f&&(h=hr(e,{startingIndex:d%o-o,amount:o,disabledIndices:l}))),Ql(e,h)&&(h=d))}if(n==="both"){const E=Gl(d/o);t.key===(a?Ho:Uo)&&(m&&br(t),d%o!==o-1?(h=hr(e,{startingIndex:d,disabledIndices:l}),r&&Ah(h,o,E)&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l}))):r&&(h=hr(e,{startingIndex:d-d%o-1,disabledIndices:l})),Ah(h,o,E)&&(h=d)),t.key===(a?Uo:Ho)&&(m&&br(t),d%o!==0?(h=hr(e,{startingIndex:d,decrement:!0,disabledIndices:l}),r&&Ah(h,o,E)&&(h=hr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l}))):r&&(h=hr(e,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:l})),Ah(h,o,E)&&(h=d));const T=Gl(f/o)===E;Ql(e,h)&&(r&&T?h=t.key===(a?Uo:Ho)?f:hr(e,{startingIndex:d-d%o-1,disabledIndices:l}):h=d)}return h}function tA(e,t,n){const r=[];let a=0;return e.forEach(({width:o,height:l},c)=>{let f=!1;for(n&&(a=0);!f;){const d=[];for(let m=0;m<o;m+=1)for(let h=0;h<l;h+=1)d.push(a+m+h*t);a%t+o<=t&&d.every(m=>r[m]==null)?(d.forEach(m=>{r[m]=c}),f=!0):a+=1}}),[...r]}function nA(e,t,n,r,a){if(e===-1)return-1;const o=n.indexOf(e),l=t[e];switch(a){case"tl":return o;case"tr":return l?o+l.width-1:o;case"bl":return l?o+(l.height-1)*r:o;case"br":return n.lastIndexOf(e);default:return-1}}function rA(e,t){return t.flatMap((n,r)=>e.includes(n)?[r]:[])}function qo(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const r=e.current[t];return r?r.hasAttribute("disabled")||r.getAttribute("aria-disabled")==="true":!1}/*!
|
|
86
|
-
* tabbable 6.4.0
|
|
87
|
-
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
88
|
-
*/var tH=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Tp=tH.join(","),iA=typeof Element>"u",wc=iA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,kp=!iA&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},Mp=function(t,n){var r;n===void 0&&(n=!0);var a=t==null||(r=t.getAttribute)===null||r===void 0?void 0:r.call(t,"inert"),o=a===""||a==="true",l=o||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Mp(t.parentNode));return l},nH=function(t){var n,r=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return r===""||r==="true"},aA=function(t,n,r){if(Mp(t))return[];var a=Array.prototype.slice.apply(t.querySelectorAll(Tp));return n&&wc.call(t,Tp)&&a.unshift(t),a=a.filter(r),a},Ap=function(t,n,r){for(var a=[],o=Array.from(t);o.length;){var l=o.shift();if(!Mp(l,!1))if(l.tagName==="SLOT"){var c=l.assignedElements(),f=c.length?c:l.children,d=Ap(f,!0,r);r.flatten?a.push.apply(a,d):a.push({scopeParent:l,candidates:d})}else{var m=wc.call(l,Tp);m&&r.filter(l)&&(n||!t.includes(l))&&a.push(l);var h=l.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(l),y=!Mp(h,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(l));if(h&&y){var g=Ap(h===!0?l.children:h.children,!0,r);r.flatten?a.push.apply(a,g):a.push({scopeParent:l,candidates:g})}else o.unshift.apply(o,l.children)}}return a},oA=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},sA=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||nH(t))&&!oA(t)?0:t.tabIndex},rH=function(t,n){var r=sA(t);return r<0&&n&&!oA(t)?0:r},iH=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},lA=function(t){return t.tagName==="INPUT"},aH=function(t){return lA(t)&&t.type==="hidden"},oH=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(r){return r.tagName==="SUMMARY"});return n},sH=function(t,n){for(var r=0;r<t.length;r++)if(t[r].checked&&t[r].form===n)return t[r]},lH=function(t){if(!t.name)return!0;var n=t.form||kp(t),r=function(c){return n.querySelectorAll('input[type="radio"][name="'+c+'"]')},a;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")a=r(window.CSS.escape(t.name));else try{a=r(t.name)}catch(l){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",l.message),!1}var o=sH(a,t.form);return!o||o===t},cH=function(t){return lA(t)&&t.type==="radio"},uH=function(t){return cH(t)&&!lH(t)},dH=function(t){var n,r=t&&kp(t),a=(n=r)===null||n===void 0?void 0:n.host,o=!1;if(r&&r!==t){var l,c,f;for(o=!!((l=a)!==null&&l!==void 0&&(c=l.ownerDocument)!==null&&c!==void 0&&c.contains(a)||t!=null&&(f=t.ownerDocument)!==null&&f!==void 0&&f.contains(t));!o&&a;){var d,m,h;r=kp(a),a=(d=r)===null||d===void 0?void 0:d.host,o=!!((m=a)!==null&&m!==void 0&&(h=m.ownerDocument)!==null&&h!==void 0&&h.contains(a))}}return o},XR=function(t){var n=t.getBoundingClientRect(),r=n.width,a=n.height;return r===0&&a===0},fH=function(t,n){var r=n.displayCheck,a=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in t){var o=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}if(getComputedStyle(t).visibility==="hidden")return!0;var l=wc.call(t,"details>summary:first-of-type"),c=l?t.parentElement:t;if(wc.call(c,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof a=="function"){for(var f=t;t;){var d=t.parentElement,m=kp(t);if(d&&!d.shadowRoot&&a(d)===!0)return XR(t);t.assignedSlot?t=t.assignedSlot:!d&&m!==t.ownerDocument?t=m.host:t=d}t=f}if(dH(t))return!t.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return XR(t);return!1},hH=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.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 wc.call(n,"fieldset[disabled] *")?!0:!a.contains(t)}return!0}n=n.parentElement}return!1},Hv=function(t,n){return!(n.disabled||aH(n)||fH(n,t)||oH(n)||hH(n))},Uv=function(t,n){return!(uH(n)||sA(n)<0||!Hv(t,n))},pH=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},cA=function(t){var n=[],r=[];return t.forEach(function(a,o){var l=!!a.scopeParent,c=l?a.scopeParent:a,f=rH(c,l),d=l?cA(a.candidates):c;f===0?l?n.push.apply(n,d):n.push(c):r.push({documentOrder:o,tabIndex:f,item:a,isScope:l,content:d})}),r.sort(iH).reduce(function(a,o){return o.isScope?a.push.apply(a,o.content):a.push(o.content),a},[]).concat(n)},Vd=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ap([t],n.includeContainer,{filter:Uv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:pH}):r=aA(t,n.includeContainer,Uv.bind(null,n)),cA(r)},mH=function(t,n){n=n||{};var r;return n.getShadowRoot?r=Ap([t],n.includeContainer,{filter:Hv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=aA(t,n.includeContainer,Hv.bind(null,n)),r},uA=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return wc.call(t,Tp)===!1?!1:Uv(n,t)};const Pc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function dA(e,t){const n=Vd(e,Pc()),r=n.length;if(r===0)return;const a=ni(Qt(e)),o=n.indexOf(a),l=o===-1?t===1?0:r-1:o+t;return n[l]}function s0(e){return dA(Qt(e).body,1)||e}function fA(e){return dA(Qt(e).body,-1)||e}function hA(e,t){if(!e)return null;const n=Vd(Qt(e).body,Pc()),r=n.length;if(r===0)return null;const a=n.indexOf(e);if(a===-1)return null;const o=(a+t+r)%r;return n[o]}function gH(e){return hA(e,1)}function yH(e){return hA(e,-1)}function Zl(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Dt(n,r)}function bH(e){Vd(e,Pc()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function QR(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const Nh=null;class vH{constructor(){at(this,"callbacks",[]);at(this,"callbacksCount",0);at(this,"nextId",1);at(this,"startId",1);at(this,"isScheduled",!1);at(this,"tick",t=>{var a;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)(a=n[o])==null||a.call(n,t)})}request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Oh=new vH;class Fn{constructor(){at(this,"currentId",Nh);at(this,"cancel",()=>{this.currentId!==Nh&&(Oh.cancel(this.currentId),this.currentId=Nh)});at(this,"disposeEffect",()=>this.cancel)}static create(){return new Fn}static request(t){return Oh.request(t)}static cancel(t){return Oh.cancel(t)}request(t){this.cancel(),this.currentId=Oh.request(()=>{this.currentId=Nh,t()})}}function $d(){const e=nr(Fn.create).current;return om(e.disposeEffect),e}function Pa(e){return e==null?e:"current"in e?e.current:e}let $s=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const xH={[$s.startingStyle]:""},wH={[$s.endingStyle]:""},Wa={transitionStatus(e){return e==="starting"?xH:e==="ending"?wH:null}};function pA(e,t=!1,n=!0){const r=$d();return We((a,o=null)=>{r.cancel();function l(){pr.flushSync(a)}const c=Pa(e);if(c==null)return;const f=c;if(typeof f.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)a();else{let d=function(){const h=$s.startingStyle;if(!f.hasAttribute(h)){r.request(m);return}const y=new MutationObserver(()=>{f.hasAttribute(h)||(y.disconnect(),m())});y.observe(f,{attributes:!0,attributeFilter:[h]}),o==null||o.addEventListener("abort",()=>y.disconnect(),{once:!0})},m=function(){Promise.all(f.getAnimations().map(h=>h.finished)).then(()=>{o!=null&&o.aborted||l()}).catch(()=>{const h=f.getAnimations();if(n){if(o!=null&&o.aborted)return;l()}else h.length>0&&h.some(y=>y.pending||y.playState!=="finished")&&m()})};if(t){d();return}r.request(m)}})}function Ya(e){const{enabled:t=!0,open:n,ref:r,onComplete:a}=e,o=We(a),l=pA(r,n,!1);v.useEffect(()=>{if(!t)return;const c=new AbortController;return l(o,c.signal),()=>{c.abort()}},[t,n,o,l])}function Wd(e,t=!1,n=!1){const[r,a]=v.useState(e&&t?"idle":void 0),[o,l]=v.useState(e);return e&&!o&&(l(!0),a("starting")),!e&&o&&r!=="ending"&&!n&&a("ending"),!e&&!o&&r==="ending"&&a(void 0),qe(()=>{if(!e&&o&&r!=="ending"&&n){const c=Fn.request(()=>{a("ending")});return()=>{Fn.cancel(c)}}},[e,o,r,n]),qe(()=>{if(!e||t)return;const c=Fn.request(()=>{a(void 0)});return()=>{Fn.cancel(c)}},[t,e]),qe(()=>{if(!e||!t)return;e&&o&&r!=="idle"&&a("starting");const c=Fn.request(()=>{a("idle")});return()=>{Fn.cancel(c)}},[t,e,o,a,r]),v.useMemo(()=>({mounted:o,setMounted:l,transitionStatus:r}),[o,r])}function Sc({controlled:e,default:t,name:n,state:r="value"}){const{current:a}=v.useRef(e!==void 0),[o,l]=v.useState(t),c=a?e:o,f=v.useCallback(d=>{a||l(d)},[]);return[c,f]}function cm(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:a,registerControlId:o}=am(),l=Vi(t),c=n?a:void 0,f=nr(()=>Symbol("labelable-control")),d=v.useRef(!1),m=v.useRef(t!=null),h=We(()=>{!d.current||o===Br||(d.current=!1,o(f.current,void 0))});return qe(()=>{if(o===Br)return;let y;if(n){const g=r==null?void 0:r.current;un(g)&&g.closest("label")!=null?y=t??null:y=c??l}else if(t!=null)m.current=!0,y=t;else if(m.current)y=l;else{h();return}if(y===void 0){h();return}d.current=!0,o(f.current,y)},[t,r,c,o,n,l,f,h]),v.useEffect(()=>h,[h]),a??l}function l0(e){const{enabled:t=!0,value:n,id:r,name:a,controlRef:o,commit:l}=e,{formRef:c}=n0(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:h}=Dc(),y=We(e.getValue);qe(()=>{if(!t)return;let g=n;g===void 0&&(g=y()),m.initialValue===null&&g!==null&&h(w=>({...w,initialValue:g}))},[t,h,n,m.initialValue,y]),qe(()=>{!t||!r||c.current.fields.set(r,{getValue:y,name:a,controlRef:o,validityData:_B(m,f),validate(g=!0){let w=n;w===void 0&&(w=y()),d.current=!0,g?pr.flushSync(()=>l(w)):l(w)}})},[l,o,t,c,y,r,f,d,a,m,n]),qe(()=>{const g=c.current.fields;return()=>{r&&g.delete(r)}},[c,r])}const Fi="none",Ws="trigger-press",vr="trigger-hover",Jl="trigger-focus",um="outside-press",id="item-press",SH="close-press",Ys="focus-out",dm="escape-key",rp="list-navigation",mA="cancel-open",ip="sibling-open",EH="disabled",c0="imperative-action",CH="window-resize";function xt(e,t,n,r){let a=!1,o=!1;const l=r??In;return{reason:e,event:t??new Event("base-ui"),cancel(){a=!0},allowPropagation(){o=!0},get isCanceled(){return a},get isPropagationAllowed(){return o},trigger:n,...l}}const RH=v.forwardRef(function(t,n){const{render:r,className:a,id:o,name:l,value:c,disabled:f=!1,onValueChange:d,defaultValue:m,autoFocus:h=!1,...y}=t,{state:g,name:w,disabled:C,setTouched:R,setDirty:E,validityData:T,setFocused:k,setFilled:M,validationMode:D,validation:A}=Dc(),N=C||f,L=w??l,q={...g,disabled:N},{labelId:F}=am(),Y=cm({id:o});qe(()=>{var H;const z=c!=null;(H=A.inputRef.current)!=null&&H.value||z&&c!==""?M(!0):z&&c===""&&M(!1)},[A.inputRef,M,c]);const _=v.useRef(null);qe(()=>{h&&_.current===ni(Qt(_.current))&&k(!0)},[h,k]);const[V]=Sc({controlled:c,default:m,name:"FieldControl",state:"value"}),$=c!==void 0,B=$?V:void 0;return l0({id:Y,name:L,commit:A.commit,value:B,getValue:()=>{var z;return(z=A.inputRef.current)==null?void 0:z.value},controlRef:A.inputRef}),It("input",t,{ref:[n,_],state:q,props:[{id:Y,disabled:N,name:L,ref:A.inputRef,"aria-labelledby":F,autoFocus:h,...$?{value:B}:{defaultValue:m},onChange(z){const H=z.currentTarget.value;d==null||d(H,xt(Fi,z.nativeEvent)),E(H!==T.initialValue),M(H!=="")},onFocus(){k(!0)},onBlur(z){R(!0),k(!1),D==="onBlur"&&A.commit(z.currentTarget.value)},onKeyDown(z){z.currentTarget.tagName==="INPUT"&&z.key==="Enter"&&(R(!0),A.commit(z.currentTarget.value))}},A.getInputValidationProps(),y],stateAttributesMapping:t0})}),TH=v.forwardRef(function(t,n){return S.jsx(RH,{ref:n,...t})});function Pi({className:e,type:t,...n}){return S.jsx(TH,{type:t,"data-slot":"input",className:Pe("dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 h-8 rounded-lg border bg-transparent px-2.5 py-1 text-base transition-colors file:h-6 file:text-sm file:font-medium focus-visible:ring-2 aria-invalid:ring-2 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",e),...n})}const gA=v.forwardRef(function(t,n){const{className:r,render:a,orientation:o="horizontal",...l}=t;return It("div",t,{state:{orientation:o},ref:n,props:[{role:"separator","aria-orientation":o},l]})});function kH({className:e,orientation:t="horizontal",...n}){return S.jsx(gA,{"data-slot":"separator",orientation:t,className:Pe("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const u0=v.createContext(void 0);function Xo(e){const t=v.useContext(u0);if(e===!1&&t===void 0)throw new Error(Cn(27));return t}let Ts=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=$s.startingStyle]="startingStyle",e[e.endingStyle=$s.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),Np=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const MH={[Np.popupOpen]:""},AH={[Np.popupOpen]:"",[Np.pressed]:""},NH={[Ts.open]:""},OH={[Ts.closed]:""},DH={[Ts.anchorHidden]:""},yA={open(e){return e?MH:null}},qv={open(e){return e?AH:null}},ua={open(e){return e?NH:OH},anchorHidden(e){return e?DH:null}},IH={...ua,...Wa},d0=v.forwardRef(function(t,n){const{render:r,className:a,forceRender:o=!1,...l}=t,{store:c}=Xo(),f=c.useState("open"),d=c.useState("nested"),m=c.useState("mounted"),h=c.useState("transitionStatus");return It("div",t,{state:{open:f,transitionStatus:h},ref:[c.context.backdropRef,n],stateAttributesMapping:IH,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},l],enabled:o||!d})}),fm=v.forwardRef(function(t,n){const{render:r,className:a,disabled:o=!1,nativeButton:l=!0,...c}=t,{store:f}=Xo(),d=f.useState("open");function m(w){d&&f.setOpen(!1,xt(SH,w.nativeEvent))}const{getButtonProps:h,buttonRef:y}=$a({disabled:o,native:l});return It("button",t,{state:{disabled:o},ref:[n,y],props:[{onClick:m},c,h]})}),f0=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Xo(),f=Vi(o);return c.useSyncedValueWithCleanup("descriptionElementId",f),It("p",t,{ref:n,props:[{id:f},l]})});function sr(e){const t=nr(PH,e).current;return t.next=e,qe(t.effect),t}function PH(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function bA(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}class h0{constructor(){at(this,"nodesRef",{current:[]});at(this,"events",bA())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const vA=v.createContext(null),xA=v.createContext(null),Ka=()=>{var e;return((e=v.useContext(vA))==null?void 0:e.id)||null},Qo=e=>{const t=v.useContext(xA);return e??t};function wA(e){const t=nl(),n=Qo(e),r=Ka();return qe(()=>{if(!t)return;const a={id:t,parentId:r};return n==null||n.addNode(a),()=>{n==null||n.removeNode(a)}},[n,t,r]),t}function LH(e){const{children:t,id:n}=e,r=Ka();return S.jsx(vA.Provider,{value:v.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function _H(e){const{children:t,externalTree:n}=e,r=nr(()=>n??new h0).current;return S.jsx(xA.Provider,{value:r,children:t})}function Ec(e){return`data-base-ui-${e}`}function ap(e,t,n){if(n&&!Vs(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r==null?void 0:r[t]}return e==null?void 0:e[t]}const jH=v.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new sa,currentIdRef:{current:null},currentContextRef:{current:null}});function zH(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,r=n.useState("floatingId"),{open:a}=t,o=v.useContext(jH),{currentIdRef:l,delayRef:c,timeoutMs:f,initialDelayRef:d,currentContextRef:m,hasProvider:h,timeout:y}=o,[g,w]=v.useState(!1);return qe(()=>{function C(){var R;w(!1),(R=m.current)==null||R.setIsInstantPhase(!1),l.current=null,m.current=null,c.current=d.current}if(l.current&&!a&&l.current===r){if(w(!1),f){const R=r;return y.start(f,()=>{n.select("open")||l.current&&l.current!==R||C()}),()=>{y.clear()}}C()}},[a,r,l,c,f,d,m,y,n]),qe(()=>{if(!a)return;const C=m.current,R=l.current;y.clear(),m.current={onOpenChange:n.setOpen,setIsInstantPhase:w},l.current=r,c.current={open:0,close:ap(d.current,"close")},R!==null&&R!==r?(w(!0),C==null||C.setIsInstantPhase(!0),C==null||C.onOpenChange(!1,xt(Fi))):(w(!1),C==null||C.setIsInstantPhase(!1))},[a,r,n,l,c,f,d,m,y]),qe(()=>()=>{m.current=null},[m]),v.useMemo(()=>({hasProvider:h,delayRef:c,isInstantPhase:g}),[h,c,g])}const SA={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},hm={...SA,position:"fixed",top:0,left:0},EA={...SA,position:"absolute"},Cc=v.forwardRef(function(t,n){const[r,a]=v.useState();qe(()=>{$2&&a("button")},[]);const o={tabIndex:0,role:r};return S.jsx("span",{...t,ref:n,style:hm,"aria-hidden":r?void 0:!0,...o,"data-base-ui-focus-guard":""})});let ZR=0;function ad(e,t={}){const{preventScroll:n=!1,cancelPrevious:r=!0,sync:a=!1}=t;r&&cancelAnimationFrame(ZR);const o=()=>e==null?void 0:e.focus({preventScroll:n});a?o():ZR=requestAnimationFrame(o)}const ec={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function JR(e){return e==="inert"?ec.inert:e==="aria-hidden"?ec["aria-hidden"]:ec.none}let Dh=new WeakSet,Ih={},pb=0;const CA=e=>e&&(e.host||CA(e.parentNode)),FH=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=CA(n);return e.contains(r)?r:null}).filter(n=>n!=null);function BH(e,t,n,r){const a="data-base-ui-inert",o=r?"inert":n?"aria-hidden":null,l=FH(t,e),c=new Set,f=new Set(l),d=[];Ih[a]||(Ih[a]=new WeakMap);const m=Ih[a];l.forEach(h),y(t),c.clear();function h(g){!g||c.has(g)||(c.add(g),g.parentNode&&h(g.parentNode))}function y(g){!g||f.has(g)||[].forEach.call(g.children,w=>{if(Yo(w)!=="script")if(c.has(w))y(w);else{const C=o?w.getAttribute(o):null,R=C!==null&&C!=="false",E=JR(o),T=(E.get(w)||0)+1,k=(m.get(w)||0)+1;E.set(w,T),m.set(w,k),d.push(w),T===1&&R&&Dh.add(w),k===1&&w.setAttribute(a,""),!R&&o&&w.setAttribute(o,o==="inert"?"":"true")}})}return pb+=1,()=>{d.forEach(g=>{const w=JR(o),R=(w.get(g)||0)-1,E=(m.get(g)||0)-1;w.set(g,R),m.set(g,E),R||(!Dh.has(g)&&o&&g.removeAttribute(o),Dh.delete(g)),E||g.removeAttribute(a)}),pb-=1,pb||(ec.inert=new WeakMap,ec["aria-hidden"]=new WeakMap,ec.none=new WeakMap,Dh=new WeakSet,Ih={})}}function HH(e,t=!1,n=!1){const r=Qt(e[0]).body;return BH(e.concat(Array.from(r.querySelectorAll("[aria-live]"))),r,t,n)}const RA=v.createContext(null),TA=()=>v.useContext(RA),UH=Ec("portal");function kA(e={}){const{ref:t,container:n,componentProps:r=In,elementProps:a}=e,o=nl(),l=TA(),c=l==null?void 0:l.portalNode,[f,d]=v.useState(null),[m,h]=v.useState(null),y=We(R=>{R!==null&&h(R)}),g=v.useRef(null);qe(()=>{if(n===null){g.current&&(g.current=null,h(null),d(null));return}if(o==null)return;const R=(n&&(Zx(n)?n:n.current))??c??document.body;if(R==null){g.current&&(g.current=null,h(null),d(null));return}g.current!==R&&(g.current=R,h(null),d(R))},[n,c,o]);const w=It("div",r,{ref:[t,y],props:[{id:o,[UH]:""},a]});return{portalNode:m,portalSubtree:f&&w?pr.createPortal(w,f):null}}const p0=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,renderGuards:c,...f}=t,{portalNode:d,portalSubtree:m}=kA({container:a,ref:n,componentProps:t,elementProps:f}),h=v.useRef(null),y=v.useRef(null),g=v.useRef(null),w=v.useRef(null),[C,R]=v.useState(null),E=C==null?void 0:C.modal,T=C==null?void 0:C.open,k=typeof c=="boolean"?c:!!C&&!C.modal&&C.open&&!!d;v.useEffect(()=>{if(!d||E)return;function D(A){d&&A.relatedTarget&&Zl(A)&&(A.type==="focusin"?QR:bH)(d)}return d.addEventListener("focusin",D,!0),d.addEventListener("focusout",D,!0),()=>{d.removeEventListener("focusin",D,!0),d.removeEventListener("focusout",D,!0)}},[d,E]),v.useEffect(()=>{!d||T||QR(d)},[T,d]);const M=v.useMemo(()=>({beforeOutsideRef:h,afterOutsideRef:y,beforeInsideRef:g,afterInsideRef:w,portalNode:d,setFocusManagerState:R}),[d]);return S.jsxs(v.Fragment,{children:[m,S.jsxs(RA.Provider,{value:M,children:[k&&d&&S.jsx(Cc,{"data-type":"outside",ref:h,onFocus:D=>{var A;if(Zl(D,d))(A=g.current)==null||A.focus();else{const N=C?C.domReference:null,L=fA(N);L==null||L.focus()}}}),k&&d&&S.jsx("span",{"aria-owns":d.id,style:bF}),d&&pr.createPortal(r,d),k&&d&&S.jsx(Cc,{"data-type":"outside",ref:y,onFocus:D=>{var A;if(Zl(D,d))(A=w.current)==null||A.focus();else{const N=C?C.domReference:null,L=s0(N);L==null||L.focus(),C!=null&&C.closeOnFocusOut&&(C==null||C.onOpenChange(!1,xt(Ys,D.nativeEvent)))}}})]})]})});function qH(e,t){const n=Hn(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const eT=20;let jo=[];function m0(){jo=jo.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function VH(e){m0(),e&&Yo(e)!=="body"&&(jo.push(new WeakRef(e)),jo.length>eT&&(jo=jo.slice(-eT)))}function mb(){var e;return m0(),(e=jo[jo.length-1])==null?void 0:e.deref()}function $H(e){if(!e)return null;const t=Pc();return uA(e,t)?e:Vd(e,t)[0]||e}function WH(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():ai(e).display!=="none"}function tT(e,t){var l;if(!t.current.includes("floating")&&!((l=e.getAttribute("role"))!=null&&l.includes("dialog")))return;const n=Pc(),a=mH(e,n).filter(c=>{const f=c.getAttribute("data-tabindex")||"";return uA(c,n)||c.hasAttribute("data-tabindex")&&!f.startsWith("-")}),o=e.getAttribute("tabindex");t.current.includes("floating")||a.length===0?o!=="0"&&e.setAttribute("tabindex","0"):(o!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function g0(e){const{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,restoreFocus:l=!1,modal:c=!0,closeOnFocusOut:f=!0,openInteractionType:d="",nextFocusableElement:m,previousFocusableElement:h,beforeContentFocusGuardRef:y,externalTree:g}=e,w="rootStore"in t?t.rootStore:t,C=w.useState("open"),R=w.useState("domReferenceElement"),E=w.useState("floatingElement"),{events:T,dataRef:k}=w.context,M=We(()=>{var he;return(he=k.current.floatingContext)==null?void 0:he.nodeId}),D=a===!1,A=jv(R)&&D,N=v.useRef(["content"]),L=sr(a),q=sr(o),F=sr(d),Y=Qo(g),_=TA(),V=v.useRef(null),$=v.useRef(null),B=v.useRef(!1),j=v.useRef(!1),z=v.useRef(!1),H=v.useRef(-1),K=v.useRef(""),P=v.useRef(""),U=v.useRef(null),G=v.useRef(null),I=zi(U,y,_==null?void 0:_.beforeInsideRef),Q=zi(G,_==null?void 0:_.afterInsideRef),le=Bn(),ae=Bn(),Z=$d(),ue=_!=null,ve=Ed(E),Se=We((he=ve)=>he?Vd(he,Pc()):[]),Le=We(he=>{const ye=Se(he);return N.current.map(()=>ye).filter(Boolean).flat()});v.useEffect(()=>{if(r||!c)return;function he(_e){_e.key==="Tab"&&Dt(ve,ni(Qt(ve)))&&Se().length===0&&!A&&br(_e)}const ye=Qt(ve);return ye.addEventListener("keydown",he),()=>{ye.removeEventListener("keydown",he)}},[r,R,ve,c,N,A,Se,Le]),v.useEffect(()=>{if(r||!C)return;const he=Qt(ve);function ye(){z.current=!1}function _e(Ce){const Te=Tr(Ce),J=Dt(E,Te)||Dt(R,Te)||Dt(_==null?void 0:_.portalNode,Te);z.current=!J,P.current=Ce.pointerType||"keyboard",Te!=null&&Te.closest(`[${yF}]`)&&(j.current=!0)}function Ae(){P.current="keyboard"}return he.addEventListener("pointerdown",_e,!0),he.addEventListener("pointerup",ye,!0),he.addEventListener("pointercancel",ye,!0),he.addEventListener("keydown",Ae,!0),()=>{he.removeEventListener("pointerdown",_e,!0),he.removeEventListener("pointerup",ye,!0),he.removeEventListener("pointercancel",ye,!0),he.removeEventListener("keydown",Ae,!0)}},[r,E,R,ve,C,_]),v.useEffect(()=>{if(r||!f)return;const he=Qt(ve);function ye(){j.current=!0,ae.start(0,()=>{j.current=!1})}function _e(Ee){const xe=Tr(Ee),Ve=Se().indexOf(xe);Ve!==-1&&(H.current=Ve)}function Ae(Ee){const xe=Ee.relatedTarget,Be=Ee.currentTarget,Ve=Tr(Ee);queueMicrotask(()=>{const De=M(),ut=w.context.triggerElements,pe=(xe==null?void 0:xe.hasAttribute(Ec("focus-guard")))&&[U.current,G.current,_==null?void 0:_.beforeInsideRef.current,_==null?void 0:_.afterInsideRef.current,_==null?void 0:_.beforeOutsideRef.current,_==null?void 0:_.afterOutsideRef.current,Pa(h),Pa(m)].includes(xe),Re=!(Dt(R,xe)||Dt(E,xe)||Dt(xe,E)||Dt(_==null?void 0:_.portalNode,xe)||xe!=null&&ut.hasElement(xe)||ut.hasMatchingElement(ee=>Dt(ee,xe))||pe||Y&&(js(Y.nodesRef.current,De).find(ee=>{var fe,Ne;return Dt((fe=ee.context)==null?void 0:fe.elements.floating,xe)||Dt((Ne=ee.context)==null?void 0:Ne.elements.domReference,xe)})||YR(Y.nodesRef.current,De).find(ee=>{var fe,Ne,He;return[(fe=ee.context)==null?void 0:fe.elements.floating,Ed((Ne=ee.context)==null?void 0:Ne.elements.floating)].includes(xe)||((He=ee.context)==null?void 0:He.elements.domReference)===xe})));if(Be===R&&ve&&tT(ve,N),l&&Be!==R&&!WH(Ve)&&ni(he)===he.body){if(Mn(ve)&&(ve.focus(),l==="popup")){Z.request(()=>{ve.focus()});return}const ee=H.current,fe=Se(),Ne=fe[ee]||fe[fe.length-1]||ve;Mn(Ne)&&Ne.focus()}if(k.current.insideReactTree){k.current.insideReactTree=!1;return}(A||!c)&&xe&&Re&&!j.current&&(A||xe!==mb())&&(B.current=!0,w.setOpen(!1,xt(Ys,Ee)))})}function Ce(){z.current||(k.current.insideReactTree=!0,le.start(0,()=>{k.current.insideReactTree=!1}))}const Te=Mn(R)?R:null,J=[];if(!(!E&&!Te))return Te&&(Te.addEventListener("focusout",Ae),Te.addEventListener("pointerdown",ye),J.push(()=>{Te.removeEventListener("focusout",Ae),Te.removeEventListener("pointerdown",ye)})),E&&(E.addEventListener("focusin",_e),E.addEventListener("focusout",Ae),_&&(E.addEventListener("focusout",Ce,!0),J.push(()=>{E.removeEventListener("focusout",Ce,!0)})),J.push(()=>{E.removeEventListener("focusin",_e),E.removeEventListener("focusout",Ae)})),()=>{J.forEach(Ee=>{Ee()})}},[r,R,E,ve,c,Y,_,w,f,l,Se,A,M,N,k,le,ae,Z,m,h]),v.useEffect(()=>{var Ce,Te,J;if(r||!E||!C)return;const he=Array.from(((Ce=_==null?void 0:_.portalNode)==null?void 0:Ce.querySelectorAll(`[${Ec("portal")}]`))||[]),_e=(J=(Te=(Y?YR(Y.nodesRef.current,M()):[]).find(Ee=>{var xe;return jv(((xe=Ee.context)==null?void 0:xe.elements.domReference)||null)}))==null?void 0:Te.context)==null?void 0:J.elements.domReference,Ae=[E,_e,...he,V.current,$.current,U.current,G.current,_==null?void 0:_.beforeOutsideRef.current,_==null?void 0:_.afterOutsideRef.current,Pa(h),Pa(m),A?R:null].filter(Ee=>Ee!=null);return HH(Ae,c||A)},[C,r,R,E,c,N,_,A,Y,M,m,h]),qe(()=>{if(!C||r||!Mn(ve))return;const he=Qt(ve),ye=ni(he);queueMicrotask(()=>{const _e=Le(ve),Ae=L.current,Ce=typeof Ae=="function"?Ae(F.current||""):Ae;if(Ce===void 0||Ce===!1)return;let Te;Ce===!0||Ce===null?Te=_e[0]||ve:Te=Pa(Ce),Te=Te||_e[0]||ve,!Dt(ve,ye)&&ad(Te,{preventScroll:Te===ve})})},[r,C,ve,D,Le,L,F]),qe(()=>{if(r||!ve)return;const he=Qt(ve),ye=ni(he);VH(ye);function _e(Te){if(Te.open||(K.current=qH(Te.nativeEvent,P.current)),Te.reason===vr&&Te.nativeEvent.type==="mouseleave"&&(B.current=!0),Te.reason===um)if(Te.nested)B.current=!1;else if(X2(Te.nativeEvent)||Q2(Te.nativeEvent))B.current=!1;else{let J=!1;document.createElement("div").focus({get preventScroll(){return J=!0,!1}}),J?B.current=!1:B.current=!0}}T.on("openchange",_e);const Ae=he.createElement("span");Ae.setAttribute("tabindex","-1"),Ae.setAttribute("aria-hidden","true"),Object.assign(Ae.style,hm),ue&&R&&R.insertAdjacentElement("afterend",Ae);function Ce(){const Te=q.current;let J=typeof Te=="function"?Te(K.current):Te;if(J===void 0||J===!1)return null;if(J===null&&(J=!0),typeof J=="boolean"){const xe=R||mb();return xe&&xe.isConnected?xe:Ae}const Ee=R||mb()||Ae;return Pa(J)||Ee}return()=>{T.off("openchange",_e);const Te=ni(he),J=Dt(E,Te)||Y&&js(Y.nodesRef.current,M(),!1).some(xe=>{var Be;return Dt((Be=xe.context)==null?void 0:Be.elements.floating,Te)}),Ee=Ce();queueMicrotask(()=>{const xe=$H(Ee),Be=typeof q.current!="boolean";q.current&&!B.current&&Mn(xe)&&(!(!Be&&xe!==Te&&Te!==he.body)||J)&&xe.focus({preventScroll:!0}),Ae.remove(),B.current=!1})}},[r,E,ve,q,k,T,Y,ue,R,M]),qe(()=>{if(!sm||C||!E)return;const he=ni(Qt(E));!Mn(he)||!lm(he)||Dt(E,he)&&he.blur()},[C,E]),qe(()=>{if(!(r||!_))return _.setFocusManagerState({modal:c,closeOnFocusOut:f,open:C,onOpenChange:w.setOpen,domReference:R}),()=>{_.setFocusManagerState(null)}},[r,_,c,C,w,f,R]),qe(()=>{if(!(r||!ve))return tT(ve,N),()=>{queueMicrotask(m0)}},[r,ve,N]);const te=!r&&(c?!A:!0)&&(ue||c);return S.jsxs(v.Fragment,{children:[te&&S.jsx(Cc,{"data-type":"inside",ref:I,onFocus:he=>{var ye;if(c){const _e=Le();ad(_e[_e.length-1])}else if(_!=null&&_.portalNode)if(B.current=!1,Zl(he,_.portalNode)){const _e=s0(R);_e==null||_e.focus()}else(ye=Pa(h??_.beforeOutsideRef))==null||ye.focus()}}),n,te&&S.jsx(Cc,{"data-type":"inside",ref:Q,onFocus:he=>{var ye;if(c)ad(Le()[0]);else if(_!=null&&_.portalNode)if(f&&(B.current=!0),Zl(he,_.portalNode)){const _e=fA(R);_e==null||_e.focus()}else(ye=Pa(m??_.afterOutsideRef))==null||ye.focus()}})]})}function MA(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,{enabled:a=!0,event:o="click",toggle:l=!0,ignoreMouse:c=!1,stickIfOpen:f=!0,touchOpenDelay:d=0,reason:m=Ws}=t,h=v.useRef(void 0),y=$d(),g=Bn(),w=v.useMemo(()=>({onPointerDown(C){h.current=C.pointerType},onMouseDown(C){const R=h.current,E=C.nativeEvent,T=n.select("open");if(C.button!==0||o==="click"||Vs(R,!0)&&c)return;const k=r.current.openEvent,M=k==null?void 0:k.type,D=n.select("domReferenceElement")!==C.currentTarget,A=T&&D||!(T&&l&&(!(k&&f)||M==="click"||M==="mousedown"));if(lm(E.target)){const L=xt(m,E,E.target);A&&R==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(A,L);return}const N=C.currentTarget;y.request(()=>{const L=xt(m,E,N);A&&R==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,L)}):n.setOpen(A,L)})},onClick(C){if(o==="mousedown-only")return;const R=h.current;if(o==="mousedown"&&R){h.current=void 0;return}if(Vs(R,!0)&&c)return;const E=n.select("open"),T=r.current.openEvent,k=n.select("domReferenceElement")!==C.currentTarget,M=E&&k||!(E&&l&&(!(T&&f)||Z2(T))),D=xt(m,C.nativeEvent,C.currentTarget);M&&R==="touch"&&d>0?g.start(d,()=>{n.setOpen(!0,D)}):n.setOpen(M,D)},onKeyDown(){h.current=void 0}}),[r,o,c,n,f,l,y,g,d,m]);return v.useMemo(()=>a?{reference:w}:In,[a,w])}function YH(e,t){let n=null,r=null,a=!1;return{contextElement:e||void 0,getBoundingClientRect(){var g;const o=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},l=t.axis==="x"||t.axis==="both",c=t.axis==="y"||t.axis==="both",f=["mouseenter","mousemove"].includes(((g=t.dataRef.current.openEvent)==null?void 0:g.type)||"")&&t.pointerType!=="touch";let d=o.width,m=o.height,h=o.x,y=o.y;return n==null&&t.x&&l&&(n=o.x-t.x),r==null&&t.y&&c&&(r=o.y-t.y),h-=n||0,y-=r||0,d=0,m=0,!a||f?(d=t.axis==="y"?o.width:0,m=t.axis==="x"?o.height:0,h=l&&t.x!=null?t.x:h,y=c&&t.y!=null?t.y:y):a&&!f&&(m=t.axis==="x"?o.height:m,d=t.axis==="y"?o.width:d),a=!0,{width:d,height:m,x:h,y,top:y,right:h+d,bottom:y+m,left:h}}}}function nT(e){return e!=null&&e.clientX!=null}function KH(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{enabled:c=!0,axis:f="both"}=t,d=v.useRef(!1),m=v.useRef(null),[h,y]=v.useState(),[g,w]=v.useState([]),C=We((M,D,A)=>{d.current||l.current.openEvent&&!nT(l.current.openEvent)||n.set("positionReference",YH(A??o,{x:M,y:D,axis:f,dataRef:l,pointerType:h}))}),R=We(M=>{r?m.current||w([]):C(M.clientX,M.clientY,M.currentTarget)}),E=Vs(h)?a:r,T=v.useCallback(()=>{if(!E||!c)return;const M=Hn(a);function D(A){const N=Tr(A);Dt(a,N)?(M.removeEventListener("mousemove",D),m.current=null):C(A.clientX,A.clientY)}if(!l.current.openEvent||nT(l.current.openEvent)){M.addEventListener("mousemove",D);const A=()=>{M.removeEventListener("mousemove",D),m.current=null};return m.current=A,A}n.set("positionReference",o)},[E,c,a,l,o,n,C]);v.useEffect(()=>T(),[T,g]),v.useEffect(()=>{c&&!a&&(d.current=!1)},[c,a]),v.useEffect(()=>{!c&&r&&(d.current=!0)},[c,r]);const k=v.useMemo(()=>{function M(D){y(D.pointerType)}return{onPointerDown:M,onPointerEnter:M,onMouseMove:R,onMouseEnter:R}},[R]);return v.useMemo(()=>c?{reference:k,trigger:k}:{},[c,k])}function rT(e,t,n){let{reference:r,floating:a}=e;const o=wi(t),l=o0(t),c=a0(l),f=Hr(t),d=o==="y",m=r.x+r.width/2-a.width/2,h=r.y+r.height/2-a.height/2,y=r[c]/2-a[c]/2;let g;switch(f){case"top":g={x:m,y:r.y-a.height};break;case"bottom":g={x:m,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:h};break;case"left":g={x:r.x-a.width,y:h};break;default:g={x:r.x,y:r.y}}switch(Go(t)){case"start":g[l]-=y*(n&&d?-1:1);break;case"end":g[l]+=y*(n&&d?-1:1);break}return g}async function GH(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:h="floating",altBoundary:y=!1,padding:g=0}=qa(t,e),w=J2(g),R=c[y?h==="floating"?"reference":"floating":h],E=Rp(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(R)))==null||n?R:R.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:m,strategy:f})),T=h==="floating"?{x:r,y:a,width:l.floating.width,height:l.floating.height}:l.reference,k=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),M=await(o.isElement==null?void 0:o.isElement(k))?await(o.getScale==null?void 0:o.getScale(k))||{x:1,y:1}:{x:1,y:1},D=Rp(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:T,offsetParent:k,strategy:f}):T);return{top:(E.top-D.top+w.top)/M.y,bottom:(D.bottom-E.bottom+w.bottom)/M.y,left:(E.left-D.left+w.left)/M.x,right:(D.right-E.right+w.right)/M.x}}const XH=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:l}=n,c=o.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:h}=rT(d,r,f),y=r,g={},w=0;for(let R=0;R<c.length;R++){var C;const{name:E,fn:T}=c[R],{x:k,y:M,data:D,reset:A}=await T({x:m,y:h,initialPlacement:r,placement:y,strategy:a,middlewareData:g,rects:d,platform:{...l,detectOverflow:(C=l.detectOverflow)!=null?C:GH},elements:{reference:e,floating:t}});m=k??m,h=M??h,g={...g,[E]:{...g[E],...D}},A&&w<=50&&(w++,typeof A=="object"&&(A.placement&&(y=A.placement),A.rects&&(d=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:m,y:h}=rT(d,y,f)),R=-1)}return{x:m,y:h,placement:y,strategy:a,middlewareData:g}},QH=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:m=!0,crossAxis:h=!0,fallbackPlacements:y,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:C=!0,...R}=qa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const E=Hr(a),T=wi(c),k=Hr(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(d.floating)),D=y||(k||!C?[Cp(c)]:GB(c)),A=w!=="none";!y&&A&&D.push(...JB(c,C,w,M));const N=[c,...D],L=await f.detectOverflow(t,R),q=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&q.push(L[E]),h){const $=KB(a,l,M);q.push(L[$[0]],L[$[1]])}if(F=[...F,{placement:a,overflows:q}],!q.every($=>$<=0)){var Y,_;const $=(((Y=o.flip)==null?void 0:Y.index)||0)+1,B=N[$];if(B&&(!(h==="alignment"?T!==wi(B):!1)||F.every(H=>wi(H.placement)===T?H.overflows[0]>0:!0)))return{data:{index:$,overflows:F},reset:{placement:B}};let j=(_=F.filter(z=>z.overflows[0]<=0).sort((z,H)=>z.overflows[1]-H.overflows[1])[0])==null?void 0:_.placement;if(!j)switch(g){case"bestFit":{var V;const z=(V=F.filter(H=>{if(A){const K=wi(H.placement);return K===T||K==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(K=>K>0).reduce((K,P)=>K+P,0)]).sort((H,K)=>H[1]-K[1])[0])==null?void 0:V[0];z&&(j=z);break}case"initialPlacement":j=c;break}if(a!==j)return{reset:{placement:j}}}return{}}}};function iT(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aT(e){return VB.some(t=>e[t]>=0)}const ZH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:a="referenceHidden",...o}=qa(e,t);switch(a){case"referenceHidden":{const l=await r.detectOverflow(t,{...o,elementContext:"reference"}),c=iT(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:aT(c)}}}case"escaped":{const l=await r.detectOverflow(t,{...o,altBoundary:!0}),c=iT(l,n.floating);return{data:{escapedOffsets:c,escaped:aT(c)}}}default:return{}}}}},AA=new Set(["left","top"]);async function JH(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Hr(n),c=Go(n),f=wi(n)==="y",d=AA.has(l)?-1:1,m=o&&f?-1:1,h=qa(t,e);let{mainAxis:y,crossAxis:g,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(g=c==="end"?w*-1:w),f?{x:g*m,y:y*d}:{x:y*d,y:g*m}}const eU=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:c}=t,f=await JH(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:l}}}}},tU=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a,platform:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:f={fn:E=>{let{x:T,y:k}=E;return{x:T,y:k}}},...d}=qa(e,t),m={x:n,y:r},h=await o.detectOverflow(t,d),y=wi(Hr(a)),g=i0(y);let w=m[g],C=m[y];if(l){const E=g==="y"?"top":"left",T=g==="y"?"bottom":"right",k=w+h[E],M=w-h[T];w=zv(k,w,M)}if(c){const E=y==="y"?"top":"left",T=y==="y"?"bottom":"right",k=C+h[E],M=C-h[T];C=zv(k,C,M)}const R=f.fn({...t,[g]:w,[y]:C});return{...R,data:{x:R.x-n,y:R.y-r,enabled:{[g]:l,[y]:c}}}}}},nU=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=qa(e,t),m={x:n,y:r},h=wi(a),y=i0(h);let g=m[y],w=m[h];const C=qa(c,t),R=typeof C=="number"?{mainAxis:C,crossAxis:0}:{mainAxis:0,crossAxis:0,...C};if(f){const k=y==="y"?"height":"width",M=o.reference[y]-o.floating[k]+R.mainAxis,D=o.reference[y]+o.reference[k]-R.mainAxis;g<M?g=M:g>D&&(g=D)}if(d){var E,T;const k=y==="y"?"width":"height",M=AA.has(Hr(a)),D=o.reference[h]-o.floating[k]+(M&&((E=l.offset)==null?void 0:E[h])||0)+(M?0:R.crossAxis),A=o.reference[h]+o.reference[k]+(M?0:((T=l.offset)==null?void 0:T[h])||0)-(M?R.crossAxis:0);w<D?w=D:w>A&&(w=A)}return{[y]:g,[h]:w}}}},rU=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:l,elements:c}=t,{apply:f=()=>{},...d}=qa(e,t),m=await l.detectOverflow(t,d),h=Hr(a),y=Go(a),g=wi(a)==="y",{width:w,height:C}=o.floating;let R,E;h==="top"||h==="bottom"?(R=h,E=y===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(E=h,R=y==="end"?"top":"bottom");const T=C-m.top-m.bottom,k=w-m.left-m.right,M=xc(C-m[R],T),D=xc(w-m[E],k),A=!t.middlewareData.shift;let N=M,L=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(N=T),A&&!y){const F=ri(m.left,0),Y=ri(m.right,0),_=ri(m.top,0),V=ri(m.bottom,0);g?L=w-2*(F!==0||Y!==0?F+Y:ri(m.left,m.right)):N=C-2*(_!==0||V!==0?_+V:ri(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:N});const q=await l.getDimensions(c.floating);return w!==q.width||C!==q.height?{reset:{rects:!0}}:{}}}};function NA(e){const t=ai(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Mn(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,c=Ep(n)!==o||Ep(r)!==l;return c&&(n=o,r=l),{width:n,height:r,$:c}}function y0(e){return un(e)?e:e.contextElement}function tc(e){const t=y0(e);if(!Mn(t))return ia(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=NA(t);let l=(o?Ep(n.width):n.width)/r,c=(o?Ep(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const iU=ia(0);function OA(e){const t=Hn(e);return!rm()||!t.visualViewport?iU:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function aU(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hn(e)?!1:t}function Ks(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=y0(e);let l=ia(1);t&&(r?un(r)&&(l=tc(r)):l=tc(e));const c=aU(o,n,r)?OA(o):ia(0);let f=(a.left+c.x)/l.x,d=(a.top+c.y)/l.y,m=a.width/l.x,h=a.height/l.y;if(o){const y=Hn(o),g=r&&un(r)?Hn(r):r;let w=y,C=Pv(w);for(;C&&r&&g!==w;){const R=tc(C),E=C.getBoundingClientRect(),T=ai(C),k=E.left+(C.clientLeft+parseFloat(T.paddingLeft))*R.x,M=E.top+(C.clientTop+parseFloat(T.paddingTop))*R.y;f*=R.x,d*=R.y,m*=R.x,h*=R.y,f+=k,d+=M,w=Hn(C),C=Pv(w)}}return Rp({width:m,height:h,x:f,y:d})}function pm(e,t){const n=im(e).scrollLeft;return t?t.left+n:Ks(ca(e)).left+n}function DA(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-pm(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function oU(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=ca(r),c=t?nm(t.floating):!1;if(r===l||c&&o)return n;let f={scrollLeft:0,scrollTop:0},d=ia(1);const m=ia(0),h=Mn(r);if((h||!h&&!o)&&((Yo(r)!=="body"||Ko(l))&&(f=im(r)),Mn(r))){const g=Ks(r);d=tc(r),m.x=g.x+r.clientLeft,m.y=g.y+r.clientTop}const y=l&&!h&&!o?DA(l,f):ia(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+m.x+y.x,y:n.y*d.y-f.scrollTop*d.y+m.y+y.y}}function sU(e){return Array.from(e.getClientRects())}function lU(e){const t=ca(e),n=im(e),r=e.ownerDocument.body,a=ri(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ri(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+pm(e);const c=-n.scrollTop;return ai(r).direction==="rtl"&&(l+=ri(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:c}}const oT=25;function cU(e,t){const n=Hn(e),r=ca(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,c=0,f=0;if(a){o=a.width,l=a.height;const m=rm();(!m||m&&t==="fixed")&&(c=a.offsetLeft,f=a.offsetTop)}const d=pm(r);if(d<=0){const m=r.ownerDocument,h=m.body,y=getComputedStyle(h),g=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,w=Math.abs(r.clientWidth-h.clientWidth-g);w<=oT&&(o-=w)}else d<=oT&&(o+=d);return{width:o,height:l,x:c,y:f}}const uU=new Set(["absolute","fixed"]);function dU(e,t){const n=Ks(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Mn(e)?tc(e):ia(1),l=e.clientWidth*o.x,c=e.clientHeight*o.y,f=a*o.x,d=r*o.y;return{width:l,height:c,x:f,y:d}}function sT(e,t,n){let r;if(t==="viewport")r=cU(e,n);else if(t==="document")r=lU(ca(e));else if(un(t))r=dU(t,n);else{const a=OA(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return Rp(r)}function IA(e,t){const n=oa(e);return n===t||!un(n)||ra(n)?!1:ai(n).position==="fixed"||IA(n,t)}function fU(e,t){const n=t.get(e);if(n)return n;let r=Bo(e,[],!1).filter(c=>un(c)&&Yo(c)!=="body"),a=null;const o=ai(e).position==="fixed";let l=o?oa(e):e;for(;un(l)&&!ra(l);){const c=ai(l),f=Jx(l);!f&&c.position==="fixed"&&(a=null),(o?!f&&!a:!f&&c.position==="static"&&!!a&&uU.has(a.position)||Ko(l)&&!f&&IA(e,l))?r=r.filter(m=>m!==l):a=c,l=oa(l)}return t.set(e,r),r}function hU(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?nm(t)?[]:fU(t,this._c):[].concat(n),r],c=l[0],f=l.reduce((d,m)=>{const h=sT(t,m,a);return d.top=ri(h.top,d.top),d.right=xc(h.right,d.right),d.bottom=xc(h.bottom,d.bottom),d.left=ri(h.left,d.left),d},sT(t,c,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function pU(e){const{width:t,height:n}=NA(e);return{width:t,height:n}}function mU(e,t,n){const r=Mn(t),a=ca(t),o=n==="fixed",l=Ks(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const f=ia(0);function d(){f.x=pm(a)}if(r||!r&&!o)if((Yo(t)!=="body"||Ko(a))&&(c=im(t)),r){const g=Ks(t,!0,o,t);f.x=g.x+t.clientLeft,f.y=g.y+t.clientTop}else a&&d();o&&!r&&a&&d();const m=a&&!r&&!o?DA(a,c):ia(0),h=l.left+c.scrollLeft-f.x-m.x,y=l.top+c.scrollTop-f.y-m.y;return{x:h,y,width:l.width,height:l.height}}function gb(e){return ai(e).position==="static"}function lT(e,t){if(!Mn(e)||ai(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ca(e)===n&&(n=n.ownerDocument.body),n}function PA(e,t){const n=Hn(e);if(nm(e))return n;if(!Mn(e)){let a=oa(e);for(;a&&!ra(a);){if(un(a)&&!gb(a))return a;a=oa(a)}return n}let r=lT(e,t);for(;r&&pB(r)&&gb(r);)r=lT(r,t);return r&&ra(r)&&gb(r)&&!Jx(r)?n:r||vB(e)||n}const gU=async function(e){const t=this.getOffsetParent||PA,n=this.getDimensions,r=await n(e.floating);return{reference:mU(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yU(e){return ai(e).direction==="rtl"}const bU={convertOffsetParentRelativeRectToViewportRelativeRect:oU,getDocumentElement:ca,getClippingRect:hU,getOffsetParent:PA,getElementRects:gU,getClientRects:sU,getDimensions:pU,getScale:tc,isElement:un,isRTL:yU};function LA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vU(e,t){let n=null,r;const a=ca(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();const d=e.getBoundingClientRect(),{left:m,top:h,width:y,height:g}=d;if(c||t(),!y||!g)return;const w=Gl(h),C=Gl(a.clientWidth-(m+y)),R=Gl(a.clientHeight-(h+g)),E=Gl(m),k={rootMargin:-w+"px "+-C+"px "+-R+"px "+-E+"px",threshold:ri(0,xc(1,f))||1};let M=!0;function D(A){const N=A[0].intersectionRatio;if(N!==f){if(!M)return l();N?l(!1,N):r=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!LA(d,e.getBoundingClientRect())&&l(),M=!1}try{n=new IntersectionObserver(D,{...k,root:a.ownerDocument})}catch{n=new IntersectionObserver(D,k)}n.observe(e)}return l(!0),o}function cT(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,d=y0(e),m=a||o?[...d?Bo(d):[],...Bo(t)]:[];m.forEach(E=>{a&&E.addEventListener("scroll",n,{passive:!0}),o&&E.addEventListener("resize",n)});const h=d&&c?vU(d,n):null;let y=-1,g=null;l&&(g=new ResizeObserver(E=>{let[T]=E;T&&T.target===d&&g&&(g.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var k;(k=g)==null||k.observe(t)})),n()}),d&&!f&&g.observe(d),g.observe(t));let w,C=f?Ks(e):null;f&&R();function R(){const E=Ks(e);C&&!LA(C,E)&&n(),C=E,w=requestAnimationFrame(R)}return n(),()=>{var E;m.forEach(T=>{a&&T.removeEventListener("scroll",n),o&&T.removeEventListener("resize",n)}),h==null||h(),(E=g)==null||E.disconnect(),g=null,f&&cancelAnimationFrame(w)}}const xU=eU,wU=tU,SU=QH,EU=rU,CU=ZH,RU=nU,TU=(e,t,n)=>{const r=new Map,a={platform:bU,...n},o={...a.platform,_c:r};return XH(e,t,{...a,platform:o})};var kU=typeof document<"u",MU=function(){},op=kU?v.useLayoutEffect:MU;function Op(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Op(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!Op(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function _A(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uT(e,t){const n=_A(e);return Math.round(t*n)/n}function yb(e){const t=v.useRef(e);return op(()=>{t.current=e}),t}function AU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[m,h]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,g]=v.useState(r);Op(y,r)||g(r);const[w,C]=v.useState(null),[R,E]=v.useState(null),T=v.useCallback(H=>{H!==A.current&&(A.current=H,C(H))},[]),k=v.useCallback(H=>{H!==N.current&&(N.current=H,E(H))},[]),M=o||w,D=l||R,A=v.useRef(null),N=v.useRef(null),L=v.useRef(m),q=f!=null,F=yb(f),Y=yb(a),_=yb(d),V=v.useCallback(()=>{if(!A.current||!N.current)return;const H={placement:t,strategy:n,middleware:y};Y.current&&(H.platform=Y.current),TU(A.current,N.current,H).then(K=>{const P={...K,isPositioned:_.current!==!1};$.current&&!Op(L.current,P)&&(L.current=P,pr.flushSync(()=>{h(P)}))})},[y,t,n,Y,_]);op(()=>{d===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,h(H=>({...H,isPositioned:!1})))},[d]);const $=v.useRef(!1);op(()=>($.current=!0,()=>{$.current=!1}),[]),op(()=>{if(M&&(A.current=M),D&&(N.current=D),M&&D){if(F.current)return F.current(M,D,V);V()}},[M,D,V,F,q]);const B=v.useMemo(()=>({reference:A,floating:N,setReference:T,setFloating:k}),[T,k]),j=v.useMemo(()=>({reference:M,floating:D}),[M,D]),z=v.useMemo(()=>{const H={position:n,left:0,top:0};if(!j.floating)return H;const K=uT(j.floating,m.x),P=uT(j.floating,m.y);return c?{...H,transform:"translate("+K+"px, "+P+"px)",..._A(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:K,top:P}},[n,c,j.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:V,refs:B,elements:j,floatingStyles:z}),[m,V,B,j,z])}const NU=(e,t)=>({...xU(e),options:[e,t]}),OU=(e,t)=>({...wU(e),options:[e,t]}),DU=(e,t)=>({...RU(e),options:[e,t]}),IU=(e,t)=>({...SU(e),options:[e,t]}),PU=(e,t)=>({...EU(e),options:[e,t]}),LU=(e,t)=>({...CU(e),options:[e,t]}),_U={intentional:"onClick",sloppy:"onPointerDown"};function jU(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function mm(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("referenceElement"),l=n.useState("domReferenceElement"),{onOpenChange:c,dataRef:f}=n.context,{enabled:d=!0,escapeKey:m=!0,outsidePress:h=!0,outsidePressEvent:y="sloppy",referencePress:g=!1,referencePressEvent:w="sloppy",ancestorScroll:C=!1,bubbles:R,externalTree:E}=t,T=Qo(E),k=We(typeof h=="function"?h:()=>!1),M=typeof h=="function"?k:h,D=v.useRef(!1),{escapeKey:A,outsidePress:N}=jU(R),L=v.useRef(null),q=Bn(),F=Bn(),Y=We(()=>{F.clear(),f.current.insideReactTree=!1}),_=v.useRef(!1),V=v.useRef(""),$=We(te=>{V.current=te.pointerType}),B=We(()=>{const te=V.current,he=te==="pen"||!te?"mouse":te,ye=typeof y=="function"?y():y;return typeof ye=="string"?ye:ye[he]}),j=We(te=>{var Ce;if(!r||!d||!m||te.key!=="Escape"||_.current)return;const he=(Ce=f.current.floatingContext)==null?void 0:Ce.nodeId,ye=T?js(T.nodesRef.current,he):[];if(!A&&ye.length>0){let Te=!0;if(ye.forEach(J=>{var Ee;(Ee=J.context)!=null&&Ee.open&&!J.context.dataRef.current.__escapeKeyBubbles&&(Te=!1)}),!Te)return}const _e=qB(te)?te.nativeEvent:te,Ae=xt(dm,_e);n.setOpen(!1,Ae),!A&&!Ae.isPropagationAllowed&&te.stopPropagation()}),z=We(te=>{const he=B();return he==="intentional"&&te.type!=="click"||he==="sloppy"&&te.type==="click"}),H=We(()=>{f.current.insideReactTree=!0,F.start(0,Y)}),K=We((te,he=!1)=>{var Be;if(z(te)){Y();return}if(f.current.insideReactTree){Y();return}if(B()==="intentional"&&he||typeof M=="function"&&!M(te))return;const ye=Tr(te),_e=`[${Ec("inert")}]`,Ae=Qt(n.select("floatingElement")).querySelectorAll(_e),Ce=n.context.triggerElements;if(ye&&(Ce.hasElement(ye)||Ce.hasMatchingElement(Ve=>Dt(Ve,ye))))return;let Te=un(ye)?ye:null;for(;Te&&!ra(Te);){const Ve=oa(Te);if(ra(Ve)||!un(Ve))break;Te=Ve}if(Ae.length&&un(ye)&&!HB(ye)&&!Dt(ye,n.select("floatingElement"))&&Array.from(Ae).every(Ve=>!Dt(Te,Ve)))return;if(Mn(ye)&&!("touches"in te)){const Ve=ra(ye),De=ai(ye),ut=/auto|scroll/,pe=Ve||ut.test(De.overflowX),Re=Ve||ut.test(De.overflowY),ee=pe&&ye.clientWidth>0&&ye.scrollWidth>ye.clientWidth,fe=Re&&ye.clientHeight>0&&ye.scrollHeight>ye.clientHeight,Ne=De.direction==="rtl",He=fe&&(Ne?te.offsetX<=ye.offsetWidth-ye.clientWidth:te.offsetX>ye.clientWidth),$e=ee&&te.offsetY>ye.clientHeight;if(He||$e)return}const J=(Be=f.current.floatingContext)==null?void 0:Be.nodeId,Ee=T&&js(T.nodesRef.current,J).some(Ve=>{var De;return Ii(te,(De=Ve.context)==null?void 0:De.elements.floating)});if(Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement"))||Ee)return;const xe=T?js(T.nodesRef.current,J):[];if(xe.length>0){let Ve=!0;if(xe.forEach(De=>{var ut;(ut=De.context)!=null&&ut.open&&!De.context.dataRef.current.__outsidePressBubbles&&(Ve=!1)}),!Ve)return}n.setOpen(!1,xt(um,te)),Y()}),P=We(te=>{B()!=="sloppy"||te.pointerType==="touch"||!n.select("open")||!d||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement"))||K(te)}),U=We(te=>{if(B()!=="sloppy"||!n.select("open")||!d||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement")))return;const he=te.touches[0];he&&(L.current={startTime:Date.now(),startX:he.clientX,startY:he.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},q.start(1e3,()=>{L.current&&(L.current.dismissOnTouchEnd=!1,L.current.dismissOnMouseDown=!1)}))}),G=We(te=>{const he=Tr(te);function ye(){U(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)}),I=We(te=>{const he=D.current;if(D.current=!1,q.clear(),te.type==="mousedown"&&L.current&&!L.current.dismissOnMouseDown)return;const ye=Tr(te);function _e(){te.type==="pointerdown"?P(te):K(te,he),ye==null||ye.removeEventListener(te.type,_e)}ye==null||ye.addEventListener(te.type,_e)}),Q=We(te=>{if(B()!=="sloppy"||!L.current||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement")))return;const he=te.touches[0];if(!he)return;const ye=Math.abs(he.clientX-L.current.startX),_e=Math.abs(he.clientY-L.current.startY),Ae=Math.sqrt(ye*ye+_e*_e);Ae>5&&(L.current.dismissOnTouchEnd=!0),Ae>10&&(K(te),q.clear(),L.current=null)}),le=We(te=>{const he=Tr(te);function ye(){Q(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)}),ae=We(te=>{B()!=="sloppy"||!L.current||Ii(te,n.select("floatingElement"))||Ii(te,n.select("domReferenceElement"))||(L.current.dismissOnTouchEnd&&K(te),q.clear(),L.current=null)}),Z=We(te=>{const he=Tr(te);function ye(){ae(te),he==null||he.removeEventListener(te.type,ye)}he==null||he.addEventListener(te.type,ye)});v.useEffect(()=>{if(!r||!d)return;f.current.__escapeKeyBubbles=A,f.current.__outsidePressBubbles=N;const te=new sa;function he(Te){n.setOpen(!1,xt(Fi,Te))}function ye(){te.clear(),_.current=!0}function _e(){te.start(rm()?5:0,()=>{_.current=!1})}const Ae=Qt(a);Ae.addEventListener("pointerdown",$,!0),m&&(Ae.addEventListener("keydown",j),Ae.addEventListener("compositionstart",ye),Ae.addEventListener("compositionend",_e)),M&&(Ae.addEventListener("click",I,!0),Ae.addEventListener("pointerdown",I,!0),Ae.addEventListener("touchstart",G,!0),Ae.addEventListener("touchmove",le,!0),Ae.addEventListener("touchend",Z,!0),Ae.addEventListener("mousedown",I,!0));let Ce=[];return C&&(un(l)&&(Ce=Bo(l)),un(a)&&(Ce=Ce.concat(Bo(a))),!un(o)&&o&&o.contextElement&&(Ce=Ce.concat(Bo(o.contextElement)))),Ce=Ce.filter(Te=>{var J;return Te!==((J=Ae.defaultView)==null?void 0:J.visualViewport)}),Ce.forEach(Te=>{Te.addEventListener("scroll",he,{passive:!0})}),()=>{Ae.removeEventListener("pointerdown",$,!0),m&&(Ae.removeEventListener("keydown",j),Ae.removeEventListener("compositionstart",ye),Ae.removeEventListener("compositionend",_e)),M&&(Ae.removeEventListener("click",I,!0),Ae.removeEventListener("pointerdown",I,!0),Ae.removeEventListener("touchstart",G,!0),Ae.removeEventListener("touchmove",le,!0),Ae.removeEventListener("touchend",Z,!0),Ae.removeEventListener("mousedown",I,!0)),Ce.forEach(Te=>{Te.removeEventListener("scroll",he)}),te.clear(),D.current=!1}},[f,a,o,l,m,M,r,c,C,d,A,N,j,K,I,P,G,le,Z,$,n]),v.useEffect(Y,[M,Y]);const ue=v.useMemo(()=>({onKeyDown:j,...g&&{[_U[w]]:te=>{n.setOpen(!1,xt(Ws,te.nativeEvent))},...w!=="intentional"&&{onClick(te){n.setOpen(!1,xt(Ws,te.nativeEvent))}}}}),[j,n,g,w]),ve=We(te=>{const he=Tr(te.nativeEvent);!Dt(n.select("floatingElement"),he)||te.button!==0||(D.current=!0)}),Se=We(te=>{!r||!d||te.button!==0||(D.current=!0)}),Le=v.useMemo(()=>({onKeyDown:j,onPointerDown:ve,onMouseDown:ve,onMouseUp:ve,onClickCapture:H,onMouseDownCapture(te){H(),Se(te)},onPointerDownCapture(te){H(),Se(te)},onMouseUpCapture:H,onTouchEndCapture:H,onTouchMoveCapture:H}),[j,ve,H,Se]);return v.useMemo(()=>d?{reference:ue,floating:Le,trigger:ue}:{},[d,ue,Le])}var Dp=Symbol("NOT_FOUND");function zU(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function FU(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function BU(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${t}[${n}]`)}}var dT=e=>Array.isArray(e)?e:[e];function HU(e){const t=Array.isArray(e[0])?e[0]:e;return BU(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function UU(e,t){const n=[],{length:r}=e;for(let a=0;a<r;a++)n.push(e[a].apply(null,t));return n}function qU(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Dp},put(n,r){t={key:n,value:r}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function VU(e,t){let n=[];function r(c){const f=n.findIndex(d=>t(c,d.key));if(f>-1){const d=n[f];return f>0&&(n.splice(f,1),n.unshift(d)),d.value}return Dp}function a(c,f){r(c)===Dp&&(n.unshift({key:c,value:f}),n.length>e&&n.pop())}function o(){return n}function l(){n=[]}return{get:r,put:a,getEntries:o,clear:l}}var $U=(e,t)=>e===t;function WU(e){return function(n,r){if(n===null||r===null||n.length!==r.length)return!1;const{length:a}=n;for(let o=0;o<a;o++)if(!e(n[o],r[o]))return!1;return!0}}function YU(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:r=$U,maxSize:a=1,resultEqualityCheck:o}=n,l=WU(r);let c=0;const f=a<=1?qU(l):VU(a,l);function d(){let m=f.get(arguments);if(m===Dp){if(m=e.apply(null,arguments),c++,o){const y=f.getEntries().find(g=>o(g.value,m));y&&(m=y.value,c!==0&&c--)}f.put(arguments,m)}return m}return d.clearCache=()=>{f.clear(),d.resetResultsCount()},d.resultsCount=()=>c,d.resetResultsCount=()=>{c=0},d}var KU=class{constructor(e){this.value=e}deref(){return this.value}},GU=typeof WeakRef<"u"?WeakRef:KU,XU=0,fT=1;function Ph(){return{s:XU,v:void 0,o:null,p:null}}function jA(e,t={}){let n=Ph();const{resultEqualityCheck:r}=t;let a,o=0;function l(){var h;let c=n;const{length:f}=arguments;for(let y=0,g=f;y<g;y++){const w=arguments[y];if(typeof w=="function"||typeof w=="object"&&w!==null){let C=c.o;C===null&&(c.o=C=new WeakMap);const R=C.get(w);R===void 0?(c=Ph(),C.set(w,c)):c=R}else{let C=c.p;C===null&&(c.p=C=new Map);const R=C.get(w);R===void 0?(c=Ph(),C.set(w,c)):c=R}}const d=c;let m;if(c.s===fT)m=c.v;else if(m=e.apply(null,arguments),o++,r){const y=((h=a==null?void 0:a.deref)==null?void 0:h.call(a))??a;y!=null&&r(y,m)&&(m=y,o!==0&&o--),a=typeof m=="object"&&m!==null||typeof m=="function"?new GU(m):m}return d.s=fT,d.v=m,m}return l.clearCache=()=>{n=Ph(),l.resetResultsCount()},l.resultsCount=()=>o,l.resetResultsCount=()=>{o=0},l}function zA(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,r=(...a)=>{let o=0,l=0,c,f={},d=a.pop();typeof d=="object"&&(f=d,d=a.pop()),zU(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...n,...f},{memoize:h,memoizeOptions:y=[],argsMemoize:g=jA,argsMemoizeOptions:w=[]}=m,C=dT(y),R=dT(w),E=HU(a),T=h(function(){return o++,d.apply(null,arguments)},...C),k=g(function(){l++;const D=UU(E,arguments);return c=T.apply(null,D),c},...R);return Object.assign(k,{resultFunc:d,memoizedResultFunc:T,dependencies:E,dependencyRecomputations:()=>l,resetDependencyRecomputations:()=>{l=0},lastResult:()=>c,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:h,argsMemoize:g})};return Object.assign(r,{withTypes:()=>r}),r}var QU=zA(jA),ZU=Object.assign((e,t=QU)=>{FU(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),r=n.map(o=>e[o]);return t(r,(...o)=>o.reduce((l,c,f)=>(l[n[f]]=c,l),{}))},{withTypes:()=>ZU});zA({memoize:YU,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ge=(e,t,n,r,a,o,...l)=>{if(l.length>0)throw new Error(Cn(1));let c;if(e)c=e;else throw new Error("Missing arguments");return c};var bb={exports:{}},vb={};/**
|
|
89
|
-
* @license React
|
|
90
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
91
|
-
*
|
|
92
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
93
|
-
*
|
|
94
|
-
* This source code is licensed under the MIT license found in the
|
|
95
|
-
* LICENSE file in the root directory of this source tree.
|
|
96
|
-
*/var hT;function JU(){if(hT)return vb;hT=1;var e=jd(),t=v2();function n(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return vb.useSyncExternalStoreWithSelector=function(d,m,h,y,g){var w=o(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=c(function(){function E(A){if(!T){if(T=!0,k=A,A=y(A),g!==void 0&&C.hasValue){var N=C.value;if(g(N,A))return M=N}return M=A}if(N=M,r(k,A))return N;var L=y(A);return g!==void 0&&g(N,L)?(k=A,N):(k=A,M=L)}var T=!1,k,M,D=h===void 0?null:h;return[function(){return E(m())},D===null?void 0:function(){return E(D())}]},[m,h,y,g]);var R=a(d,w[0],w[1]);return l(function(){C.hasValue=!0,C.value=R},[R]),f(R),R},vb}var pT;function e6(){return pT||(pT=1,bb.exports=JU()),bb.exports}var t6=e6();const Vv=[];let $v;function n6(){return $v}function r6(e){Vv.push(e)}function b0(e){const t=(n,r)=>{const a=nr(i6).current;let o;try{$v=a;for(const l of Vv)l.before(a);o=e(n,r);for(const l of Vv)l.after(a);a.didInitialize=!0}finally{$v=void 0}return o};return t.displayName=e.displayName||e.name,t}function FA(e){return v.forwardRef(b0(e))}function i6(){return{didInitialize:!1}}const a6=Xx(19),o6=a6?l6:c6;function Ct(e,t,n,r,a){return o6(e,t,n,r,a)}function s6(e,t,n,r,a){const o=v.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return Gx.useSyncExternalStore(e.subscribe,o,o)}r6({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],a=r.selector(r.store.state,r.a1,r.a2,r.a3);(r.didChange||!Object.is(r.value,a))&&(t=!0,r.value=a,r.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const a of e.syncHooks)n.add(a.store);const r=[];for(const a of n)r.push(a.subscribe(t));return()=>{for(const a of r)a()}}),Gx.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function l6(e,t,n,r,a){const o=n6();if(!o)return s6(e,t,n,r,a);const l=o.syncIndex;o.syncIndex+=1;let c;return o.didInitialize?(c=o.syncHooks[l],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,a))&&(c.store!==e&&(o.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=a,c.didChange=!0)):(c={store:e,selector:t,a1:n,a2:r,a3:a,value:t(e.getSnapshot(),n,r,a),didChange:!1},o.syncHooks.push(c)),c.value}function c6(e,t,n,r,a){return t6.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,o=>t(o,n,r,a))}class BA{constructor(t){at(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));at(this,"getSnapshot",()=>this.state);this.state=t,this.listeners=new Set,this.updateTick=0}setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,a){return Ct(this,t,n,r,a)}}class gm extends BA{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){v.useDebugValue(t),qe(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const r=this;qe(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);qe(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){v.useDebugValue(t);const r=n!==void 0;qe(()=>{r&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,r])}select(t,n,r,a){const o=this.selectors[t];return o(this.state,n,r,a)}useState(t,n,r,a){return v.useDebugValue(t),Ct(this,this.selectors[t],n,r,a)}useContextCallback(t,n){v.useDebugValue(t);const r=We(n??Br);this.context[t]=r}useStateSetter(t){const n=v.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let a=r(this.state);return n(a,a,this),this.subscribe(o=>{const l=r(o);if(!Object.is(a,l)){const c=a;a=l,n(l,c,this)}})}}const u6={open:Ge(e=>e.open),domReferenceElement:Ge(e=>e.domReferenceElement),referenceElement:Ge(e=>e.positionReference??e.referenceElement),floatingElement:Ge(e=>e.floatingElement),floatingId:Ge(e=>e.floatingId)};class v0 extends gm{constructor(n){const{nested:r,noEmit:a,onOpenChange:o,triggerElements:l,...c}=n;super({...c,positionReference:c.referenceElement,domReferenceElement:c.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:bA(),nested:r,noEmit:a,triggerElements:l},u6);at(this,"setOpen",(n,r)=>{var a,o;if((!n||!this.state.open||Z2(r.event))&&(this.context.dataRef.current.openEvent=n?r.event:void 0),!this.context.noEmit){const l={open:n,reason:r.reason,nativeEvent:r.event,nested:this.context.nested,triggerElement:r.trigger};this.context.events.emit("openchange",l)}(o=(a=this.context).onOpenChange)==null||o.call(a,n,r)})}}function d6(e,t){const n=v.useRef(null),r=v.useRef(null);return v.useCallback(a=>{if(e!==void 0){if(n.current!==null){const o=n.current,l=r.current,c=t.context.triggerElements.getById(o);l&&c===l&&t.context.triggerElements.delete(o),n.current=null,r.current=null}a!==null&&(n.current=e,r.current=a,t.context.triggerElements.add(e,a))}},[t,e])}function HA(e,t,n,r){const a=n.useState("isMountedByTrigger",e),o=d6(e,n),l=We(c=>{if(o(c),!c||!n.select("open"))return;const f=n.select("activeTriggerId");if(f===e){n.update({activeTriggerElement:c,...r});return}f==null&&n.update({activeTriggerId:e,activeTriggerElement:c,...r})});return qe(()=>{a&&n.update({activeTriggerElement:t.current,...r})},[a,n,t,...Object.values(r)]),{registerTrigger:l,isMountedByThisTrigger:a}}function x0(e){const t=e.useState("open");qe(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[r,a]=n.value;e.update({activeTriggerId:r,activeTriggerElement:a})}}},[t,e])}function w0(e,t,n){const{mounted:r,setMounted:a,transitionStatus:o}=Wd(e);t.useSyncedValues({mounted:r,transitionStatus:o});const l=We(()=>{var f,d;a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(d=(f=t.context).onOpenChangeComplete)==null||d.call(f,!1)}),c=t.useState("preventUnmountingOnClose");return Ya({enabled:!c,open:e,ref:t.context.popupRef,onComplete(){e||l()}}),{forceUnmount:l,transitionStatus:o}}class Yd{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const r=this.idMap.get(t);r!==n&&(r!==void 0&&this.elementsSet.delete(r),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function f6(){return new v0({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Yd,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function S0(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:f6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:In,inactiveTriggerProps:In,popupProps:In}}const Lh=Ge(e=>e.triggerIdProp??e.activeTriggerId),E0={open:Ge(e=>e.openProp??e.open),mounted:Ge(e=>e.mounted),transitionStatus:Ge(e=>e.transitionStatus),floatingRootContext:Ge(e=>e.floatingRootContext),preventUnmountingOnClose:Ge(e=>e.preventUnmountingOnClose),payload:Ge(e=>e.payload),activeTriggerId:Lh,activeTriggerElement:Ge(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:Ge((e,t)=>t!==void 0&&Lh(e)===t),isOpenedByTrigger:Ge((e,t)=>t!==void 0&&Lh(e)===t&&e.open),isMountedByTrigger:Ge((e,t)=>t!==void 0&&Lh(e)===t&&e.mounted),triggerProps:Ge((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:Ge(e=>e.popupProps),popupElement:Ge(e=>e.popupElement),positionerElement:Ge(e=>e.positionerElement)};function UA(e){const{open:t=!1,onOpenChange:n,elements:r={}}=e,a=nl(),o=Ka()!=null,l=nr(()=>new v0({open:t,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Yd,floatingId:a,nested:o,noEmit:!1})).current;return qe(()=>{const c={open:t,floatingId:a};r.reference!==void 0&&(c.referenceElement=r.reference,c.domReferenceElement=un(r.reference)?r.reference:null),r.floating!==void 0&&(c.floatingElement=r.floating),l.update(c)},[t,a,r.reference,r.floating,l]),l.context.onOpenChange=n,l.context.nested=o,l.context.noEmit=!1,l}function h6(e={}){const{nodeId:t,externalTree:n}=e,r=UA(e),a=e.rootContext||r,o={reference:a.useState("referenceElement"),floating:a.useState("floatingElement"),domReference:a.useState("domReferenceElement")},[l,c]=v.useState(null),f=v.useRef(null),d=Qo(n);qe(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const m=AU({...e,elements:{...o,...l&&{reference:l}}}),h=v.useCallback(N=>{const L=un(N)?{getBoundingClientRect:()=>N.getBoundingClientRect(),getClientRects:()=>N.getClientRects(),contextElement:N}:N;c(L),m.refs.setReference(L)},[m.refs]),[y,g]=v.useState(null),[w,C]=v.useState(null);a.useSyncedValue("referenceElement",y),a.useSyncedValue("domReferenceElement",un(y)?y:null),a.useSyncedValue("floatingElement",w);const R=v.useCallback(N=>{(un(N)||N===null)&&(f.current=N,g(N)),(un(m.refs.reference.current)||m.refs.reference.current===null||N!==null&&!un(N))&&m.refs.setReference(N)},[m.refs,g]),E=v.useCallback(N=>{C(N),m.refs.setFloating(N)},[m.refs]),T=v.useMemo(()=>({...m.refs,setReference:R,setFloating:E,setPositionReference:h,domReference:f}),[m.refs,R,E,h]),k=v.useMemo(()=>({...m.elements,domReference:o.domReference}),[m.elements,o.domReference]),M=a.useState("open"),D=a.useState("floatingId"),A=v.useMemo(()=>({...m,dataRef:a.context.dataRef,open:M,onOpenChange:a.setOpen,events:a.context.events,floatingId:D,refs:T,elements:k,nodeId:t,rootStore:a}),[m,T,k,t,a,M,D]);return qe(()=>{a.context.dataRef.current.floatingContext=A;const N=d==null?void 0:d.nodesRef.current.find(L=>L.id===t);N&&(N.context=A)}),v.useMemo(()=>({...m,context:A,refs:T,elements:k,rootStore:a}),[m,T,k,A,a])}function C0(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:r=!1,onOpenChange:a}=e,o=nl(),l=Ka()!=null,c=t.useState("open"),f=t.useState("activeTriggerElement"),d=t.useState(r?"popupElement":"positionerElement"),m=t.context.triggerElements,h=nr(()=>new v0({open:c,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:a,floatingId:o,nested:l,noEmit:n})).current;return qe(()=>{const y={open:c,floatingId:o,referenceElement:f,floatingElement:d};un(f)&&(y.domReferenceElement=f),h.state.positionReference===h.state.referenceElement&&(y.positionReference=f),h.update(y)},[c,o,f,d,h]),h.context.onOpenChange=a,h.context.nested=l,h.context.noEmit=n,h}const xb=jB&&$2;function qA(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:r,dataRef:a}=n.context,{enabled:o=!0,delay:l}=t,c=v.useRef(!1),f=v.useRef(null),d=Bn(),m=v.useRef(!0);v.useEffect(()=>{const y=n.select("domReferenceElement");if(!o)return;const g=Hn(y);function w(){const E=n.select("domReferenceElement");!n.select("open")&&Mn(E)&&E===ni(Qt(E))&&(c.current=!0)}function C(){m.current=!0}function R(){m.current=!1}return g.addEventListener("blur",w),xb&&(g.addEventListener("keydown",C,!0),g.addEventListener("pointerdown",R,!0)),()=>{g.removeEventListener("blur",w),xb&&(g.removeEventListener("keydown",C,!0),g.removeEventListener("pointerdown",R,!0))}},[n,o]),v.useEffect(()=>{if(!o)return;function y(g){if(g.reason===Ws||g.reason===dm){const w=n.select("domReferenceElement");un(w)&&(f.current=w,c.current=!0)}}return r.on("openchange",y),()=>{r.off("openchange",y)}},[r,o,n]);const h=v.useMemo(()=>({onMouseLeave(){c.current=!1,f.current=null},onFocus(y){const g=y.currentTarget;if(c.current){if(f.current===g)return;c.current=!1,f.current=null}const w=Tr(y.nativeEvent);if(un(w)){if(xb&&!y.relatedTarget){if(!m.current&&!lm(w))return}else if(!UB(w))return}const C=Sp(y.relatedTarget,n.context.triggerElements),{nativeEvent:R,currentTarget:E}=y,T=typeof l=="function"?l():l;if(n.select("open")&&C||T===0||T===void 0){n.setOpen(!0,xt(Jl,R,E));return}d.start(T,()=>{c.current||n.setOpen(!0,xt(Jl,R,E))})},onBlur(y){c.current=!1,f.current=null;const g=y.relatedTarget,w=y.nativeEvent,C=un(g)&&g.hasAttribute(Ec("focus-guard"))&&g.getAttribute("data-type")==="outside";d.start(0,()=>{var k;const R=n.select("domReferenceElement"),E=ni(R?R.ownerDocument:document);!g&&E===R||Dt((k=a.current.floatingContext)==null?void 0:k.refs.floating.current,E)||Dt(R,E)||C||Sp(g??E,n.context.triggerElements)||n.setOpen(!1,xt(Jl,w))})}}),[a,n,d,l]);return v.useMemo(()=>o?{reference:h,trigger:h}:{},[o,h])}const Wv=Ec("safe-polygon"),p6=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${G2}`;function m6(e){return e?!!e.closest(p6):!1}class R0{constructor(){at(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});at(this,"disposeEffect",()=>this.dispose);this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new sa,this.restTimeout=new sa,this.handleCloseOptions=void 0}static create(){return new R0}}function VA(e){const t=nr(R0.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),om(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const g6=new Set(["click","mousedown"]);function $A(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),{dataRef:l}=n.context,{enabled:c=!0,closeDelay:f=0}=t,d=VA(n),m=Qo(),h=Ka(),y=We(()=>d.interactedInside?!0:l.current.openEvent?g6.has(l.current.openEvent.type):!1),g=We(()=>{var M;const k=(M=l.current.openEvent)==null?void 0:M.type;return(k==null?void 0:k.includes("mouse"))&&k!=="mousedown"}),w=We(k=>Sp(k,n.context.triggerElements)),C=v.useCallback((k,M=!0)=>{const D=y6(f,d.pointerType);D&&!d.handler?d.openChangeTimeout.start(D,()=>n.setOpen(!1,xt(vr,k))):M&&(d.openChangeTimeout.clear(),n.setOpen(!1,xt(vr,k)))},[f,n,d]),R=We(()=>{d.unbindMouseMove(),d.handler=void 0}),E=We(()=>{if(d.performedPointerEventsMutation){const k=Qt(a).body;k.style.pointerEvents="",k.removeAttribute(Wv),d.performedPointerEventsMutation=!1}}),T=We(k=>{const M=Tr(k);if(!m6(M)){d.interactedInside=!1;return}d.interactedInside=!0});qe(()=>{r||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,R(),E())},[r,d,R,E]),v.useEffect(()=>()=>{R()},[R]),v.useEffect(()=>E,[E]),qe(()=>{var k,M,D;if(c&&r&&(k=d.handleCloseOptions)!=null&&k.blockPointerEvents&&g()&&un(o)&&a){d.performedPointerEventsMutation=!0;const A=Qt(a).body;A.setAttribute(Wv,"");const N=o,L=a,q=(D=(M=m==null?void 0:m.nodesRef.current.find(F=>F.id===h))==null?void 0:M.context)==null?void 0:D.elements.floating;return q&&(q.style.pointerEvents=""),A.style.pointerEvents="none",N.style.pointerEvents="auto",L.style.pointerEvents="auto",()=>{A.style.pointerEvents="",N.style.pointerEvents="",L.style.pointerEvents=""}}},[c,r,o,a,d,g,m,h]),v.useEffect(()=>{if(!c)return;function k(N){y()||!l.current.floatingContext||!n.select("open")||w(N.relatedTarget)||(E(),R(),y()||C(N))}function M(N){var L;d.openChangeTimeout.clear(),E(),(L=d.handler)==null||L.call(d,N),R()}function D(N){y()||C(N,!1)}const A=a;return A&&(A.addEventListener("mouseleave",k),A.addEventListener("mouseenter",M),A.addEventListener("mouseleave",D),A.addEventListener("pointerdown",T,!0)),()=>{A&&(A.removeEventListener("mouseleave",k),A.removeEventListener("mouseenter",M),A.removeEventListener("mouseleave",D),A.removeEventListener("pointerdown",T,!0))}},[c,a,n,l,y,w,C,E,R,T,d])}function y6(e,t){return t&&!Vs(t)?0:typeof e=="function"?e():e}function wb(e){return typeof e=="function"?e():e}const b6={current:null};function WA(e,t={}){var F;const n="rootStore"in e?e.rootStore:e,{dataRef:r,events:a}=n.context,{enabled:o=!0,delay:l=0,handleClose:c=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:h=b6,externalTree:y,isActiveTrigger:g=!0}=t,w=Qo(y),C=VA(n),R=sr(c),E=sr(l),T=sr(d),k=sr(o);g&&(C.handleCloseOptions=(F=R.current)==null?void 0:F.__options);const M=We(()=>C.interactedInside?!0:r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1),D=We(Y=>Sp(Y,n.context.triggerElements)),A=v.useCallback((Y,_=!0)=>{const V=ap(E.current,"close",C.pointerType);V&&!C.handler?C.openChangeTimeout.start(V,()=>n.setOpen(!1,xt(vr,Y))):_&&(C.openChangeTimeout.clear(),n.setOpen(!1,xt(vr,Y)))},[E,n,C]),N=We(()=>{C.unbindMouseMove(),C.handler=void 0}),L=We(()=>{if(C.performedPointerEventsMutation){const Y=Qt(n.select("domReferenceElement")).body;Y.style.pointerEvents="",Y.removeAttribute(Wv),C.performedPointerEventsMutation=!1}});v.useEffect(()=>{if(!o)return;function Y(_){_.open||(C.openChangeTimeout.clear(),C.restTimeout.clear(),C.blockMouseMove=!0,C.restTimeoutPending=!1)}return a.on("openchange",Y),()=>{a.off("openchange",Y)}},[o,a,C]);const q=We(Y=>{var V;if(M()||!r.current.floatingContext||D(Y.relatedTarget))return;const _=h.current;(V=R.current)==null||V.call(R,{...r.current.floatingContext,tree:w,x:Y.clientX,y:Y.clientY,onClose(){L(),N(),!M()&&_===n.select("domReferenceElement")&&A(Y)}})(Y)});return v.useEffect(()=>{if(!o)return;const Y=h.current??(g?n.select("domReferenceElement"):null);if(!un(Y))return;function _(B){if(C.openChangeTimeout.clear(),C.blockMouseMove=!1,f&&!Vs(C.pointerType)||wb(T.current)>0&&!ap(E.current,"open"))return;const j=ap(E.current,"open",C.pointerType),z=n.select("domReferenceElement"),H=n.context.triggerElements,K=(H.hasElement(B.target)||H.hasMatchingElement(I=>Dt(I,B.target)))&&(!z||!Dt(z,B.target)),P=B.currentTarget??null,U=n.select("open"),G=!U||K;K&&U?n.setOpen(!0,xt(vr,B,P)):j?C.openChangeTimeout.start(j,()=>{G&&n.setOpen(!0,xt(vr,B,P))}):G&&n.setOpen(!0,xt(vr,B,P))}function V(B){if(M()){L();return}C.unbindMouseMove();const j=n.select("domReferenceElement"),z=Qt(j);if(C.restTimeout.clear(),C.restTimeoutPending=!1,D(B.relatedTarget))return;if(R.current&&r.current.floatingContext){n.select("open")||C.openChangeTimeout.clear();const K=h.current;C.handler=R.current({...r.current.floatingContext,tree:w,x:B.clientX,y:B.clientY,onClose(){L(),N(),k.current&&!M()&&K===n.select("domReferenceElement")&&A(B,!0)}});const P=C.handler;P(B),z.addEventListener("mousemove",P),C.unbindMouseMove=()=>{z.removeEventListener("mousemove",P)};return}(C.pointerType==="touch"?!Dt(n.select("floatingElement"),B.relatedTarget):!0)&&A(B)}function $(B){q(B)}return n.select("open")&&Y.addEventListener("mouseleave",$),m&&Y.addEventListener("mousemove",_,{once:!0}),Y.addEventListener("mouseenter",_),Y.addEventListener("mouseleave",V),()=>{Y.removeEventListener("mouseleave",$),m&&Y.removeEventListener("mousemove",_),Y.removeEventListener("mouseenter",_),Y.removeEventListener("mouseleave",V)}},[N,L,r,E,A,n,o,R,q,C,g,M,D,f,m,T,h,w,k]),v.useMemo(()=>{if(!o)return;function Y(_){C.pointerType=_.pointerType}return{onPointerDown:Y,onPointerEnter:Y,onMouseMove(_){const{nativeEvent:V}=_,$=_.currentTarget,B=n.select("domReferenceElement"),j=n.context.triggerElements,z=n.select("open"),H=(j.hasElement(_.target)||j.hasMatchingElement(P=>Dt(P,_.target)))&&(!B||!Dt(B,_.target));if(f&&!Vs(C.pointerType)||z&&!H||wb(T.current)===0||!H&&C.restTimeoutPending&&_.movementX**2+_.movementY**2<2)return;C.restTimeout.clear();function K(){if(C.restTimeoutPending=!1,M())return;const P=n.select("open");!C.blockMouseMove&&(!P||H)&&n.setOpen(!0,xt(vr,V,$))}C.pointerType==="touch"?pr.flushSync(()=>{K()}):H&&z?K():(C.restTimeoutPending=!0,C.restTimeout.start(wb(T.current),K))}}},[o,C,M,f,n,T])}function Kd(e=[]){const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),r=e.map(d=>d==null?void 0:d.item),a=e.map(d=>d==null?void 0:d.trigger),o=v.useCallback(d=>_h(d,e,"reference"),t),l=v.useCallback(d=>_h(d,e,"floating"),n),c=v.useCallback(d=>_h(d,e,"item"),r),f=v.useCallback(d=>_h(d,e,"trigger"),a);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c,getTriggerProps:f}),[o,l,c,f])}function _h(e,t,n){var l;const r=new Map,a=n==="item",o={};n==="floating"&&(o.tabIndex=-1,o[_v]="");for(const c in e)a&&e&&(c===Y2||c===K2)||(o[c]=e[c]);for(let c=0;c<t.length;c+=1){let f;const d=(l=t[c])==null?void 0:l[n];typeof d=="function"?f=e?d(e):null:f=d,f&&mT(o,f,a,r)}return mT(o,e,a,r),o}function mT(e,t,n,r){var a;for(const o in t){const l=t[o];n&&(o===Y2||o===K2)||(o.startsWith("on")?(r.has(o)||r.set(o,[]),typeof l=="function"&&((a=r.get(o))==null||a.push(l),e[o]=(...c)=>{var f;return(f=r.get(o))==null?void 0:f.map(d=>d(...c)).find(d=>d!==void 0)})):e[o]=l)}}const v6="Escape";function ym(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function jh(e,t){return ym(t,e===r0||e===qd,e===Ho||e===Uo)}function Sb(e,t,n){return ym(t,e===qd,n?e===Ho:e===Uo)||e==="Enter"||e===" "||e===""}function x6(e,t,n){return ym(t,n?e===Ho:e===Uo,e===qd)}function w6(e,t,n,r){const a=n?e===Uo:e===Ho,o=e===r0;return t==="both"||t==="horizontal"&&r&&r>1?e===v6:ym(t,a,o)}function YA(e,t){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingElement"),o=n.useState("domReferenceElement"),l=n.context.dataRef,{listRef:c,activeIndex:f,onNavigate:d=()=>{},enabled:m=!0,selectedIndex:h=null,allowEscape:y=!1,loopFocus:g=!1,nested:w=!1,rtl:C=!1,virtual:R=!1,focusItemOnOpen:E="auto",focusItemOnHover:T=!0,openOnArrowKeyDown:k=!0,disabledIndices:M=void 0,orientation:D="vertical",parentOrientation:A,cols:N=1,id:L,resetOnPointerLeave:q=!0,externalTree:F}=t,Y=Ed(a),_=sr(Y),V=Ka(),$=Qo(F);qe(()=>{l.current.orientation=D},[l,D]);const B=jv(o),j=v.useRef(E),z=v.useRef(h??-1),H=v.useRef(null),K=v.useRef(!0),P=We(J=>{d(z.current===-1?null:z.current,J)}),U=v.useRef(P),G=v.useRef(!!a),I=v.useRef(r),Q=v.useRef(!1),le=v.useRef(!1),ae=sr(M),Z=sr(r),ue=sr(h),ve=sr(q),Se=We(()=>{function J(Ve){R?$==null||$.events.emit("virtualfocus",Ve):ad(Ve,{sync:Q.current,preventScroll:!0})}const Ee=c.current[z.current],xe=le.current;Ee&&J(Ee),(Q.current?Ve=>Ve():requestAnimationFrame)(()=>{var ut;const Ve=c.current[z.current]||Ee;if(!Ve)return;Ee||J(Ve),te&&(xe||!K.current)&&((ut=Ve.scrollIntoView)==null||ut.call(Ve,{block:"nearest",inline:"nearest"}))})});qe(()=>{m&&(r&&a?(z.current=h??-1,j.current&&h!=null&&(le.current=!0,P())):G.current&&(z.current=-1,U.current()))},[m,r,a,h,P]),qe(()=>{if(m){if(!r){Q.current=!1;return}if(a)if(f==null){if(Q.current=!1,ue.current!=null)return;if(G.current&&(z.current=-1,Se()),(!I.current||!G.current)&&j.current&&(H.current!=null||j.current===!0&&H.current==null)){let J=0;const Ee=()=>{c.current[0]==null?(J<2&&(J?requestAnimationFrame:queueMicrotask)(Ee),J+=1):(z.current=H.current==null||Sb(H.current,D,C)||w?np(c):Bv(c),H.current=null,P())};Ee()}}else Ql(c,f)||(z.current=f,Se(),le.current=!1)}},[m,r,a,f,ue,w,c,D,C,P,Se,ae]),qe(()=>{var Ve,De;if(!m||a||!$||R||!G.current)return;const J=$.nodesRef.current,Ee=(De=(Ve=J.find(ut=>ut.id===V))==null?void 0:Ve.context)==null?void 0:De.elements.floating,xe=ni(Qt(a)),Be=J.some(ut=>ut.context&&Dt(ut.context.elements.floating,xe));Ee&&!Be&&K.current&&Ee.focus({preventScroll:!0})},[m,a,$,V,R]),qe(()=>{U.current=P,I.current=r,G.current=!!a}),qe(()=>{r||(H.current=null,j.current=E)},[r,E]);const Le=f!=null,te=v.useMemo(()=>{function J(xe){if(!Z.current)return;const Be=c.current.indexOf(xe.currentTarget);Be!==-1&&z.current!==Be&&(z.current=Be,P(xe))}return{onFocus(xe){Q.current=!0,J(xe)},onClick:({currentTarget:xe})=>xe.focus({preventScroll:!0}),onMouseMove(xe){Q.current=!0,le.current=!1,T&&J(xe)},onPointerLeave(xe){var Ve;if(!Z.current||!K.current||xe.pointerType==="touch")return;Q.current=!0;const Be=xe.relatedTarget;!T||c.current.includes(Be)||ve.current&&(ad(null,{sync:!0}),z.current=-1,P(xe),R||(Ve=_.current)==null||Ve.focus({preventScroll:!0}))}}},[Z,_,T,c,P,ve,R]),he=v.useCallback(()=>{var J,Ee,xe;return A??((xe=(Ee=(J=$==null?void 0:$.nodesRef.current.find(Be=>Be.id===V))==null?void 0:J.context)==null?void 0:Ee.dataRef)==null?void 0:xe.current.orientation)},[V,$,A]),ye=We(J=>{if(K.current=!1,Q.current=!0,J.which===229||!Z.current&&J.currentTarget===_.current)return;if(w&&w6(J.key,D,C,N)){jh(J.key,he())||br(J),n.setOpen(!1,xt(rp,J.nativeEvent)),Mn(o)&&(R?$==null||$.events.emit("virtualfocus",o):o.focus());return}const Ee=z.current,xe=np(c,M),Be=Bv(c,M);if(B||(J.key==="Home"&&(br(J),z.current=xe,P(J)),J.key==="End"&&(br(J),z.current=Be,P(J))),N>1){const Ve=Array.from({length:c.current.length},()=>({width:1,height:1})),De=tA(Ve,N,!1),ut=De.findIndex(ee=>ee!=null&&!qo(c,ee,M)),pe=De.reduce((ee,fe,Ne)=>fe!=null&&!qo(c,fe,M)?Ne:ee,-1),Re=De[eA({current:De.map(ee=>ee!=null?c.current[ee]:null)},{event:J,orientation:D,loopFocus:g,rtl:C,cols:N,disabledIndices:rA([...(typeof M!="function"?M:null)||c.current.map((ee,fe)=>qo(c,fe,M)?fe:void 0),void 0],De),minIndex:ut,maxIndex:pe,prevIndex:nA(z.current>Be?xe:z.current,Ve,De,N,J.key===qd?"bl":J.key===(C?Ho:Uo)?"tr":"tl"),stopEvent:!0})];if(Re!=null&&(z.current=Re,P(J)),D==="both")return}if(jh(J.key,D)){if(br(J),r&&!R&&ni(J.currentTarget.ownerDocument)===J.currentTarget){z.current=Sb(J.key,D,C)?xe:Be,P(J);return}Sb(J.key,D,C)?g?Ee>=Be?y&&Ee!==c.current.length?z.current=-1:(Q.current=!1,z.current=xe):z.current=hr(c,{startingIndex:Ee,disabledIndices:M}):z.current=Math.min(Be,hr(c,{startingIndex:Ee,disabledIndices:M})):g?Ee<=xe?y&&Ee!==-1?z.current=c.current.length:(Q.current=!1,z.current=Be):z.current=hr(c,{startingIndex:Ee,decrement:!0,disabledIndices:M}):z.current=Math.max(xe,hr(c,{startingIndex:Ee,decrement:!0,disabledIndices:M})),Ql(c,z.current)&&(z.current=-1),P(J)}}),_e=v.useMemo(()=>R&&r&&Le&&{"aria-activedescendant":`${L}-${f}`},[R,r,Le,L,f]),Ae=v.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...B?{}:_e,onKeyDown(J){if(J.key==="Tab"&&J.shiftKey&&r&&!R){const Ee=Tr(J.nativeEvent);if(Ee&&!Dt(_.current,Ee))return;br(J),n.setOpen(!1,xt(Ys,J.nativeEvent)),Mn(o)&&o.focus();return}ye(J)},onPointerMove(){K.current=!0}}),[_e,ye,_,D,B,n,r,R,o]),Ce=v.useMemo(()=>{function J(xe){E==="auto"&&X2(xe.nativeEvent)&&(j.current=!R)}function Ee(xe){j.current=E,E==="auto"&&Q2(xe.nativeEvent)&&(j.current=!0)}return{onKeyDown(xe){const Be=n.select("open");K.current=!1;const Ve=xe.key.startsWith("Arrow"),De=x6(xe.key,he(),C),ut=jh(xe.key,D),pe=(w?De:ut)||xe.key==="Enter"||xe.key.trim()==="";if(R&&Be)return ye(xe);if(!(!Be&&!k&&Ve)){if(pe){const Re=jh(xe.key,he());H.current=w&&Re?null:xe.key}if(w){De&&(br(xe),Be?(z.current=np(c,ae.current),P(xe)):n.setOpen(!0,xt(rp,xe.nativeEvent,xe.currentTarget)));return}ut&&(ue.current!=null&&(z.current=ue.current),br(xe),!Be&&k?n.setOpen(!0,xt(rp,xe.nativeEvent,xe.currentTarget)):ye(xe),Be&&P(xe))}},onFocus(xe){n.select("open")&&!R&&(z.current=-1,P(xe))},onPointerDown:Ee,onPointerEnter:Ee,onMouseDown:J,onClick:J}},[ye,ae,E,c,w,P,n,k,D,he,C,ue,R]),Te=v.useMemo(()=>({..._e,...Ce}),[_e,Ce]);return v.useMemo(()=>m?{reference:Te,floating:Ae,item:te,trigger:Ce}:{},[m,Te,Ae,Ce,te])}const S6=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function KA(e,t={}){const n="rootStore"in e?e.rootStore:e,r=n.useState("open"),a=n.useState("floatingId"),o=n.useState("domReferenceElement"),l=n.useState("floatingElement"),{role:c="dialog"}=t,f=nl(),d=(o==null?void 0:o.id)||f,m=v.useMemo(()=>{var T;return((T=Ed(l))==null?void 0:T.id)||a},[l,a]),h=S6.get(c)??c,g=Ka()!=null,w=v.useMemo(()=>h==="tooltip"||c==="label"?In:{"aria-haspopup":h==="alertdialog"?"dialog":h,"aria-expanded":"false",...h==="listbox"&&{role:"combobox"},...h==="menu"&&g&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[h,g,c]),C=v.useMemo(()=>h==="tooltip"||c==="label"?{[`aria-${c==="label"?"labelledby":"describedby"}`]:r?m:void 0}:{...w,"aria-expanded":r?"true":"false","aria-controls":r?m:void 0,...h==="menu"&&{id:d}},[h,m,r,d,c,w]),R=v.useMemo(()=>{const T={id:m,...h&&{role:h}};return h==="tooltip"||c==="label"?T:{...T,...h==="menu"&&{"aria-labelledby":d}}},[h,m,d,c]),E=v.useCallback(({active:T,selected:k})=>{const M={role:"option",...T&&{id:`${m}-fui-option`}};switch(c){case"select":case"combobox":return{...M,"aria-selected":k}}return{}},[m,c]);return v.useMemo(()=>({reference:C,floating:R,item:E,trigger:w}),[C,R,w,E])}function GA(e,t){const n="rootStore"in e?e.rootStore:e,r=n.context.dataRef,a=n.useState("open"),{listRef:o,activeIndex:l,onMatch:c,onTypingChange:f,enabled:d=!0,resetMs:m=750,selectedIndex:h=null}=t,y=Bn(),g=v.useRef(""),w=v.useRef(h??l??-1),C=v.useRef(null);qe(()=>{!a&&h!==null||(y.clear(),C.current=null,g.current!==""&&(g.current=""))},[a,h,y]),qe(()=>{a&&g.current===""&&(w.current=h??l??-1)},[a,h,l]);const R=We(D=>{D?r.current.typing||(r.current.typing=D,f==null||f(D)):r.current.typing&&(r.current.typing=D,f==null||f(D))}),E=We(D=>{function A(_,V,$){const B=V.find(j=>(j==null?void 0:j.toLocaleLowerCase().indexOf($.toLocaleLowerCase()))===0);return B?_.indexOf(B):-1}const N=o.current;if(g.current.length>0&&g.current[0]!==" "&&(A(N,N,g.current)===-1?R(!1):D.key===" "&&br(D)),N==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;a&&D.key!==" "&&(br(D),R(!0));const L=g.current==="";L&&(w.current=h??l??-1),N.every(_=>{var V,$;return _?((V=_[0])==null?void 0:V.toLocaleLowerCase())!==(($=_[1])==null?void 0:$.toLocaleLowerCase()):!0})&&g.current===D.key&&(g.current="",w.current=C.current),g.current+=D.key,y.start(m,()=>{g.current="",w.current=C.current,R(!1)});const F=L?h??l??-1:w.current,Y=A(N,[...N.slice((F||0)+1),...N.slice(0,(F||0)+1)],g.current);Y!==-1?(c==null||c(Y),C.current=Y):D.key!==" "&&(g.current="",R(!1))}),T=We(D=>{const A=D.relatedTarget,N=n.select("domReferenceElement"),L=n.select("floatingElement"),q=Dt(N,A),F=Dt(L,A);q||F||(y.clear(),g.current="",w.current=C.current,R(!1))}),k=v.useMemo(()=>({onKeyDown:E,onBlur:T}),[E,T]),M=v.useMemo(()=>({onKeyDown:E,onKeyUp(D){D.key===" "&&R(!1)},onBlur:T}),[E,T,R]);return v.useMemo(()=>d?{reference:k,floating:M}:{},[d,k,M])}function gT(e,t){const[n,r]=e;let a=!1;const o=t.length;for(let l=0,c=o-1;l<o;c=l++){const[f,d]=t[l]||[0,0],[m,h]=t[c]||[0,0];d>=r!=h>=r&&n<=(m-f)*(r-d)/(h-d)+f&&(a=!a)}return a}function E6(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function XA(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,a=new sa;let o=!1,l=null,c=null,f=typeof performance<"u"?performance.now():0;function d(h,y){const g=performance.now(),w=g-f;if(l===null||c===null||w===0)return l=h,c=y,f=g,null;const C=h-l,R=y-c,T=Math.sqrt(C*C+R*R)/w;return l=h,c=y,f=g,T}const m=({x:h,y,placement:g,elements:w,onClose:C,nodeId:R,tree:E})=>function(k){function M(){a.clear(),C()}if(a.clear(),!w.domReference||!w.floating||g==null||h==null||y==null)return;const{clientX:D,clientY:A}=k,N=[D,A],L=Tr(k),q=k.type==="mouseleave",F=Dt(w.floating,L),Y=Dt(w.domReference,L),_=w.domReference.getBoundingClientRect(),V=w.floating.getBoundingClientRect(),$=g.split("-")[0],B=h>V.right-V.width/2,j=y>V.bottom-V.height/2,z=E6(N,_),H=V.width>_.width,K=V.height>_.height,P=(H?_:V).left,U=(H?_:V).right,G=(K?_:V).top,I=(K?_:V).bottom;if(F&&(o=!0,!q))return;if(Y&&(o=!1),Y&&!q){o=!0;return}if(q&&un(k.relatedTarget)&&Dt(w.floating,k.relatedTarget)||E&&js(E.nodesRef.current,R).some(({context:ae})=>ae==null?void 0:ae.open))return;if($==="top"&&y>=_.bottom-1||$==="bottom"&&y<=_.top+1||$==="left"&&h>=_.right-1||$==="right"&&h<=_.left+1)return M();let Q=[];switch($){case"top":Q=[[P,_.top+1],[P,V.bottom-1],[U,V.bottom-1],[U,_.top+1]];break;case"bottom":Q=[[P,V.top+1],[P,_.bottom-1],[U,_.bottom-1],[U,V.top+1]];break;case"left":Q=[[V.right-1,I],[V.right-1,G],[_.left+1,G],[_.left+1,I]];break;case"right":Q=[[_.right-1,I],[_.right-1,G],[V.left+1,G],[V.left+1,I]];break}function le([ae,Z]){switch($){case"top":{const ue=[H?ae+t/2:B?ae+t*4:ae-t*4,Z+t+1],ve=[H?ae-t/2:B?ae+t*4:ae-t*4,Z+t+1],Se=[[V.left,B||H?V.bottom-t:V.top],[V.right,B?H?V.bottom-t:V.top:V.bottom-t]];return[ue,ve,...Se]}case"bottom":{const ue=[H?ae+t/2:B?ae+t*4:ae-t*4,Z-t],ve=[H?ae-t/2:B?ae+t*4:ae-t*4,Z-t],Se=[[V.left,B||H?V.top+t:V.bottom],[V.right,B?H?V.top+t:V.bottom:V.top+t]];return[ue,ve,...Se]}case"left":{const ue=[ae+t+1,K?Z+t/2:j?Z+t*4:Z-t*4],ve=[ae+t+1,K?Z-t/2:j?Z+t*4:Z-t*4];return[...[[j||K?V.right-t:V.left,V.top],[j?K?V.right-t:V.left:V.right-t,V.bottom]],ue,ve]}case"right":{const ue=[ae-t,K?Z+t/2:j?Z+t*4:Z-t*4],ve=[ae-t,K?Z-t/2:j?Z+t*4:Z-t*4],Se=[[j||K?V.left+t:V.right,V.top],[j?K?V.left+t:V.right:V.left+t,V.bottom]];return[ue,ve,...Se]}default:return[]}}if(!gT([D,A],Q)){if(o&&!z)return M();if(!q&&r){const ae=d(k.clientX,k.clientY);if(ae!==null&&ae<.1)return M()}gT([D,A],le([h,y]))?!o&&r&&a.start(40,M):M()}};return m.__options={blockPointerEvents:n},m}let C6=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),R6=(function(e){return e[e.open=Ts.open]="open",e[e.closed=Ts.closed]="closed",e[e.startingStyle=Ts.startingStyle]="startingStyle",e[e.endingStyle=Ts.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const QA=v.createContext(void 0);function T6(){const e=v.useContext(QA);if(e===void 0)throw new Error(Cn(26));return e}const nc="ArrowUp",ks="ArrowDown",Cd="ArrowLeft",rc="ArrowRight",Gd="Home",Xd="End",ZA=new Set([Cd,rc]),k6=new Set([Cd,rc,Gd,Xd]),JA=new Set([nc,ks]),M6=new Set([nc,ks,Gd,Xd]),eN=new Set([...ZA,...JA]),A6=new Set([...eN,Gd,Xd]),T0=new Set([nc,ks,Cd,rc,Gd,Xd]),N6="Shift",O6="Control",D6="Alt",I6="Meta",P6=new Set([N6,O6,D6,I6]);function L6(e){return Mn(e)&&e.tagName==="INPUT"}function yT(e){return!!(L6(e)&&e.selectionStart!=null||Mn(e)&&e.tagName==="TEXTAREA")}function bT(e,t,n,r){if(!e||!t||!t.scrollTo)return;let a=e.scrollLeft,o=e.scrollTop;const l=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(l&&r!=="vertical"){const f=vT(e,t,"left"),d=zh(e),m=zh(t);n==="ltr"&&(f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight?a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight:f-m.scrollMarginLeft<e.scrollLeft+d.scrollPaddingLeft&&(a=f-m.scrollMarginLeft-d.scrollPaddingLeft)),n==="rtl"&&(f-m.scrollMarginRight<e.scrollLeft+d.scrollPaddingLeft?a=f-m.scrollMarginLeft-d.scrollPaddingLeft:f+t.offsetWidth+m.scrollMarginRight>e.scrollLeft+e.clientWidth-d.scrollPaddingRight&&(a=f+t.offsetWidth+m.scrollMarginRight-e.clientWidth+d.scrollPaddingRight))}if(c&&r!=="horizontal"){const f=vT(e,t,"top"),d=zh(e),m=zh(t);f-m.scrollMarginTop<e.scrollTop+d.scrollPaddingTop?o=f-m.scrollMarginTop-d.scrollPaddingTop:f+t.offsetHeight+m.scrollMarginBottom>e.scrollTop+e.clientHeight-d.scrollPaddingBottom&&(o=f+t.offsetHeight+m.scrollMarginBottom-e.clientHeight+d.scrollPaddingBottom)}e.scrollTo({left:a,top:o,behavior:"auto"})}function vT(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let a=0;for(;t.offsetParent&&(a+=t[r],t.offsetParent!==e);)t=t.offsetParent;return a}function zh(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const _6={...ua,...Wa,nestedDialogOpen(e){return e?{[R6.nestedDialogOpen]:""}:null}},k0=v.forwardRef(function(t,n){const{className:r,finalFocus:a,initialFocus:o,render:l,...c}=t,{store:f}=Xo(),d=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),h=f.useState("floatingRootContext"),y=f.useState("popupProps"),g=f.useState("modal"),w=f.useState("mounted"),C=f.useState("nested"),R=f.useState("nestedOpenDialogCount"),E=f.useState("open"),T=f.useState("openMethod"),k=f.useState("titleElementId"),M=f.useState("transitionStatus"),D=f.useState("role");T6(),Ya({open:E,ref:f.context.popupRef,onComplete(){var Y,_;E&&((_=(Y=f.context).onOpenChangeComplete)==null||_.call(Y,!0))}});function A(Y){return Y==="touch"?f.context.popupRef.current:!0}const N=o===void 0?A:o,L=R>0,F=It("div",t,{state:{open:E,nested:C,transitionStatus:M,nestedDialogOpen:L},props:[y,{"aria-labelledby":k??void 0,"aria-describedby":d??void 0,role:D,tabIndex:-1,hidden:!w,onKeyDown(Y){T0.has(Y.key)&&Y.stopPropagation()},style:{[C6.nestedDialogs]:R}},c],ref:[n,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:_6});return S.jsx(g0,{context:h,openInteractionType:T,disabled:!w,closeOnFocusOut:!m,initialFocus:N,returnFocus:a,modal:g!==!1,restoreFocus:"popup",children:F})});function M0(e){return Xx(19)?e:e?"true":void 0}const A0=v.forwardRef(function(t,n){const{cutout:r,...a}=t;let o;if(r){const l=r==null?void 0:r.getBoundingClientRect();o=`polygon(
|
|
97
|
-
0% 0%,
|
|
98
|
-
100% 0%,
|
|
99
|
-
100% 100%,
|
|
100
|
-
0% 100%,
|
|
101
|
-
0% 0%,
|
|
102
|
-
${l.left}px ${l.top}px,
|
|
103
|
-
${l.left}px ${l.bottom}px,
|
|
104
|
-
${l.right}px ${l.bottom}px,
|
|
105
|
-
${l.right}px ${l.top}px,
|
|
106
|
-
${l.left}px ${l.top}px
|
|
107
|
-
)`}return S.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...a,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})}),N0=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Xo(),l=o.useState("mounted"),c=o.useState("modal"),f=o.useState("open");return l||r?S.jsx(QA.Provider,{value:r,children:S.jsxs(p0,{ref:n,...a,children:[l&&c===!0&&S.jsx(A0,{ref:o.context.internalBackdropRef,inert:M0(!f)}),t.children]})}):null});function bm(e){const t=v.useRef(!0);t.current&&(t.current=!1,e())}let xT={},wT={},ST="";function j6(e){if(typeof document>"u")return!1;const t=Qt(e);return Hn(t).innerWidth-t.documentElement.clientWidth>0}function z6(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Qt(e),r=n.documentElement,a=n.body,o=Ko(r)?r:a,l=o.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",o.style.overflowY="scroll";const f=o.offsetWidth;o.style.overflowY="hidden";const d=o.offsetWidth;return o.style.overflowY=l,r.style.scrollbarGutter=c,f===d}function F6(e){const t=Qt(e),n=t.documentElement,r=t.body,a=Ko(n)?n:r,o={overflowY:a.style.overflowY,overflowX:a.style.overflowX};return Object.assign(a.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(a.style,o)}}function B6(e){var y;const t=Qt(e),n=t.documentElement,r=t.body,a=Hn(n);let o=0,l=0,c=!1;const f=Fn.create();if(sm&&(((y=a.visualViewport)==null?void 0:y.scale)??1)!==1)return()=>{};function d(){const g=a.getComputedStyle(n),w=a.getComputedStyle(r),E=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=n.scrollTop,l=n.scrollLeft,xT={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ST=n.style.scrollBehavior,wT={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const T=n.scrollHeight>n.clientHeight,k=n.scrollWidth>n.clientWidth,M=g.overflowY==="scroll"||w.overflowY==="scroll",D=g.overflowX==="scroll"||w.overflowX==="scroll",A=Math.max(0,a.innerWidth-r.clientWidth),N=Math.max(0,a.innerHeight-r.clientHeight),L=parseFloat(w.marginTop)+parseFloat(w.marginBottom),q=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=Ko(n)?n:r;if(c=z6(e),c){n.style.scrollbarGutter=E,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:E,overflowY:"hidden",overflowX:"hidden"}),(T||M)&&(n.style.overflowY="scroll"),(k||D)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:L||N?`calc(100dvh - ${L+N}px)`:"100dvh",width:q||A?`calc(100vw - ${q+A}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),r.scrollTop=o,r.scrollLeft=l,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function m(){Object.assign(n.style,xT),Object.assign(r.style,wT),c||(n.scrollTop=o,n.scrollLeft=l,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ST)}function h(){m(),f.request(d)}return d(),a.addEventListener("resize",h),()=>{f.cancel(),m(),typeof a.removeEventListener=="function"&&a.removeEventListener("resize",h)}}class H6{constructor(){at(this,"lockCount",0);at(this,"restore",null);at(this,"timeoutLock",sa.create());at(this,"timeoutUnlock",sa.create());at(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});at(this,"unlock",()=>{var t;this.lockCount===0&&this.restore&&((t=this.restore)==null||t.call(this),this.restore=null)})}acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}lock(t){if(this.lockCount===0||this.restore!==null)return;const r=Qt(t).documentElement,a=Hn(r).getComputedStyle(r).overflowY;if(a==="hidden"||a==="clip"){this.restore=Br;return}const o=V2||!j6(t);this.restore=o?F6(t):B6(t)}}const U6=new H6;function O0(e=!0,t=null){qe(()=>{if(e)return U6.acquire(t)},[e,t])}function q6(e){const t=v.useRef(""),n=v.useCallback(a=>{a.defaultPrevented||(t.current=a.pointerType,e(a,a.pointerType))},[e]);return{onClick:v.useCallback(a=>{if(a.detail===0){e(a,"keyboard");return}"pointerType"in a?e(a,a.pointerType):e(a,t.current),t.current=""},[e]),onPointerDown:n}}function D0(e){const[t,n]=v.useState(null),r=We((c,f)=>{e||n(f||(V2?"touch":""))}),a=v.useCallback(()=>{n(null)},[]),{onClick:o,onPointerDown:l}=q6(r);return v.useMemo(()=>({openMethod:t,reset:a,triggerProps:{onClick:o,onPointerDown:l}}),[t,a,o,l])}function tN(e){const{store:t,parentContext:n,actionsRef:r}=e,a=t.useState("open"),o=t.useState("disablePointerDismissal"),l=t.useState("modal"),c=t.useState("popupElement"),{openMethod:f,triggerProps:d,reset:m}=D0(a);x0(t);const{forceUnmount:h}=w0(a,t,()=>{m()}),y=We(F=>{const Y=xt(F);return Y.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},Y}),g=v.useCallback(()=>{t.setOpen(!1,y(c0))},[t,y]);v.useImperativeHandle(r,()=>({unmount:h,close:g}),[h,g]);const w=C0({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[C,R]=v.useState(0),E=C===0,T=KA(w),k=mm(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:l==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(F){if(!t.context.outsidePressEnabledRef.current||"button"in F&&F.button!==0||"touches"in F&&F.touches.length!==1)return!1;const Y=Tr(F);if(E&&!o){const _=Y;return l&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===_||t.context.backdropRef.current===_||Dt(_,c)&&!(_!=null&&_.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:E});O0(a&&l===!0,c);const{getReferenceProps:M,getFloatingProps:D,getTriggerProps:A}=Kd([T,k]);t.useContextCallback("onNestedDialogOpen",F=>{R(F+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),v.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&a&&n.onNestedDialogOpen(C),n!=null&&n.onNestedDialogClose&&!a&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&a&&n.onNestedDialogClose()}),[a,n,C]);const N=v.useMemo(()=>M(d),[M,d]),L=v.useMemo(()=>A(d),[A,d]),q=v.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:f,activeTriggerProps:N,inactiveTriggerProps:L,popupProps:q,floatingRootContext:w,nestedOpenDialogCount:C})}const V6={...E0,modal:Ge(e=>e.modal),nested:Ge(e=>e.nested),nestedOpenDialogCount:Ge(e=>e.nestedOpenDialogCount),disablePointerDismissal:Ge(e=>e.disablePointerDismissal),openMethod:Ge(e=>e.openMethod),descriptionElementId:Ge(e=>e.descriptionElementId),titleElementId:Ge(e=>e.titleElementId),viewportElement:Ge(e=>e.viewportElement),role:Ge(e=>e.role)};class nN extends gm{constructor(n){super($6(n),{popupRef:v.createRef(),backdropRef:v.createRef(),internalBackdropRef:v.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new Yd,onOpenChange:void 0,onOpenChangeComplete:void 0},V6);at(this,"setOpen",(n,r)=>{var c,f,d,m;if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&r.trigger==null&&this.state.activeTriggerId!=null&&(r.trigger=this.state.activeTriggerElement??void 0),(f=(c=this.context).onOpenChange)==null||f.call(c,n,r),r.isCanceled)return;const a={open:n,nativeEvent:r.event,reason:r.reason,nested:this.state.nested};(d=this.state.floatingRootContext.context.events)==null||d.emit("openchange",a);const o={open:n},l=((m=r.trigger)==null?void 0:m.id)??null;(l||n)&&(o.activeTriggerId=l,o.activeTriggerElement=r.trigger??null),this.update(o)})}}function $6(e={}){return{...S0(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function rN(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,disablePointerDismissal:l=!1,modal:c=!0,actionsRef:f,handle:d,triggerId:m,defaultTriggerId:h=null}=e,y=Xo(!0),g=!!y,w=nr(()=>(d==null?void 0:d.store)??new nN({open:r,openProp:n,activeTriggerId:h,triggerIdProp:m,modal:c,disablePointerDismissal:l,nested:g})).current;bm(()=>{n===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:h})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",m),w.useSyncedValues({disablePointerDismissal:l,nested:g,modal:c}),w.useContextCallback("onOpenChange",a),w.useContextCallback("onOpenChangeComplete",o);const C=w.useState("payload");tN({store:w,actionsRef:f,parentContext:y==null?void 0:y.store.context});const R=v.useMemo(()=>({store:w}),[w]);return S.jsx(u0.Provider,{value:R,children:typeof t=="function"?t({payload:C}):t})}const I0=v.forwardRef(function(t,n){const{render:r,className:a,id:o,...l}=t,{store:c}=Xo(),f=Vi(o);return c.useSyncedValueWithCleanup("titleElementId",f),It("h2",t,{ref:n,props:[{id:f},l]})});/**
|
|
108
|
-
* @license lucide-react v0.564.0 - ISC
|
|
109
|
-
*
|
|
110
|
-
* This source code is licensed under the ISC license.
|
|
111
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
-
*/const iN=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
113
|
-
* @license lucide-react v0.564.0 - ISC
|
|
114
|
-
*
|
|
115
|
-
* This source code is licensed under the ISC license.
|
|
116
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
-
*/const W6=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
118
|
-
* @license lucide-react v0.564.0 - ISC
|
|
119
|
-
*
|
|
120
|
-
* This source code is licensed under the ISC license.
|
|
121
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
-
*/const Y6=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
123
|
-
* @license lucide-react v0.564.0 - ISC
|
|
124
|
-
*
|
|
125
|
-
* This source code is licensed under the ISC license.
|
|
126
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
-
*/const ET=e=>{const t=Y6(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
128
|
-
* @license lucide-react v0.564.0 - ISC
|
|
129
|
-
*
|
|
130
|
-
* This source code is licensed under the ISC license.
|
|
131
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
-
*/var K6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
133
|
-
* @license lucide-react v0.564.0 - ISC
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the ISC license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/const G6=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
138
|
-
* @license lucide-react v0.564.0 - ISC
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the ISC license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const X6=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...c},f)=>v.createElement("svg",{ref:f,...K6,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:iN("lucide",a),...!o&&!G6(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,m])=>v.createElement(d,m)),...Array.isArray(o)?o:[o]]));/**
|
|
143
|
-
* @license lucide-react v0.564.0 - ISC
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the ISC license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/const gt=(e,t)=>{const n=v.forwardRef(({className:r,...a},o)=>v.createElement(X6,{ref:o,iconNode:t,className:iN(`lucide-${W6(ET(e))}`,`lucide-${e}`,r),...a}));return n.displayName=ET(e),n};/**
|
|
148
|
-
* @license lucide-react v0.564.0 - ISC
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the ISC license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/const Q6=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Z6=gt("activity",Q6);/**
|
|
153
|
-
* @license lucide-react v0.564.0 - ISC
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the ISC license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/const J6=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],e8=gt("arrow-down",J6);/**
|
|
158
|
-
* @license lucide-react v0.564.0 - ISC
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the ISC license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/const t8=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],n8=gt("arrow-left",t8);/**
|
|
163
|
-
* @license lucide-react v0.564.0 - ISC
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the ISC license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/const r8=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],i8=gt("bell",r8);/**
|
|
168
|
-
* @license lucide-react v0.564.0 - ISC
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the ISC license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/const a8=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],P0=gt("bot",a8);/**
|
|
173
|
-
* @license lucide-react v0.564.0 - ISC
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the ISC license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/const o8=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],s8=gt("brain",o8);/**
|
|
178
|
-
* @license lucide-react v0.564.0 - ISC
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the ISC license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/const l8=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Ip=gt("check",l8);/**
|
|
183
|
-
* @license lucide-react v0.564.0 - ISC
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the ISC license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/const c8=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],aN=gt("chevron-down",c8);/**
|
|
188
|
-
* @license lucide-react v0.564.0 - ISC
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the ISC license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/const u8=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qd=gt("chevron-right",u8);/**
|
|
193
|
-
* @license lucide-react v0.564.0 - ISC
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the ISC license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/const d8=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],f8=gt("chevron-up",d8);/**
|
|
198
|
-
* @license lucide-react v0.564.0 - ISC
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the ISC license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/const h8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],od=gt("circle-alert",h8);/**
|
|
203
|
-
* @license lucide-react v0.564.0 - ISC
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the ISC license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/const p8=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],m8=gt("download",p8);/**
|
|
208
|
-
* @license lucide-react v0.564.0 - ISC
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the ISC license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/const g8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]],oN=gt("ellipsis-vertical",g8);/**
|
|
213
|
-
* @license lucide-react v0.564.0 - ISC
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the ISC license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/const y8=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],b8=gt("ellipsis",y8);/**
|
|
218
|
-
* @license lucide-react v0.564.0 - ISC
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the ISC license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/const v8=[["path",{d:"M13.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v11.5",key:"4pqfef"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M8 12v-1",key:"1ej8lb"}],["path",{d:"M8 18v-2",key:"qcmpov"}],["path",{d:"M8 7V6",key:"1nbb54"}],["circle",{cx:"8",cy:"20",r:"2",key:"ckkr5m"}]],x8=gt("file-archive",v8);/**
|
|
223
|
-
* @license lucide-react v0.564.0 - ISC
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the ISC license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/const w8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1",key:"1oajmo"}],["path",{d:"M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",key:"mpwhp6"}]],S8=gt("file-braces",w8);/**
|
|
228
|
-
* @license lucide-react v0.564.0 - ISC
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the ISC license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/const E8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],C8=gt("file-code",E8);/**
|
|
233
|
-
* @license lucide-react v0.564.0 - ISC
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the ISC license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/const R8=[["path",{d:"M4 6.835V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-.343",key:"1vfytu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M2 19a2 2 0 0 1 4 0v1a2 2 0 0 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 0 1-4 0v-1a2 2 0 0 1 4 0",key:"1etmh7"}]],T8=gt("file-headphone",R8);/**
|
|
238
|
-
* @license lucide-react v0.564.0 - ISC
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the ISC license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/const k8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]],M8=gt("file-image",k8);/**
|
|
243
|
-
* @license lucide-react v0.564.0 - ISC
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the ISC license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/const A8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M15.033 13.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56v-4.704a.645.645 0 0 1 .967-.56z",key:"1tzo1f"}]],N8=gt("file-play",A8);/**
|
|
248
|
-
* @license lucide-react v0.564.0 - ISC
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the ISC license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/const O8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Eb=gt("file-text",O8);/**
|
|
253
|
-
* @license lucide-react v0.564.0 - ISC
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the ISC license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/const D8=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],I8=gt("file",D8);/**
|
|
258
|
-
* @license lucide-react v0.564.0 - ISC
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the ISC license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/const P8=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}],["path",{d:"M2 10h20",key:"1ir3d8"}]],L8=gt("folder-closed",P8);/**
|
|
263
|
-
* @license lucide-react v0.564.0 - ISC
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the ISC license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/const _8=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],j8=gt("folder-open",_8);/**
|
|
268
|
-
* @license lucide-react v0.564.0 - ISC
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the ISC license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/const z8=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],F8=gt("folder",z8);/**
|
|
273
|
-
* @license lucide-react v0.564.0 - ISC
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the ISC license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/const B8=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],L0=gt("globe",B8);/**
|
|
278
|
-
* @license lucide-react v0.564.0 - ISC
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the ISC license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/const H8=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],_0=gt("grip-vertical",H8);/**
|
|
283
|
-
* @license lucide-react v0.564.0 - ISC
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the ISC license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/const U8=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],q8=gt("history",U8);/**
|
|
288
|
-
* @license lucide-react v0.564.0 - ISC
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the ISC license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/const V8=[["path",{d:"M10 8h.01",key:"1r9ogq"}],["path",{d:"M12 12h.01",key:"1mp3jc"}],["path",{d:"M14 8h.01",key:"1primd"}],["path",{d:"M16 12h.01",key:"1l6xoz"}],["path",{d:"M18 8h.01",key:"emo2bl"}],["path",{d:"M6 8h.01",key:"x9i8wu"}],["path",{d:"M7 16h10",key:"wp8him"}],["path",{d:"M8 12h.01",key:"czm47f"}],["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}]],$8=gt("keyboard",V8);/**
|
|
293
|
-
* @license lucide-react v0.564.0 - ISC
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the ISC license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/const W8=[["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"M3 10a2 2 0 0 0 2 2h3",key:"1npucw"}],["path",{d:"M3 5v12a2 2 0 0 0 2 2h3",key:"x1gjn2"}]],Y8=gt("list-tree",W8);/**
|
|
298
|
-
* @license lucide-react v0.564.0 - ISC
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the ISC license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/const K8=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Gs=gt("loader-circle",K8);/**
|
|
303
|
-
* @license lucide-react v0.564.0 - ISC
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the ISC license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/const G8=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],X8=gt("menu",G8);/**
|
|
308
|
-
* @license lucide-react v0.564.0 - ISC
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the ISC license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/const Q8=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],vm=gt("monitor",Q8);/**
|
|
313
|
-
* @license lucide-react v0.564.0 - ISC
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the ISC license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/const Z8=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],J8=gt("moon",Z8);/**
|
|
318
|
-
* @license lucide-react v0.564.0 - ISC
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the ISC license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/const e9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],t9=gt("panel-left",e9);/**
|
|
323
|
-
* @license lucide-react v0.564.0 - ISC
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the ISC license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/const n9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],r9=gt("panels-top-left",n9);/**
|
|
328
|
-
* @license lucide-react v0.564.0 - ISC
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the ISC license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/const i9=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],xm=gt("pencil",i9);/**
|
|
333
|
-
* @license lucide-react v0.564.0 - ISC
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the ISC license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/const a9=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],wm=gt("plus",a9);/**
|
|
338
|
-
* @license lucide-react v0.564.0 - ISC
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the ISC license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/const o9=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],s9=gt("power-off",o9);/**
|
|
343
|
-
* @license lucide-react v0.564.0 - ISC
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the ISC license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/const l9=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],c9=gt("power",l9);/**
|
|
348
|
-
* @license lucide-react v0.564.0 - ISC
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the ISC license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/const u9=[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]],d9=gt("radar",u9);/**
|
|
353
|
-
* @license lucide-react v0.564.0 - ISC
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the ISC license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/const f9=[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]],h9=gt("refresh-ccw",f9);/**
|
|
358
|
-
* @license lucide-react v0.564.0 - ISC
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the ISC license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/const p9=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],sN=gt("rotate-cw",p9);/**
|
|
363
|
-
* @license lucide-react v0.564.0 - ISC
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the ISC license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/const m9=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],g9=gt("search",m9);/**
|
|
368
|
-
* @license lucide-react v0.564.0 - ISC
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the ISC license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/const y9=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],CT=gt("send",y9);/**
|
|
373
|
-
* @license lucide-react v0.564.0 - ISC
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the ISC license.
|
|
376
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/const b9=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],v9=gt("settings",b9);/**
|
|
378
|
-
* @license lucide-react v0.564.0 - ISC
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the ISC license.
|
|
381
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/const x9=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],lN=gt("sparkles",x9);/**
|
|
383
|
-
* @license lucide-react v0.564.0 - ISC
|
|
384
|
-
*
|
|
385
|
-
* This source code is licensed under the ISC license.
|
|
386
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
-
*/const w9=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],S9=gt("square",w9);/**
|
|
388
|
-
* @license lucide-react v0.564.0 - ISC
|
|
389
|
-
*
|
|
390
|
-
* This source code is licensed under the ISC license.
|
|
391
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
-
*/const E9=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],C9=gt("sun",E9);/**
|
|
393
|
-
* @license lucide-react v0.564.0 - ISC
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the ISC license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/const R9=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],T9=gt("terminal",R9);/**
|
|
398
|
-
* @license lucide-react v0.564.0 - ISC
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the ISC license.
|
|
401
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
-
*/const k9=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],cN=gt("trash-2",k9);/**
|
|
403
|
-
* @license lucide-react v0.564.0 - ISC
|
|
404
|
-
*
|
|
405
|
-
* This source code is licensed under the ISC license.
|
|
406
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
-
*/const M9=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],A9=gt("triangle-alert",M9);/**
|
|
408
|
-
* @license lucide-react v0.564.0 - ISC
|
|
409
|
-
*
|
|
410
|
-
* This source code is licensed under the ISC license.
|
|
411
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/const N9=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],O9=gt("wrench",N9);/**
|
|
413
|
-
* @license lucide-react v0.564.0 - ISC
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the ISC license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/const D9=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Va=gt("x",D9);/**
|
|
418
|
-
* @license lucide-react v0.564.0 - ISC
|
|
419
|
-
*
|
|
420
|
-
* This source code is licensed under the ISC license.
|
|
421
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
-
*/const I9=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],uN=gt("zap",I9);function P9({...e}){return S.jsx(rN,{"data-slot":"sheet",...e})}function L9({...e}){return S.jsx(N0,{"data-slot":"sheet-portal",...e})}function _9({className:e,...t}){return S.jsx(d0,{"data-slot":"sheet-overlay",className:Pe("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50",e),...t})}const j9="data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10";function z9({className:e,children:t,side:n="right",showCloseButton:r=!0,animation:a="slide",...o}){return S.jsxs(L9,{children:[S.jsx(_9,{}),S.jsxs(k0,{"data-slot":"sheet-content","data-side":n,className:Pe("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 fixed z-50 flex flex-col gap-4 bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",a==="slide"&&j9,a==="bottom-up"&&"data-open:slide-in-from-bottom-16 data-closed:slide-out-to-bottom-16",a==="top-down"&&"data-open:slide-in-from-top-16 data-closed:slide-out-to-top-16",e),...o,children:[t,r&&S.jsxs(fm,{"data-slot":"sheet-close",render:S.jsx(Ht,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[S.jsx(Va,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function F9({className:e,...t}){return S.jsx("div",{"data-slot":"sheet-header",className:Pe("gap-0.5 p-4 flex flex-col",e),...t})}function B9({className:e,...t}){return S.jsx(I0,{"data-slot":"sheet-title",className:Pe("text-foreground text-base font-medium",e),...t})}function H9({className:e,...t}){return S.jsx(f0,{"data-slot":"sheet-description",className:Pe("text-muted-foreground text-sm",e),...t})}const dN=v.createContext(void 0);function Zd(e){const t=v.useContext(dN);if(t===void 0&&!e)throw new Error(Cn(72));return t}const U9={...E0,disabled:Ge(e=>e.disabled),instantType:Ge(e=>e.instantType),isInstantPhase:Ge(e=>e.isInstantPhase),trackCursorAxis:Ge(e=>e.trackCursorAxis),disableHoverablePopup:Ge(e=>e.disableHoverablePopup),lastOpenChangeReason:Ge(e=>e.openChangeReason),closeDelay:Ge(e=>e.closeDelay),hasViewport:Ge(e=>e.hasViewport)};class j0 extends gm{constructor(n){super({...q9(),...n},{popupRef:v.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new Yd},U9);at(this,"setOpen",(n,r)=>{var d,m;const a=r.reason,o=a===vr,l=n&&a===Jl,c=!n&&(a===Ws||a===dm);if(r.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(m=(d=this.context).onOpenChange)==null||m.call(d,n,r),r.isCanceled)return;const f=()=>{var g;const h={open:n,openChangeReason:a};l?h.instantType="focus":c?h.instantType="dismiss":a===vr&&(h.instantType=void 0);const y=((g=r.trigger)==null?void 0:g.id)??null;(y||n)&&(h.activeTriggerId=y,h.activeTriggerElement=r.trigger??null),this.update(h)};o?pr.flushSync(f):f()})}static useStore(n,r){const a=nr(()=>new j0(r)).current,o=n??a,l=C0({popupStore:o,onOpenChange:o.setOpen});return o.state.floatingRootContext=l,o}}function q9(){return{...S0(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const V9=b0(function(t){const{disabled:n=!1,defaultOpen:r=!1,open:a,disableHoverablePopup:o=!1,trackCursorAxis:l="none",actionsRef:c,onOpenChange:f,onOpenChangeComplete:d,handle:m,triggerId:h,defaultTriggerId:y=null,children:g}=t,w=j0.useStore(m==null?void 0:m.store,{open:r,openProp:a,activeTriggerId:y,triggerIdProp:h});bm(()=>{a===void 0&&w.state.open===!1&&r===!0&&w.update({open:!0,activeTriggerId:y})}),w.useControlledProp("openProp",a),w.useControlledProp("triggerIdProp",h),w.useContextCallback("onOpenChange",f),w.useContextCallback("onOpenChangeComplete",d);const C=w.useState("open"),R=!n&&C,E=w.useState("activeTriggerId"),T=w.useState("payload");w.useSyncedValues({trackCursorAxis:l,disableHoverablePopup:o}),qe(()=>{C&&n&&w.setOpen(!1,xt(EH))},[C,n,w]),w.useSyncedValue("disabled",n),x0(w);const{forceUnmount:k,transitionStatus:M}=w0(R,w),D=w.useState("isInstantPhase"),A=w.useState("instantType"),N=w.useState("lastOpenChangeReason"),L=v.useRef(null);qe(()=>{M==="ending"&&N===Fi||M!=="ending"&&D?(A!=="delay"&&(L.current=A),w.set("instantType","delay")):L.current!==null&&(w.set("instantType",L.current),L.current=null)},[M,D,N,A,w]),qe(()=>{R&&E==null&&w.set("payload",void 0)},[w,E,R]);const q=v.useCallback(()=>{w.setOpen(!1,$9(w,c0))},[w]);v.useImperativeHandle(c,()=>({unmount:k,close:q}),[k,q]);const F=w.useState("floatingRootContext"),Y=mm(F,{enabled:!n,referencePress:!0}),_=KH(F,{enabled:!n&&l!=="none",axis:l==="none"?void 0:l}),{getReferenceProps:V,getFloatingProps:$,getTriggerProps:B}=Kd([Y,_]),j=v.useMemo(()=>V(),[V]),z=v.useMemo(()=>B(),[B]),H=v.useMemo(()=>$(),[$]);return w.useSyncedValues({activeTriggerProps:j,inactiveTriggerProps:z,popupProps:H}),S.jsx(dN.Provider,{value:w,children:typeof g=="function"?g({payload:T}):g})});function $9(e,t){const n=xt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const W9=v.createContext(void 0);function Y9(){return v.useContext(W9)}let K9=(function(e){return e[e.popupOpen=Np.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const G9=600,X9=FA(function(t,n){const{className:r,render:a,handle:o,payload:l,disabled:c,delay:f,closeDelay:d,id:m,...h}=t,y=Zd(!0),g=(o==null?void 0:o.store)??y;if(!g)throw new Error(Cn(82));const w=Vi(m),C=g.useState("isTriggerActive",w),R=g.useState("isOpenedByTrigger",w),E=g.useState("floatingRootContext"),T=v.useRef(null),k=f??G9,M=d??0,{registerTrigger:D,isMountedByThisTrigger:A}=HA(w,T,g,{payload:l,closeDelay:M}),N=Y9(),{delayRef:L,isInstantPhase:q,hasProvider:F}=zH(E,{open:R});g.useSyncedValue("isInstantPhase",q);const Y=g.useState("disabled"),_=c??Y,V=g.useState("trackCursorAxis"),$=g.useState("disableHoverablePopup"),B=WA(E,{enabled:!_,mouseOnly:!0,move:!1,handleClose:!$&&V!=="both"?XA():null,restMs(){const P=N==null?void 0:N.delay,U=typeof L.current=="object"?L.current.open:void 0;let G=k;return F&&(U!==0?G=f??P??k:G=0),G},delay(){const P=typeof L.current=="object"?L.current.close:void 0;let U=M;return d==null&&F&&(U=P),{close:U}},triggerElementRef:T,isActiveTrigger:C}),j=qA(E,{enabled:!_}).reference,z={open:R},H=g.useState("triggerProps",A);return It("button",t,{state:z,ref:[n,D,T],props:[B,j,H,{id:w,[K9.triggerDisabled]:_?"":void 0},h],stateAttributesMapping:yA})}),fN=v.createContext(void 0);function Q9(){const e=v.useContext(fN);if(e===void 0)throw new Error(Cn(70));return e}const Z9=v.forwardRef(function(t,n){const{children:r,container:a,className:o,render:l,...c}=t,{portalNode:f,portalSubtree:d}=kA({container:a,ref:n,componentProps:t,elementProps:c});return!d&&!f?null:S.jsxs(v.Fragment,{children:[d,f&&pr.createPortal(r,f)]})}),J9=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t;return Zd().useState("mounted")||r?S.jsx(fN.Provider,{value:r,children:S.jsx(Z9,{ref:n,...a})}):null}),hN=v.createContext(void 0);function pN(){const e=v.useContext(hN);if(e===void 0)throw new Error(Cn(71));return e}const eq=v.createContext(void 0);function Lc(){const e=v.useContext(eq);return(e==null?void 0:e.direction)??"ltr"}const tq=e=>({name:"arrow",options:e,async fn(t){var K,P;const{x:n,y:r,placement:a,rects:o,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:m=0,offsetParent:h="real"}=qa(e,t)||{};if(d==null)return{};const y=J2(m),g={x:n,y:r},w=o0(a),C=a0(w),R=await l.getDimensions(d),E=w==="y",T=E?"top":"left",k=E?"bottom":"right",M=E?"clientHeight":"clientWidth",D=o.reference[C]+o.reference[w]-g[w]-o.floating[C],A=g[w]-o.reference[w],N=h==="real"?await((K=l.getOffsetParent)==null?void 0:K.call(l,d)):c.floating;let L=c.floating[M]||o.floating[C];(!L||!await((P=l.isElement)==null?void 0:P.call(l,N)))&&(L=c.floating[M]||o.floating[C]);const q=D/2-A/2,F=L/2-R[C]/2-1,Y=Math.min(y[T],F),_=Math.min(y[k],F),V=Y,$=L-R[C]-_,B=L/2-R[C]/2+q,j=zv(V,B,$),z=!f.arrow&&Go(a)!=null&&B!==j&&o.reference[C]/2-(B<V?Y:_)-R[C]/2<0,H=z?B<V?B-V:B-$:0;return{[w]:g[w]+H,data:{[w]:j,centerOffset:B-j-H,...z&&{alignmentOffset:H}},reset:z}}}),nq=(e,t)=>({...tq(e),options:[e,t]}),rq={name:"hide",async fn(e){var c;const{width:t,height:n,x:r,y:a}=e.rects.reference,o=t===0&&n===0&&r===0&&a===0;return{data:{referenceHidden:((c=(await LU().fn(e)).data)==null?void 0:c.referenceHidden)||o}}}},sp={sideX:"left",sideY:"top"},iq={name:"adaptiveOrigin",async fn(e){var T,k;const{x:t,y:n,rects:{floating:r},elements:{floating:a},platform:o,strategy:l,placement:c}=e,f=Hn(a),d=f.getComputedStyle(a);if(!(d.transitionDuration!=="0s"&&d.transitionDuration!==""))return{x:t,y:n,data:sp};const h=await((T=o.getOffsetParent)==null?void 0:T.call(o,a));let y={width:0,height:0};if(l==="fixed"&&(f!=null&&f.visualViewport))y={width:f.visualViewport.width,height:f.visualViewport.height};else if(h===f){const M=Qt(a);y={width:M.documentElement.clientWidth,height:M.documentElement.clientHeight}}else await((k=o.isElement)==null?void 0:k.call(o,h))&&(y=await o.getDimensions(h));const g=Hr(c);let w=t,C=n;g==="left"&&(w=y.width-(t+r.width)),g==="top"&&(C=y.height-(n+r.height));const R=g==="left"?"right":sp.sideX,E=g==="top"?"bottom":sp.sideY;return{x:w,y:C,data:{sideX:R,sideY:E}}}};function mN(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function RT(e,t,n){const{rects:r,placement:a}=e;return{side:mN(t,Hr(a),n),align:Go(a)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function z0(e){var Rt,zt;const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:l=0,collisionBoundary:c,collisionPadding:f=5,sticky:d=!1,arrowPadding:m=5,disableAnchorTracking:h=!1,keepMounted:y=!1,floatingRootContext:g,mounted:w,collisionAvoidance:C,shiftCrossAxis:R=!1,nodeId:E,adaptiveOrigin:T,lazyFlip:k=!1,externalTree:M}=e,[D,A]=v.useState(null);!w&&D!==null&&A(null);const N=C.side||"flip",L=C.align||"flip",q=C.fallbackAxisSide||"end",F=typeof t=="function"?t:void 0,Y=We(F),_=F?Y:t,V=sr(t),B=Lc()==="rtl",j=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[r],z=o==="center"?j:`${j}-${o}`;let H=f;const K=1,P=r==="bottom"?K:0,U=r==="top"?K:0,G=r==="right"?K:0,I=r==="left"?K:0;typeof H=="number"?H={top:H+P,right:H+I,bottom:H+U,left:H+G}:H&&(H={top:(H.top||0)+P,right:(H.right||0)+I,bottom:(H.bottom||0)+U,left:(H.left||0)+G});const Q={boundary:c==="clipping-ancestors"?"clippingAncestors":c,padding:H},le=v.useRef(null),ae=sr(a),Z=sr(l),Se=[NU(yt=>{const Nt=RT(yt,r,B),it=typeof ae.current=="function"?ae.current(Nt):ae.current,ft=typeof Z.current=="function"?Z.current(Nt):Z.current;return{mainAxis:it,crossAxis:ft,alignmentAxis:ft}},[typeof a!="function"?a:0,typeof l!="function"?l:0,B,r])],Le=L==="none"&&N!=="shift",te=!Le&&(d||R||N==="shift"),he=N==="none"?null:IU({...Q,padding:{top:H.top+K,right:H.right+K,bottom:H.bottom+K,left:H.left+K},mainAxis:!R&&N==="flip",crossAxis:L==="flip"?"alignment":!1,fallbackAxisSideDirection:q}),ye=Le?null:OU(yt=>{const Nt=Qt(yt.elements.floating).documentElement;return{...Q,rootBoundary:R?{x:0,y:0,width:Nt.clientWidth,height:Nt.clientHeight}:void 0,mainAxis:L!=="none",crossAxis:te,limiter:d||R?void 0:DU(it=>{if(!le.current)return{};const{width:ft,height:bt}=le.current.getBoundingClientRect(),Ke=wi(Hr(it.placement)),kt=Ke==="y"?ft:bt,_t=Ke==="y"?H.left+H.right:H.top+H.bottom;return{offset:kt/2+_t/2}})}},[Q,d,R,H,L]);N==="shift"||L==="shift"||o==="center"?Se.push(ye,he):Se.push(he,ye),Se.push(PU({...Q,apply({elements:{floating:yt},rects:{reference:Nt},availableWidth:it,availableHeight:ft}){const bt=yt.style;bt.setProperty("--available-width",`${it}px`),bt.setProperty("--available-height",`${ft}px`),bt.setProperty("--anchor-width",`${Nt.width}px`),bt.setProperty("--anchor-height",`${Nt.height}px`)}}),nq(()=>({element:le.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(yt){var Xe,ot,Et;const{elements:Nt,middlewareData:it,placement:ft,rects:bt,y:Ke}=yt,kt=Hr(ft),_t=wi(kt),Tt=le.current,dn=((Xe=it.arrow)==null?void 0:Xe.x)||0,Ut=((ot=it.arrow)==null?void 0:ot.y)||0,Je=(Tt==null?void 0:Tt.clientWidth)||0,Mt=(Tt==null?void 0:Tt.clientHeight)||0,X=dn+Je/2,ie=Ut+Mt/2,de=Math.abs(((Et=it.shift)==null?void 0:Et.y)||0),ke=bt.reference.height/2,je=typeof a=="function"?a(RT(yt,r,B)):a,rt=de>je,nt={top:`${X}px calc(100% + ${je}px)`,bottom:`${X}px ${-je}px`,left:`calc(100% + ${je}px) ${ie}px`,right:`${-je}px ${ie}px`}[kt],Ye=`${X}px ${bt.reference.y+ke-Ke}px`;return Nt.floating.style.setProperty("--transform-origin",te&&_t==="y"&&rt?Ye:nt),{}}},rq,T),qe(()=>{!w&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,g]);const _e=v.useMemo(()=>({elementResize:!h&&typeof ResizeObserver<"u",layoutShift:!h&&typeof IntersectionObserver<"u"}),[h]),{refs:Ae,elements:Ce,x:Te,y:J,middlewareData:Ee,update:xe,placement:Be,context:Ve,isPositioned:De,floatingStyles:ut}=h6({rootContext:g,placement:z,middleware:Se,strategy:n,whileElementsMounted:y?void 0:(...yt)=>cT(...yt,_e),nodeId:E,externalTree:M}),{sideX:pe,sideY:Re}=Ee.adaptiveOrigin||sp,ee=De?n:"fixed",fe=v.useMemo(()=>{const yt=T?{position:ee,[pe]:Te,[Re]:J}:{position:ee,...ut};return De||(yt.opacity=0),yt},[T,ee,pe,Te,Re,J,ut,De]),Ne=v.useRef(null);qe(()=>{if(!w)return;const yt=V.current,Nt=typeof yt=="function"?yt():yt,ft=(TT(Nt)?Nt.current:Nt)||null||null;ft!==Ne.current&&(Ae.setPositionReference(ft),Ne.current=ft)},[w,Ae,_,V]),v.useEffect(()=>{if(!w)return;const yt=V.current;typeof yt!="function"&&TT(yt)&&yt.current!==Ne.current&&(Ae.setPositionReference(yt.current),Ne.current=yt.current)},[w,Ae,_,V]),v.useEffect(()=>{if(y&&w&&Ce.domReference&&Ce.floating)return cT(Ce.domReference,Ce.floating,xe,_e)},[y,w,Ce,xe,_e]);const He=Hr(Be),$e=mN(r,He,B),et=Go(Be)||"center",ze=!!((Rt=Ee.hide)!=null&&Rt.referenceHidden);qe(()=>{k&&w&&De&&A(He)},[k,w,De,He]);const Ze=v.useMemo(()=>{var yt,Nt;return{position:"absolute",top:(yt=Ee.arrow)==null?void 0:yt.y,left:(Nt=Ee.arrow)==null?void 0:Nt.x}},[Ee.arrow]),tt=((zt=Ee.arrow)==null?void 0:zt.centerOffset)!==0;return v.useMemo(()=>({positionerStyles:fe,arrowStyles:Ze,arrowRef:le,arrowUncentered:tt,side:$e,align:et,physicalSide:He,anchorHidden:ze,refs:Ae,context:Ve,isPositioned:De,update:xe}),[fe,Ze,le,tt,$e,et,He,ze,Ae,Ve,De,xe])}function TT(e){return e!=null&&"current"in e}function _c(e){return e==="starting"?gF:In}const aq=v.forwardRef(function(t,n){const{render:r,className:a,anchor:o,positionMethod:l="absolute",side:c="top",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:R=R2,...E}=t,T=Zd(),k=Q9(),M=T.useState("open"),D=T.useState("mounted"),A=T.useState("trackCursorAxis"),N=T.useState("disableHoverablePopup"),L=T.useState("floatingRootContext"),q=T.useState("instantType"),F=T.useState("transitionStatus"),Y=T.useState("hasViewport"),_=z0({anchor:o,positionMethod:l,floatingRootContext:L,mounted:D,side:c,sideOffset:d,align:f,alignOffset:m,collisionBoundary:h,collisionPadding:y,sticky:w,arrowPadding:g,disableAnchorTracking:C,keepMounted:k,collisionAvoidance:R,adaptiveOrigin:Y?iq:void 0}),V=v.useMemo(()=>{const z={};return(!M||A==="both"||N)&&(z.pointerEvents="none"),{role:"presentation",hidden:!D,style:{..._.positionerStyles,...z}}},[M,A,N,D,_.positionerStyles]),$=v.useMemo(()=>({open:M,side:_.side,align:_.align,anchorHidden:_.anchorHidden,instant:A!=="none"?"tracking-cursor":q}),[M,_.side,_.align,_.anchorHidden,A,q]),B=v.useMemo(()=>({...$,arrowRef:_.arrowRef,arrowStyles:_.arrowStyles,arrowUncentered:_.arrowUncentered}),[$,_.arrowRef,_.arrowStyles,_.arrowUncentered]),j=It("div",t,{state:$,props:[V,_c(F),E],ref:[n,T.useStateSetter("positionerElement")],stateAttributesMapping:ua});return S.jsx(hN.Provider,{value:B,children:j})}),oq={...ua,...Wa},sq=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,l=Zd(),{side:c,align:f}=pN(),d=l.useState("open"),m=l.useState("instantType"),h=l.useState("transitionStatus"),y=l.useState("popupProps"),g=l.useState("floatingRootContext");Ya({open:d,ref:l.context.popupRef,onComplete(){var T,k;d&&((k=(T=l.context).onOpenChangeComplete)==null||k.call(T,!0))}});const w=l.useState("disabled"),C=l.useState("closeDelay");return $A(g,{enabled:!w,closeDelay:C}),It("div",t,{state:{open:d,side:c,align:f,instant:m,transitionStatus:h},ref:[n,l.context.popupRef,l.useStateSetter("popupElement")],props:[y,_c(h),o],stateAttributesMapping:oq})}),lq=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,c=Zd().useState("instantType"),{open:f,arrowRef:d,side:m,align:h,arrowUncentered:y,arrowStyles:g}=pN();return It("div",t,{state:{open:f,side:m,align:h,uncentered:y,instant:c},ref:[n,d],props:[{style:g,"aria-hidden":!0},o],stateAttributesMapping:ua})});function cq({...e}){return S.jsx(V9,{"data-slot":"tooltip",...e})}function uq({...e}){return S.jsx(X9,{"data-slot":"tooltip-trigger",...e})}function dq({className:e,side:t="top",sideOffset:n=4,align:r="center",alignOffset:a=0,children:o,...l}){return S.jsx(J9,{children:S.jsx(aq,{align:r,alignOffset:a,side:t,sideOffset:n,className:"isolate z-50",children:S.jsxs(sq,{"data-slot":"tooltip-content",className:Pe("data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 rounded-md px-3 py-1.5 text-xs data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-foreground text-background z-50 w-fit max-w-xs origin-(--transform-origin)",e),...l,children:[o,S.jsx(lq,{className:"size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 bg-foreground fill-foreground z-50 data-[side=bottom]:top-1 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const fq="sidebar_state",hq=3600*24*7,Cb="100vw",pq="3rem",mq="b",Fu=320,Pp=320,gq=450,Rb="tmex_sidebar_width";function yq(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(Pp,e-gq)}function Fh(e){return Math.min(yq(),Math.max(Pp,Math.round(e)))}const gN=v.createContext(null);function Ur(){const e=v.useContext(gN);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function bq({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:a,children:o,...l}){const c=EF(),[f,d]=v.useState(!1),m=v.useRef(Fu),[h,y]=v.useState(()=>{if(typeof window>"u")return Fu;const L=Number(window.localStorage.getItem(Rb)),q=Number.isFinite(L)&&L>0?Math.max(Pp,Math.round(L)):Fu;return m.current=q,Fh(q)}),[g,w]=v.useState(!1),C=v.useCallback(L=>{const q=Math.max(Pp,Math.round(L));m.current=q,y(Fh(L)),window.localStorage.setItem(Rb,String(q))},[]),R=v.useCallback(()=>{m.current=Fu,y(Fh(Fu)),window.localStorage.removeItem(Rb)},[]);v.useEffect(()=>{const L=()=>{y(Fh(m.current))};return window.addEventListener("resize",L),()=>window.removeEventListener("resize",L)},[]);const[E,T]=v.useState(e),k=t??E,M=v.useCallback(L=>{const q=typeof L=="function"?L(k):L;n?n(q):T(q),document.cookie=`${fq}=${q}; path=/; max-age=${hq}`},[n,k]),D=v.useCallback(()=>c?d(L=>!L):M(L=>!L),[c,M,d]);v.useEffect(()=>{const L=q=>{q.defaultPrevented||q.target instanceof HTMLElement&&q.target.closest(".xterm")||q.key===mq&&(q.metaKey||q.ctrlKey)&&(q.preventDefault(),D())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[D]);const A=k?"expanded":"collapsed",N=v.useMemo(()=>({state:A,open:k,setOpen:M,isMobile:c,openMobile:f,setOpenMobile:d,toggleSidebar:D,width:h,setWidth:C,resetWidth:R,isResizing:g,setIsResizing:w}),[A,k,M,c,f,d,D,h,C,R,g]);return S.jsx(gN.Provider,{value:N,children:S.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${h}px`,"--sidebar-width-icon":pq,...a},className:Pe("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",r),...l,children:o})})}function vq({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:a,dir:o,...l}){const{isMobile:c,state:f,openMobile:d,setOpenMobile:m,isResizing:h}=Ur();return n==="none"?S.jsx("div",{"data-slot":"sidebar",className:Pe("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",r),...l,children:a}):c?S.jsx(P9,{open:d,onOpenChange:m,...l,children:S.jsxs(z9,{dir:o,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true","data-testid":"mobile-sidebar-sheet",className:"bg-sidebar text-sidebar-foreground p-0 [&>button]:hidden border-none",style:{"--sidebar-width":Cb,width:Cb,maxWidth:Cb},side:e,animation:"top-down",children:[S.jsxs(F9,{className:"sr-only",children:[S.jsx(B9,{children:"Sidebar"}),S.jsx(H9,{children:"Displays the mobile sidebar."})]}),S.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a})]})}):S.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":f,"data-collapsible":f==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[S.jsx("div",{"data-slot":"sidebar-gap",className:Pe(!h&&"transition-[width] duration-200 ease-linear","relative w-(--sidebar-width) bg-transparent","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),S.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:Pe(!h&&"transition-[left,right,width] duration-200 ease-linear","fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...l,children:[S.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner","data-testid":"sidebar",className:"bg-sidebar group-data-[variant=floating]:ring-sidebar-border group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 flex size-full flex-col",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:a}),f==="expanded"&&S.jsx(xq,{side:e})]})]})}function xq({side:e}){const{width:t,setWidth:n,resetWidth:r,setIsResizing:a}=Ur(),o=v.useRef(null);return S.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:Pe("absolute inset-y-0 z-30 w-2 cursor-col-resize touch-none select-none","after:absolute after:inset-y-0 after:w-[2px] after:bg-transparent hover:after:bg-sidebar-border active:after:bg-sidebar-border",e==="left"?"-right-1 after:right-[3px]":"-left-1 after:left-[3px]"),onPointerDown:l=>{l.preventDefault(),o.current={pointerId:l.pointerId,startX:l.clientX,startWidth:t},l.currentTarget.setPointerCapture(l.pointerId),a(!0)},onPointerMove:l=>{const c=o.current;if(!c||c.pointerId!==l.pointerId)return;const f=l.clientX-c.startX;n(c.startWidth+(e==="left"?f:-f))},onPointerUp:l=>{var c;((c=o.current)==null?void 0:c.pointerId)===l.pointerId&&(o.current=null,a(!1))},onPointerCancel:l=>{var c;((c=o.current)==null?void 0:c.pointerId)===l.pointerId&&(o.current=null,a(!1))},onDoubleClick:r})}function wq({className:e,onClick:t,...n}){const{toggleSidebar:r,isMobile:a}=Ur();return S.jsxs(Ht,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Pe(e),onClick:o=>{t==null||t(o),r()},...n,children:[a?S.jsx(X8,{}):S.jsx(t9,{}),S.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Sq({className:e,...t}){return S.jsx("main",{"data-slot":"sidebar-inset",className:Pe("bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2 relative flex w-full flex-1 flex-col",e),...t})}function Eq({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Pe("gap-2 p-2 flex flex-col",e),...t})}function Cq({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Pe("gap-2 p-2 flex flex-col",e),...t})}function Rq({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Pe("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function F0({className:e,...t}){return S.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Pe("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function Tq({className:e,...t}){return S.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Pe("gap-0 flex w-full min-w-0 flex-col",e),...t})}function kq({className:e,...t}){return S.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Pe("group/menu-item relative",e),...t})}const Mq=em("ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground gap-2 rounded-md p-2 text-left text-sm transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 data-active:font-medium peer/menu-button flex w-full items-center overflow-hidden outline-hidden group/menu-button disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Aq({render:e,isActive:t=!1,variant:n="default",size:r="default",tooltip:a,className:o,...l}){const{isMobile:c,state:f}=Ur(),d=Jp({defaultTagName:"button",props:Ri({className:Pe(Mq({variant:n,size:r}),o)},l),render:a?uq:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:r,active:t}});return a?(typeof a=="string"&&(a={children:a}),S.jsxs(cq,{children:[d,S.jsx(dq,{side:"right",align:"center",hidden:f!=="collapsed"||c,...a})]})):d}function Nq({className:e,render:t,showOnHover:n=!1,...r}){return Jp({defaultTagName:"button",props:Ri({className:Pe("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 aspect-square w-5 rounded-md p-0 peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 focus-visible:ring-2 [&>svg]:size-4 flex items-center justify-center outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 md:after:hidden [&>svg]:shrink-0",n&&"peer-data-active/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 aria-expanded:opacity-100 md:opacity-0",e)},r),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function Oq({className:e,...t}){return S.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Pe("border-sidebar-border mx-3.5 translate-x-px gap-1 border-l px-2.5 py-0.5 group-data-[collapsible=icon]:hidden flex min-w-0 flex-col",e),...t})}function Dq({className:e,...t}){return S.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Pe("group/menu-sub-item relative",e),...t})}function Iq({render:e,size:t="md",isActive:n=!1,className:r,...a}){return Jp({defaultTagName:"a",props:Ri({className:Pe("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground h-7 gap-2 rounded-md px-2 focus-visible:ring-2 data-[size=md]:text-sm data-[size=sm]:text-xs [&>svg]:size-4 flex min-w-0 -translate-x-px items-center overflow-hidden outline-hidden group-data-[collapsible=icon]:hidden disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:shrink-0",r)},a),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}let lp=null;function kT(e){lp=e}function Pq(e,t){lp==null||lp(e,t)}let Qu=null;function MT(e){Qu=e}function Lq(){Qu!=null&&Qu.isMobile&&Qu.setOpenMobile(!0)}function _q(){const e=Hd(),{isMobile:t,setOpenMobile:n}=Ur();return v.useEffect(()=>(kT((r,a)=>e(r,a??{})),()=>kT(null)),[e]),v.useEffect(()=>(MT({isMobile:t,setOpenMobile:n}),()=>MT(null)),[t,n]),null}const jq={background:"#e1e1e1",foreground:"#616161",cursor:"#616161",selectionBackground:"rgba(97, 97, 97, 0.25)",black:"#171717",red:"#bf2172",green:"#009799",yellow:"#9a7200",blue:"#007299",magenta:"#9b1d72",cyan:"#007173",white:"#d9d9d9",brightBlack:"#4e4e4e",brightRed:"#e12672",brightGreen:"#00bddf",brightYellow:"#ffdd00",brightBlue:"#7299bc",brightMagenta:"#e17899",brightCyan:"#6fbcbd",brightWhite:"#f1f1f1"},zq={background:"#262626",foreground:"#d0d0d0",cursor:"#c5c5c5",selectionBackground:"rgba(197, 197, 197, 0.25)",black:"#000000",red:"#ba3c3c",green:"#5d876d",yellow:"#d5a54e",blue:"#887c8d",magenta:"#cd6d6d",cyan:"#618484",white:"#cfcdc3",brightBlack:"#000000",brightRed:"#ea7171",brightGreen:"#7aab7a",brightYellow:"#d1d194",brightBlue:"#afa3b5",brightMagenta:"#e29f9f",brightCyan:"#a0aea3",brightWhite:"#d0d0d0"};function Fq(e){const t=e==="light"?jq:zq;return`fg=${t.foreground},bg=${t.background}`}const yN=["GeistMonoTmex","NotoSansSymbols2Tmex"],_te=`${yN.join(", ")}, monospace`;let Bl=null;function jte(){var t;if(Bl)return Bl;const e=(t=globalThis.document)==null?void 0:t.fonts;return e!=null&&e.load?(Bl=Promise.all(yN.flatMap(n=>[e.load(`13px ${n}`),e.load(`bold 13px ${n}`)])).then(()=>{}).catch(()=>{}),Bl):(Bl=Promise.resolve(),Bl)}const Bq=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,Hq={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:15e3};class Uq{constructor(t={}){at(this,"ws",null);at(this,"options");at(this,"state","IDLE");at(this,"seq",0);at(this,"chunkReassembler",new ez);at(this,"reconnectAttempts",0);at(this,"reconnectTimer",null);at(this,"heartbeatTimer",null);at(this,"messageHandlers",new Set);at(this,"stateChangeHandlers",new Set);at(this,"errorHandlers",new Set);at(this,"pendingMessages",[]);at(this,"maxPendingMessages",100);this.options={...Hq,...t}}setState(t){if(this.state!==t){console.log(`[borsh-client] State: ${this.state} -> ${t}`),this.state=t;for(const n of this.stateChangeHandlers)try{n(t)}catch(r){console.error("[borsh-client] State change handler error:",r)}t==="READY"&&this.flushPendingMessages()}}getState(){return this.state}isReady(){return this.state==="READY"}onMessage(t){return this.messageHandlers.add(t),()=>this.messageHandlers.delete(t)}onStateChange(t){return this.stateChangeHandlers.add(t),()=>this.stateChangeHandlers.delete(t)}onError(t){return this.errorHandlers.add(t),()=>this.errorHandlers.delete(t)}connect(){var t,n;if(!(((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN||((n=this.ws)==null?void 0:n.readyState)===WebSocket.CONNECTING)){this.setState("WS_CONNECTING");try{this.ws=new WebSocket(Bq),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=r=>{this.handleMessage(r.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(r){this.handleError(r instanceof Error?r:new Error(String(r)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.ws&&(this.ws.close(),this.ws=null)}handleMessage(t){if(typeof t=="string")return;const n=new Uint8Array(t);if(!Zj(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const r=Gj(n);if(r.kind===T_){const a=Qj(r.payload),o=this.chunkReassembler.addChunk(a);o&&this.dispatchMessage({kind:o.kind,seq:o.seq,payload:o.payload});return}if(r.kind===ZL){this.handleHelloS2C(r.payload);return}if(r.kind===e_)return;this.dispatchMessage({kind:r.kind,seq:r.seq,payload:r.payload})}catch(r){console.error("[borsh-client] Failed to decode message:",r)}}dispatchMessage(t){for(const n of this.messageHandlers)try{n(t)}catch(r){console.error("[borsh-client] Message handler error:",r)}}handleHelloS2C(t){try{const n=_a(oj,t);console.log("[borsh-client] HELLO_S2C received:",n),this.setState("READY"),this.startHeartbeat(),this.reconnectAttempts=0}catch(n){console.error("[borsh-client] Failed to decode HELLO_S2C:",n),this.handleError(new Error("HELLO negotiation failed"))}}handleClose(){this.stopHeartbeat(),this.state!=="CLOSED"&&(this.reconnectAttempts<this.options.maxReconnectAttempts?this.scheduleReconnect():(this.setState("CLOSED"),this.handleError(new Error("Max reconnection attempts reached"))))}handleError(t){console.error("[borsh-client] Error:",t);for(const n of this.errorHandlers)try{n(t)}catch(r){console.error("[borsh-client] Error handler error:",r)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},n=tr(aj,t),r=this.nextSeq(),a=Zh(QL,n,r);this.sendRaw(a),this.setState("HELLO_NEGOTIATING")}send(t,n){if(!this.isReady())return this.pendingMessages.length<this.maxPendingMessages&&this.pendingMessages.push({kind:t,payload:n}),!1;const r=this.nextSeq(),a=tz(n,t,r,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:nz()});if(a.totalChunks===0){const o=Zh(t,n,r);this.sendRaw(o)}else for(const o of a.chunks){const l=Xj(o,this.nextSeq());this.sendRaw(l)}return!0}sendRaw(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(t)}flushPendingMessages(){for(;this.pendingMessages.length>0;){const t=this.pendingMessages.shift();t&&this.send(t.kind,t.payload)}}startHeartbeat(){this.stopHeartbeat(),this.heartbeatTimer=setInterval(()=>{this.sendPing()},this.options.heartbeatIntervalMs)}stopHeartbeat(){this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null)}sendPing(){if(!this.isReady())return;const t={nonce:Math.floor(Math.random()*4294967295),timeMs:BigInt(Date.now())},n=tr(sj,t),r=this.nextSeq(),a=Zh(JL,n,r);this.sendRaw(a)}scheduleReconnect(){if(this.reconnectTimer)return;this.reconnectAttempts++,this.setState("RECONNECT_BACKOFF");const t=Math.min(this.options.reconnectDelayMs*2**(this.reconnectAttempts-1),3e4);console.log(`[borsh-client] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},t)}clearTimers(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.stopHeartbeat()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let Tb=null;function Dn(){return Tb||(Tb=new Uq),Tb}class qq{constructor(t={}){at(this,"transactions",new Map);at(this,"outputGates",new Map);at(this,"deferredResets",new Set);at(this,"deferredHistories",new Map);at(this,"deferredFlushes",new Map);at(this,"deferredOutputs",new Map);at(this,"callbacks");at(this,"ackTimeoutMs",1500);at(this,"liveResumeTimeoutMs",2e3);at(this,"timers",new Map);this.callbacks=t}setCallbacks(t){this.callbacks=t;for(const n of this.transactions.keys())this.replayDeferred(n);for(const n of this.deferredResets)this.replayDeferred(n);for(const n of this.deferredHistories.keys())this.replayDeferred(n);for(const n of this.deferredFlushes.keys())this.replayDeferred(n);for(const n of this.deferredOutputs.keys())this.replayDeferred(n)}getTransaction(t){return this.transactions.get(t)}getState(t){var n;return((n=this.transactions.get(t))==null?void 0:n.state)??"STABLE"}isStable(t){return this.getState(t)==="STABLE"}isBuffering(t){var n;return((n=this.outputGates.get(t))==null?void 0:n.state)==="BUFFERING"}dispatch(t){switch(t.type){case"SELECT_START":this.handleSelectStart(t);break;case"SWITCH_ACK":this.handleSwitchAck(t);break;case"HISTORY":this.handleHistory(t);break;case"LIVE_RESUME":this.handleLiveResume(t);break;case"OUTPUT":this.handleOutput(t);break;case"SELECT_FAILED":this.handleSelectFailed(t);break}}handleSelectStart(t){const{deviceId:n,windowId:r,paneId:a,selectToken:o,wantHistory:l}=t;this.cancelTransaction(n),this.clearDeferred(n);const c={state:"SELECTING",deviceId:n,windowId:r,paneId:a,selectToken:new Uint8Array(o),wantHistory:l,startedAt:Date.now()};this.transactions.set(n,c),this.startOutputBuffering(n),this.setTimer(n,()=>{this.handleTimeout(n,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);!a||!this.validateToken(a.selectToken,r)||a.state==="SELECTING"&&(this.clearTimer(n),a.state="ACKED",this.callbacks.onResetTerminal?this.callbacks.onResetTerminal(n):this.deferredResets.add(n),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleHistory(t){const{deviceId:n,selectToken:r,data:a}=t,o=this.transactions.get(n);!o||!this.validateToken(o.selectToken,r)||o.state==="ACKED"&&(o.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(n,a,t.alternateScreen):this.deferredHistories.set(n,{data:a,alternateScreen:t.alternateScreen}),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:n,selectToken:r}=t,a=this.transactions.get(n);if(!a||!this.validateToken(a.selectToken,r)||a.state!=="ACKED"&&a.state!=="HISTORY_APPLIED")return;this.clearTimer(n),a.state="LIVE";const o=this.stopOutputBuffering(n);this.completeTransaction(n),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(n,o):o.length>0&&this.deferredFlushes.set(n,o),this.replayDeferred(n)}handleOutput(t){const{deviceId:n,paneId:r,data:a}=t,o=this.transactions.get(n);if(o&&o.paneId!==r)return;if(this.isBuffering(n)){this.bufferOutput(n,a);return}if(this.callbacks.onOutput){this.callbacks.onOutput(n,r,a);return}const l=this.deferredOutputs.get(n)??[];l.push({paneId:r,data:new Uint8Array(a)}),this.deferredOutputs.set(n,l)}handleSelectFailed(t){const{deviceId:n}=t;this.failTransaction(n)}handleTimeout(t,n){console.warn(`[select-sm] Timeout at ${n} for ${t}`),this.failTransaction(t)}completeTransaction(t){const n=this.transactions.get(t);n&&(n.state="STABLE",this.transactions.delete(t))}failTransaction(t){var r,a;const n=this.transactions.get(t);n&&(n.state="SELECT_FAILED",this.stopOutputBuffering(t),(a=(r=this.callbacks).onSelectFailed)==null||a.call(r,t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}cancelTransaction(t){this.transactions.get(t)&&(this.stopOutputBuffering(t),this.transactions.delete(t),this.clearTimer(t),this.clearDeferred(t))}startOutputBuffering(t){this.outputGates.set(t,{state:"BUFFERING",buffer:[]})}stopOutputBuffering(t){const n=this.outputGates.get(t);if(!n)return[];const r=[...n.buffer];return this.outputGates.delete(t),r}bufferOutput(t,n){const r=this.outputGates.get(t);r&&(r.buffer.length>=1e3&&r.buffer.shift(),r.buffer.push(new Uint8Array(n)))}validateToken(t,n){if(t.length!==n.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==n[r])return!1;return!0}replayDeferred(t){var o,l;this.deferredResets.has(t)&&(this.deferredResets.delete(t),(l=(o=this.callbacks).onResetTerminal)==null||l.call(o,t));const n=this.deferredHistories.get(t);n!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(t,n.data,n.alternateScreen),this.deferredHistories.delete(t));const r=this.deferredFlushes.get(t);r&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,r),this.deferredFlushes.delete(t));const a=this.deferredOutputs.get(t);if(a&&this.callbacks.onOutput){for(const c of a)this.callbacks.onOutput(t,c.paneId,c.data);this.deferredOutputs.delete(t)}}clearDeferred(t){this.deferredResets.delete(t),this.deferredHistories.delete(t),this.deferredFlushes.delete(t),this.deferredOutputs.delete(t)}setTimer(t,n,r){this.clearTimer(t);const a=setTimeout(n,r);this.timers.set(t,a)}clearTimer(t){const n=this.timers.get(t);n&&(clearTimeout(n),this.timers.delete(t))}cleanup(t){this.cancelTransaction(t),this.outputGates.delete(t),this.clearDeferred(t)}cleanupAll(){for(const t of this.transactions.keys())this.cleanup(t);this.transactions.clear(),this.outputGates.clear(),this.deferredResets.clear(),this.deferredHistories.clear(),this.deferredFlushes.clear(),this.deferredOutputs.clear();for(const t of this.timers.values())clearTimeout(t);this.timers.clear()}}let Bu=null;function Rd(e){return Bu?(e&&Bu.setCallbacks(e),Bu):(Bu=new qq(e),Bu)}function Vq(){return crypto.getRandomValues(new Uint8Array(16))}function bN(e){const t=tr(lj,{deviceId:e});return{kind:n_,payload:t}}function $q(e){const t=tr(uj,{deviceId:e});return{kind:i_,payload:t}}function Wq(e){const t=tr(hj,{deviceId:e.deviceId,windowId:e.windowId??null,paneId:e.paneId??null,selectToken:e.selectToken,wantHistory:e.wantHistory,cols:e.cols??null,rows:e.rows??null});return{kind:s_,payload:t}}function Yq(e,t){const n=tr(pj,{deviceId:e,windowId:t});return{kind:l_,payload:n}}function Kq(e,t){const n=tr(mj,{deviceId:e,name:t??null});return{kind:c_,payload:n}}function Gq(e,t){const n=tr(gj,{deviceId:e,windowId:t});return{kind:u_,payload:n}}function Xq(e,t){const n=tr(yj,{deviceId:e,paneId:t});return{kind:d_,payload:n}}function Qq(e,t,n){const r=tr(bj,{deviceId:e,windowId:t,name:n});return{kind:f_,payload:r}}function Zq(e,t){const n=tr(vj,{deviceId:e,style:t});return{kind:m_,payload:n}}function Jq(e,t){const n=tr(xj,{deviceId:e,windowIds:t});return{kind:g_,payload:n}}function eV(e,t,n){const r=tr(wj,{deviceId:e,windowId:t,paneIds:n});return{kind:y_,payload:r}}function tV(e,t,n,r=!1){const a=new TextEncoder,o=tr(Ej,{deviceId:e,paneId:t,encoding:2,data:a.encode(n),isComposing:r});return{kind:b_,payload:o}}function nV(e,t,n){const r=new TextEncoder,a=tr(Cj,{deviceId:e,paneId:t,encoding:2,data:r.encode(n),isComposing:!1});return{kind:v_,payload:a}}function rV(e,t,n,r){const a=tr(IM,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:x_,payload:a}}function iV(e,t,n,r){const a=tr(Rj,{deviceId:e,paneId:t,cols:n,rows:r});return{kind:w_,payload:a}}function aV(e){const t=tr(Pj,{sessionId:e});return{kind:k_,payload:t}}function oV(e){const t=tr(Lj,{sessionId:e});return{kind:M_,payload:t}}const AT=e=>{let t;const n=new Set,r=(d,m)=>{const h=typeof d=="function"?d(t):d;if(!Object.is(h,t)){const y=t;t=m??(typeof h!="object"||h===null)?h:Object.assign({},t,h),n.forEach(g=>g(t,y))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>f,subscribe:d=>(n.add(d),()=>n.delete(d))},f=t=e(r,a,c);return c},sV=(e=>e?AT(e):AT),lV=e=>e;function cV(e,t=lV){const n=Fe.useSyncExternalStore(e.subscribe,Fe.useCallback(()=>t(e.getState()),[e,t]),Fe.useCallback(()=>t(e.getInitialState()),[e,t]));return Fe.useDebugValue(n),n}const NT=e=>{const t=sV(e),n=r=>cV(t,r);return Object.assign(n,t),n},Jd=(e=>e?NT(e):NT),kb={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Lx,updatedAt:new Date(0).toISOString()};async function OT(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const Xs=Jd((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const r=await OT();return e({settings:r,loading:!1}),hn.changeLanguage(r.language),r}catch(r){return console.error("[site] failed to fetch settings:",r),e({settings:kb,loading:!1}),hn.changeLanguage(kb.language),kb}},refreshSettings:async()=>{e({loading:!0});try{const n=await OT();return e({settings:n,loading:!1}),hn.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function uV(e){const t=typeof e.windowIndex=="number"?`Window ${e.windowIndex}`:typeof e.windowId=="string"&&e.windowId?`Window ${e.windowId}`:"",n=typeof e.paneIndex=="number"?`Pane ${e.paneIndex}`:typeof e.paneId=="string"&&e.paneId?`Pane ${e.paneId}`:"";return[t,n].filter(Boolean).join(" · ")}function dV(e){const t=typeof e.title=="string"&&e.title?e.title:"Terminal Notification",n=uV(e),r=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?`From ${e.source}`:"Terminal notification";return{title:t,description:n?`${n}
|
|
423
|
-
${r}`:r}}function fV(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const l=f=>f===null?null:JSON.parse(f,void 0),c=(o=n.getItem(a))!=null?o:null;return c instanceof Promise?c.then(l):l(c)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const Yv=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Yv(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Yv(r)(n)}}}},hV=(e,t)=>(n,r,a)=>{let o={storage:fV(()=>window.localStorage),partialize:R=>R,version:0,merge:(R,E)=>({...E,...R}),...t},l=!1,c=0;const f=new Set,d=new Set;let m=o.storage;if(!m)return e((...R)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...R)},r,a);const h=()=>{const R=o.partialize({...r()});return m.setItem(o.name,{state:R,version:o.version})},y=a.setState;a.setState=(R,E)=>(y(R,E),h());const g=e((...R)=>(n(...R),h()),r,a);a.getInitialState=()=>g;let w;const C=()=>{var R,E;if(!m)return;const T=++c;l=!1,f.forEach(M=>{var D;return M((D=r())!=null?D:g)});const k=((E=o.onRehydrateStorage)==null?void 0:E.call(o,(R=r())!=null?R:g))||void 0;return Yv(m.getItem.bind(m))(o.name).then(M=>{if(M)if(typeof M.version=="number"&&M.version!==o.version){if(o.migrate){const D=o.migrate(M.state,M.version);return D instanceof Promise?D.then(A=>[!0,A]):[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,M.state];return[!1,void 0]}).then(M=>{var D;if(T!==c)return;const[A,N]=M;if(w=o.merge(N,(D=r())!=null?D:g),n(w,!0),A)return h()}).then(()=>{T===c&&(k==null||k(w,void 0),w=r(),l=!0,d.forEach(M=>M(w)))}).catch(M=>{T===c&&(k==null||k(void 0,M))})};return a.persist={setOptions:R=>{o={...o,...R},R.storage&&(m=R.storage)},clearStorage:()=>{m==null||m.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>C(),hasHydrated:()=>l,onHydrate:R=>(f.add(R),()=>{f.delete(R)}),onFinishHydration:R=>(d.add(R),()=>{d.delete(R)})},o.skipHydration||C(),w||g},B0=hV,Bi=Jd()(B0(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",editorHistory:[],editorDrafts:{},setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),addEditorHistory:t=>e(n=>({editorHistory:[t,...n.editorHistory.slice(0,49)]})),setEditorDraft:(t,n)=>e(r=>({editorDrafts:{...r.editorDrafts,[t]:n}})),removeEditorDraft:t=>e(n=>{if(!(t in n.editorDrafts))return n;const r={...n.editorDrafts};return delete r[t],{editorDrafts:r}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts}),merge:(e,t)=>{const{sidebarTab:n,...r}=e??{};return{...t,...r}}})),pV=500,DT=new Map,Mb=new Map;function vN(e){const t=Date.now(),n=DT.get(e);return n!==void 0&&t-n<pV?!0:(DT.set(e,t),!1)}let IT=!1;function Ab(e){const t=Fq(Bi.getState().theme),n=Zq(e,t);Dn().send(n.kind,n.payload)}function Nb(e,t){if(typeof e!="number"||typeof t!="number")return null;const n=Math.max(2,Math.floor(e)),r=Math.max(2,Math.floor(t));return{cols:n,rows:r}}function mV(e,t){if(IT)return;IT=!0;const n=Dn(),r=o=>{const l=t().selectedPanes[o];!l||Rd().getTransaction(o)||t().selectPane(o,l.windowId,l.paneId)};n.onStateChange(o=>{e({socketReady:o==="READY"})}),n.onMessage(o=>{const l=Rd();switch(o.kind){case r_:{const c=_a(cj,o.payload);e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!0},deviceErrors:{...f.deviceErrors,[c.deviceId]:void 0},deviceReconnecting:{...f.deviceReconnecting,[c.deviceId]:void 0}})),Ab(c.deviceId),r(c.deviceId);return}case a_:{const c=_a(dj,o.payload);l.cleanup(c.deviceId),e(f=>({deviceConnected:{...f.deviceConnected,[c.deviceId]:!1}}));return}case o_:{const c=iz(o.payload);gV(e,c),c.type==="reconnected"&&(Ab(c.deviceId),r(c.deviceId));return}case p_:{const c=sz(o.payload);e(f=>({snapshots:{...f.snapshots,[c.deviceId]:c}}));return}case h_:{const c=az(o.payload);yV(e,c);return}case C_:{const c=_a(Mj,o.payload);l.dispatch({type:"SWITCH_ACK",deviceId:c.deviceId,selectToken:c.selectToken});return}case E_:{const c=_a(kj,o.payload),f=new TextDecoder().decode(c.data);l.dispatch({type:"HISTORY",deviceId:c.deviceId,selectToken:c.selectToken,data:f,alternateScreen:c.alternateScreen});return}case R_:{const c=_a(Aj,o.payload);l.dispatch({type:"LIVE_RESUME",deviceId:c.deviceId,selectToken:c.selectToken});return}case S_:{const c=_a(Tj,o.payload);l.dispatch({type:"OUTPUT",deviceId:c.deviceId,paneId:c.paneId,data:c.data});return}case t_:return}}),n.onError(o=>{console.error("[tmux] borsh ws error:",o),e({socketReady:!1}),sn.error("WebSocket Connection Error",{description:"Please check Gateway status"})}),n.onStateChange(o=>{if(o!=="READY")return;const l=t().connectedDevices;for(const c of l){if(vN(c))continue;const f=bN(c);n.send(f.kind,f.payload)}});let a=Bi.getState().theme;Bi.subscribe(o=>{if(o.theme===a)return;a=o.theme;const l=t();for(const c of l.connectedDevices)l.deviceConnected[c]&&Ab(c)})}function gV(e,t){if(t.type==="error"){const n=t.message??"Device Error",r=t.errorType??"unknown";if(r==="reconnecting"){e(a=>({deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:{message:n,at:Date.now()}}}));return}e(a=>{const o=a.deviceErrors[t.deviceId];return(!o||o.type!==r)&&sn.error(n),{deviceErrors:{...a.deviceErrors,[t.deviceId]:{message:n,type:r,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...a.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){Rd().cleanup(t.deviceId),e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!1}}));return}t.type==="reconnected"&&e(n=>({deviceConnected:{...n.deviceConnected,[t.deviceId]:!0},deviceErrors:{...n.deviceErrors,[t.deviceId]:void 0},deviceReconnecting:{...n.deviceReconnecting,[t.deviceId]:void 0}}))}function yV(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=Xs.getState().settings;if((n==null?void 0:n.enableBrowserBellToast)===!1)return;const r=t.data??{},a="Terminal Bell",o=[typeof r.windowIndex=="number"?`Window ${r.windowIndex}`:void 0,typeof r.paneIndex=="number"?`Pane ${r.paneIndex}`:void 0].filter(Boolean).join(" · "),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;sn(a,{description:o||"Received tmux bell",action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const n=Xs.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const r=t.data??{},{title:a,description:o}=dV(r),l=typeof r.paneUrl=="string"?r.paneUrl:void 0;sn(a,{description:o,action:l?{label:"Open",onClick:()=>{window.location.href=l}}:void 0})}if(t.type==="pane-active"){const n=t.data;n!=null&&n.windowId&&(n!=null&&n.paneId)&&e(r=>({activePaneFromEvent:{...r.activePaneFromEvent,[t.deviceId]:{windowId:n.windowId,paneId:n.paneId}}}))}}const kn=Jd((e,t)=>({socketReady:!1,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){mV(e,t),Dn().connect()},connectDevice(n){if(!n||(e(a=>{const o=new Set(a.connectedDevices);return o.add(n),{connectedDevices:o}}),t().ensureSocketConnected(),vN(n)))return;const r=bN(n);Dn().send(r.kind,r.payload)},disconnectDevice(n){if(!n)return;e(a=>{const o=new Set(a.connectedDevices);return o.delete(n),{connectedDevices:o}}),Rd().cleanup(n);const r=$q(n);Dn().send(r.kind,r.payload)},clearDeviceError(n){e(r=>({deviceErrors:{...r.deviceErrors,[n]:void 0},deviceReconnecting:{...r.deviceReconnecting,[n]:void 0}}))},hydrateDeviceErrors(n){e(r=>{const a={...r.deviceErrors};for(const o of n)a[o.deviceId]||!o.lastError||!o.lastErrorType||(a[o.deviceId]={message:o.lastError,type:o.lastErrorType,at:0});return{deviceErrors:a}})},selectPane(n,r,a,o){if(!n||!r||!a)return;e(m=>({selectedPanes:{...m.selectedPanes,[n]:{windowId:r,paneId:a}}}));const l=Vq(),c=!0;Rd().dispatch({type:"SELECT_START",deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c});const f=Nb(o==null?void 0:o.cols,o==null?void 0:o.rows)??Mb.get(n)??null,d=Wq({deviceId:n,windowId:r,paneId:a,selectToken:l,wantHistory:c,cols:f==null?void 0:f.cols,rows:f==null?void 0:f.rows});Dn().send(d.kind,d.payload)},selectWindow(n,r){if(!n||!r)return;const a=Yq(n,r);Dn().send(a.kind,a.payload)},sendInput(n,r,a,o=!1){if(!n||!r)return;const l=tV(n,r,a,o);Dn().send(l.kind,l.payload)},resizePane(n,r,a,o){if(!n||!r)return;const l=Nb(a,o);l&&Mb.set(n,{...l,at:Date.now()});const c=rV(n,r,a,o);Dn().send(c.kind,c.payload)},syncPaneSize(n,r,a,o){if(!n||!r)return;const l=Nb(a,o);l&&Mb.set(n,{...l,at:Date.now()});const c=iV(n,r,a,o);Dn().send(c.kind,c.payload)},paste(n,r,a){if(!n||!r)return;const o=nV(n,r,a);Dn().send(o.kind,o.payload)},createWindow(n,r){if(!n)return;const a=Kq(n,r);Dn().send(a.kind,a.payload),e(o=>({pendingCreateWindowAt:{...o.pendingCreateWindowAt,[n]:Date.now()}}))},clearPendingCreateWindow(n){n&&e(r=>{if(r.pendingCreateWindowAt[n]===void 0)return r;const a={...r.pendingCreateWindowAt};return delete a[n],{pendingCreateWindowAt:a}})},closeWindow(n,r){if(!n||!r)return;const a=Gq(n,r);Dn().send(a.kind,a.payload)},closePane(n,r){if(!n||!r)return;const a=Xq(n,r);Dn().send(a.kind,a.payload)},renameWindow(n,r,a){if(!n||!r)return;const o=Qq(n,r,a);Dn().send(o.kind,o.payload)},reorderWindows(n,r){if(!n||r.length===0)return;e(o=>{const l=o.snapshots[n],c=l==null?void 0:l.session;if(!c)return{};const f=new Map(c.windows.map(h=>[h.id,h])),d=r.map(h=>f.get(h)).filter(h=>h!==void 0),m=c.windows.filter(h=>!r.includes(h.id));return{snapshots:{...o.snapshots,[n]:{...l,session:{...c,windows:[...d,...m]}}}}});const a=Jq(n,r);Dn().send(a.kind,a.payload)},reorderPanes(n,r,a){if(!n||!r||a.length===0)return;e(l=>{const c=l.snapshots[n],f=c==null?void 0:c.session;if(!f)return{};const d=f.windows.map(m=>{if(m.id!==r)return m;const h=new Map(m.panes.map(w=>[w.id,w])),y=a.map(w=>h.get(w)).filter(w=>w!==void 0),g=m.panes.filter(w=>!a.includes(w.id));return{...m,panes:[...y,...g]}});return{snapshots:{...l.snapshots,[n]:{...c,session:{...f,windows:d}}}}});const o=eV(n,r,a);Dn().send(o.kind,o.payload)}})),PT="tmex:connectedDevices",xN=v.createContext(null);function bV(){const e=v.useContext(xN);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function vV({children:e}){const t=qi(),[n,r]=v.useState(()=>{try{const h=localStorage.getItem(PT);if(h){const y=JSON.parse(h);return new Set(y)}}catch{}return new Set}),a=kn(h=>h.connectDevice),o=kn(h=>h.disconnectDevice),l=kn(h=>h.connectedDevices);v.useEffect(()=>{try{localStorage.setItem(PT,JSON.stringify([...n]))}catch{}},[n]),v.useEffect(()=>{const h=t.pathname.match(/^\/devices\/([^/]+)/),y=h==null?void 0:h[1];y&&!l.has(y)&&a(y)},[t.pathname,l,a]);const c=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.add(h),g}),l.has(h)||a(h)},[l,a]),f=v.useCallback(h=>{r(y=>{const g=new Set(y);return g.delete(h),g}),l.has(h)&&o(h)},[l,o]),d=v.useCallback((h,y)=>{y?f(h):c(h)},[c,f]),m=v.useMemo(()=>({persistedDevices:n,connectDevice:c,disconnectDevice:f,toggleDevice:d}),[n,c,f,d]);return S.jsx(xN.Provider,{value:m,children:e})}const wN=v.createContext(void 0);function xV(){const e=v.useContext(wN);if(e===void 0)throw new Error(Cn(63));return e}let LT=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const SN={...t0,checked(e){return e?{[LT.checked]:""}:{[LT.unchecked]:""}}};function EN(e,t){const n=v.useRef(e),r=We(t);qe(()=>{n.current!==e&&r(n.current)},[e,r]),qe(()=>{n.current=e},[e])}const wV=v.forwardRef(function(t,n){const{checked:r,className:a,defaultChecked:o,id:l,inputRef:c,name:f,nativeButton:d=!1,onCheckedChange:m,readOnly:h=!1,required:y=!1,disabled:g=!1,render:w,uncheckedValue:C,value:R,...E}=t,{clearErrors:T}=n0(),{state:k,setTouched:M,setDirty:D,validityData:A,setFilled:N,setFocused:L,shouldValidateOnChange:q,validationMode:F,disabled:Y,name:_,validation:V}=Dc(),{labelId:$}=am(),B=Y||g,j=_??f,z=We(m),H=v.useRef(null),K=zi(H,c,V.inputRef),P=v.useRef(null),U=Vi(),G=cm({id:l,implicit:!1,controlRef:P}),I=d?void 0:G,[Q,le]=Sc({controlled:r,default:!!o,name:"Switch",state:"checked"});l0({id:U,commit:V.commit,value:Q,controlRef:P,name:j,getValue:()=>Q}),qe(()=>{H.current&&N(H.current.checked)},[H,N]),EN(Q,()=>{T(j),D(Q!==A.initialValue),N(Q),q()?V.commit(Q):V.commit(Q,!0)});const{getButtonProps:ae,buttonRef:Z}=$a({disabled:B,native:d}),ue={id:d?G:U,role:"switch","aria-checked":Q,"aria-readonly":h||void 0,"aria-required":y||void 0,"aria-labelledby":$,onFocus(){B||L(!0)},onBlur(){const te=H.current;!te||B||(M(!0),L(!1),F==="onBlur"&&V.commit(te.checked))},onClick(te){var he;h||B||(te.preventDefault(),(he=H.current)==null||he.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:te.shiftKey,ctrlKey:te.ctrlKey,altKey:te.altKey,metaKey:te.metaKey})))}},ve=v.useMemo(()=>Ri({checked:Q,disabled:B,id:I,name:j,required:y,style:j?EA:hm,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:K,onChange(te){if(te.nativeEvent.defaultPrevented)return;const he=te.target.checked,ye=xt(Fi,te.nativeEvent);z==null||z(he,ye),!ye.isCanceled&&le(he)},onFocus(){var te;(te=P.current)==null||te.focus()}},V.getInputValidationProps,R!==void 0?{value:R}:In),[Q,B,K,I,j,z,y,le,V,R]),Se=v.useMemo(()=>({...k,checked:Q,disabled:B,readOnly:h,required:y}),[k,Q,B,h,y]),Le=It("span",t,{state:Se,ref:[n,P,Z],props:[ue,V.getValidationProps,E,ae],stateAttributesMapping:SN});return S.jsxs(wN.Provider,{value:Se,children:[Le,!Q&&j&&C!==void 0&&S.jsx("input",{type:"hidden",name:j,value:C}),S.jsx("input",{...ve})]})}),SV=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{state:l}=Dc(),c=xV(),f={...l,...c};return It("span",t,{state:f,ref:n,stateAttributesMapping:SN,props:o})});function Lp({className:e,size:t="default",...n}){return S.jsx(wV,{"data-slot":"switch","data-size":t,className:Pe("data-checked:bg-primary data-unchecked:bg-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 dark:data-unchecked:bg-input/80 shrink-0 rounded-full border border-transparent focus-visible:ring-3 aria-invalid:ring-3 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] peer group/switch relative inline-flex items-center transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 data-disabled:cursor-not-allowed data-disabled:opacity-50",e),...n,children:S.jsx(SV,{"data-slot":"switch-thumb",className:"bg-background dark:data-unchecked:bg-foreground dark:data-checked:bg-primary-foreground rounded-full group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 pointer-events-none block ring-0 transition-transform"})})}function H0({className:e,...t}){return S.jsx("textarea",{"data-slot":"textarea",className:Pe("border-input dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 disabled:bg-input/50 dark:disabled:bg-input/80 rounded-lg border bg-transparent px-2.5 py-2 text-base transition-colors focus-visible:ring-2 aria-invalid:ring-2 md:text-sm placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...t})}function Zu(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function ic(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function CN(e){if(ic(e)&&typeof e.type=="string")switch(e.type){case"text":case"json":if("value"in e)return{value:e.value,isError:!1,denied:!1};break;case"error-text":case"error-json":if("value"in e)return{value:e.value,isError:!0,denied:!1};break;case"execution-denied":return{value:typeof e.reason=="string"?e.reason:void 0,isError:!1,denied:!0}}return{value:e,isError:!1,denied:!1}}function RN(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>ic(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
|
|
424
|
-
`):""}function EV(e){const t=[],n=new Map;for(const r of e){const a=ic(r.content)?r.content:null;if(!a)continue;const o=a.content;switch(r.role){case"user":{const l=RN(o);l&&t.push({kind:"user",key:`m${r.seq}`,text:l});break}case"assistant":{if(typeof o=="string"){o&&t.push({kind:"assistant-text",key:`m${r.seq}`,text:o,streaming:!1});break}if(!Array.isArray(o))break;o.forEach((l,c)=>{if(!ic(l))return;const f=`m${r.seq}p${c}`;if(l.type==="text"&&typeof l.text=="string"&&l.text){t.push({kind:"assistant-text",key:f,text:l.text,streaming:!1});return}if(l.type==="reasoning"&&typeof l.text=="string"&&l.text){t.push({kind:"reasoning",key:f,text:l.text,streaming:!1});return}if(l.type==="tool-call"&&typeof l.toolCallId=="string"){const d={toolCallId:l.toolCallId,toolName:typeof l.toolName=="string"?l.toolName:"unknown",input:l.input,isError:!1,denied:!1,resolved:!1};n.set(d.toolCallId,d),t.push({kind:"tool-call",key:f,call:d})}});break}case"tool":{if(!Array.isArray(o))break;for(const l of o){if(!ic(l)||l.type!=="tool-result")continue;const c=typeof l.toolCallId=="string"?l.toolCallId:"",f=n.get(c),{value:d,isError:m,denied:h}=CN(l.output);f&&(f.output=d,f.isError=m,f.denied=h,f.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function CV(e,t){const{blocks:n,toolBlocksById:r}=EV(e??[]);if(!t)return n;for(const a of t.toolCalls){const o=r.get(a.toolCallId);if(o){!o.resolved&&a.resolved&&(o.output=a.output,o.isError=a.isError,o.denied=a.denied,o.resolved=!0);continue}n.push({kind:"tool-call",key:`live-tool-${a.toolCallId}`,call:a})}for(const a of t.reasonings)a.text&&n.push({kind:"reasoning",key:`live-reasoning-${a.messageId}`,text:a.text,streaming:!0});for(const a of t.texts)a.text&&n.push({kind:"assistant-text",key:`live-text-${a.messageId}`,text:a.text,streaming:!0});return n}function Kv(e){return!e||e.length===0?-1:e[e.length-1].seq}function RV(e){if(!e)return null;for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role!=="user")continue;const r=ic(n.content)?n.content:null,a=r?RN(r.content):"";if(a)return a}return null}async function Er(e,t){try{return(await e.json()).error??t}catch{return t}}function Hu(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function _T(e,t){if(!e||e.length===0)return[...t].sort((r,a)=>r.seq-a.seq);const n=new Map;for(const r of e)n.set(r.seq,r);for(const r of t)n.set(r.seq,r);return[...n.values()].sort((r,a)=>r.seq-a.seq)}let jT=!1;const Eo=new Set,TV=40,zs=new Map;let Uu=null;const kV=120,sd=new Map,Ob=new Set,Gv=new Set;function MV(e){const t=sd.get(e);t&&(clearTimeout(t),sd.delete(e)),zs.delete(e),Gv.delete(e)}function Xv(e){const t=aV(e);Dn().send(t.kind,t.payload)}function zT(e){const t=oV(e);Dn().send(t.kind,t.payload)}function FT(e,t,n,r){let a=zs.get(e);a||(a={texts:new Map,reasonings:new Map},zs.set(e,a));const o=a[t];o.set(n,(o.get(n)??"")+r)}function AV(e){const t=()=>{if(Uu&&(clearTimeout(Uu),Uu=null),zs.size===0)return;const r=new Map(zs);zs.clear(),e(a=>{const o={...a.inProgress};for(const[l,c]of r){const f=o[l]??Zu(),d={...f,texts:[...f.texts],reasonings:[...f.reasonings]};for(const m of["texts","reasonings"])for(const[h,y]of c[m]){const g=d[m],w=g.findIndex(C=>C.messageId===h);w>=0?g[w]={...g[w],text:g[w].text+y}:g.push({messageId:h,text:y,stale:!1})}o[l]=d}return{inProgress:o}})};return{flush:t,schedule:()=>{Uu||(Uu=setTimeout(t,TV))}}}function NV(e,t){if(jT)return;jT=!0;const n=Dn(),r=AV(e),a=R=>{sd.get(R)||sd.set(R,setTimeout(()=>{sd.delete(R),t().loadHistory(R)},kV))},o=(R,E)=>{zs.delete(R),e(k=>{const M=k.sessions[R],D=Zu();return E.inProgressText&&D.texts.push({messageId:"__sync__",text:E.inProgressText,stale:!1}),E.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:E.inProgressReasoning,stale:!1}),{sessions:M?{...k.sessions,[R]:{...M,status:E.status,lastError:E.lastError}}:k.sessions,inProgress:{...k.inProgress,[R]:D},pendingConfirmations:{...k.pendingConfirmations,[R]:E.pendingConfirmations.map(A=>({id:A.confirmationId,toolCallId:A.toolCallId,toolName:A.toolName,input:A.input,createdAt:A.createdAt}))},queued:{...k.queued,[R]:E.queuedMessages.map(A=>({id:A.id,sessionId:R,seq:A.seq,text:A.text,createdAt:A.createdAt}))}}});const T=t();(E.lastMessageSeq>Kv(T.messages[R])||!T.historyLoaded[R])&&T.loadHistory(R)},l=(R,E)=>{const T=!!t().sessions[R];if(e(k=>{const M=k.sessions[R];return M?{sessions:{...k.sessions,[R]:{...M,status:E.status,lastError:E.lastError!==void 0?E.lastError:M.lastError}}}:k}),!T){t().loadSessions();return}t().refreshSession(R)},c=(R,E)=>{r.flush(),e(T=>{const k=T.inProgress[R]??Zu(),M=[...k.toolCalls],D=M.findIndex(N=>N.toolCallId===E.toolCallId),A={toolCallId:E.toolCallId,toolName:E.toolName,input:E.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?M[D]={...M[D],...A}:M.push(A),{inProgress:{...T.inProgress,[R]:{...k,toolCalls:M}}}})},f=(R,E)=>{r.flush();const{value:T,isError:k,denied:M}=CN(E.output);e(D=>{const A=D.inProgress[R]??Zu(),N=[...A.toolCalls],L=N.findIndex(q=>q.toolCallId===E.toolCallId);return L>=0?N[L]={...N[L],output:T,isError:!!E.isError||k,denied:M,resolved:!0}:N.push({toolCallId:E.toolCallId,toolName:E.toolName,input:void 0,output:T,isError:!!E.isError||k,denied:M,resolved:!0,stale:A.staleBarrier}),{inProgress:{...D.inProgress,[R]:{...A,toolCalls:N}}}})},d=(R,E)=>{e(T=>{const k=T.pendingConfirmations[R]??[];return k.some(M=>M.id===E.confirmationId)?T:{pendingConfirmations:{...T.pendingConfirmations,[R]:[...k,{id:E.confirmationId,toolCallId:E.toolCallId,toolName:E.toolName,input:E.input,createdAt:new Date().toISOString()}]}}})},m=(R,E)=>{e(T=>{const k=T.pendingConfirmations[R];return!k||!k.some(M=>M.id===E.confirmationId)?T:{pendingConfirmations:{...T.pendingConfirmations,[R]:k.filter(M=>M.id!==E.confirmationId)}}})},h=(R,E)=>{r.flush(),(E.role==="assistant"||E.role==="tool")&&e(T=>{const k=T.inProgress[R];return k?{inProgress:{...T.inProgress,[R]:{texts:k.texts.map(M=>({...M,stale:!0})),reasonings:k.reasonings.map(M=>({...M,stale:!0})),toolCalls:k.toolCalls.map(M=>M.resolved?{...M,stale:!0}:M),staleBarrier:!0}}}:T}),a(R)},y=(R,E)=>{r.flush(),e(T=>{const k=T.sessions[R];return{sessions:k?{...T.sessions,[R]:{...k,status:E.sessionStatus}}:T.sessions,inProgress:{...T.inProgress,[R]:Zu()}}}),E.lastMessageSeq>Kv(t().messages[R])&&a(R)},g=(R,E)=>{const T=t().sessions[R];sn.error(hn.t("agent.toast.errorTitle",{title:(T==null?void 0:T.title)??"Agent"}),{description:E.message})},w=(R,E)=>{sn.warning(hn.t("agent.toast.credentialWarningTitle"),{description:hn.t("agent.toast.credentialWarningDescription",{types:E.types.join(", ")}),duration:1e4})},C=(R,E)=>{e(T=>({queued:{...T.queued,[R]:E.queued.map(k=>({id:k.id,sessionId:R,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}))};n.onMessage(R=>{if(R.kind!==A_)return;let E;try{E=_a(_j,R.payload)}catch(M){console.error("[agent] failed to decode AGENT_EVENT:",M);return}let T;try{T=JSON.parse(new TextDecoder().decode(E.payload))}catch(M){console.error("[agent] failed to parse AGENT_EVENT payload:",M);return}const k=E.sessionId;switch(E.eventType){case O_:o(k,T);return;case D_:l(k,T);return;case I_:{const M=T;FT(k,"texts",M.messageId,M.delta),r.schedule();return}case P_:{const M=T;FT(k,"reasonings",M.messageId,M.delta),r.schedule();return}case L_:c(k,T);return;case __:f(k,T);return;case j_:d(k,T);return;case z_:m(k,T);return;case F_:h(k,T);return;case B_:g(k,T);return;case H_:y(k,T);return;case U_:w(k,T);return;case q_:C(k,T);return;default:return}}),n.onStateChange(R=>{if(R!=="READY")return;for(const T of Eo)Xv(T);const E=t().activeSessionId;E&&t().loadHistory(E)})}const an=Jd()(B0((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){NV(e,t),Dn().connect();const n=t().activeSessionId;n&&!Eo.has(n)&&(Eo.add(n),Xv(n))},async loadSessions(){try{const n=await fetch("/api/agent/sessions");if(!n.ok)throw new Error(await Er(n,"Failed to load agent sessions"));const r=await n.json();e(()=>{const o={};for(const l of r.sessions)o[l.id]=l;return{sessions:o,sessionOrder:Hu(o),sessionsLoaded:!0}});const a=t();a.activeSessionId&&!a.sessions[a.activeSessionId]&&a.setActiveSession(null)}catch(n){console.error("[agent] loadSessions failed:",n)}},async refreshSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`);if(r.status===404){await t().loadSessions();return}if(!r.ok)throw new Error(await Er(r,"Failed to load agent session"));const a=await r.json();e(o=>{const l={...o.sessions,[n]:a.session};return{sessions:l,sessionOrder:Hu(l)}})}catch(r){console.error("[agent] refreshSession failed:",r)}},setActiveSession(n){const r=t().activeSessionId;r!==n&&(r&&Eo.has(r)&&(Eo.delete(r),zT(r)),e({activeSessionId:n,draft:null}),n&&(Eo.add(n),Xv(n),t().historyLoaded[n]||t().loadHistory(n)))},async createSession(n,r,a){try{const o=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:n,paneId:r,...(a==null?void 0:a.providerId)!==void 0?{providerId:a.providerId}:{},...(a==null?void 0:a.modelId)!==void 0&&a.modelId!==null?{modelId:a.modelId}:{},...(a==null?void 0:a.providerHostedTools)!==void 0?{providerHostedTools:a.providerHostedTools}:{},...(a==null?void 0:a.originPaneTitle)!==void 0?{originPaneTitle:a.originPaneTitle}:{},writeMode:(a==null?void 0:a.writeMode)??t().defaultWriteMode})});if(!o.ok)throw new Error(await Er(o,"Failed to create agent session"));const c=(await o.json()).session;return e(f=>{const d={...f.sessions,[c.id]:c};return{sessions:d,sessionOrder:Hu(d),messages:{...f.messages,[c.id]:[]},historyLoaded:{...f.historyLoaded,[c.id]:!0}}}),t().setActiveSession(c.id),c}catch(o){return sn.error(o instanceof Error?o.message:String(o)),null}},async renameSession(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:r})});if(!a.ok)throw new Error(await Er(a,"Failed to rename agent session"));const o=await a.json();return e(l=>{const c={...l.sessions,[n]:o.session};return{sessions:c,sessionOrder:Hu(c)}}),!0}catch(a){return sn.error(a instanceof Error?a.message:String(a)),!1}},async deleteSession(n){try{const r=await fetch(`/api/agent/sessions/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(await Er(r,"Failed to delete agent session"));return t().activeSessionId===n&&t().setActiveSession(null),MV(n),e(a=>{const o={...a.sessions};delete o[n];const l={...a.messages};delete l[n];const c={...a.historyLoaded};delete c[n];const f={...a.inProgress};delete f[n];const d={...a.pendingConfirmations};delete d[n];const m={...a.queued};return delete m[n],{sessions:o,sessionOrder:Hu(o),messages:l,historyLoaded:c,inProgress:f,pendingConfirmations:d,queued:m}}),!0}catch(r){return sn.error(r instanceof Error?r.message:String(r)),!1}},async setWriteMode(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:r})});if(!a.ok)throw new Error(await Er(a,"Failed to update write mode"));const o=await a.json();e(l=>({sessions:{...l.sessions,[n]:o.session}}))}catch(a){sn.error(a instanceof Error?a.message:String(a))}},setDefaultWriteMode(n){e({defaultWriteMode:n})},async setSessionModel(n,r,a){try{const o=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:r,modelId:a})});if(!o.ok)throw new Error(await Er(o,"Failed to update model"));const l=await o.json();e(c=>({sessions:{...c.sessions,[n]:l.session}}))}catch(o){sn.error(o instanceof Error?o.message:String(o))}},async rebindPane(n,r){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:r})});if(!a.ok)throw new Error(await Er(a,"Failed to rebind pane"));const o=await a.json();e(l=>({sessions:{...l.sessions,[n]:o.session}}))}catch(a){sn.error(a instanceof Error?a.message:String(a))}},async loadHistory(n){if(Ob.has(n)){Gv.add(n);return}Ob.add(n);try{const r=t(),a=r.historyLoaded[n]?Kv(r.messages[n]):-1,o=a>=0?`?afterSeq=${a}`:"",l=await fetch(`/api/agent/sessions/${n}/messages${o}`);if(!l.ok)throw new Error(await Er(l,"Failed to load agent messages"));const c=await l.json();e(f=>{const d=_T(a>=0?f.messages[n]:void 0,c.messages),m=f.inProgress[n],h=m&&{texts:m.texts.filter(y=>!y.stale),reasonings:m.reasonings.filter(y=>!y.stale),toolCalls:m.toolCalls.filter(y=>!y.stale),staleBarrier:!1};return{messages:{...f.messages,[n]:d},historyLoaded:{...f.historyLoaded,[n]:!0},inProgress:h?{...f.inProgress,[n]:h}:f.inProgress}})}catch(r){console.error("[agent] loadHistory failed:",r)}finally{Ob.delete(n),Gv.delete(n)&&t().loadHistory(n)}},async sendMessage(n,r){e(a=>({sending:{...a.sending,[n]:!0}}));try{const a=await fetch(`/api/agent/sessions/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r})});if(!a.ok)throw new Error(await Er(a,"Failed to send message"));const o=await a.json();if(o.message){const l=o.message;e(c=>{const f=c.sessions[n];return{messages:{...c.messages,[n]:_T(c.messages[n],[l])},sessions:f?{...c.sessions,[n]:{...f,status:"running",lastError:null}}:c.sessions}})}return!0}catch(a){return sn.error(a instanceof Error?a.message:String(a)),!1}finally{e(a=>({sending:{...a.sending,[n]:!1}}))}},async enqueueMessage(n,r,a=!1){try{const o=await fetch(`/api/agent/sessions/${n}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:r,steer:a})});if(!o.ok)throw new Error(await Er(o,"Failed to queue message"))}catch(o){sn.error(o instanceof Error?o.message:String(o))}},async editQueuedMessage(n,r,a){try{const o=await fetch(`/api/agent/queue/${r}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!o.ok)throw new Error(await Er(o,"Failed to edit queued message"))}catch(o){sn.error(o instanceof Error?o.message:String(o))}},async withdrawQueuedMessage(n,r){try{const a=await fetch(`/api/agent/queue/${r}`,{method:"DELETE"});if(!a.ok)throw new Error(await Er(a,"Failed to withdraw queued message"))}catch(a){sn.error(a instanceof Error?a.message:String(a))}},startDraft(n,r,a,o){const l=t().activeSessionId;l&&Eo.has(l)&&(Eo.delete(l),zT(l)),e({activeSessionId:null,draft:{deviceId:n,paneId:r,providerId:null,modelId:null,paneTitle:a,prompt:o??null}})},updateDraft(n){e(r=>r.draft?{draft:{...r.draft,...n}}:r)},clearDraft(){e({draft:null})},async materializeDraft(){const n=t().draft;return n?await t().createSession(n.deviceId,n.paneId,{providerId:n.providerId,modelId:n.modelId,originPaneTitle:n.paneTitle}):null},async stopSession(n){try{const r=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!r.ok)throw new Error(await Er(r,"Failed to stop agent session"));const a=await r.json();if(a.session){const o=a.session;e(l=>({sessions:{...l.sessions,[n]:o}}))}}catch(r){sn.error(r instanceof Error?r.message:String(r))}},async decideConfirmation(n,r,a,o){const l=()=>{e(c=>{const f=c.pendingConfirmations[n];return f?{pendingConfirmations:{...c.pendingConfirmations,[n]:f.filter(d=>d.id!==r)}}:c})};try{const c=await fetch(`/api/agent/confirmations/${r}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(o===void 0?{approved:a}:{approved:a,reason:o})});if(c.status===409){l();try{const f=await fetch(`/api/agent/sessions/${n}/confirmations`);if(f.ok){const d=await f.json();e(m=>({pendingConfirmations:{...m.pendingConfirmations,[n]:d.confirmations.map(h=>({id:h.id,toolCallId:h.toolCallId,toolName:h.toolName,input:h.input,createdAt:h.createdAt}))}}))}}catch{}return}if(!c.ok)throw new Error(await Er(c,"Failed to decide confirmation"));l()}catch(c){sn.error(c instanceof Error?c.message:String(c))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function OV(){const e=Xs.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function BT(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function DV({paneIdx:e,windowIdx:t,paneTitle:n,windowName:r,windowCustomName:a,deviceName:o}){const l=t??"?",c=e??"?",f=BT(a??n??r),d=BT(o);return`${l}/${c}: ${f}@${d}`}function U0(e){var c,f;const t=(c=e.customName)==null?void 0:c.trim(),n=e.panes.find(d=>d.active)??e.panes[0],r=e.name.trim(),a=(f=n==null?void 0:n.title)==null?void 0:f.trim(),o=t||a||r;return{title:o,processName:!!r&&r!==o?r:void 0}}function IV(e){const{title:t,processName:n}=U0(e);return n?`${n}: ${t}`:t}function zte(e){const t=OV();return e!=null&&e.trim()?`[${t}]${e}`:t}function Fte(){}function Bte(e){const t=[],n=String(e||"");let r=n.indexOf(","),a=0,o=!1;for(;!o;){r===-1&&(r=n.length,o=!0);const l=n.slice(a,r).trim();(l||!o)&&t.push(l),a=r+1,r=n.indexOf(",",a)}return t}function PV(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const LV=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,_V=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,jV={};function HT(e,t){return(jV.jsx?_V:LV).test(e)}const zV=/[ \t\n\f\r]/g;function FV(e){return typeof e=="object"?e.type==="text"?UT(e.value):!1:UT(e)}function UT(e){return e.replace(zV,"")===""}class ef{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}ef.prototype.normal={};ef.prototype.property={};ef.prototype.space=void 0;function TN(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new ef(n,r,t)}function Qv(e){return e.toLowerCase()}class qr{constructor(t,n){this.attribute=n,this.property=t}}qr.prototype.attribute="";qr.prototype.booleanish=!1;qr.prototype.boolean=!1;qr.prototype.commaOrSpaceSeparated=!1;qr.prototype.commaSeparated=!1;qr.prototype.defined=!1;qr.prototype.mustUseProperty=!1;qr.prototype.number=!1;qr.prototype.overloadedBoolean=!1;qr.prototype.property="";qr.prototype.spaceSeparated=!1;qr.prototype.space=void 0;let BV=0;const Ot=rl(),Gn=rl(),Zv=rl(),Ue=rl(),Sn=rl(),Fs=rl(),Jr=rl();function rl(){return 2**++BV}const Jv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ot,booleanish:Gn,commaOrSpaceSeparated:Jr,commaSeparated:Fs,number:Ue,overloadedBoolean:Zv,spaceSeparated:Sn},Symbol.toStringTag,{value:"Module"})),Db=Object.keys(Jv);class q0 extends qr{constructor(t,n,r,a){let o=-1;if(super(t,n),qT(this,"space",a),typeof r=="number")for(;++o<Db.length;){const l=Db[o];qT(this,Db[o],(r&Jv[l])===Jv[l])}}}q0.prototype.defined=!0;function qT(e,t,n){n&&(e[t]=n)}function jc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new q0(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Qv(r)]=r,n[Qv(o.attribute)]=r}return new ef(t,n,e.space)}const kN=jc({properties:{ariaActiveDescendant:null,ariaAtomic:Gn,ariaAutoComplete:null,ariaBusy:Gn,ariaChecked:Gn,ariaColCount:Ue,ariaColIndex:Ue,ariaColSpan:Ue,ariaControls:Sn,ariaCurrent:null,ariaDescribedBy:Sn,ariaDetails:null,ariaDisabled:Gn,ariaDropEffect:Sn,ariaErrorMessage:null,ariaExpanded:Gn,ariaFlowTo:Sn,ariaGrabbed:Gn,ariaHasPopup:null,ariaHidden:Gn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Sn,ariaLevel:Ue,ariaLive:null,ariaModal:Gn,ariaMultiLine:Gn,ariaMultiSelectable:Gn,ariaOrientation:null,ariaOwns:Sn,ariaPlaceholder:null,ariaPosInSet:Ue,ariaPressed:Gn,ariaReadOnly:Gn,ariaRelevant:null,ariaRequired:Gn,ariaRoleDescription:Sn,ariaRowCount:Ue,ariaRowIndex:Ue,ariaRowSpan:Ue,ariaSelected:Gn,ariaSetSize:Ue,ariaSort:null,ariaValueMax:Ue,ariaValueMin:Ue,ariaValueNow:Ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function MN(e,t){return t in e?e[t]:t}function AN(e,t){return MN(e,t.toLowerCase())}const HV=jc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Fs,acceptCharset:Sn,accessKey:Sn,action:null,allow:null,allowFullScreen:Ot,allowPaymentRequest:Ot,allowUserMedia:Ot,alpha:Ot,alt:null,as:null,async:Ot,autoCapitalize:null,autoComplete:Sn,autoFocus:Ot,autoPlay:Ot,blocking:Sn,capture:null,charSet:null,checked:Ot,cite:null,className:Sn,closedBy:null,colorSpace:null,cols:Ue,colSpan:Ue,command:null,commandFor:null,content:null,contentEditable:Gn,controls:Ot,controlsList:Sn,coords:Ue|Fs,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ot,defer:Ot,dir:null,dirName:null,disabled:Ot,download:Zv,draggable:Gn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ot,formTarget:null,headers:Sn,height:Ue,hidden:Zv,high:Ue,href:null,hrefLang:null,htmlFor:Sn,httpEquiv:Sn,id:null,imageSizes:null,imageSrcSet:null,inert:Ot,inputMode:null,integrity:null,is:null,isMap:Ot,itemId:null,itemProp:Sn,itemRef:Sn,itemScope:Ot,itemType:Sn,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ot,low:Ue,manifest:null,max:null,maxLength:Ue,media:null,method:null,min:null,minLength:Ue,multiple:Ot,muted:Ot,name:null,nonce:null,noModule:Ot,noValidate:Ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ot,optimum:Ue,pattern:null,ping:Sn,placeholder:null,playsInline:Ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ot,referrerPolicy:null,rel:Sn,required:Ot,reversed:Ot,rows:Ue,rowSpan:Ue,sandbox:Sn,scope:null,scoped:Ot,seamless:Ot,selected:Ot,shadowRootClonable:Ot,shadowRootCustomElementRegistry:Ot,shadowRootDelegatesFocus:Ot,shadowRootMode:null,shadowRootSerializable:Ot,shape:null,size:Ue,sizes:null,slot:null,span:Ue,spellCheck:Gn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ue,step:null,style:null,tabIndex:Ue,target:null,title:null,translate:null,type:null,typeMustMatch:Ot,useMap:null,value:Gn,width:Ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Sn,axis:null,background:null,bgColor:null,border:Ue,borderColor:null,bottomMargin:Ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ot,declare:Ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ue,leftMargin:Ue,link:null,longDesc:null,lowSrc:null,marginHeight:Ue,marginWidth:Ue,noResize:Ot,noHref:Ot,noShade:Ot,noWrap:Ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ue,rules:null,scheme:null,scrolling:Gn,standby:null,summary:null,text:null,topMargin:Ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ue,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ot,disablePictureInPicture:Ot,disableRemotePlayback:Ot,exportParts:Fs,part:Sn,prefix:null,property:null,results:Ue,security:null,unselectable:null},space:"html",transform:AN}),UV=jc({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",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",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",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",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",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",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Jr,accentHeight:Ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ue,amplitude:Ue,arabicForm:null,ascent:Ue,attributeName:null,attributeType:null,azimuth:Ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ue,by:null,calcMode:null,capHeight:Ue,className:Sn,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ue,diffuseConstant:Ue,direction:null,display:null,dur:null,divisor:Ue,dominantBaseline:null,download:Ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ue,enableBackground:null,end:null,event:null,exponent:Ue,externalResourcesRequired:null,fill:null,fillOpacity:Ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Fs,g2:Fs,glyphName:Fs,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ue,horizOriginX:Ue,horizOriginY:Ue,id:null,ideographic:Ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ue,k:Ue,k1:Ue,k2:Ue,k3:Ue,k4:Ue,kernelMatrix:Jr,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ue,overlineThickness:Ue,paintOrder:null,panose1:null,path:null,pathLength:Ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Sn,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ue,pointsAtY:Ue,pointsAtZ:Ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jr,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jr,rev:Jr,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jr,requiredFeatures:Jr,requiredFonts:Jr,requiredFormats:Jr,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ue,specularExponent:Ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ue,strikethroughThickness:Ue,string:null,stroke:null,strokeDashArray:Jr,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ue,strokeOpacity:Ue,strokeWidth:null,style:null,surfaceScale:Ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jr,tabIndex:Ue,tableValues:null,target:null,targetX:Ue,targetY:Ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jr,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ue,underlineThickness:Ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ue,values:null,vAlphabetic:Ue,vMathematical:Ue,vectorEffect:null,vHanging:Ue,vIdeographic:Ue,version:null,vertAdvY:Ue,vertOriginX:Ue,vertOriginY:Ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:MN}),NN=jc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),ON=jc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:AN}),DN=jc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),qV={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},VV=/[A-Z]/g,VT=/-[a-z]/g,$V=/^data[-\w.:]+$/i;function WV(e,t){const n=Qv(t);let r=t,a=qr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&$V.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(VT,KV);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!VT.test(o)){let l=o.replace(VV,YV);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=q0}return new a(r,t)}function YV(e){return"-"+e.toLowerCase()}function KV(e){return e.charAt(1).toUpperCase()}const GV=TN([kN,HV,NN,ON,DN],"html"),V0=TN([kN,UV,NN,ON,DN],"svg");function Hte(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function XV(e){return e.join(" ").trim()}var Hl={},Ib,$T;function QV(){if($T)return Ib;$T=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,c=/^\s+|\s+$/g,f=`
|
|
425
|
-
`,d="/",m="*",h="",y="comment",g="declaration";function w(R,E){if(typeof R!="string")throw new TypeError("First argument must be a string");if(!R)return[];E=E||{};var T=1,k=1;function M($){var B=$.match(t);B&&(T+=B.length);var j=$.lastIndexOf(f);k=~j?$.length-j:k+$.length}function D(){var $={line:T,column:k};return function(B){return B.position=new A($),q(),B}}function A($){this.start=$,this.end={line:T,column:k},this.source=E.source}A.prototype.content=R;function N($){var B=new Error(E.source+":"+T+":"+k+": "+$);if(B.reason=$,B.filename=E.source,B.line=T,B.column=k,B.source=R,!E.silent)throw B}function L($){var B=$.exec(R);if(B){var j=B[0];return M(j),R=R.slice(j.length),B}}function q(){L(n)}function F($){var B;for($=$||[];B=Y();)B!==!1&&$.push(B);return $}function Y(){var $=D();if(!(d!=R.charAt(0)||m!=R.charAt(1))){for(var B=2;h!=R.charAt(B)&&(m!=R.charAt(B)||d!=R.charAt(B+1));)++B;if(B+=2,h===R.charAt(B-1))return N("End of comment missing");var j=R.slice(2,B-2);return k+=2,M(j),R=R.slice(B),k+=2,$({type:y,comment:j})}}function _(){var $=D(),B=L(r);if(B){if(Y(),!L(a))return N("property missing ':'");var j=L(o),z=$({type:g,property:C(B[0].replace(e,h)),value:j?C(j[0].replace(e,h)):h});return L(l),z}}function V(){var $=[];F($);for(var B;B=_();)B!==!1&&($.push(B),F($));return $}return q(),V()}function C(R){return R?R.replace(c,h):h}return Ib=w,Ib}var WT;function ZV(){if(WT)return Hl;WT=1;var e=Hl&&Hl.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.default=n;const t=e(QV());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),c=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:d,value:m}=f;c?a(d,m,f):m&&(o=o||{},o[d]=m)}),o}return Hl}var qu={},YT;function JV(){if(YT)return qu;YT=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(d){return!d||n.test(d)||e.test(d)},l=function(d,m){return m.toUpperCase()},c=function(d,m){return"".concat(m,"-")},f=function(d,m){return m===void 0&&(m={}),o(d)?d:(d=d.toLowerCase(),m.reactCompat?d=d.replace(a,c):d=d.replace(r,c),d.replace(t,l))};return qu.camelCase=f,qu}var Vu,KT;function e7(){if(KT)return Vu;KT=1;var e=Vu&&Vu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(ZV()),n=JV();function r(a,o){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(c,f){c&&f&&(l[(0,n.camelCase)(c,o)]=f)}),l}return r.default=r,Vu=r,Vu}var t7=e7();const n7=Gp(t7),IN=PN("end"),$0=PN("start");function PN(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function r7(e){const t=$0(e),n=IN(e);if(t&&n)return{start:t,end:n}}function ld(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?GT(e.position):"start"in e||"end"in e?GT(e):"line"in e||"column"in e?ex(e):""}function ex(e){return XT(e&&e.line)+":"+XT(e&&e.column)}function GT(e){return ex(e&&e.start)+"-"+ex(e&&e.end)}function XT(e){return e&&typeof e=="number"?e:1}class wr extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(l=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=c?c.line:void 0,this.name=ld(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wr.prototype.file="";wr.prototype.name="";wr.prototype.reason="";wr.prototype.message="";wr.prototype.stack="";wr.prototype.column=void 0;wr.prototype.line=void 0;wr.prototype.ancestors=void 0;wr.prototype.cause=void 0;wr.prototype.fatal=void 0;wr.prototype.place=void 0;wr.prototype.ruleId=void 0;wr.prototype.source=void 0;const W0={}.hasOwnProperty,i7=new Map,a7=/[A-Z]/g,o7=new Set(["table","tbody","thead","tfoot","tr"]),s7=new Set(["td","th"]),LN="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function l7(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=g7(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=m7(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?V0:GV,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=_N(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function _N(e,t,n){if(t.type==="element")return c7(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return u7(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return f7(e,t,n);if(t.type==="mdxjsEsm")return d7(e,t);if(t.type==="root")return h7(e,t,n);if(t.type==="text")return p7(e,t)}function c7(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=V0,e.schema=a),e.ancestors.push(t);const o=zN(e,t.tagName,!1),l=y7(e,t);let c=K0(e,t);return o7.has(t.tagName)&&(c=c.filter(function(f){return typeof f=="string"?!FV(f):!0})),jN(e,l,o,t),Y0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function u7(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Td(e,t.position)}function d7(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Td(e,t.position)}function f7(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=V0,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:zN(e,t.name,!0),l=b7(e,t),c=K0(e,t);return jN(e,l,o,t),Y0(l,c),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function h7(e,t,n){const r={};return Y0(r,K0(e,t)),e.create(t,e.Fragment,r,n)}function p7(e,t){return t.value}function jN(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Y0(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function m7(e,t,n){return r;function r(a,o,l,c){const d=Array.isArray(l.children)?n:t;return c?d(o,l,c):d(o,l)}}function g7(e,t){return n;function n(r,a,o,l){const c=Array.isArray(o.children),f=$0(r);return t(a,o,l,c,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function y7(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&W0.call(t.properties,a)){const o=v7(e,a,t.properties[a]);if(o){const[l,c]=o;e.tableCellAlignToStyle&&l==="align"&&typeof c=="string"&&s7.has(t.tagName)?r=c:n[l]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function b7(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const c=l.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else Td(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else Td(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function K0(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:i7;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const d=a.get(f)||0;l=f+"-"+d,a.set(f,d+1)}}const c=_N(e,o,l);c!==void 0&&n.push(c)}return n}function v7(e,t,n){const r=WV(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?PV(n):XV(n)),r.property==="style"){let a=typeof n=="object"?n:x7(e,String(n));return e.stylePropertyNameCase==="css"&&(a=w7(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?qV[r.property]||r.property:r.attribute,n]}}function x7(e,t){try{return n7(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new wr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=LN+"#cannot-parse-style-attribute",a}}function zN(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,l;for(;++o<a.length;){const c=HT(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};l=l?{type:"MemberExpression",object:l,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=l}else r=HT(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return W0.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);Td(e)}function Td(e,t){const n=new wr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=LN+"#cannot-handle-mdx-estrees-without-createevaluater",n}function w7(e){const t={};let n;for(n in e)W0.call(e,n)&&(t[S7(n)]=e[n]);return t}function S7(e){let t=e.replace(a7,E7);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function E7(e){return"-"+e.toLowerCase()}const Pb={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},C7={};function G0(e,t){const n=C7,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return FN(e,r,a)}function FN(e,t,n){if(R7(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return QT(e.children,t,n)}return Array.isArray(e)?QT(e,t,n):""}function QT(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=FN(e[a],t,n);return r.join("")}function R7(e){return!!(e&&typeof e=="object")}const ZT=document.createElement("i");function X0(e){const t="&"+e+";";ZT.innerHTML=t;const n=ZT.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ii(e,t,n,r){const a=e.length;let o=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function xi(e,t){return e.length>0?(ii(e,e.length,0,t),e):t}const JT={}.hasOwnProperty;function BN(e){const t={};let n=-1;for(;++n<e.length;)T7(t,e[n]);return t}function T7(e,t){let n;for(n in t){const a=(JT.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){JT.call(a,l)||(a[l]=[]);const c=o[l];k7(a[l],Array.isArray(c)?c:c?[c]:[])}}}function k7(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ii(e,0,0,r)}function HN(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ji(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const kr=Zo(/[A-Za-z]/),xr=Zo(/[\dA-Za-z]/),M7=Zo(/[#-'*+\--9=?A-Z^-~]/);function _p(e){return e!==null&&(e<32||e===127)}const tx=Zo(/\d/),A7=Zo(/[\dA-Fa-f]/),N7=Zo(/[!-/:-@[-`{-~]/);function vt(e){return e!==null&&e<-2}function En(e){return e!==null&&(e<0||e===32)}function Kt(e){return e===-2||e===-1||e===32}const Sm=Zo(new RegExp("\\p{P}|\\p{S}","u")),Qs=Zo(/\s/);function Zo(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function zc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&xr(e.charCodeAt(n+1))&&xr(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(l=String.fromCharCode(o,c),a=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function on(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return Kt(f)?(e.enter(n),c(f)):t(f)}function c(f){return Kt(f)&&o++<a?(e.consume(f),c):(e.exit(n),t(f))}}const O7={tokenize:D7};function D7(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),on(e,t,"linePrefix")}function a(c){return e.enter("paragraph"),o(c)}function o(c){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(c)}function l(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return vt(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),l)}}const I7={tokenize:P7},ek={tokenize:L7};function P7(e){const t=this,n=[];let r=0,a,o,l;return c;function c(k){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,f,d)(k)}return d(k)}function f(k){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&T();const M=t.events.length;let D=M,A;for(;D--;)if(t.events[D][0]==="exit"&&t.events[D][1].type==="chunkFlow"){A=t.events[D][1].end;break}E(r);let N=M;for(;N<t.events.length;)t.events[N][1].end={...A},N++;return ii(t.events,D+1,0,t.events.slice(M)),t.events.length=N,d(k)}return c(k)}function d(k){if(r===n.length){if(!a)return y(k);if(a.currentConstruct&&a.currentConstruct.concrete)return w(k);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(ek,m,h)(k)}function m(k){return a&&T(),E(r),y(k)}function h(k){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,w(k)}function y(k){return t.containerState={},e.attempt(ek,g,w)(k)}function g(k){return r++,n.push([t.currentConstruct,t.containerState]),y(k)}function w(k){if(k===null){a&&T(),E(0),e.consume(k);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),C(k)}function C(k){if(k===null){R(e.exit("chunkFlow"),!0),E(0),e.consume(k);return}return vt(k)?(e.consume(k),R(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(k),C)}function R(k,M){const D=t.sliceStream(k);if(M&&D.push(null),k.previous=o,o&&(o.next=k),o=k,a.defineSkip(k.start),a.write(D),t.parser.lazy[k.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<l&&(!a.events[A][1].end||a.events[A][1].end.offset>l))return;const N=t.events.length;let L=N,q,F;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(q){F=t.events[L][1].end;break}q=!0}for(E(r),A=N;A<t.events.length;)t.events[A][1].end={...F},A++;ii(t.events,L+1,0,t.events.slice(N)),t.events.length=A}}function E(k){let M=n.length;for(;M-- >k;){const D=n[M];t.containerState=D[1],D[0].exit.call(t,e)}n.length=k}function T(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function L7(e,t,n){return on(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Rc(e){if(e===null||En(e)||Qs(e))return 1;if(Sm(e))return 2}function Em(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const nx={name:"attention",resolveAll:_7,tokenize:j7};function _7(e,t){let n=-1,r,a,o,l,c,f,d,m;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},y={...e[n][1].start};tk(h,-f),tk(y,f),l={type:f>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},c={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...c.end}},e[r][1].end={...l.start},e[n][1].start={...c.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=xi(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=xi(d,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),d=xi(d,Em(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=xi(d,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(m=2,d=xi(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):m=0,ii(e,r-1,n-r+3,d),n=r+d.length-m-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function j7(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Rc(r);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),c(f)}function c(f){if(f===o)return e.consume(f),c;const d=e.exit("attentionSequence"),m=Rc(f),h=!m||m===2&&a||n.includes(f),y=!a||a===2&&m||n.includes(r);return d._open=!!(o===42?h:h&&(a||!y)),d._close=!!(o===42?y:y&&(m||!h)),t(f)}}function tk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const z7={name:"autolink",tokenize:F7};function F7(e,t,n){let r=0;return a;function a(g){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(g){return kr(g)?(e.consume(g),l):g===64?n(g):d(g)}function l(g){return g===43||g===45||g===46||xr(g)?(r=1,c(g)):d(g)}function c(g){return g===58?(e.consume(g),r=0,f):(g===43||g===45||g===46||xr(g))&&r++<32?(e.consume(g),c):(r=0,d(g))}function f(g){return g===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):g===null||g===32||g===60||_p(g)?n(g):(e.consume(g),f)}function d(g){return g===64?(e.consume(g),m):M7(g)?(e.consume(g),d):n(g)}function m(g){return xr(g)?h(g):n(g)}function h(g){return g===46?(e.consume(g),r=0,m):g===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(g),e.exit("autolinkMarker"),e.exit("autolink"),t):y(g)}function y(g){if((g===45||xr(g))&&r++<63){const w=g===45?y:h;return e.consume(g),w}return n(g)}}const tf={partial:!0,tokenize:B7};function B7(e,t,n){return r;function r(o){return Kt(o)?on(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||vt(o)?t(o):n(o)}}const UN={continuation:{tokenize:U7},exit:q7,name:"blockQuote",tokenize:H7};function H7(e,t,n){const r=this;return a;function a(l){if(l===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return Kt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function U7(e,t,n){const r=this;return a;function a(l){return Kt(l)?on(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(UN,t,n)(l)}}function q7(e){e.exit("blockQuote")}const qN={name:"characterEscape",tokenize:V7};function V7(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return N7(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const VN={name:"characterReference",tokenize:$7};function $7(e,t,n){const r=this;let a=0,o,l;return c;function c(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),f}function f(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),o=31,l=xr,m(h))}function d(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=A7,m):(e.enter("characterReferenceValue"),o=7,l=tx,m(h))}function m(h){if(h===59&&a){const y=e.exit("characterReferenceValue");return l===xr&&!X0(r.sliceSerialize(y))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(h)&&a++<o?(e.consume(h),m):n(h)}}const nk={partial:!0,tokenize:Y7},rk={concrete:!0,name:"codeFenced",tokenize:W7};function W7(e,t,n){const r=this,a={partial:!0,tokenize:D};let o=0,l=0,c;return f;function f(A){return d(A)}function d(A){const N=r.events[r.events.length-1];return o=N&&N[1].type==="linePrefix"?N[2].sliceSerialize(N[1],!0).length:0,c=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),m(A)}function m(A){return A===c?(l++,e.consume(A),m):l<3?n(A):(e.exit("codeFencedFenceSequence"),Kt(A)?on(e,h,"whitespace")(A):h(A))}function h(A){return A===null||vt(A)?(e.exit("codeFencedFence"),r.interrupt?t(A):e.check(nk,C,M)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(A))}function y(A){return A===null||vt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(A)):Kt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),on(e,g,"whitespace")(A)):A===96&&A===c?n(A):(e.consume(A),y)}function g(A){return A===null||vt(A)?h(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(A))}function w(A){return A===null||vt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(A)):A===96&&A===c?n(A):(e.consume(A),w)}function C(A){return e.attempt(a,M,R)(A)}function R(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),E}function E(A){return o>0&&Kt(A)?on(e,T,"linePrefix",o+1)(A):T(A)}function T(A){return A===null||vt(A)?e.check(nk,C,M)(A):(e.enter("codeFlowValue"),k(A))}function k(A){return A===null||vt(A)?(e.exit("codeFlowValue"),T(A)):(e.consume(A),k)}function M(A){return e.exit("codeFenced"),t(A)}function D(A,N,L){let q=0;return F;function F(B){return A.enter("lineEnding"),A.consume(B),A.exit("lineEnding"),Y}function Y(B){return A.enter("codeFencedFence"),Kt(B)?on(A,_,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(B):_(B)}function _(B){return B===c?(A.enter("codeFencedFenceSequence"),V(B)):L(B)}function V(B){return B===c?(q++,A.consume(B),V):q>=l?(A.exit("codeFencedFenceSequence"),Kt(B)?on(A,$,"whitespace")(B):$(B)):L(B)}function $(B){return B===null||vt(B)?(A.exit("codeFencedFence"),N(B)):L(B)}}}function Y7(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Lb={name:"codeIndented",tokenize:G7},K7={partial:!0,tokenize:X7};function G7(e,t,n){const r=this;return a;function a(d){return e.enter("codeIndented"),on(e,o,"linePrefix",5)(d)}function o(d){const m=r.events[r.events.length-1];return m&&m[1].type==="linePrefix"&&m[2].sliceSerialize(m[1],!0).length>=4?l(d):n(d)}function l(d){return d===null?f(d):vt(d)?e.attempt(K7,l,f)(d):(e.enter("codeFlowValue"),c(d))}function c(d){return d===null||vt(d)?(e.exit("codeFlowValue"),l(d)):(e.consume(d),c)}function f(d){return e.exit("codeIndented"),t(d)}}function X7(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):vt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):on(e,o,"linePrefix",5)(l)}function o(l){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):vt(l)?a(l):n(l)}}const Q7={name:"codeText",previous:J7,resolve:Z7,tokenize:e$};function Z7(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function J7(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function e$(e,t,n){let r=0,a,o;return l;function l(h){return e.enter("codeText"),e.enter("codeTextSequence"),c(h)}function c(h){return h===96?(e.consume(h),r++,c):(e.exit("codeTextSequence"),f(h))}function f(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),f):h===96?(o=e.enter("codeTextSequence"),a=0,m(h)):vt(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("codeTextData"),d(h))}function d(h){return h===null||h===32||h===96||vt(h)?(e.exit("codeTextData"),f(h)):(e.consume(h),d)}function m(h){return h===96?(e.consume(h),a++,m):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(o.type="codeTextData",d(h))}}class t${constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&$u(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),$u(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),$u(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);$u(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);$u(this.left,n.reverse())}}}function $u(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $N(e){const t={};let n=-1,r,a,o,l,c,f,d;const m=new t$(e);for(;++n<m.length;){for(;n in t;)n=t[n];if(r=m.get(n),n&&r[1].type==="chunkFlow"&&m.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,n$(m,n)),n=t[n],d=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=m.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(m.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...m.get(a)[1].start},c=m.slice(a,n),c.unshift(r),m.splice(a,n-a+1,c))}}return ii(e,0,Number.POSITIVE_INFINITY,m.slice(0)),!d}function n$(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const c=l.events,f=[],d={};let m,h,y=-1,g=n,w=0,C=0;const R=[C];for(;g;){for(;e.get(++a)[1]!==g;);o.push(a),g._tokenizer||(m=r.sliceStream(g),g.next||m.push(null),h&&l.defineSkip(g.start),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(m),g._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),h=g,g=g.next}for(g=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(C=y+1,R.push(C),g._tokenizer=void 0,g.previous=void 0,g=g.next);for(l.events=[],g?(g._tokenizer=void 0,g.previous=void 0):R.pop(),y=R.length;y--;){const E=c.slice(R[y],R[y+1]),T=o.pop();f.push([T,T+E.length-1]),e.splice(T,2,E)}for(f.reverse(),y=-1;++y<f.length;)d[w+f[y][0]]=w+f[y][1],w+=f[y][1]-f[y][0]-1;return d}const r$={resolve:a$,tokenize:o$},i$={partial:!0,tokenize:s$};function a$(e){return $N(e),e}function o$(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(c)}function a(c){return c===null?o(c):vt(c)?e.check(i$,l,o)(c):(e.consume(c),a)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function l(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function s$(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),on(e,o,"linePrefix")}function o(l){if(l===null||vt(l))return n(l);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function WN(e,t,n,r,a,o,l,c,f){const d=f||Number.POSITIVE_INFINITY;let m=0;return h;function h(E){return E===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(E),e.exit(o),y):E===null||E===32||E===41||_p(E)?n(E):(e.enter(r),e.enter(l),e.enter(c),e.enter("chunkString",{contentType:"string"}),C(E))}function y(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===62?(e.exit("chunkString"),e.exit(c),y(E)):E===null||E===60||vt(E)?n(E):(e.consume(E),E===92?w:g)}function w(E){return E===60||E===62||E===92?(e.consume(E),g):g(E)}function C(E){return!m&&(E===null||E===41||En(E))?(e.exit("chunkString"),e.exit(c),e.exit(l),e.exit(r),t(E)):m<d&&E===40?(e.consume(E),m++,C):E===41?(e.consume(E),m--,C):E===null||E===32||E===40||_p(E)?n(E):(e.consume(E),E===92?R:C)}function R(E){return E===40||E===41||E===92?(e.consume(E),C):C(E)}}function YN(e,t,n,r,a,o){const l=this;let c=0,f;return d;function d(g){return e.enter(r),e.enter(a),e.consume(g),e.exit(a),e.enter(o),m}function m(g){return c>999||g===null||g===91||g===93&&!f||g===94&&!c&&"_hiddenFootnoteSupport"in l.parser.constructs?n(g):g===93?(e.exit(o),e.enter(a),e.consume(g),e.exit(a),e.exit(r),t):vt(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),m):(e.enter("chunkString",{contentType:"string"}),h(g))}function h(g){return g===null||g===91||g===93||vt(g)||c++>999?(e.exit("chunkString"),m(g)):(e.consume(g),f||(f=!Kt(g)),g===92?y:h)}function y(g){return g===91||g===92||g===93?(e.consume(g),c++,h):h(g)}}function KN(e,t,n,r,a,o){let l;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(a),e.consume(y),e.exit(a),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):(e.enter(o),d(y))}function d(y){return y===l?(e.exit(o),f(l)):y===null?n(y):vt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),on(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),m(y))}function m(y){return y===l||y===null||vt(y)?(e.exit("chunkString"),d(y)):(e.consume(y),y===92?h:m)}function h(y){return y===l||y===92?(e.consume(y),m):m(y)}}function cd(e,t){let n;return r;function r(a){return vt(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):Kt(a)?on(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const l$={name:"definition",tokenize:u$},c$={partial:!0,tokenize:d$};function u$(e,t,n){const r=this;let a;return o;function o(g){return e.enter("definition"),l(g)}function l(g){return YN.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(g)}function c(g){return a=ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),g===58?(e.enter("definitionMarker"),e.consume(g),e.exit("definitionMarker"),f):n(g)}function f(g){return En(g)?cd(e,d)(g):d(g)}function d(g){return WN(e,m,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(g)}function m(g){return e.attempt(c$,h,h)(g)}function h(g){return Kt(g)?on(e,y,"whitespace")(g):y(g)}function y(g){return g===null||vt(g)?(e.exit("definition"),r.parser.defined.push(a),t(g)):n(g)}}function d$(e,t,n){return r;function r(c){return En(c)?cd(e,a)(c):n(c)}function a(c){return KN(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Kt(c)?on(e,l,"whitespace")(c):l(c)}function l(c){return c===null||vt(c)?t(c):n(c)}}const f$={name:"hardBreakEscape",tokenize:h$};function h$(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return vt(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const p$={name:"headingAtx",resolve:m$,tokenize:g$};function m$(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ii(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function g$(e,t,n){let r=0;return a;function a(m){return e.enter("atxHeading"),o(m)}function o(m){return e.enter("atxHeadingSequence"),l(m)}function l(m){return m===35&&r++<6?(e.consume(m),l):m===null||En(m)?(e.exit("atxHeadingSequence"),c(m)):n(m)}function c(m){return m===35?(e.enter("atxHeadingSequence"),f(m)):m===null||vt(m)?(e.exit("atxHeading"),t(m)):Kt(m)?on(e,c,"whitespace")(m):(e.enter("atxHeadingText"),d(m))}function f(m){return m===35?(e.consume(m),f):(e.exit("atxHeadingSequence"),c(m))}function d(m){return m===null||m===35||En(m)?(e.exit("atxHeadingText"),c(m)):(e.consume(m),d)}}const y$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],ik=["pre","script","style","textarea"],b$={concrete:!0,name:"htmlFlow",resolveTo:w$,tokenize:S$},v$={partial:!0,tokenize:C$},x$={partial:!0,tokenize:E$};function w$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function S$(e,t,n){const r=this;let a,o,l,c,f;return d;function d(I){return m(I)}function m(I){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(I),h}function h(I){return I===33?(e.consume(I),y):I===47?(e.consume(I),o=!0,C):I===63?(e.consume(I),a=3,r.interrupt?t:P):kr(I)?(e.consume(I),l=String.fromCharCode(I),R):n(I)}function y(I){return I===45?(e.consume(I),a=2,g):I===91?(e.consume(I),a=5,c=0,w):kr(I)?(e.consume(I),a=4,r.interrupt?t:P):n(I)}function g(I){return I===45?(e.consume(I),r.interrupt?t:P):n(I)}function w(I){const Q="CDATA[";return I===Q.charCodeAt(c++)?(e.consume(I),c===Q.length?r.interrupt?t:_:w):n(I)}function C(I){return kr(I)?(e.consume(I),l=String.fromCharCode(I),R):n(I)}function R(I){if(I===null||I===47||I===62||En(I)){const Q=I===47,le=l.toLowerCase();return!Q&&!o&&ik.includes(le)?(a=1,r.interrupt?t(I):_(I)):y$.includes(l.toLowerCase())?(a=6,Q?(e.consume(I),E):r.interrupt?t(I):_(I)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(I):o?T(I):k(I))}return I===45||xr(I)?(e.consume(I),l+=String.fromCharCode(I),R):n(I)}function E(I){return I===62?(e.consume(I),r.interrupt?t:_):n(I)}function T(I){return Kt(I)?(e.consume(I),T):F(I)}function k(I){return I===47?(e.consume(I),F):I===58||I===95||kr(I)?(e.consume(I),M):Kt(I)?(e.consume(I),k):F(I)}function M(I){return I===45||I===46||I===58||I===95||xr(I)?(e.consume(I),M):D(I)}function D(I){return I===61?(e.consume(I),A):Kt(I)?(e.consume(I),D):k(I)}function A(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),f=I,N):Kt(I)?(e.consume(I),A):L(I)}function N(I){return I===f?(e.consume(I),f=null,q):I===null||vt(I)?n(I):(e.consume(I),N)}function L(I){return I===null||I===34||I===39||I===47||I===60||I===61||I===62||I===96||En(I)?D(I):(e.consume(I),L)}function q(I){return I===47||I===62||Kt(I)?k(I):n(I)}function F(I){return I===62?(e.consume(I),Y):n(I)}function Y(I){return I===null||vt(I)?_(I):Kt(I)?(e.consume(I),Y):n(I)}function _(I){return I===45&&a===2?(e.consume(I),j):I===60&&a===1?(e.consume(I),z):I===62&&a===4?(e.consume(I),U):I===63&&a===3?(e.consume(I),P):I===93&&a===5?(e.consume(I),K):vt(I)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(v$,G,V)(I)):I===null||vt(I)?(e.exit("htmlFlowData"),V(I)):(e.consume(I),_)}function V(I){return e.check(x$,$,G)(I)}function $(I){return e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),B}function B(I){return I===null||vt(I)?V(I):(e.enter("htmlFlowData"),_(I))}function j(I){return I===45?(e.consume(I),P):_(I)}function z(I){return I===47?(e.consume(I),l="",H):_(I)}function H(I){if(I===62){const Q=l.toLowerCase();return ik.includes(Q)?(e.consume(I),U):_(I)}return kr(I)&&l.length<8?(e.consume(I),l+=String.fromCharCode(I),H):_(I)}function K(I){return I===93?(e.consume(I),P):_(I)}function P(I){return I===62?(e.consume(I),U):I===45&&a===2?(e.consume(I),P):_(I)}function U(I){return I===null||vt(I)?(e.exit("htmlFlowData"),G(I)):(e.consume(I),U)}function G(I){return e.exit("htmlFlow"),t(I)}}function E$(e,t,n){const r=this;return a;function a(l){return vt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function C$(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(tf,t,n)}}const R$={name:"htmlText",tokenize:T$};function T$(e,t,n){const r=this;let a,o,l;return c;function c(P){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(P),f}function f(P){return P===33?(e.consume(P),d):P===47?(e.consume(P),D):P===63?(e.consume(P),k):kr(P)?(e.consume(P),L):n(P)}function d(P){return P===45?(e.consume(P),m):P===91?(e.consume(P),o=0,w):kr(P)?(e.consume(P),T):n(P)}function m(P){return P===45?(e.consume(P),g):n(P)}function h(P){return P===null?n(P):P===45?(e.consume(P),y):vt(P)?(l=h,z(P)):(e.consume(P),h)}function y(P){return P===45?(e.consume(P),g):h(P)}function g(P){return P===62?j(P):P===45?y(P):h(P)}function w(P){const U="CDATA[";return P===U.charCodeAt(o++)?(e.consume(P),o===U.length?C:w):n(P)}function C(P){return P===null?n(P):P===93?(e.consume(P),R):vt(P)?(l=C,z(P)):(e.consume(P),C)}function R(P){return P===93?(e.consume(P),E):C(P)}function E(P){return P===62?j(P):P===93?(e.consume(P),E):C(P)}function T(P){return P===null||P===62?j(P):vt(P)?(l=T,z(P)):(e.consume(P),T)}function k(P){return P===null?n(P):P===63?(e.consume(P),M):vt(P)?(l=k,z(P)):(e.consume(P),k)}function M(P){return P===62?j(P):k(P)}function D(P){return kr(P)?(e.consume(P),A):n(P)}function A(P){return P===45||xr(P)?(e.consume(P),A):N(P)}function N(P){return vt(P)?(l=N,z(P)):Kt(P)?(e.consume(P),N):j(P)}function L(P){return P===45||xr(P)?(e.consume(P),L):P===47||P===62||En(P)?q(P):n(P)}function q(P){return P===47?(e.consume(P),j):P===58||P===95||kr(P)?(e.consume(P),F):vt(P)?(l=q,z(P)):Kt(P)?(e.consume(P),q):j(P)}function F(P){return P===45||P===46||P===58||P===95||xr(P)?(e.consume(P),F):Y(P)}function Y(P){return P===61?(e.consume(P),_):vt(P)?(l=Y,z(P)):Kt(P)?(e.consume(P),Y):q(P)}function _(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),a=P,V):vt(P)?(l=_,z(P)):Kt(P)?(e.consume(P),_):(e.consume(P),$)}function V(P){return P===a?(e.consume(P),a=void 0,B):P===null?n(P):vt(P)?(l=V,z(P)):(e.consume(P),V)}function $(P){return P===null||P===34||P===39||P===60||P===61||P===96?n(P):P===47||P===62||En(P)?q(P):(e.consume(P),$)}function B(P){return P===47||P===62||En(P)?q(P):n(P)}function j(P){return P===62?(e.consume(P),e.exit("htmlTextData"),e.exit("htmlText"),t):n(P)}function z(P){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),H}function H(P){return Kt(P)?on(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):K(P)}function K(P){return e.enter("htmlTextData"),l(P)}}const Q0={name:"labelEnd",resolveAll:N$,resolveTo:O$,tokenize:D$},k$={tokenize:I$},M$={tokenize:P$},A$={tokenize:L$};function N$(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&ii(e,0,e.length,n),e}function O$(e,t){let n=e.length,r=0,a,o,l,c;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},m={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return c=[["enter",f,t],["enter",d,t]],c=xi(c,e.slice(o+1,o+r+3)),c=xi(c,[["enter",m,t]]),c=xi(c,Em(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),c=xi(c,[["exit",m,t],e[l-2],e[l-1],["exit",d,t]]),c=xi(c,e.slice(l+1)),c=xi(c,[["exit",f,t]]),ii(e,o,e.length,c),e}function D$(e,t,n){const r=this;let a=r.events.length,o,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return c;function c(y){return o?o._inactive?h(y):(l=r.parser.defined.includes(ji(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(k$,m,l?m:h)(y):y===91?e.attempt(M$,m,l?d:h)(y):l?m(y):h(y)}function d(y){return e.attempt(A$,m,h)(y)}function m(y){return t(y)}function h(y){return o._balanced=!0,n(y)}}function I$(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),a}function a(h){return En(h)?cd(e,o)(h):o(h)}function o(h){return h===41?m(h):WN(e,l,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function l(h){return En(h)?cd(e,f)(h):m(h)}function c(h){return n(h)}function f(h){return h===34||h===39||h===40?KN(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):m(h)}function d(h){return En(h)?cd(e,m)(h):m(h)}function m(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function P$(e,t,n){const r=this;return a;function a(c){return YN.call(r,e,o,l,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(ji(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function l(c){return n(c)}}function L$(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const _$={name:"labelStartImage",resolveAll:Q0.resolveAll,tokenize:j$};function j$(e,t,n){const r=this;return a;function a(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),l):n(c)}function l(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const z$={name:"labelStartLink",resolveAll:Q0.resolveAll,tokenize:F$};function F$(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const _b={name:"lineEnding",tokenize:B$};function B$(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),on(e,t,"linePrefix")}}const cp={name:"thematicBreak",tokenize:H$};function H$(e,t,n){let r=0,a;return o;function o(d){return e.enter("thematicBreak"),l(d)}function l(d){return a=d,c(d)}function c(d){return d===a?(e.enter("thematicBreakSequence"),f(d)):r>=3&&(d===null||vt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function f(d){return d===a?(e.consume(d),r++,f):(e.exit("thematicBreakSequence"),Kt(d)?on(e,c,"whitespace")(d):c(d))}}const _r={continuation:{tokenize:$$},exit:Y$,name:"list",tokenize:V$},U$={partial:!0,tokenize:K$},q$={partial:!0,tokenize:W$};function V$(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return c;function c(g){const w=r.containerState.type||(g===42||g===43||g===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!r.containerState.marker||g===r.containerState.marker:tx(g)){if(r.containerState.type||(r.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),g===42||g===45?e.check(cp,n,d)(g):d(g);if(!r.interrupt||g===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(g)}return n(g)}function f(g){return tx(g)&&++l<10?(e.consume(g),f):(!r.interrupt||l<2)&&(r.containerState.marker?g===r.containerState.marker:g===41||g===46)?(e.exit("listItemValue"),d(g)):n(g)}function d(g){return e.enter("listItemMarker"),e.consume(g),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||g,e.check(tf,r.interrupt?n:m,e.attempt(U$,y,h))}function m(g){return r.containerState.initialBlankLine=!0,o++,y(g)}function h(g){return Kt(g)?(e.enter("listItemPrefixWhitespace"),e.consume(g),e.exit("listItemPrefixWhitespace"),y):n(g)}function y(g){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(g)}}function $$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(tf,a,o);function a(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,on(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Kt(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(q$,t,l)(c))}function l(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,on(e,e.attempt(_r,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function W$(e,t,n){const r=this;return on(e,a,"listItemIndent",r.containerState.size+1);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Y$(e){e.exit(this.containerState.type)}function K$(e,t,n){const r=this;return on(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const l=r.events[r.events.length-1];return!Kt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const ak={name:"setextUnderline",resolveTo:G$,tokenize:X$};function G$(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function X$(e,t,n){const r=this;let a;return o;function o(d){let m=r.events.length,h;for(;m--;)if(r.events[m][1].type!=="lineEnding"&&r.events[m][1].type!=="linePrefix"&&r.events[m][1].type!=="content"){h=r.events[m][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),a=d,l(d)):n(d)}function l(d){return e.enter("setextHeadingLineSequence"),c(d)}function c(d){return d===a?(e.consume(d),c):(e.exit("setextHeadingLineSequence"),Kt(d)?on(e,f,"lineSuffix")(d):f(d))}function f(d){return d===null||vt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const Q$={tokenize:Z$};function Z$(e){const t=this,n=e.attempt(tf,r,e.attempt(this.parser.constructs.flowInitial,a,on(e,e.attempt(this.parser.constructs.flow,a,e.attempt(r$,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const J$={resolveAll:XN()},eW=GN("string"),tW=GN("text");function GN(e){return{resolveAll:XN(e==="text"?nW:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,l,c);return l;function l(m){return d(m)?o(m):c(m)}function c(m){if(m===null){n.consume(m);return}return n.enter("data"),n.consume(m),f}function f(m){return d(m)?(n.exit("data"),o(m)):(n.consume(m),f)}function d(m){if(m===null)return!0;const h=a[m];let y=-1;if(h)for(;++y<h.length;){const g=h[y];if(!g.previous||g.previous.call(r,r.previous))return!0}return!1}}}function XN(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function nW(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,l=-1,c=0,f;for(;o--;){const d=a[o];if(typeof d=="string"){for(l=d.length;d.charCodeAt(l-1)===32;)c++,l--;if(l)break;l=-1}else if(d===-2)f=!0,c++;else if(d!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const d={type:n===e.length||f||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const rW={42:_r,43:_r,45:_r,48:_r,49:_r,50:_r,51:_r,52:_r,53:_r,54:_r,55:_r,56:_r,57:_r,62:UN},iW={91:l$},aW={[-2]:Lb,[-1]:Lb,32:Lb},oW={35:p$,42:cp,45:[ak,cp],60:b$,61:ak,95:cp,96:rk,126:rk},sW={38:VN,92:qN},lW={[-5]:_b,[-4]:_b,[-3]:_b,33:_$,38:VN,42:nx,60:[z7,R$],91:z$,92:[f$,qN],93:Q0,95:nx,96:Q7},cW={null:[nx,J$]},uW={null:[42,95]},dW={null:[]},fW=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:uW,contentInitial:iW,disable:dW,document:rW,flow:oW,flowInitial:aW,insideSpan:cW,string:sW,text:lW},Symbol.toStringTag,{value:"Module"}));function hW(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let l=[],c=[];const f={attempt:N(D),check:N(A),consume:T,enter:k,exit:M,interrupt:N(A,{interrupt:!0})},d={code:null,containerState:{},defineSkip:C,events:[],now:w,parser:e,previous:null,sliceSerialize:y,sliceStream:g,write:h};let m=t.tokenize.call(d,f);return t.resolveAll&&o.push(t),d;function h(Y){return l=xi(l,Y),R(),l[l.length-1]!==null?[]:(L(t,0),d.events=Em(o,d.events,d),d.events)}function y(Y,_){return mW(g(Y),_)}function g(Y){return pW(l,Y)}function w(){const{_bufferIndex:Y,_index:_,line:V,column:$,offset:B}=r;return{_bufferIndex:Y,_index:_,line:V,column:$,offset:B}}function C(Y){a[Y.line]=Y.column,F()}function R(){let Y;for(;r._index<l.length;){const _=l[r._index];if(typeof _=="string")for(Y=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===Y&&r._bufferIndex<_.length;)E(_.charCodeAt(r._bufferIndex));else E(_)}}function E(Y){m=m(Y)}function T(Y){vt(Y)?(r.line++,r.column=1,r.offset+=Y===-3?2:1,F()):Y!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=Y}function k(Y,_){const V=_||{};return V.type=Y,V.start=w(),d.events.push(["enter",V,d]),c.push(V),V}function M(Y){const _=c.pop();return _.end=w(),d.events.push(["exit",_,d]),_}function D(Y,_){L(Y,_.from)}function A(Y,_){_.restore()}function N(Y,_){return V;function V($,B,j){let z,H,K,P;return Array.isArray($)?G($):"tokenize"in $?G([$]):U($);function U(ae){return Z;function Z(ue){const ve=ue!==null&&ae[ue],Se=ue!==null&&ae.null,Le=[...Array.isArray(ve)?ve:ve?[ve]:[],...Array.isArray(Se)?Se:Se?[Se]:[]];return G(Le)(ue)}}function G(ae){return z=ae,H=0,ae.length===0?j:I(ae[H])}function I(ae){return Z;function Z(ue){return P=q(),K=ae,ae.partial||(d.currentConstruct=ae),ae.name&&d.parser.constructs.disable.null.includes(ae.name)?le():ae.tokenize.call(_?Object.assign(Object.create(d),_):d,f,Q,le)(ue)}}function Q(ae){return Y(K,P),B}function le(ae){return P.restore(),++H<z.length?I(z[H]):j}}}function L(Y,_){Y.resolveAll&&!o.includes(Y)&&o.push(Y),Y.resolve&&ii(d.events,_,d.events.length-_,Y.resolve(d.events.slice(_),d)),Y.resolveTo&&(d.events=Y.resolveTo(d.events,d))}function q(){const Y=w(),_=d.previous,V=d.currentConstruct,$=d.events.length,B=Array.from(c);return{from:$,restore:j};function j(){r=Y,d.previous=_,d.currentConstruct=V,d.events.length=$,c=B,F()}}function F(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function pW(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,o)];else{if(l=e.slice(n,a),r>-1){const c=l[0];typeof c=="string"?l[0]=c.slice(r):l.shift()}o>0&&l.push(e[a].slice(0,o))}return l}function mW(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
426
|
-
`;break}case-3:{l=`\r
|
|
427
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(o)}a=o===-2,r.push(l)}return r.join("")}function gW(e){const r={constructs:BN([fW,...(e||{}).extensions||[]]),content:a(O7),defined:[],document:a(I7),flow:a(Q$),lazy:{},string:a(eW),text:a(tW)};return r;function a(o){return l;function l(c){return hW(r,o,c)}}}function yW(e){for(;!$N(e););return e}const ok=/[\0\t\n\r]/g;function bW(){let e=1,t="",n=!0,r;return a;function a(o,l,c){const f=[];let d,m,h,y,g;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),h=0,t="",n&&(o.charCodeAt(0)===65279&&h++,n=void 0);h<o.length;){if(ok.lastIndex=h,d=ok.exec(o),y=d&&d.index!==void 0?d.index:o.length,g=o.charCodeAt(y),!d){t=o.slice(h);break}if(g===10&&h===y&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),h<y&&(f.push(o.slice(h,y)),e+=y-h),g){case 0:{f.push(65533),e++;break}case 9:{for(m=Math.ceil(e/4)*4,f.push(-2);e++<m;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}h=y+1}return c&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const vW=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function xW(e){return e.replace(vW,wW)}function wW(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return HN(n.slice(o?2:1),o?16:10)}return X0(n)||e}const QN={}.hasOwnProperty;function SW(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),EW(n)(yW(gW(n).document().write(bW()(e,t,!0))))}function EW(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(J),autolinkProtocol:q,autolinkEmail:q,atxHeading:o(_e),blockQuote:o(Se),characterEscape:q,characterReference:q,codeFenced:o(Le),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Le,l),codeText:o(te,l),codeTextData:q,data:q,codeFlowValue:q,definition:o(he),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(ye),hardBreakEscape:o(Ae),hardBreakTrailing:o(Ae),htmlFlow:o(Ce,l),htmlFlowData:q,htmlText:o(Ce,l),htmlTextData:q,image:o(Te),label:l,link:o(J),listItem:o(xe),listItemValue:y,listOrdered:o(Ee,h),listUnordered:o(Ee),paragraph:o(Be),reference:I,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(_e),strong:o(Ve),thematicBreak:o(ut)},exit:{atxHeading:f(),atxHeadingSequence:D,autolink:f(),autolinkEmail:ve,autolinkProtocol:ue,blockQuote:f(),characterEscapeValue:F,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ae,characterReference:Z,codeFenced:f(R),codeFencedFence:C,codeFencedFenceInfo:g,codeFencedFenceMeta:w,codeFlowValue:F,codeIndented:f(E),codeText:f(B),codeTextData:F,data:F,definition:f(),definitionDestinationString:M,definitionLabelString:T,definitionTitleString:k,emphasis:f(),hardBreakEscape:f(_),hardBreakTrailing:f(_),htmlFlow:f(V),htmlFlowData:F,htmlText:f($),htmlTextData:F,image:f(z),label:K,labelText:H,lineEnding:Y,link:f(j),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:Q,resourceDestinationString:P,resourceTitleString:U,resource:G,setextHeading:f(L),setextHeadingLineSequence:N,setextHeadingText:A,strong:f(),thematicBreak:f()}};ZN(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(pe){let Re={type:"root",children:[]};const ee={stack:[Re],tokenStack:[],config:t,enter:c,exit:d,buffer:l,resume:m,data:n},fe=[];let Ne=-1;for(;++Ne<pe.length;)if(pe[Ne][1].type==="listOrdered"||pe[Ne][1].type==="listUnordered")if(pe[Ne][0]==="enter")fe.push(Ne);else{const He=fe.pop();Ne=a(pe,He,Ne)}for(Ne=-1;++Ne<pe.length;){const He=t[pe[Ne][0]];QN.call(He,pe[Ne][1].type)&&He[pe[Ne][1].type].call(Object.assign({sliceSerialize:pe[Ne][2].sliceSerialize},ee),pe[Ne][1])}if(ee.tokenStack.length>0){const He=ee.tokenStack[ee.tokenStack.length-1];(He[1]||sk).call(ee,void 0,He[0])}for(Re.position={start:wo(pe.length>0?pe[0][1].start:{line:1,column:1,offset:0}),end:wo(pe.length>0?pe[pe.length-2][1].end:{line:1,column:1,offset:0})},Ne=-1;++Ne<t.transforms.length;)Re=t.transforms[Ne](Re)||Re;return Re}function a(pe,Re,ee){let fe=Re-1,Ne=-1,He=!1,$e,et,ze,Ze;for(;++fe<=ee;){const tt=pe[fe];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Ne++:Ne--,Ze=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&($e&&!Ze&&!Ne&&!ze&&(ze=fe),Ze=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ze=void 0}if(!Ne&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Ne===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if($e){let Rt=fe;for(et=void 0;Rt--;){const zt=pe[Rt];if(zt[1].type==="lineEnding"||zt[1].type==="lineEndingBlank"){if(zt[0]==="exit")continue;et&&(pe[et][1].type="lineEndingBlank",He=!0),zt[1].type="lineEnding",et=Rt}else if(!(zt[1].type==="linePrefix"||zt[1].type==="blockQuotePrefix"||zt[1].type==="blockQuotePrefixWhitespace"||zt[1].type==="blockQuoteMarker"||zt[1].type==="listItemIndent"))break}ze&&(!et||ze<et)&&($e._spread=!0),$e.end=Object.assign({},et?pe[et][1].start:tt[1].end),pe.splice(et||fe,0,["exit",$e,tt[2]]),fe++,ee++}if(tt[1].type==="listItemPrefix"){const Rt={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};$e=Rt,pe.splice(fe,0,["enter",Rt,tt[2]]),fe++,ee++,ze=void 0,Ze=!0}}}return pe[Re][1]._spread=He,ee}function o(pe,Re){return ee;function ee(fe){c.call(this,pe(fe),fe),Re&&Re.call(this,fe)}}function l(){this.stack.push({type:"fragment",children:[]})}function c(pe,Re,ee){this.stack[this.stack.length-1].children.push(pe),this.stack.push(pe),this.tokenStack.push([Re,ee||void 0]),pe.position={start:wo(Re.start),end:void 0}}function f(pe){return Re;function Re(ee){pe&&pe.call(this,ee),d.call(this,ee)}}function d(pe,Re){const ee=this.stack.pop(),fe=this.tokenStack.pop();if(fe)fe[0].type!==pe.type&&(Re?Re.call(this,pe,fe[0]):(fe[1]||sk).call(this,pe,fe[0]));else throw new Error("Cannot close `"+pe.type+"` ("+ld({start:pe.start,end:pe.end})+"): it’s not open");ee.position.end=wo(pe.end)}function m(){return G0(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function y(pe){if(this.data.expectingFirstListItemValue){const Re=this.stack[this.stack.length-2];Re.start=Number.parseInt(this.sliceSerialize(pe),10),this.data.expectingFirstListItemValue=void 0}}function g(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.lang=pe}function w(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.meta=pe}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function R(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe.replace(/(\r?\n|\r)$/g,"")}function T(pe){const Re=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Re,ee.identifier=ji(this.sliceSerialize(pe)).toLowerCase()}function k(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.title=pe}function M(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.url=pe}function D(pe){const Re=this.stack[this.stack.length-1];if(!Re.depth){const ee=this.sliceSerialize(pe).length;Re.depth=ee}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function N(pe){const Re=this.stack[this.stack.length-1];Re.depth=this.sliceSerialize(pe).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function q(pe){const ee=this.stack[this.stack.length-1].children;let fe=ee[ee.length-1];(!fe||fe.type!=="text")&&(fe=De(),fe.position={start:wo(pe.start),end:void 0},ee.push(fe)),this.stack.push(fe)}function F(pe){const Re=this.stack.pop();Re.value+=this.sliceSerialize(pe),Re.position.end=wo(pe.end)}function Y(pe){const Re=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ee=Re.children[Re.children.length-1];ee.position.end=wo(pe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Re.type)&&(q.call(this,pe),F.call(this,pe))}function _(){this.data.atHardBreak=!0}function V(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function $(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function B(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.value=pe}function j(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Re,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function z(){const pe=this.stack[this.stack.length-1];if(this.data.inReference){const Re=this.data.referenceType||"shortcut";pe.type+="Reference",pe.referenceType=Re,delete pe.url,delete pe.title}else delete pe.identifier,delete pe.label;this.data.referenceType=void 0}function H(pe){const Re=this.sliceSerialize(pe),ee=this.stack[this.stack.length-2];ee.label=xW(Re),ee.identifier=ji(Re).toLowerCase()}function K(){const pe=this.stack[this.stack.length-1],Re=this.resume(),ee=this.stack[this.stack.length-1];if(this.data.inReference=!0,ee.type==="link"){const fe=pe.children;ee.children=fe}else ee.alt=Re}function P(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.url=pe}function U(){const pe=this.resume(),Re=this.stack[this.stack.length-1];Re.title=pe}function G(){this.data.inReference=void 0}function I(){this.data.referenceType="collapsed"}function Q(pe){const Re=this.resume(),ee=this.stack[this.stack.length-1];ee.label=Re,ee.identifier=ji(this.sliceSerialize(pe)).toLowerCase(),this.data.referenceType="full"}function le(pe){this.data.characterReferenceType=pe.type}function ae(pe){const Re=this.sliceSerialize(pe),ee=this.data.characterReferenceType;let fe;ee?(fe=HN(Re,ee==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):fe=X0(Re);const Ne=this.stack[this.stack.length-1];Ne.value+=fe}function Z(pe){const Re=this.stack.pop();Re.position.end=wo(pe.end)}function ue(pe){F.call(this,pe);const Re=this.stack[this.stack.length-1];Re.url=this.sliceSerialize(pe)}function ve(pe){F.call(this,pe);const Re=this.stack[this.stack.length-1];Re.url="mailto:"+this.sliceSerialize(pe)}function Se(){return{type:"blockquote",children:[]}}function Le(){return{type:"code",lang:null,meta:null,value:""}}function te(){return{type:"inlineCode",value:""}}function he(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ye(){return{type:"emphasis",children:[]}}function _e(){return{type:"heading",depth:0,children:[]}}function Ae(){return{type:"break"}}function Ce(){return{type:"html",value:""}}function Te(){return{type:"image",title:null,url:"",alt:null}}function J(){return{type:"link",title:null,url:"",children:[]}}function Ee(pe){return{type:"list",ordered:pe.type==="listOrdered",start:null,spread:pe._spread,children:[]}}function xe(pe){return{type:"listItem",spread:pe._spread,checked:null,children:[]}}function Be(){return{type:"paragraph",children:[]}}function Ve(){return{type:"strong",children:[]}}function De(){return{type:"text",value:""}}function ut(){return{type:"thematicBreak"}}}function wo(e){return{line:e.line,column:e.column,offset:e.offset}}function ZN(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ZN(e,r):CW(e,r)}}function CW(e,t){let n;for(n in t)if(QN.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function sk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ld({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ld({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ld({start:t.start,end:t.end})+") is still open")}function RW(e){const t=this;t.parser=n;function n(r){return SW(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function TW(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function kW(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
428
|
-
`}]}function MW(e,t){const n=t.value?t.value+`
|
|
429
|
-
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function AW(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NW(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OW(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=zc(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,c+=1,e.footnoteCounts.set(r,c);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const d={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,d),e.applyData(t,d)}function DW(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IW(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function JN(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function PW(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JN(e,t);const a={src:zc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function LW(e,t){const n={src:zc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function _W(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function jW(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return JN(e,t);const a={href:zc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function zW(e,t){const n={href:zc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function FW(e,t,n){const r=e.all(t),a=n?BW(n):eO(t),o={},l=[];if(typeof t.checked=="boolean"){const m=r[0];let h;m&&m.type==="element"&&m.tagName==="p"?h=m:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const m=r[c];(a||c!==0||m.type!=="element"||m.tagName!=="p")&&l.push({type:"text",value:`
|
|
430
|
-
`}),m.type==="element"&&m.tagName==="p"&&!a?l.push(...m.children):l.push(m)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
431
|
-
`});const d={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,d),e.applyData(t,d)}function BW(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=eO(n[r])}return t}function eO(e){const t=e.spread;return t??e.children.length>1}function HW(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];if(l.type==="element"&&l.tagName==="li"&&l.properties&&Array.isArray(l.properties.className)&&l.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function UW(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qW(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function VW(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $W(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=$0(t.children[1]),f=IN(t.children[t.children.length-1]);c&&f&&(l.position={start:c,end:f}),a.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function WW(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,c=l?l.length:t.children.length;let f=-1;const d=[];for(;++f<c;){const h=t.children[f],y={},g=l?l[f]:void 0;g&&(y.align=g);let w={type:"element",tagName:o,properties:y,children:[]};h&&(w.children=e.all(h),e.patch(h,w),w=e.applyData(h,w)),d.push(w)}const m={type:"element",tagName:"tr",properties:{},children:e.wrap(d,!0)};return e.patch(t,m),e.applyData(t,m)}function YW(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const lk=9,ck=32;function KW(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(uk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(uk(t.slice(a),a>0,!1)),o.join("")}function uk(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===lk||o===ck;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===lk||o===ck;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function GW(e,t){const n={type:"text",value:KW(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function XW(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const QW={blockquote:TW,break:kW,code:MW,delete:AW,emphasis:NW,footnoteReference:OW,heading:DW,html:IW,imageReference:PW,image:LW,inlineCode:_W,linkReference:jW,link:zW,listItem:FW,list:HW,paragraph:UW,root:qW,strong:VW,table:$W,tableCell:YW,tableRow:WW,text:GW,thematicBreak:XW,toml:Bh,yaml:Bh,definition:Bh,footnoteDefinition:Bh};function Bh(){}const tO=-1,Cm=0,ud=1,jp=2,Z0=3,J0=4,ew=5,tw=6,nO=7,rO=8,ZW=typeof self=="object"?self:globalThis,dk=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new ZW[e](t)},JW=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,l]=t[a];switch(o){case Cm:case tO:return n(l,a);case ud:{const c=n([],a);for(const f of l)c.push(r(f));return c}case jp:{const c=n({},a);for(const[f,d]of l)c[r(f)]=r(d);return c}case Z0:return n(new Date(l),a);case J0:{const{source:c,flags:f}=l;return n(new RegExp(c,f),a)}case ew:{const c=n(new Map,a);for(const[f,d]of l)c.set(r(f),r(d));return c}case tw:{const c=n(new Set,a);for(const f of l)c.add(r(f));return c}case nO:{const{name:c,message:f}=l;return n(dk(c,f),a)}case rO:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:c}=new Uint8Array(l);return n(new DataView(c),l)}}return n(dk(o,l),a)};return r},fk=e=>JW(new Map,e)(0),Ul="",{toString:eY}={},{keys:tY}=Object,Wu=e=>{const t=typeof e;if(t!=="object"||!e)return[Cm,t];const n=eY.call(e).slice(8,-1);switch(n){case"Array":return[ud,Ul];case"Object":return[jp,Ul];case"Date":return[Z0,Ul];case"RegExp":return[J0,Ul];case"Map":return[ew,Ul];case"Set":return[tw,Ul];case"DataView":return[ud,n]}return n.includes("Array")?[ud,n]:n.includes("Error")?[nO,n]:[jp,n]},Hh=([e,t])=>e===Cm&&(t==="function"||t==="symbol"),nY=(e,t,n,r)=>{const a=(l,c)=>{const f=r.push(l)-1;return n.set(c,f),f},o=l=>{if(n.has(l))return n.get(l);let[c,f]=Wu(l);switch(c){case Cm:{let m=l;switch(f){case"bigint":c=rO,m=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);m=null;break;case"undefined":return a([tO],l)}return a([c,m],l)}case ud:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),a([f,[...y]],l)}const m=[],h=a([c,m],l);for(const y of l)m.push(o(y));return h}case jp:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const m=[],h=a([c,m],l);for(const y of tY(l))(e||!Hh(Wu(l[y])))&&m.push([o(y),o(l[y])]);return h}case Z0:return a([c,l.toISOString()],l);case J0:{const{source:m,flags:h}=l;return a([c,{source:m,flags:h}],l)}case ew:{const m=[],h=a([c,m],l);for(const[y,g]of l)(e||!(Hh(Wu(y))||Hh(Wu(g))))&&m.push([o(y),o(g)]);return h}case tw:{const m=[],h=a([c,m],l);for(const y of l)(e||!Hh(Wu(y)))&&m.push(o(y));return h}}const{message:d}=l;return a([c,{name:f,message:d}],l)};return o},hk=(e,{json:t,lossy:n}={})=>{const r=[];return nY(!(t||n),!!t,new Map,r)(e),r},zp=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?fk(hk(e,t)):structuredClone(e):(e,t)=>fk(hk(e,t));function rY(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function iY(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function aY(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||rY,r=e.options.footnoteBackLabel||iY,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let f=-1;for(;++f<e.footnoteOrder.length;){const d=e.footnoteById.get(e.footnoteOrder[f]);if(!d)continue;const m=e.all(d),h=String(d.identifier).toUpperCase(),y=zc(h.toLowerCase());let g=0;const w=[],C=e.footnoteCounts.get(h);for(;C!==void 0&&++g<=C;){w.length>0&&w.push({type:"text",value:" "});let T=typeof n=="string"?n:n(f,g);typeof T=="string"&&(T={type:"text",value:T}),w.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(g>1?"-"+g:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,g),className:["data-footnote-backref"]},children:Array.isArray(T)?T:[T]})}const R=m[m.length-1];if(R&&R.type==="element"&&R.tagName==="p"){const T=R.children[R.children.length-1];T&&T.type==="text"?T.value+=" ":R.children.push({type:"text",value:" "}),R.children.push(...w)}else m.push(...w);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(m,!0)};e.patch(d,E),c.push(E)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...zp(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
432
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
433
|
-
`}]}}const Rm=(function(e){if(e==null)return cY;if(typeof e=="function")return Tm(e);if(typeof e=="object")return Array.isArray(e)?oY(e):sY(e);if(typeof e=="string")return lY(e);throw new Error("Expected function, string, or object as test")});function oY(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Rm(e[n]);return Tm(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function sY(e){const t=e;return Tm(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function lY(e){return Tm(t);function t(n){return n&&n.type===e}}function Tm(e){return t;function t(n,r,a){return!!(uY(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function cY(){return!0}function uY(e){return e!==null&&typeof e=="object"&&"type"in e}const iO=[],dY=!0,rx=!1,fY="skip";function aO(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=Rm(a),l=r?-1:1;c(e,void 0,[])();function c(f,d,m){const h=f&&typeof f=="object"?f:{};if(typeof h.type=="string"){const g=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(g?"<"+g+">":""))+")"})}return y;function y(){let g=iO,w,C,R;if((!t||o(f,d,m[m.length-1]||void 0))&&(g=hY(n(f,m)),g[0]===rx))return g;if("children"in f&&f.children){const E=f;if(E.children&&g[0]!==fY)for(C=(r?E.children.length:-1)+l,R=m.concat(E);C>-1&&C<E.children.length;){const T=E.children[C];if(w=c(T,C,R)(),w[0]===rx)return w;C=typeof w[1]=="number"?w[1]:C+l}}return g}}}function hY(e){return Array.isArray(e)?e:typeof e=="number"?[dY,e]:e==null?iO:[e]}function nw(e,t,n,r){let a,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,a=n):(o=t,l=n,a=r),aO(e,o,c,a);function c(f,d){const m=d[d.length-1],h=m?m.children.indexOf(f):void 0;return l(f,h,m)}}const ix={}.hasOwnProperty,pY={};function mY(e,t){const n=t||pY,r=new Map,a=new Map,o=new Map,l={...QW,...n.handlers},c={all:d,applyData:yY,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:gY,wrap:vY};return nw(e,function(m){if(m.type==="definition"||m.type==="footnoteDefinition"){const h=m.type==="definition"?r:a,y=String(m.identifier).toUpperCase();h.has(y)||h.set(y,m)}}),c;function f(m,h){const y=m.type,g=c.handlers[y];if(ix.call(c.handlers,y)&&g)return g(c,m,h);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in m){const{children:C,...R}=m,E=zp(R);return E.children=c.all(m),E}return zp(m)}return(c.options.unknownHandler||bY)(c,m,h)}function d(m){const h=[];if("children"in m){const y=m.children;let g=-1;for(;++g<y.length;){const w=c.one(y[g],m);if(w){if(g&&y[g-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=pk(w.value)),!Array.isArray(w)&&w.type==="element")){const C=w.children[0];C&&C.type==="text"&&(C.value=pk(C.value))}Array.isArray(w)?h.push(...w):h.push(w)}}}return h}}function gY(e,t){e.position&&(t.position=r7(e))}function yY(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const l="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:l}}n.type==="element"&&o&&Object.assign(n.properties,zp(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function bY(e,t){const n=t.data||{},r="value"in t&&!(ix.call(n,"hProperties")||ix.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function vY(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
434
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
435
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
436
|
-
`}),n}function pk(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function mk(e,t){const n=mY(e,t),r=n.one(e,void 0),a=aY(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
|
|
437
|
-
`},a),o}function xY(e,t){return e&&"run"in e?async function(n,r){const a=mk(n,{file:r,...t});await e.run(a,r)}:function(n,r){return mk(n,{file:r,...e||t})}}function gk(e){if(e)throw e}var jb,yk;function wY(){if(yk)return jb;yk=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(d){return typeof Array.isArray=="function"?Array.isArray(d):t.call(d)==="[object Array]"},o=function(d){if(!d||t.call(d)!=="[object Object]")return!1;var m=e.call(d,"constructor"),h=d.constructor&&d.constructor.prototype&&e.call(d.constructor.prototype,"isPrototypeOf");if(d.constructor&&!m&&!h)return!1;var y;for(y in d);return typeof y>"u"||e.call(d,y)},l=function(d,m){n&&m.name==="__proto__"?n(d,m.name,{enumerable:!0,configurable:!0,value:m.newValue,writable:!0}):d[m.name]=m.newValue},c=function(d,m){if(m==="__proto__")if(e.call(d,m)){if(r)return r(d,m).value}else return;return d[m]};return jb=function f(){var d,m,h,y,g,w,C=arguments[0],R=1,E=arguments.length,T=!1;for(typeof C=="boolean"&&(T=C,C=arguments[1]||{},R=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});R<E;++R)if(d=arguments[R],d!=null)for(m in d)h=c(C,m),y=c(d,m),C!==y&&(T&&y&&(o(y)||(g=a(y)))?(g?(g=!1,w=h&&a(h)?h:[]):w=h&&o(h)?h:{},l(C,{name:m,newValue:f(T,w,y)})):typeof y<"u"&&l(C,{name:m,newValue:y}));return C},jb}var SY=wY();const zb=Gp(SY);function ax(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function EY(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);c(null,...a);function c(f,...d){const m=e[++o];let h=-1;if(f){l(f);return}for(;++h<a.length;)(d[h]===null||d[h]===void 0)&&(d[h]=a[h]);a=d,m?CY(m,c)(...d):l(null,...d)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function CY(e,t){let n;return r;function r(...l){const c=e.length>l.length;let f;c&&l.push(a);try{f=e.apply(this,l)}catch(d){const m=d;if(c&&n)throw m;return a(m)}c||(f&&f.then&&typeof f.then=="function"?f.then(o,a):f instanceof Error?a(f):o(f))}function a(l,...c){n||(n=!0,t(l,...c))}function o(l){a(null,l)}}const Xi={basename:RY,dirname:TY,extname:kY,join:MY,sep:"/"};function RY(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');nf(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,c=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else l<0&&(o=!0,l=a+1),c>-1&&(e.codePointAt(a)===t.codePointAt(c--)?c<0&&(r=a):(c=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function TY(e){if(nf(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function kY(e){nf(e);let t=e.length,n=-1,r=0,a=-1,o=0,l;for(;t--;){const c=e.codePointAt(t);if(c===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),c===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function MY(...e){let t=-1,n;for(;++t<e.length;)nf(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":AY(n)}function AY(e){nf(e);const t=e.codePointAt(0)===47;let n=NY(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function NY(e,t){let n="",r=0,a=-1,o=0,l=-1,c,f;for(;++l<=e.length;){if(l<e.length)c=e.codePointAt(l);else{if(c===47)break;c=47}if(c===47){if(!(a===l-1||o===1))if(a!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,o=0;continue}}else if(n.length>0){n="",r=0,a=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,o=0}else c===46&&o>-1?o++:o=-1}return n}function nf(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const OY={cwd:DY};function DY(){return"/"}function ox(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function IY(e){if(typeof e=="string")e=new URL(e);else if(!ox(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return PY(e)}function PY(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Fb=["history","path","basename","stem","extname","dirname"];class oO{constructor(t){let n;t?ox(t)?n={path:t}:typeof t=="string"||LY(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":OY.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Fb.length;){const o=Fb[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)Fb.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Xi.basename(this.path):void 0}set basename(t){Hb(t,"basename"),Bb(t,"basename"),this.path=Xi.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Xi.dirname(this.path):void 0}set dirname(t){bk(this.basename,"dirname"),this.path=Xi.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Xi.extname(this.path):void 0}set extname(t){if(Bb(t,"extname"),bk(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Xi.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ox(t)&&(t=IY(t)),Hb(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Xi.basename(this.path,this.extname):void 0}set stem(t){Hb(t,"stem"),Bb(t,"stem"),this.path=Xi.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new wr(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Bb(e,t){if(e&&e.includes(Xi.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Xi.sep+"`")}function Hb(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function bk(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function LY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const _Y=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),jY={}.hasOwnProperty;class rw extends _Y{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=EY()}copy(){const t=new rw;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(zb(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Vb("data",this.frozen),this.namespace[t]=n,this):jY.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Vb("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Uh(t),r=this.parser||this.Parser;return Ub("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ub("process",this.parser||this.Parser),qb("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const c=Uh(t),f=r.parse(c);r.run(f,c,function(m,h,y){if(m||!h||!y)return d(m);const g=h,w=r.stringify(g,y);BY(w)?y.value=w:y.result=w,d(m,y)});function d(m,h){m||!h?l(m):o?o(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),Ub("processSync",this.parser||this.Parser),qb("processSync",this.compiler||this.Compiler),this.process(t,a),xk("processSync","process",n),r;function a(o,l){n=!0,gk(o),r=l}}run(t,n,r){vk(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,c){const f=Uh(n);a.run(t,f,d);function d(m,h,y){const g=h||t;m?c(m):l?l(g):r(void 0,g,y)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),xk("runSync","run",r),a;function o(l,c){gk(l),a=c,r=!0}}stringify(t,n){this.freeze();const r=Uh(n),a=this.compiler||this.Compiler;return qb("stringify",a),vk(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Vb("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(d){if(typeof d=="function")f(d,[]);else if(typeof d=="object")if(Array.isArray(d)){const[m,...h]=d;f(m,h)}else l(d);else throw new TypeError("Expected usable value, not `"+d+"`")}function l(d){if(!("plugins"in d)&&!("settings"in d))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(d.plugins),d.settings&&(a.settings=zb(!0,a.settings,d.settings))}function c(d){let m=-1;if(d!=null)if(Array.isArray(d))for(;++m<d.length;){const h=d[m];o(h)}else throw new TypeError("Expected a list of plugins, not `"+d+"`")}function f(d,m){let h=-1,y=-1;for(;++h<r.length;)if(r[h][0]===d){y=h;break}if(y===-1)r.push([d,...m]);else if(m.length>0){let[g,...w]=m;const C=r[y][1];ax(C)&&ax(g)&&(g=zb(!0,C,g)),r[y]=[d,g,...w]}}}}const zY=new rw().freeze();function Ub(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function qb(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Vb(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function vk(e){if(!ax(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function xk(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Uh(e){return FY(e)?e:new oO(e)}function FY(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function BY(e){return typeof e=="string"||HY(e)}function HY(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const UY="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",wk=[],Sk={allowDangerousHtml:!0},qY=/^(https?|ircs?|mailto|xmpp)$/i,VY=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function $Y(e){const t=WY(e),n=YY(e);return KY(t.runSync(t.parse(n),n),e)}function WY(e){const t=e.rehypePlugins||wk,n=e.remarkPlugins||wk,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Sk}:Sk;return zY().use(RW).use(n).use(xY,r).use(t)}function YY(e){const t=e.children||"",n=new oO;return typeof t=="string"&&(n.value=t),n}function KY(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,c=t.unwrapDisallowed,f=t.urlTransform||GY;for(const m of VY)Object.hasOwn(t,m.from)&&(""+m.from+(m.to?"use `"+m.to+"` instead":"remove it")+UY+m.id,void 0);return nw(e,d),l7(e,{Fragment:S.Fragment,components:a,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function d(m,h,y){if(m.type==="raw"&&y&&typeof h=="number")return l?y.children.splice(h,1):y.children[h]={type:"text",value:m.value},h;if(m.type==="element"){let g;for(g in Pb)if(Object.hasOwn(Pb,g)&&Object.hasOwn(m.properties,g)){const w=m.properties[g],C=Pb[g];(C===null||C.includes(m.tagName))&&(m.properties[g]=f(String(w||""),g,m))}}if(m.type==="element"){let g=n?!n.includes(m.tagName):o?o.includes(m.tagName):!1;if(!g&&r&&typeof h=="number"&&(g=!r(m,h,y)),g&&y&&typeof h=="number")return c&&m.children?y.children.splice(h,1,...m.children):y.children.splice(h,1),h}}}function GY(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||qY.test(e.slice(0,t))?e:""}function Ek(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function XY(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function QY(e,t,n){const a=Rm((n||{}).ignore||[]),o=ZY(t);let l=-1;for(;++l<o.length;)aO(e,"text",c);function c(d,m){let h=-1,y;for(;++h<m.length;){const g=m[h],w=y?y.children:void 0;if(a(g,w?w.indexOf(g):void 0,y))return;y=g}if(y)return f(d,m)}function f(d,m){const h=m[m.length-1],y=o[l][0],g=o[l][1];let w=0;const R=h.children.indexOf(d);let E=!1,T=[];y.lastIndex=0;let k=y.exec(d.value);for(;k;){const M=k.index,D={index:k.index,input:k.input,stack:[...m,d]};let A=g(...k,D);if(typeof A=="string"&&(A=A.length>0?{type:"text",value:A}:void 0),A===!1?y.lastIndex=M+1:(w!==M&&T.push({type:"text",value:d.value.slice(w,M)}),Array.isArray(A)?T.push(...A):A&&T.push(A),w=M+k[0].length,E=!0),!y.global)break;k=y.exec(d.value)}return E?(w<d.value.length&&T.push({type:"text",value:d.value.slice(w)}),h.children.splice(R,1,...T)):T=[d],R+T.length}}function ZY(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([JY(a[0]),eK(a[1])])}return t}function JY(e){return typeof e=="string"?new RegExp(XY(e),"g"):e}function eK(e){return typeof e=="function"?e:function(){return e}}const $b="phrasing",Wb=["autolink","link","image","label"];function tK(){return{transforms:[lK],enter:{literalAutolink:rK,literalAutolinkEmail:Yb,literalAutolinkHttp:Yb,literalAutolinkWww:Yb},exit:{literalAutolink:sK,literalAutolinkEmail:oK,literalAutolinkHttp:iK,literalAutolinkWww:aK}}}function nK(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:$b,notInConstruct:Wb},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:$b,notInConstruct:Wb},{character:":",before:"[ps]",after:"\\/",inConstruct:$b,notInConstruct:Wb}]}}function rK(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Yb(e){this.config.enter.autolinkProtocol.call(this,e)}function iK(e){this.config.exit.autolinkProtocol.call(this,e)}function aK(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function oK(e){this.config.exit.autolinkEmail.call(this,e)}function sK(e){this.exit(e)}function lK(e){QY(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,cK],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),uK]],{ignore:["link","linkReference"]})}function cK(e,t,n,r,a){let o="";if(!sO(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!dK(n)))return!1;const l=fK(n+r);if(!l[0])return!1;const c={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[c,{type:"text",value:l[1]}]:c}function uK(e,t,n,r){return!sO(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function dK(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function fK(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=Ek(e,"(");let o=Ek(e,")");for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function sO(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Qs(n)||Sm(n))&&(!t||n!==47)}lO.peek=wK;function hK(){this.buffer()}function pK(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function mK(){this.buffer()}function gK(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function yK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function bK(e){this.exit(e)}function vK(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=ji(this.sliceSerialize(e)).toLowerCase(),n.label=t}function xK(e){this.exit(e)}function wK(){return"["}function lO(e,t,n,r){const a=n.createTracker(r);let o=a.move("[^");const l=n.enter("footnoteReference"),c=n.enter("reference");return o+=a.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),l(),o+=a.move("]"),o}function SK(){return{enter:{gfmFootnoteCallString:hK,gfmFootnoteCall:pK,gfmFootnoteDefinitionLabelString:mK,gfmFootnoteDefinition:gK},exit:{gfmFootnoteCallString:yK,gfmFootnoteCall:bK,gfmFootnoteDefinitionLabelString:vK,gfmFootnoteDefinition:xK}}}function EK(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lO},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,l){const c=o.createTracker(l);let f=c.move("[^");const d=o.enter("footnoteDefinition"),m=o.enter("label");return f+=c.move(o.safe(o.associationId(r),{before:f,after:"]"})),m(),f+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),f+=c.move((t?`
|
|
438
|
-
`:" ")+o.indentLines(o.containerFlow(r,c.current()),t?cO:CK))),d(),f}}function CK(e,t,n){return t===0?e:cO(e,t,n)}function cO(e,t,n){return(n?"":" ")+e}const RK=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];uO.peek=NK;function TK(){return{canContainEols:["delete"],enter:{strikethrough:MK},exit:{strikethrough:AK}}}function kK(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:RK}],handlers:{delete:uO}}}function MK(e){this.enter({type:"delete",children:[]},e)}function AK(e){this.exit(e)}function uO(e,t,n,r){const a=n.createTracker(r),o=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),o(),l}function NK(){return"~"}function OK(e){return e.length}function DK(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||OK,o=[],l=[],c=[],f=[];let d=0,m=-1;for(;++m<e.length;){const C=[],R=[];let E=-1;for(e[m].length>d&&(d=e[m].length);++E<e[m].length;){const T=IK(e[m][E]);if(n.alignDelimiters!==!1){const k=a(T);R[E]=k,(f[E]===void 0||k>f[E])&&(f[E]=k)}C.push(T)}l[m]=C,c[m]=R}let h=-1;if(typeof r=="object"&&"length"in r)for(;++h<d;)o[h]=Ck(r[h]);else{const C=Ck(r);for(;++h<d;)o[h]=C}h=-1;const y=[],g=[];for(;++h<d;){const C=o[h];let R="",E="";C===99?(R=":",E=":"):C===108?R=":":C===114&&(E=":");let T=n.alignDelimiters===!1?1:Math.max(1,f[h]-R.length-E.length);const k=R+"-".repeat(T)+E;n.alignDelimiters!==!1&&(T=R.length+T+E.length,T>f[h]&&(f[h]=T),g[h]=T),y[h]=k}l.splice(1,0,y),c.splice(1,0,g),m=-1;const w=[];for(;++m<l.length;){const C=l[m],R=c[m];h=-1;const E=[];for(;++h<d;){const T=C[h]||"";let k="",M="";if(n.alignDelimiters!==!1){const D=f[h]-(R[h]||0),A=o[h];A===114?k=" ".repeat(D):A===99?D%2?(k=" ".repeat(D/2+.5),M=" ".repeat(D/2-.5)):(k=" ".repeat(D/2),M=k):M=" ".repeat(D)}n.delimiterStart!==!1&&!h&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&T==="")&&(n.delimiterStart!==!1||h)&&E.push(" "),n.alignDelimiters!==!1&&E.push(k),E.push(T),n.alignDelimiters!==!1&&E.push(M),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||h!==d-1)&&E.push("|")}w.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return w.join(`
|
|
439
|
-
`)}function IK(e){return e==null?"":String(e)}function Ck(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function PK(e,t,n,r){const a=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),LK);return a(),l}function LK(e,t,n){return">"+(n?"":" ")+e}function _K(e,t){return Rk(e,t.inConstruct,!0)&&!Rk(e,t.notInConstruct,!1)}function Rk(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Tk(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
440
|
-
`&&_K(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
441
|
-
`}function jK(e,t){const n=String(e);let r=n.indexOf(t),a=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>l&&(l=o):o=1,a=r+t.length,r=n.indexOf(t,a);return l}function zK(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function FK(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function BK(e,t,n,r){const a=FK(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(zK(e,n)){const h=n.enter("codeIndented"),y=n.indentLines(o,HK);return h(),y}const c=n.createTracker(r),f=a.repeat(Math.max(jK(o,a)+1,3)),d=n.enter("codeFenced");let m=c.move(f);if(e.lang){const h=n.enter(`codeFencedLang${l}`);m+=c.move(n.safe(e.lang,{before:m,after:" ",encode:["`"],...c.current()})),h()}if(e.lang&&e.meta){const h=n.enter(`codeFencedMeta${l}`);m+=c.move(" "),m+=c.move(n.safe(e.meta,{before:m,after:`
|
|
442
|
-
`,encode:["`"],...c.current()})),h()}return m+=c.move(`
|
|
443
|
-
`),o&&(m+=c.move(o+`
|
|
444
|
-
`)),m+=c.move(f),d(),m}function HK(e,t,n){return(n?"":" ")+e}function iw(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function UK(e,t,n,r){const a=iw(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("[");return d+=f.move(n.safe(n.associationId(e),{before:d,after:"]",...f.current()})),d+=f.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":`
|
|
445
|
-
`,...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),l(),d}function qK(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function kd(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Fp(e,t,n){const r=Rc(e),a=Rc(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}dO.peek=VK;function dO(e,t,n,r){const a=qK(n),o=n.enter("emphasis"),l=n.createTracker(r),c=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=Fp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=kd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Fp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+kd(h));const g=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function VK(e,t,n){return n.options.emphasis||"*"}function $K(e,t){let n=!1;return nw(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,rx}),!!((!e.depth||e.depth<3)&&G0(e)&&(t.options.setext||n))}function WK(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if($K(e,n)){const m=n.enter("headingSetext"),h=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
|
|
446
|
-
`,after:`
|
|
447
|
-
`});return h(),m(),y+`
|
|
448
|
-
`+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
449
|
-
`))+1))}const l="#".repeat(a),c=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let d=n.containerPhrasing(e,{before:"# ",after:`
|
|
450
|
-
`,...o.current()});return/^[\t ]/.test(d)&&(d=kd(d.charCodeAt(0))+d.slice(1)),d=d?l+" "+d:l,n.options.closeAtx&&(d+=" "+l),f(),c(),d}fO.peek=YK;function fO(e){return e.value||""}function YK(){return"<"}hO.peek=KK;function hO(e,t,n,r){const a=iw(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let c=n.enter("label");const f=n.createTracker(r);let d=f.move("![");return d+=f.move(n.safe(e.alt,{before:d,after:"]",...f.current()})),d+=f.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),d+=f.move("<"),d+=f.move(n.safe(e.url,{before:d,after:">",...f.current()})),d+=f.move(">")):(c=n.enter("destinationRaw"),d+=f.move(n.safe(e.url,{before:d,after:e.title?" ":")",...f.current()}))),c(),e.title&&(c=n.enter(`title${o}`),d+=f.move(" "+a),d+=f.move(n.safe(e.title,{before:d,after:a,...f.current()})),d+=f.move(a),c()),d+=f.move(")"),l(),d}function KK(){return"!"}pO.peek=GK;function pO(e,t,n,r){const a=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("![");const d=n.safe(e.alt,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!d||d!==h?f+=c.move(h+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function GK(){return"!"}mO.peek=XK;function mO(e,t,n){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],c=n.compilePattern(l);let f;if(l.atBreak)for(;f=c.exec(r);){let d=f.index;r.charCodeAt(d)===10&&r.charCodeAt(d-1)===13&&d--,r=r.slice(0,d)+" "+r.slice(f.index+1)}}return a+r+a}function XK(){return"`"}function gO(e,t){const n=G0(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}yO.peek=QK;function yO(e,t,n,r){const a=iw(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let c,f;if(gO(e,n)){const m=n.stack;n.stack=[],c=n.enter("autolink");let h=l.move("<");return h+=l.move(n.containerPhrasing(e,{before:h,after:">",...l.current()})),h+=l.move(">"),c(),n.stack=m,h}c=n.enter("link"),f=n.enter("label");let d=l.move("[");return d+=l.move(n.containerPhrasing(e,{before:d,after:"](",...l.current()})),d+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),d+=l.move("<"),d+=l.move(n.safe(e.url,{before:d,after:">",...l.current()})),d+=l.move(">")):(f=n.enter("destinationRaw"),d+=l.move(n.safe(e.url,{before:d,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),d+=l.move(" "+a),d+=l.move(n.safe(e.title,{before:d,after:a,...l.current()})),d+=l.move(a),f()),d+=l.move(")"),c(),d}function QK(e,t,n){return gO(e,n)?"<":"["}bO.peek=ZK;function bO(e,t,n,r){const a=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const c=n.createTracker(r);let f=c.move("[");const d=n.containerPhrasing(e,{before:f,after:"]",...c.current()});f+=c.move(d+"]["),l();const m=n.stack;n.stack=[],l=n.enter("reference");const h=n.safe(n.associationId(e),{before:f,after:"]",...c.current()});return l(),n.stack=m,o(),a==="full"||!d||d!==h?f+=c.move(h+"]"):a==="shortcut"?f=f.slice(0,-1):f+=c.move("]"),f}function ZK(){return"["}function aw(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function JK(e){const t=aw(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function eG(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function vO(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function tG(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?eG(n):aw(n);const c=e.ordered?l==="."?")":".":JK(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const m=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&m&&(!m.children||!m.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),vO(n)===l&&m){let h=-1;for(;++h<e.children.length;){const y=e.children[h];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=c),n.bulletCurrent=l;const d=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,a(),d}function nG(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function rG(e,t,n,r){const a=nG(n);let o=n.bulletCurrent||aw(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(l-o.length)),c.shift(l);const f=n.enter("listItem"),d=n.indentLines(n.containerFlow(e,c.current()),m);return f(),d;function m(h,y,g){return y?(g?"":" ".repeat(l))+h:(g?o:o+" ".repeat(l-o.length))+h}}function iG(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const aG=Rm(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function oG(e,t,n,r){return(e.children.some(function(l){return aG(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function sG(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}xO.peek=lG;function xO(e,t,n,r){const a=sG(n),o=n.enter("strong"),l=n.createTracker(r),c=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:c,...l.current()}));const d=f.charCodeAt(0),m=Fp(r.before.charCodeAt(r.before.length-1),d,a);m.inside&&(f=kd(d)+f.slice(1));const h=f.charCodeAt(f.length-1),y=Fp(r.after.charCodeAt(0),h,a);y.inside&&(f=f.slice(0,-1)+kd(h));const g=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:m.outside},c+f+g}function lG(e,t,n){return n.options.strong||"*"}function cG(e,t,n,r){return n.safe(e.value,r)}function uG(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function dG(e,t,n){const r=(vO(n)+(n.options.ruleSpaces?" ":"")).repeat(uG(n));return n.options.ruleSpaces?r.slice(0,-1):r}const wO={blockquote:PK,break:Tk,code:BK,definition:UK,emphasis:dO,hardBreak:Tk,heading:WK,html:fO,image:hO,imageReference:pO,inlineCode:mO,link:yO,linkReference:bO,list:tG,listItem:rG,paragraph:iG,root:oG,strong:xO,text:cG,thematicBreak:dG};function fG(){return{enter:{table:hG,tableData:kk,tableHeader:kk,tableRow:mG},exit:{codeText:gG,table:pG,tableData:Kb,tableHeader:Kb,tableRow:Kb}}}function hG(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function pG(e){this.exit(e),this.data.inTable=void 0}function mG(e){this.enter({type:"tableRow",children:[]},e)}function Kb(e){this.exit(e)}function kk(e){this.enter({type:"tableCell",children:[]},e)}function gG(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,yG));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function yG(e,t){return t==="|"?t:e}function bG(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
451
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:c}};function l(g,w,C,R){return d(m(g,C,R),g.align)}function c(g,w,C,R){const E=h(g,C,R),T=d([E]);return T.slice(0,T.indexOf(`
|
|
452
|
-
`))}function f(g,w,C,R){const E=C.enter("tableCell"),T=C.enter("phrasing"),k=C.containerPhrasing(g,{...R,before:o,after:o});return T(),E(),k}function d(g,w){return DK(g,{align:w,alignDelimiters:r,padding:n,stringLength:a})}function m(g,w,C){const R=g.children;let E=-1;const T=[],k=w.enter("table");for(;++E<R.length;)T[E]=h(R[E],w,C);return k(),T}function h(g,w,C){const R=g.children;let E=-1;const T=[],k=w.enter("tableRow");for(;++E<R.length;)T[E]=f(R[E],g,w,C);return k(),T}function y(g,w,C){let R=wO.inlineCode(g,w,C);return C.stack.includes("tableCell")&&(R=R.replace(/\|/g,"\\$&")),R}}function vG(){return{exit:{taskListCheckValueChecked:Mk,taskListCheckValueUnchecked:Mk,paragraph:wG}}}function xG(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:SG}}}function Mk(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function wG(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let o=-1,l;for(;++o<a.length;){const c=a[o];if(c.type==="paragraph"){l=c;break}}l===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function SG(e,t,n,r){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(l);let f=wO.listItem(e,t,n,{...r,...c.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,d)),f;function d(m){return m+l}}function EG(){return[tK(),SK(),TK(),fG(),vG()]}function CG(e){return{extensions:[nK(),EK(e),kK(),bG(e),xG()]}}const RG={tokenize:OG,partial:!0},SO={tokenize:DG,partial:!0},EO={tokenize:IG,partial:!0},CO={tokenize:PG,partial:!0},TG={tokenize:LG,partial:!0},RO={name:"wwwAutolink",tokenize:AG,previous:kO},TO={name:"protocolAutolink",tokenize:NG,previous:MO},Ga={name:"emailAutolink",tokenize:MG,previous:AO},da={};function kG(){return{text:da}}let Ss=48;for(;Ss<123;)da[Ss]=Ga,Ss++,Ss===58?Ss=65:Ss===91&&(Ss=97);da[43]=Ga;da[45]=Ga;da[46]=Ga;da[95]=Ga;da[72]=[Ga,TO];da[104]=[Ga,TO];da[87]=[Ga,RO];da[119]=[Ga,RO];function MG(e,t,n){const r=this;let a,o;return l;function l(h){return!sx(h)||!AO.call(r,r.previous)||ow(r.events)?n(h):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(h))}function c(h){return sx(h)?(e.consume(h),c):h===64?(e.consume(h),f):n(h)}function f(h){return h===46?e.check(TG,m,d)(h):h===45||h===95||xr(h)?(o=!0,e.consume(h),f):m(h)}function d(h){return e.consume(h),a=!0,f}function m(h){return o&&a&&kr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(h)):n(h)}}function AG(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!kO.call(r,r.previous)||ow(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(RG,e.attempt(SO,e.attempt(EO,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function NG(e,t,n){const r=this;let a="",o=!1;return l;function l(h){return(h===72||h===104)&&MO.call(r,r.previous)&&!ow(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(h),e.consume(h),c):n(h)}function c(h){if(kr(h)&&a.length<5)return a+=String.fromCodePoint(h),e.consume(h),c;if(h===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(h),f}return n(h)}function f(h){return h===47?(e.consume(h),o?d:(o=!0,f)):n(h)}function d(h){return h===null||_p(h)||En(h)||Qs(h)||Sm(h)?n(h):e.attempt(SO,e.attempt(EO,m),n)(h)}function m(h){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(h)}}function OG(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function DG(e,t,n){let r,a,o;return l;function l(d){return d===46||d===95?e.check(CO,f,c)(d):d===null||En(d)||Qs(d)||d!==45&&Sm(d)?f(d):(o=!0,e.consume(d),l)}function c(d){return d===95?r=!0:(a=r,r=void 0),e.consume(d),l}function f(d){return a||r||!o?n(d):t(d)}}function IG(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?o(l):l===33||l===34||l===38||l===39||l===41||l===42||l===44||l===46||l===58||l===59||l===60||l===63||l===93||l===95||l===126?e.check(CO,t,o)(l):l===null||En(l)||Qs(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function PG(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),a):c===60||c===null||En(c)||Qs(c)?t(c):n(c)}function a(c){return c===null||c===40||c===91||En(c)||Qs(c)?t(c):r(c)}function o(c){return kr(c)?l(c):n(c)}function l(c){return c===59?(e.consume(c),r):kr(c)?(e.consume(c),l):n(c)}}function LG(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return xr(o)?n(o):t(o)}}function kO(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||En(e)}function MO(e){return!kr(e)}function AO(e){return!(e===47||sx(e))}function sx(e){return e===43||e===45||e===46||e===95||xr(e)}function ow(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const _G={tokenize:VG,partial:!0};function jG(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:HG,continuation:{tokenize:UG},exit:qG}},text:{91:{name:"gfmFootnoteCall",tokenize:BG},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:zG,resolveTo:FG}}}}function zG(e,t,n){const r=this;let a=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return c;function c(f){if(!l||!l._balanced)return n(f);const d=ji(r.sliceSerialize({start:l.end,end:r.now()}));return d.codePointAt(0)!==94||!o.includes(d.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function FG(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function BG(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return c;function c(h){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),f}function f(h){return h!==94?n(h):(e.enter("gfmFootnoteCallMarker"),e.consume(h),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",d)}function d(h){if(o>999||h===93&&!l||h===null||h===91||En(h))return n(h);if(h===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(ji(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(h)}return En(h)||(l=!0),o++,e.consume(h),h===92?m:d}function m(h){return h===91||h===92||h===93?(e.consume(h),o++,d):d(h)}}function HG(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,c;return f;function f(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),d}function d(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):n(w)}function m(w){if(l>999||w===93&&!c||w===null||w===91||En(w))return n(w);if(w===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return o=ji(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return En(w)||(c=!0),l++,e.consume(w),w===92?h:m}function h(w){return w===91||w===92||w===93?(e.consume(w),l++,m):m(w)}function y(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(o)||a.push(o),on(e,g,"gfmFootnoteDefinitionWhitespace")):n(w)}function g(w){return t(w)}}function UG(e,t,n){return e.check(tf,t,e.attempt(_G,t,n))}function qG(e){e.exit("gfmFootnoteDefinition")}function VG(e,t,n){const r=this;return on(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function $G(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,c){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let d=f;for(;d--;)if(l[d][0]==="exit"&&l[d][1].type==="strikethroughSequenceTemporary"&&l[d][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[d][1].end.offset-l[d][1].start.offset){l[f][1].type="strikethroughSequence",l[d][1].type="strikethroughSequence";const m={type:"strikethrough",start:Object.assign({},l[d][1].start),end:Object.assign({},l[f][1].end)},h={type:"strikethroughText",start:Object.assign({},l[d][1].end),end:Object.assign({},l[f][1].start)},y=[["enter",m,c],["enter",l[d][1],c],["exit",l[d][1],c],["enter",h,c]],g=c.parser.constructs.insideSpan.null;g&&ii(y,y.length,0,Em(g,l.slice(d+1,f),c)),ii(y,y.length,0,[["exit",h,c],["enter",l[f][1],c],["exit",l[f][1],c],["exit",m,c]]),ii(l,d-1,f-d+3,y),f=d+y.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,c,f){const d=this.previous,m=this.events;let h=0;return y;function y(w){return d===126&&m[m.length-1][1].type!=="characterEscape"?f(w):(l.enter("strikethroughSequenceTemporary"),g(w))}function g(w){const C=Rc(d);if(w===126)return h>1?f(w):(l.consume(w),h++,g);if(h<2&&!n)return f(w);const R=l.exit("strikethroughSequenceTemporary"),E=Rc(w);return R._open=!E||E===2&&!!C,R._close=!C||C===2&&!!E,c(w)}}}class WG{constructor(){this.map=[]}add(t,n,r){YG(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const o of a)t.push(o);a=r.pop()}this.map.length=0}}function YG(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function KG(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function GG(){return{flow:{null:{name:"table",tokenize:XG,resolveAll:QG}}}}function XG(e,t,n){const r=this;let a=0,o=0,l;return c;function c(F){let Y=r.events.length-1;for(;Y>-1;){const $=r.events[Y][1].type;if($==="lineEnding"||$==="linePrefix")Y--;else break}const _=Y>-1?r.events[Y][1].type:null,V=_==="tableHead"||_==="tableRow"?A:f;return V===A&&r.parser.lazy[r.now().line]?n(F):V(F)}function f(F){return e.enter("tableHead"),e.enter("tableRow"),d(F)}function d(F){return F===124||(l=!0,o+=1),m(F)}function m(F){return F===null?n(F):vt(F)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(F),e.exit("lineEnding"),g):n(F):Kt(F)?on(e,m,"whitespace")(F):(o+=1,l&&(l=!1,a+=1),F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),l=!0,m):(e.enter("data"),h(F)))}function h(F){return F===null||F===124||En(F)?(e.exit("data"),m(F)):(e.consume(F),F===92?y:h)}function y(F){return F===92||F===124?(e.consume(F),h):h(F)}function g(F){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(F):(e.enter("tableDelimiterRow"),l=!1,Kt(F)?on(e,w,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(F):w(F))}function w(F){return F===45||F===58?R(F):F===124?(l=!0,e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),C):D(F)}function C(F){return Kt(F)?on(e,R,"whitespace")(F):R(F)}function R(F){return F===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),E):F===45?(o+=1,E(F)):F===null||vt(F)?M(F):D(F)}function E(F){return F===45?(e.enter("tableDelimiterFiller"),T(F)):D(F)}function T(F){return F===45?(e.consume(F),T):F===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(F),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(F))}function k(F){return Kt(F)?on(e,M,"whitespace")(F):M(F)}function M(F){return F===124?w(F):F===null||vt(F)?!l||a!==o?D(F):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(F)):D(F)}function D(F){return n(F)}function A(F){return e.enter("tableRow"),N(F)}function N(F){return F===124?(e.enter("tableCellDivider"),e.consume(F),e.exit("tableCellDivider"),N):F===null||vt(F)?(e.exit("tableRow"),t(F)):Kt(F)?on(e,N,"whitespace")(F):(e.enter("data"),L(F))}function L(F){return F===null||F===124||En(F)?(e.exit("data"),N(F)):(e.consume(F),F===92?q:L)}function q(F){return F===92||F===124?(e.consume(F),L):L(F)}}function QG(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],l=[0,0,0,0],c=!1,f=0,d,m,h;const y=new WG;for(;++n<e.length;){const g=e[n],w=g[1];g[0]==="enter"?w.type==="tableHead"?(c=!1,f!==0&&(Ak(y,t,f,d,m),m=void 0,f=0),d={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",d,t]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(r=!0,h=void 0,o=[0,0,0,0],l=[0,n+1,0,0],c&&(c=!1,m={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},y.add(n,0,[["enter",m,t]])),a=w.type==="tableDelimiterRow"?2:m?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],h=qh(y,t,o,a,void 0,h),o=[0,0,0,0]),l[2]=n)):w.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],h=qh(y,t,o,a,void 0,h)),o=l,l=[o[1],n,0,0])):w.type==="tableHead"?(c=!0,f=n):w.type==="tableRow"||w.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],h=qh(y,t,o,a,n,h)):l[1]!==0&&(h=qh(y,t,l,a,n,h)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&Ak(y,t,f,d,m),y.consume(t.events),n=-1;++n<t.events.length;){const g=t.events[n];g[0]==="enter"&&g[1].type==="table"&&(g[1]._align=KG(t.events,n))}return e}function qh(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},Wl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=Wl(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const d=Wl(t.events,n[2]),m=Wl(t.events,n[3]),h={type:c,start:Object.assign({},d),end:Object.assign({},m)};if(e.add(n[2],0,[["enter",h,t]]),r!==2){const y=t.events[n[2]],g=t.events[n[3]];if(y[1].end=Object.assign({},g[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const w=n[2]+1,C=n[3]-n[2]-1;e.add(w,C,[])}}e.add(n[3]+1,0,[["exit",h,t]])}return a!==void 0&&(o.end=Object.assign({},Wl(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function Ak(e,t,n,r,a){const o=[],l=Wl(t.events,n);a&&(a.end=Object.assign({},l),o.push(["exit",a,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function Wl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const ZG={name:"tasklistCheck",tokenize:eX};function JG(){return{text:{91:ZG}}}function eX(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return En(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(f)}function c(f){return vt(f)?t(f):Kt(f)?e.check({tokenize:tX},t,n)(f):n(f)}}function tX(e,t,n){return on(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function nX(e){return BN([kG(),jG(),$G(e),GG(),JG()])}const rX={};function iX(e){const t=this,n=e||rX,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(nX(n)),o.push(EG()),l.push(CG(n))}function aX(e){const t=e.split(`
|
|
453
|
-
`),n=[];let r=[],a=!1;const o=()=>{const l=r.join(`
|
|
454
|
-
`);l.trim()&&n.push(l),r=[]};for(const l of t){if(/^\s*(```|~~~)/.test(l)){a=!a,r.push(l);continue}if(!a&&l.trim()===""){o();continue}r.push(l)}return o(),n}const oX={a:({node:e,...t})=>S.jsx("a",{...t,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline underline-offset-2 break-all"}),pre:({node:e,...t})=>S.jsx("pre",{...t,className:"bg-muted overflow-x-auto rounded-md p-2 font-mono text-xs leading-relaxed"}),code:({node:e,className:t,...n})=>S.jsx("code",{...n,className:Pe("bg-muted rounded px-1 font-mono text-xs",t)}),ul:({node:e,...t})=>S.jsx("ul",{...t,className:"list-disc pl-5"}),ol:({node:e,...t})=>S.jsx("ol",{...t,className:"list-decimal pl-5"}),blockquote:({node:e,...t})=>S.jsx("blockquote",{...t,className:"border-border text-muted-foreground border-l-2 pl-2"}),h1:({node:e,...t})=>S.jsx("h1",{...t,className:"text-base font-semibold"}),h2:({node:e,...t})=>S.jsx("h2",{...t,className:"text-sm font-semibold"}),h3:({node:e,...t})=>S.jsx("h3",{...t,className:"text-sm font-semibold"}),table:({node:e,...t})=>S.jsx("div",{className:"overflow-x-auto",children:S.jsx("table",{...t,className:"border-border w-full border-collapse border text-xs"})}),th:({node:e,...t})=>S.jsx("th",{...t,className:"border-border bg-muted border px-2 py-1 text-left"}),td:({node:e,...t})=>S.jsx("td",{...t,className:"border-border border px-2 py-1"})},sX=v.memo(function({content:t}){return S.jsx($Y,{remarkPlugins:[iX],components:oX,children:t})});function lX({text:e,streaming:t=!1,className:n}){const r=v.useMemo(()=>aX(e),[e]);return S.jsxs("div",{className:Pe("flex min-w-0 flex-col gap-2 text-sm leading-relaxed",n),children:[r.map((a,o)=>S.jsx(sX,{content:a},o)),t&&S.jsx("span",{"data-testid":"agent-streaming-cursor",className:"bg-foreground inline-block h-4 w-2 animate-pulse self-start"})]})}function cX({text:e,streaming:t=!1,className:n}){return S.jsx("div",{"data-testid":"agent-assistant-message",className:Pe("min-w-0 max-w-full self-start",n),children:S.jsx(lX,{text:e,streaming:t})})}function uX(e){const{open:t,defaultOpen:n,onOpenChange:r,disabled:a}=e,o=t!==void 0,[l,c]=Sc({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:f,setMounted:d,transitionStatus:m}=Wd(l,!0,!0),[h,y]=v.useState(l),[{height:g,width:w},C]=v.useState({height:void 0,width:void 0}),R=Vi(),[E,T]=v.useState(),k=E??R,[M,D]=v.useState(!1),[A,N]=v.useState(!1),L=v.useRef(null),q=v.useRef(null),F=v.useRef(null),Y=v.useRef(null),_=pA(Y,!1),V=We($=>{const B=!l,j=xt(Ws,$.nativeEvent);if(r(B,j),j.isCanceled)return;const z=Y.current;q.current==="css-animation"&&z!=null&&z.style.removeProperty("animation-name"),!M&&!A&&(q.current!=null&&q.current!=="css-animation"&&!f&&B&&d(!0),q.current==="css-animation"&&(!h&&B&&y(!0),!f&&B&&d(!0))),c(B),q.current==="none"&&f&&!B&&d(!1)});return qe(()=>{o&&q.current==="none"&&!A&&!l&&d(!1)},[o,A,l,t,d]),v.useMemo(()=>({abortControllerRef:L,animationTypeRef:q,disabled:a,handleTrigger:V,height:g,mounted:f,open:l,panelId:k,panelRef:Y,runOnceAnimationsFinish:_,setDimensions:C,setHiddenUntilFound:D,setKeepMounted:N,setMounted:d,setOpen:c,setPanelIdState:T,setVisible:y,transitionDimensionRef:F,transitionStatus:m,visible:h,width:w}),[L,q,a,V,g,f,l,k,Y,_,C,D,N,d,c,y,F,m,h,w])}const NO=v.createContext(void 0);function OO(){const e=v.useContext(NO);if(e===void 0)throw new Error(Cn(15));return e}let dd=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=$s.startingStyle]="startingStyle",e[e.endingStyle=$s.endingStyle]="endingStyle",e})({}),dX=(function(e){return e.panelOpen="data-panel-open",e})({});const fX={[dd.open]:""},hX={[dd.closed]:""},pX={open(e){return e?{[dX.panelOpen]:""}:null}},mX={open(e){return e?fX:hX}},DO={...mX,...Wa},gX=v.forwardRef(function(t,n){const{render:r,className:a,defaultOpen:o=!1,disabled:l=!1,onOpenChange:c,open:f,...d}=t,m=We(c),h=uX({open:f,defaultOpen:o,onOpenChange:m,disabled:l}),y=v.useMemo(()=>({open:h.open,disabled:h.disabled,transitionStatus:h.transitionStatus}),[h.open,h.disabled,h.transitionStatus]),g=v.useMemo(()=>({...h,onOpenChange:m,state:y}),[h,m,y]),w=It("div",t,{state:y,ref:n,props:d,stateAttributesMapping:DO});return S.jsx(NO.Provider,{value:g,children:w})}),yX={...pX,...Wa},bX=v.forwardRef(function(t,n){const{panelId:r,open:a,handleTrigger:o,state:l,disabled:c}=OO(),{className:f,disabled:d=c,id:m,render:h,nativeButton:y=!0,...g}=t,{getButtonProps:w,buttonRef:C}=$a({disabled:d,focusableWhenDisabled:!0,native:y}),R=v.useMemo(()=>({"aria-controls":a?r:void 0,"aria-expanded":a,onClick:o}),[r,a,o]);return It("button",t,{state:l,ref:[n,C],props:[R,g,w],stateAttributesMapping:yX})});let vX=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function xX(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:r,height:a,hiddenUntilFound:o,keepMounted:l,id:c,mounted:f,onOpenChange:d,open:m,panelRef:h,runOnceAnimationsFinish:y,setDimensions:g,setMounted:w,setOpen:C,setVisible:R,transitionDimensionRef:E,visible:T,width:k}=e,M=v.useRef(!1),D=v.useRef(null),A=v.useRef(m),N=v.useRef(m),L=$d(),q=v.useMemo(()=>n.current==="css-animation"?!T:!m&&!f,[m,f,T,n]),F=We(_=>{if(!_)return;if(n.current==null||E.current==null){const B=getComputedStyle(_),j=B.animationName!=="none"&&B.animationName!=="",z=B.transitionDuration!=="0s"&&B.transitionDuration!=="";j&&z||(B.animationName==="none"&&B.transitionDuration!=="0s"?n.current="css-transition":B.animationName!=="none"&&B.transitionDuration==="0s"?n.current="css-animation":n.current="none"),_.getAttribute(vX.orientation)==="horizontal"||B.transitionProperty.indexOf("width")>-1?E.current="width":E.current="height"}if(n.current!=="css-transition")return;(a===void 0||k===void 0)&&(g({height:_.scrollHeight,width:_.scrollWidth}),N.current&&_.style.setProperty("transition-duration","0s"));let V=-1,$=-1;return V=Fn.request(()=>{N.current=!1,$=Fn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})}),()=>{Fn.cancel(V),Fn.cancel($)}}),Y=zi(r,h,F);return qe(()=>{if(n.current!=="css-transition")return;const _=h.current;if(!_)return;let V=-1;if(t.current!=null&&(t.current.abort(),t.current=null),m){const $={"justify-content":_.style.justifyContent,"align-items":_.style.alignItems,"align-content":_.style.alignContent,"justify-items":_.style.justifyItems};Object.keys($).forEach(B=>{_.style.setProperty(B,"initial","important")}),!N.current&&!l&&_.setAttribute(dd.startingStyle,""),g({height:_.scrollHeight,width:_.scrollWidth}),V=Fn.request(()=>{Object.entries($).forEach(([B,j])=>{j===""?_.style.removeProperty(B):_.style.setProperty(B,j)})})}else{if(_.scrollHeight===0&&_.scrollWidth===0)return;g({height:_.scrollHeight,width:_.scrollWidth});const $=new AbortController;t.current=$;const B=$.signal;let j=null;const z=dd.endingStyle;return j=new MutationObserver(H=>{H.some(P=>P.type==="attributes"&&P.attributeName===z)&&(j==null||j.disconnect(),j=null,y(()=>{g({height:0,width:0}),_.style.removeProperty("content-visibility"),w(!1),t.current===$&&(t.current=null)},B))}),j.observe(_,{attributes:!0,attributeFilter:[z]}),()=>{j==null||j.disconnect(),L.cancel(),t.current===$&&($.abort(),t.current=null)}}return()=>{Fn.cancel(V)}},[t,n,L,o,l,f,m,h,y,g,w]),qe(()=>{if(n.current!=="css-animation")return;const _=h.current;_&&(D.current=_.style.animationName||D.current,_.style.setProperty("animation-name","none"),g({height:_.scrollHeight,width:_.scrollWidth}),!A.current&&!M.current&&_.style.removeProperty("animation-name"),m?(t.current!=null&&(t.current.abort(),t.current=null),w(!0),R(!0)):(t.current=new AbortController,y(()=>{w(!1),R(!1),t.current=null},t.current.signal)))},[t,n,m,h,y,g,w,R,T]),om(()=>{const _=Fn.request(()=>{A.current=!1});return()=>Fn.cancel(_)}),qe(()=>{if(!o)return;const _=h.current;if(!_)return;let V=-1,$=-1;return m&&M.current&&(_.style.transitionDuration="0s",g({height:_.scrollHeight,width:_.scrollWidth}),V=Fn.request(()=>{M.current=!1,$=Fn.request(()=>{setTimeout(()=>{_.style.removeProperty("transition-duration")})})})),()=>{Fn.cancel(V),Fn.cancel($)}},[o,m,h,g]),qe(()=>{const _=h.current;_&&o&&q&&(_.setAttribute("hidden","until-found"),n.current==="css-transition"&&_.setAttribute(dd.startingStyle,""))},[o,q,n,h]),v.useEffect(function(){const V=h.current;if(!V)return;function $(B){M.current=!0,C(!0),d(!0,xt(Fi,B))}return V.addEventListener("beforematch",$),()=>{V.removeEventListener("beforematch",$)}},[d,h,C]),v.useMemo(()=>({props:{hidden:q,id:c,ref:Y}}),[q,c,Y])}let Nk=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const wX=v.forwardRef(function(t,n){const{className:r,hiddenUntilFound:a,keepMounted:o,render:l,id:c,...f}=t,{abortControllerRef:d,animationTypeRef:m,height:h,mounted:y,onOpenChange:g,open:w,panelId:C,panelRef:R,runOnceAnimationsFinish:E,setDimensions:T,setHiddenUntilFound:k,setKeepMounted:M,setMounted:D,setPanelIdState:A,setOpen:N,setVisible:L,state:q,transitionDimensionRef:F,visible:Y,width:_,transitionStatus:V}=OO(),$=a??!1,B=o??!1;qe(()=>{if(c)return A(c),()=>{A(void 0)}},[c,A]),qe(()=>{k($)},[k,$]),qe(()=>{M(B)},[M,B]);const{props:j}=xX({abortControllerRef:d,animationTypeRef:m,externalRef:n,height:h,hiddenUntilFound:$,id:C,keepMounted:B,mounted:y,onOpenChange:g,open:w,panelRef:R,runOnceAnimationsFinish:E,setDimensions:T,setMounted:D,setOpen:N,setVisible:L,transitionDimensionRef:F,visible:Y,width:_});Ya({open:w&&V==="idle",ref:R,onComplete(){w&&T({height:void 0,width:void 0})}});const z=v.useMemo(()=>({...q,transitionStatus:V}),[q,V]),H=It("div",t,{state:z,ref:[n,R],props:[j,{style:{[Nk.collapsiblePanelHeight]:h===void 0?"auto":`${h}px`,[Nk.collapsiblePanelWidth]:_===void 0?"auto":`${_}px`}},f],stateAttributesMapping:DO});return B||$||!B&&y?H:null});function km({...e}){return S.jsx(gX,{"data-slot":"collapsible",...e})}function Mm({...e}){return S.jsx(bX,{"data-slot":"collapsible-trigger",...e})}function Am({...e}){return S.jsx(wX,{"data-slot":"collapsible-content",...e})}function SX({text:e,streaming:t=!1,className:n}){const{t:r}=mn();return S.jsxs(km,{"data-testid":"agent-reasoning-block",className:Pe("min-w-0 max-w-full self-start",n),children:[S.jsxs(Mm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[S.jsx(Qd,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),S.jsx(s8,{className:"size-3"}),S.jsx("span",{children:r("agent.reasoning.title")}),t&&S.jsx(Gs,{className:"size-3 animate-spin"})]}),S.jsx(Am,{children:S.jsx("div",{className:"text-muted-foreground border-border mt-1 border-l-2 pl-2 text-xs whitespace-pre-wrap break-words",children:e})})]})}const EX=em("h-5 gap-1 rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-3! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive overflow-hidden group/badge",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function Zs({className:e,variant:t="default",render:n,...r}){return Jp({defaultTagName:"span",props:Ri({className:Pe(EX({className:e,variant:t}))},r),render:n,state:{slot:"badge",variant:t}})}function $o(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lx(e){if(typeof e=="string")return e;try{return JSON.stringify(e,null,2)}catch{return String(e)}}function CX(e){return $o(e.output)&&typeof e.output.error=="string"?e.output.error:e.isError?lx(e.output):null}function RX(e){switch(e){case"send_input":return S.jsx($8,{className:"size-3.5"});case"read_screen":return S.jsx(vm,{className:"size-3.5"});case"web_search":return S.jsx(g9,{className:"size-3.5"});case"fetch_url":return S.jsx(L0,{className:"size-3.5"});default:return S.jsx(O9,{className:"size-3.5"})}}function Tc({label:e,text:t}){return S.jsxs(km,{children:[S.jsxs(Mm,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs",children:[S.jsx(Qd,{className:"size-3 transition-transform group-data-[panel-open]:rotate-90"}),S.jsx("span",{children:e})]}),S.jsx(Am,{children:S.jsx("pre",{className:"bg-muted mt-1 max-h-64 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:t})})]})}function TX(e){if(typeof e!="string")return null;try{const t=JSON.parse(e);return Array.isArray(t)?t.filter($o).map(n=>({title:typeof n.title=="string"?n.title:"",url:typeof n.url=="string"?n.url:"",snippet:typeof n.snippet=="string"?n.snippet:""})).filter(n=>n.url):null}catch{return null}}function kX({call:e}){const{t}=mn(),n=$o(e.input)?e.input:{},r=typeof n.text=="string"?n.text:"",a=Array.isArray(n.keys)?n.keys.filter(c=>typeof c=="string"):[],o=$o(e.output)?e.output:{},l=typeof o.screenTail=="string"?o.screenTail:"";return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&S.jsx("pre",{className:"bg-muted max-h-40 overflow-auto rounded-md p-2 font-mono text-xs whitespace-pre-wrap break-all",children:r}),a.length>0&&S.jsx("div",{className:"flex flex-wrap items-center gap-1",children:a.map((c,f)=>S.jsx(Zs,{variant:"outline",className:"font-mono",children:c},`${f}-${c}`))}),l&&S.jsx(Tc,{label:t("agent.tool.result"),text:l})]})}function MX({call:e}){const{t}=mn(),n=$o(e.output)?e.output:{},r=typeof n.screen=="string"?n.screen:"";return r?S.jsx(Tc,{label:t("agent.tool.screen"),text:r}):null}function AX({call:e}){const{t}=mn(),n=$o(e.input)?e.input:{},r=typeof n.query=="string"?n.query:"",a=e.resolved&&!e.isError&&!e.denied?TX(e.output):null;return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&S.jsxs("p",{className:"text-muted-foreground text-xs break-words",children:["“",r,"”"]}),a&&a.length>0&&S.jsx("ul",{className:"flex flex-col gap-1",children:a.map(o=>S.jsxs("li",{className:"min-w-0 text-xs",children:[S.jsx("a",{href:o.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate underline underline-offset-2",title:o.title||o.url,children:o.title||o.url}),o.snippet&&S.jsx("p",{className:"text-muted-foreground line-clamp-2 break-words",children:o.snippet})]},o.url))}),e.resolved&&!e.isError&&!e.denied&&!a&&typeof e.output=="string"&&S.jsx(Tc,{label:t("agent.tool.result"),text:e.output})]})}function NX({call:e}){const{t}=mn(),n=$o(e.input)?e.input:{},r=typeof n.url=="string"?n.url:"",a=typeof e.output=="string"?e.output:"";return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[r&&S.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-primary block truncate text-xs underline underline-offset-2",title:r,children:r}),e.resolved&&!e.isError&&!e.denied&&a&&S.jsx(Tc,{label:t("agent.tool.result"),text:a})]})}const OX=/^[A-Za-z0-9+/]{256,}={0,2}$/,DX=/^https?:\/\/\S+\.(png|jpe?g|webp|gif)(\?\S*)?$/i;function IX(e){return typeof e!="string"||e.length===0?null:e.startsWith("data:image/")||DX.test(e)?e:OX.test(e.replace(/\s/g,""))?`data:image/png;base64,${e.replace(/\s/g,"")}`:null}function PX(e){if(!e.resolved||e.isError||e.denied)return[];const t=[],n=(r,a)=>{if(t.length>=8||a>3)return;const o=IX(r);if(o){t.push(o);return}if(Array.isArray(r)){for(const l of r)n(l,a+1);return}if($o(r))for(const l of["result","image","images","url","b64_json","data"])l in r&&n(r[l],a+1)};return n(e.output,0),[...new Set(t)]}function LX({images:e}){return e.length===0?null:S.jsx("div",{className:"flex flex-wrap gap-2",children:e.map((t,n)=>S.jsx("a",{href:t,target:"_blank",rel:"noopener noreferrer",className:"block",children:S.jsx("img",{src:t,alt:"generated",className:"max-h-64 max-w-full rounded-md border border-border object-contain",loading:"lazy"})},n))})}function _X({call:e,hideOutput:t}){const{t:n}=mn();return S.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.input!==void 0&&S.jsx(Tc,{label:n("agent.tool.input"),text:lx(e.input)}),!t&&e.resolved&&!e.isError&&!e.denied&&e.output!==void 0&&S.jsx(Tc,{label:n("agent.tool.result"),text:lx(e.output)})]})}function jX({call:e,confirmationId:t,onDecide:n,className:r}){const{t:a}=mn(),o=!!t&&!e.resolved,l=e.resolved&&e.denied,c=e.resolved&&!l?CX(e):null,f=!e.resolved&&!o,d=l&&typeof e.output=="string"?e.output:"",m=`agent.tool.${e.toolName}`,h=["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)?a(m):e.toolName,y=PX(e);return S.jsxs("div",{"data-testid":`agent-tool-card-${e.toolCallId}`,"data-tool-name":e.toolName,"data-tool-denied":l||void 0,className:Pe("border-border bg-card flex max-w-full min-w-0 flex-col gap-1.5 self-start rounded-lg border p-2",c!==null&&"border-destructive/50",l&&"opacity-80",r),children:[S.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium",children:[RX(e.toolName),S.jsx("span",{className:"min-w-0 truncate",children:h}),f&&S.jsx(Gs,{className:"text-muted-foreground size-3 animate-spin"}),e.resolved&&!l&&c===null&&S.jsx(Ip,{className:"size-3 text-emerald-500"}),c!==null&&S.jsx(od,{className:"text-destructive size-3"}),l&&S.jsxs("span",{className:"text-destructive flex items-center gap-0.5",children:[S.jsx(Va,{className:"size-3"}),a("agent.tool.denied")]})]}),e.toolName==="send_input"&&S.jsx(kX,{call:e}),e.toolName==="read_screen"&&S.jsx(MX,{call:e}),e.toolName==="web_search"&&S.jsx(AX,{call:e}),e.toolName==="fetch_url"&&S.jsx(NX,{call:e}),!["send_input","read_screen","web_search","fetch_url"].includes(e.toolName)&&S.jsx(_X,{call:e,hideOutput:y.length>0}),S.jsx(LX,{images:y}),c!==null&&S.jsx("p",{className:"text-destructive text-xs break-words whitespace-pre-wrap",children:c}),d&&S.jsx("p",{className:"text-muted-foreground text-xs break-words whitespace-pre-wrap",children:d}),o&&t&&S.jsxs("div",{"data-testid":`agent-tool-approval-${e.toolCallId}`,className:"flex items-center gap-2 pt-1",children:[S.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:a("agent.confirm.title")}),S.jsxs(Ht,{"data-testid":"agent-confirm-approve",size:"xs",variant:"secondary",onClick:()=>n==null?void 0:n(t,!0),children:[S.jsx(Ip,{}),a("agent.confirm.approve")]}),S.jsxs(Ht,{"data-testid":"agent-confirm-deny",size:"xs",variant:"destructive",onClick:()=>n==null?void 0:n(t,!1),children:[S.jsx(Va,{}),a("agent.confirm.deny")]})]})]})}function zX({text:e,className:t}){return S.jsx("div",{"data-testid":"agent-user-message",className:Pe("bg-primary text-primary-foreground max-w-[85%] self-end rounded-2xl px-3 py-2 text-sm whitespace-pre-wrap break-words",t),children:e})}const FX=48;function BX(){return S.jsxs("div",{"data-testid":"agent-running-indicator",className:"flex items-center gap-1 self-start px-1",children:[S.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full"}),S.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:150ms]"}),S.jsx("span",{className:"bg-muted-foreground size-1.5 animate-pulse rounded-full [animation-delay:300ms]"})]})}function HX({blocks:e,running:t,emptyText:n,confirmationByToolCallId:r,onDecide:a,className:o}){const{t:l}=mn(),c=v.useRef(null),f=v.useRef(!0),[d,m]=v.useState(!1),h=()=>{const g=c.current;g&&(g.scrollTop=g.scrollHeight,f.current=!0,m(!1))};v.useEffect(()=>{if(f.current){const g=c.current;g&&(g.scrollTop=g.scrollHeight)}else m(!0)},[e,t]);const y=()=>{const g=c.current;if(!g)return;const C=g.scrollHeight-g.scrollTop-g.clientHeight<FX;f.current=C,m(!C)};return e.length===0&&!t?S.jsx("div",{"data-testid":"agent-chat-thread",className:Pe("flex min-h-0 flex-1 items-center justify-center p-4",o),children:S.jsx("p",{className:"text-muted-foreground text-sm",children:n})}):S.jsxs("div",{className:Pe("relative min-h-0 flex-1",o),children:[S.jsx("div",{ref:c,"data-testid":"agent-chat-thread",className:"h-full overflow-y-auto p-3",onScroll:y,children:S.jsxs("div",{className:"flex flex-col gap-3",children:[e.map(g=>{switch(g.kind){case"user":return S.jsx(zX,{text:g.text},g.key);case"assistant-text":return S.jsx(cX,{text:g.text,streaming:g.streaming},g.key);case"reasoning":return S.jsx(SX,{text:g.text,streaming:g.streaming},g.key);case"tool-call":return S.jsx(jX,{call:g.call,confirmationId:r.get(g.call.toolCallId),onDecide:a},g.key);default:return null}}),t&&S.jsx(BX,{})]})}),d&&S.jsx(Ht,{"data-testid":"agent-scroll-to-bottom",size:"icon-sm",variant:"secondary",className:"absolute right-3 bottom-3 z-10 rounded-full shadow-md",onClick:h,"aria-label":l("agent.panel.scrollToBottom"),children:S.jsx(e8,{})})]})}const IO=v.createContext(null),PO=v.createContext(null);function fa(){const e=v.useContext(IO);if(e===null)throw new Error(Cn(60));return e}function LO(){const e=v.useContext(PO);if(e===null)throw new Error(Cn(61));return e}const UX=(e,t)=>Object.is(e,t);function kc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function qX(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:kc(t,r,n))}function fd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:kc(r,t,n))}function VX(e,t,n){return e.filter(r=>!kc(t,r,n))}function cx(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function _O(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function $X(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(_O(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function WX(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return cx(e)}function Yl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?cx(e.value):cx(e)}function jO(e,t,n){function r(){return WX(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const a=_O(t)?t.flatMap(o=>o.items):t;if(e==null||typeof e!="object"){const o=a.find(l=>l.value===e);return o&&o.label!=null?o.label:r()}if("value"in e){const o=a.find(l=>l&&l.value===e.value);if(o&&o.label!=null)return o.label}}return r()}function YX(e,t,n){return e.reduce((r,a,o)=>(o>0&&r.push(", "),r.push(S.jsx(v.Fragment,{children:jO(a,t,n)},o)),r),[])}const St={id:Ge(e=>e.id),modal:Ge(e=>e.modal),multiple:Ge(e=>e.multiple),items:Ge(e=>e.items),itemToStringLabel:Ge(e=>e.itemToStringLabel),itemToStringValue:Ge(e=>e.itemToStringValue),isItemEqualToValue:Ge(e=>e.isItemEqualToValue),value:Ge(e=>e.value),hasSelectedValue:Ge(e=>{const{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Yl(t,r)!==""}),hasNullItemLabel:Ge((e,t)=>t?$X(e.items):!1),open:Ge(e=>e.open),mounted:Ge(e=>e.mounted),forceMount:Ge(e=>e.forceMount),transitionStatus:Ge(e=>e.transitionStatus),openMethod:Ge(e=>e.openMethod),activeIndex:Ge(e=>e.activeIndex),selectedIndex:Ge(e=>e.selectedIndex),isActive:Ge((e,t)=>e.activeIndex===t),isSelected:Ge((e,t,n)=>{const r=e.isItemEqualToValue,a=e.value;return e.multiple?Array.isArray(a)&&a.some(o=>kc(n,o,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:kc(n,a,r)}),isSelectedByFocus:Ge((e,t)=>e.selectedIndex===t),popupProps:Ge(e=>e.popupProps),triggerProps:Ge(e=>e.triggerProps),triggerElement:Ge(e=>e.triggerElement),positionerElement:Ge(e=>e.positionerElement),listElement:Ge(e=>e.listElement),scrollUpArrowVisible:Ge(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:Ge(e=>e.scrollDownArrowVisible),hasScrollArrows:Ge(e=>e.hasScrollArrows)};function KX(e){const{id:t,value:n,defaultValue:r=null,onValueChange:a,open:o,defaultOpen:l=!1,onOpenChange:c,name:f,autoComplete:d,disabled:m=!1,readOnly:h=!1,required:y=!1,modal:g=!0,actionsRef:w,inputRef:C,onOpenChangeComplete:R,items:E,multiple:T=!1,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D=UX,highlightItemOnHover:A=!0,children:N}=e,{clearErrors:L}=n0(),{setDirty:q,setTouched:F,setFocused:Y,shouldValidateOnChange:_,validityData:V,setFilled:$,name:B,disabled:j,validation:z,validationMode:H}=Dc(),K=cm({id:t}),P=j||m,U=B??f,[G,I]=Sc({controlled:n,default:T?r??Vo:r,name:"Select",state:"value"}),[Q,le]=Sc({controlled:o,default:l,name:"Select",state:"open"}),ae=v.useRef([]),Z=v.useRef([]),ue=v.useRef(null),ve=v.useRef(null),Se=v.useRef(0),Le=v.useRef(null),te=v.useRef([]),he=v.useRef(!1),ye=v.useRef(!1),_e=v.useRef(null),Ae=v.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ce=v.useRef(!1),{mounted:Te,setMounted:J,transitionStatus:Ee}=Wd(Q),{openMethod:xe,triggerProps:Be,reset:Ve}=D0(Q),De=nr(()=>new BA({id:K,modal:g,multiple:T,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,value:G,open:Q,mounted:Te,transitionStatus:Ee,items:E,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,ut=Ct(De,St.activeIndex),pe=Ct(De,St.selectedIndex),Re=Ct(De,St.triggerElement),ee=Ct(De,St.positionerElement),fe=v.useMemo(()=>T&&Array.isArray(G)&&G.length===0?"":Yl(G,M),[T,G,M]),Ne=v.useMemo(()=>T&&Array.isArray(G)?G.map(Je=>Yl(Je,M)):Yl(G,M),[T,G,M]),He=sr(De.state.triggerElement);l0({id:K,commit:z.commit,value:G,controlRef:He,name:U,getValue:()=>Ne});const $e=v.useRef(G);qe(()=>{G!==$e.current&&De.set("forceMount",!0)},[De,G]),qe(()=>{$(T?Array.isArray(G)&&G.length>0:G!=null)},[T,G,$]),qe(function(){if(Q)return;const Mt=te.current;if(T){const ie=Array.isArray(G)?G:[];if(ie.length===0){De.set("selectedIndex",null);return}const de=ie[ie.length-1],ke=fd(Mt,de,D);De.set("selectedIndex",ke===-1?null:ke);return}const X=fd(Mt,G,D);De.set("selectedIndex",X===-1?null:X)},[T,Q,G,te,D,De]),EN(G,()=>{L(U),q(G!==V.initialValue),_()?z.commit(G):z.commit(G,!0)});const et=We((Je,Mt)=>{if(c==null||c(Je,Mt),!Mt.isCanceled&&(le(Je),!Je&&(Mt.reason===Ys||Mt.reason===um)&&(F(!0),Y(!1),H==="onBlur"&&z.commit(G)),!Je&&De.state.activeIndex!==null)){const X=ae.current[De.state.activeIndex];queueMicrotask(()=>{X==null||X.setAttribute("tabindex","-1")})}}),ze=We(()=>{J(!1),De.set("activeIndex",null),Ve(),R==null||R(!1)});Ya({enabled:!w,open:Q,ref:ue,onComplete(){Q||ze()}}),v.useImperativeHandle(w,()=>({unmount:ze}),[ze]);const Ze=We((Je,Mt)=>{a==null||a(Je,Mt),!Mt.isCanceled&&I(Je)}),tt=We(()=>{const Je=De.state.listElement||ue.current;if(!Je)return;const Mt=Je.scrollTop,X=Je.scrollTop+Je.clientHeight,ie=Mt>1,de=X<Je.scrollHeight-1;De.state.scrollUpArrowVisible!==ie&&De.set("scrollUpArrowVisible",ie),De.state.scrollDownArrowVisible!==de&&De.set("scrollDownArrowVisible",de)}),Rt=UA({open:Q,onOpenChange:et,elements:{reference:Re,floating:ee}}),zt=MA(Rt,{enabled:!h&&!P,event:"mousedown"}),yt=mm(Rt,{bubbles:!1}),Nt=YA(Rt,{enabled:!h&&!P,listRef:ae,activeIndex:ut,selectedIndex:pe,disabledIndices:Vo,onNavigate(Je){Je===null&&!Q||De.set("activeIndex",Je)},focusItemOnHover:!1}),it=GA(Rt,{enabled:!h&&!P&&(Q||!T),listRef:Z,activeIndex:ut,selectedIndex:pe,onMatch(Je){Q?De.set("activeIndex",Je):Ze(te.current[Je],xt("none"))},onTypingChange(Je){he.current=Je}}),{getReferenceProps:ft,getFloatingProps:bt,getItemProps:Ke}=Kd([zt,yt,Nt,it]),kt=v.useMemo(()=>Ri(ft(),Be,K?{id:K}:In),[ft,Be,K]);bm(()=>{De.update({popupProps:bt(),triggerProps:kt})}),qe(()=>{De.update({id:K,modal:g,multiple:T,value:G,open:Q,mounted:Te,transitionStatus:Ee,popupProps:bt(),triggerProps:kt,items:E,itemToStringLabel:k,itemToStringValue:M,isItemEqualToValue:D,openMethod:xe})},[De,K,g,T,G,Q,Te,Ee,bt,kt,E,k,M,D,xe]);const _t=v.useMemo(()=>({store:De,name:U,required:y,disabled:P,readOnly:h,multiple:T,itemToStringLabel:k,itemToStringValue:M,highlightItemOnHover:A,setValue:Ze,setOpen:et,listRef:ae,popupRef:ue,scrollHandlerRef:ve,handleScrollArrowVisibility:tt,scrollArrowsMountedCountRef:Se,getItemProps:Ke,events:Rt.context.events,valueRef:Le,valuesRef:te,labelsRef:Z,typingRef:he,selectionRef:Ae,selectedItemTextRef:_e,validation:z,onOpenChangeComplete:R,keyboardActiveRef:ye,alignItemWithTriggerActiveRef:Ce,initialValueRef:$e}),[De,U,y,P,h,T,k,M,A,Ze,et,Ke,Rt.context.events,z,R,tt]),Tt=zi(C,z.inputRef),dn=T&&Array.isArray(G)&&G.length>0,Ut=v.useMemo(()=>!T||!Array.isArray(G)||!U?null:G.map(Je=>{const Mt=Yl(Je,M);return S.jsx("input",{type:"hidden",name:U,value:Mt},Mt)}),[T,G,U,M]);return S.jsx(IO.Provider,{value:_t,children:S.jsxs(PO.Provider,{value:Rt,children:[N,S.jsx("input",{...z.getInputValidationProps({onFocus(){var Je;(Je=De.state.triggerElement)==null||Je.focus({focusVisible:!0})},onChange(Je){if(Je.nativeEvent.defaultPrevented)return;const Mt=Je.target.value,X=xt(Fi,Je.nativeEvent);function ie(){if(T)return;const de=te.current.find(ke=>Yl(ke,M).toLowerCase()===Mt.toLowerCase());de!=null&&(q(de!==V.initialValue),Ze(de,X),_()&&z.commit(de))}De.set("forceMount",!0),queueMicrotask(ie)}}),name:T?void 0:U,autoComplete:d,value:fe,disabled:P,required:y&&!dn,readOnly:h,ref:Tt,style:U?EA:hm,tabIndex:-1,"aria-hidden":!0}),Ut]})})}function zO(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const o=parseFloat(n.width)||0,l=parseFloat(n.height)||0,c=parseFloat(r.width)||0,f=parseFloat(r.height)||0,d=Math.max(t.width,o,c),m=Math.max(t.height,l,f),h=d-t.width,y=m-t.height;return{left:t.left-h/2,right:t.right+h/2,top:t.top-y/2,bottom:t.bottom+y/2}}const Vh=2,GX=400,Ok=200,XX={...qv,...t0,value:()=>null},QX=v.forwardRef(function(t,n){const{render:r,className:a,id:o,disabled:l=!1,nativeButton:c=!0,...f}=t,{setTouched:d,setFocused:m,validationMode:h,state:y,disabled:g}=Dc(),{labelId:w}=am(),{store:C,setOpen:R,selectionRef:E,validation:T,readOnly:k,required:M,alignItemWithTriggerActiveRef:D,disabled:A,keyboardActiveRef:N}=fa(),L=g||A||l,q=Ct(C,St.open),F=Ct(C,St.value),Y=Ct(C,St.triggerProps),_=Ct(C,St.positionerElement),V=Ct(C,St.listElement),$=Ct(C,St.id),B=Ct(C,St.hasSelectedValue),j=!B&&q,z=Ct(C,St.hasNullItemLabel,j),H=o??$;cm({id:H});const K=sr(_),P=v.useRef(null),{getButtonProps:U,buttonRef:G}=$a({disabled:L,native:c}),I=We(te=>{C.set("triggerElement",te)}),Q=zi(n,P,G,I),le=Bn(),ae=Bn(),Z=Bn(),ue=Bn();v.useEffect(()=>{if(q)return!(B||z)?Z.start(GX,()=>{E.current.allowUnselectedMouseUp=!0,E.current.allowSelectedMouseUp=!0}):ue.start(Ok,()=>{E.current.allowUnselectedMouseUp=!0,Z.start(Ok,()=>{E.current.allowSelectedMouseUp=!0})}),()=>{Z.clear(),ue.clear()};E.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},ae.clear()},[q,B,z,E,ae,Z,ue]);const ve=v.useMemo(()=>{var te;return(V==null?void 0:V.id)??((te=Ed(_))==null?void 0:te.id)},[V,_]),Se=Ri(Y,{id:H,role:"combobox","aria-expanded":q?"true":"false","aria-haspopup":"listbox","aria-controls":q?ve:void 0,"aria-labelledby":w,"aria-readonly":k||void 0,"aria-required":M||void 0,tabIndex:L?-1:0,ref:Q,onFocus(te){m(!0),q&&D.current&&R(!1,xt(Fi,te.nativeEvent)),le.start(0,()=>{C.set("forceMount",!0)})},onBlur(te){Dt(_,te.relatedTarget)||(d(!0),m(!1),h==="onBlur"&&T.commit(F))},onPointerMove(){N.current=!1},onKeyDown(){N.current=!0},onMouseDown(te){if(q)return;const he=Qt(te.currentTarget);function ye(_e){if(!P.current)return;const Ae=_e.target;if(Dt(P.current,Ae)||Dt(K.current,Ae)||Ae===P.current)return;const Ce=zO(P.current);_e.clientX>=Ce.left-Vh&&_e.clientX<=Ce.right+Vh&&_e.clientY>=Ce.top-Vh&&_e.clientY<=Ce.bottom+Vh||R(!1,xt(mA,_e))}ae.start(0,()=>{he.addEventListener("mouseup",ye,{once:!0})})}},T.getValidationProps,f,U);Se.role="combobox";const Le={...y,open:q,disabled:L,value:F,readOnly:k,placeholder:!B};return It("button",t,{ref:[n,P],state:Le,stateAttributesMapping:XX,props:Se})}),ZX={value:()=>null},JX=v.forwardRef(function(t,n){const{className:r,render:a,children:o,placeholder:l,...c}=t,{store:f,valueRef:d}=fa(),m=Ct(f,St.value),h=Ct(f,St.items),y=Ct(f,St.itemToStringLabel),g=Ct(f,St.hasSelectedValue),w=!g&&l!=null&&o==null,C=Ct(f,St.hasNullItemLabel,w),R={value:m,placeholder:!g};let E=null;return typeof o=="function"?E=o(m):o!=null?E=o:!g&&l!=null&&!C?E=l:Array.isArray(m)?E=YX(m,h,y):E=jO(m,h,y),It("span",t,{state:R,ref:[n,d],props:[{children:E},c],stateAttributesMapping:ZX})}),eQ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l}=fa(),f={open:Ct(l,St.open)};return It("span",t,{state:f,ref:n,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:yA})}),tQ=v.createContext(void 0),nQ=v.forwardRef(function(t,n){const{store:r}=fa(),a=Ct(r,St.mounted),o=Ct(r,St.forceMount);return a||o?S.jsx(tQ.Provider,{value:!0,children:S.jsx(p0,{ref:n,...t})}):null}),FO=v.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function rQ(){return v.useContext(FO)}function Nm(e){const{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,o=We(a),l=v.useRef(0),c=nr(aQ).current,f=nr(iQ).current,[d,m]=v.useState(0),h=v.useRef(d),y=We((E,T)=>{f.set(E,T??null),h.current+=1,m(h.current)}),g=We(E=>{f.delete(E),h.current+=1,m(h.current)}),w=v.useMemo(()=>{const E=new Map;return Array.from(f.keys()).filter(k=>k.isConnected).sort(oQ).forEach((k,M)=>{const D=f.get(k)??{};E.set(k,{...D,index:M})}),E},[f,d]);qe(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const E=new MutationObserver(T=>{const k=new Set,M=D=>k.has(D)?k.delete(D):k.add(D);T.forEach(D=>{D.removedNodes.forEach(M),D.addedNodes.forEach(M)}),k.size===0&&(h.current+=1,m(h.current))});return w.forEach((T,k)=>{k.parentElement&&E.observe(k.parentElement,{childList:!0})}),()=>{E.disconnect()}},[w]),qe(()=>{h.current===d&&(n.current.length!==w.size&&(n.current.length=w.size),r&&r.current.length!==w.size&&(r.current.length=w.size),l.current=w.size),o(w)},[o,w,n,r,d]),qe(()=>()=>{n.current=[]},[n]),qe(()=>()=>{r&&(r.current=[])},[r]);const C=We(E=>(c.add(E),()=>{c.delete(E)}));qe(()=>{c.forEach(E=>E(w))},[c,w]);const R=v.useMemo(()=>({register:y,unregister:g,subscribeMapChange:C,elementsRef:n,labelsRef:r,nextIndexRef:l}),[y,g,C,n,r,l]);return S.jsx(FO.Provider,{value:R,children:t})}function iQ(){return new Map}function aQ(){return new Set}function oQ(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const BO=v.createContext(void 0);function sw(){const e=v.useContext(BO);if(!e)throw new Error(Cn(59));return e}function Bp(e,t){e&&Object.assign(e.style,t)}const HO={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},sQ={position:"fixed"},lQ=v.forwardRef(function(t,n){const{anchor:r,positionMethod:a="absolute",className:o,render:l,side:c="bottom",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C,alignItemWithTrigger:R=!0,collisionAvoidance:E=C2,...T}=t,{store:k,listRef:M,labelsRef:D,alignItemWithTriggerActiveRef:A,selectedItemTextRef:N,valuesRef:L,initialValueRef:q,popupRef:F,setValue:Y}=fa(),_=LO(),V=Ct(k,St.open),$=Ct(k,St.mounted),B=Ct(k,St.modal),j=Ct(k,St.value),z=Ct(k,St.openMethod),H=Ct(k,St.positionerElement),K=Ct(k,St.triggerElement),P=Ct(k,St.isItemEqualToValue),U=Ct(k,St.transitionStatus),G=v.useRef(null),I=v.useRef(null),[Q,le]=v.useState(R),ae=$&&Q&&z!=="touch";!$&&Q!==R&&le(R),qe(()=>{$||(St.scrollUpArrowVisible(k.state)&&k.set("scrollUpArrowVisible",!1),St.scrollDownArrowVisible(k.state)&&k.set("scrollDownArrowVisible",!1))},[k,$]),v.useImperativeHandle(A,()=>ae),O0((ae||B)&&V&&z!=="touch",K);const Z=z0({anchor:r,floatingRootContext:_,positionMethod:a,mounted:$,side:c,sideOffset:d,align:f,alignOffset:m,arrowPadding:g,collisionBoundary:h,collisionPadding:y,sticky:w,disableAnchorTracking:C??ae,collisionAvoidance:E,keepMounted:!0}),ue=ae?"none":Z.side,ve=ae?sQ:Z.positionerStyles,Se=v.useMemo(()=>{const Ce={};return V||(Ce.pointerEvents="none"),{role:"presentation",hidden:!$,style:{...ve,...Ce}}},[V,$,ve]),Le={open:V,side:ue,align:Z.align,anchorHidden:Z.anchorHidden},te=We(Ce=>{k.set("positionerElement",Ce)}),he=It("div",t,{ref:[n,te],state:Le,stateAttributesMapping:ua,props:[Se,_c(U),T]}),ye=v.useRef(0),_e=We(Ce=>{if(Ce.size===0&&ye.current===0||L.current.length===0)return;const Te=ye.current;if(ye.current=Ce.size,Ce.size===Te)return;const J=xt(Fi);if(Te!==0&&!k.state.multiple&&j!==null&&fd(L.current,j,P)===-1){const xe=q.current,Ve=xe!=null&&fd(L.current,xe,P)!==-1?xe:null;Y(Ve,J),Ve===null&&(k.set("selectedIndex",null),N.current=null)}if(Te!==0&&k.state.multiple&&Array.isArray(j)){const Ee=Be=>fd(L.current,Be,P)!==-1,xe=j.filter(Be=>Ee(Be));(xe.length!==j.length||xe.some(Be=>!qX(j,Be,P)))&&(Y(xe,J),xe.length===0&&(k.set("selectedIndex",null),N.current=null))}if(V&&ae){k.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ee={height:""};Bp(H,Ee),Bp(F.current,Ee)}}),Ae=v.useMemo(()=>({...Z,side:ue,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:G,scrollDownArrowRef:I}),[Z,ue,ae,le]);return S.jsx(Nm,{elementsRef:M,labelsRef:D,onMapChange:_e,children:S.jsxs(BO.Provider,{value:Ae,children:[$&&B&&S.jsx(A0,{inert:M0(!V),cutout:K}),he]})})});function UO(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const $h="base-ui-disable-scrollbar",Md={className:$h,getElement(e){return S.jsx("style",{nonce:e,href:$h,precedence:"base-ui:low",children:`.${$h}{scrollbar-width:none}.${$h}::-webkit-scrollbar{display:none}`})}},cQ=v.createContext(void 0);function qO(e){return v.useContext(cQ)}function Ha(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const uQ=v.createContext(void 0),dQ={disableStyleElements:!1};function VO(){return v.useContext(uQ)??dQ}const Es=1,fQ={...ua,...Wa},hQ=v.forwardRef(function(t,n){const{render:r,className:a,finalFocus:o,...l}=t,{store:c,popupRef:f,onOpenChangeComplete:d,setOpen:m,valueRef:h,selectedItemTextRef:y,keyboardActiveRef:g,multiple:w,handleScrollArrowVisibility:C,scrollHandlerRef:R,highlightItemOnHover:E}=fa(),{side:T,align:k,alignItemWithTriggerActive:M,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:A,scrollUpArrowRef:N}=sw(),L=qO()!=null,q=LO(),{nonce:F,disableStyleElements:Y}=VO(),_=Bn(),V=Ct(c,St.id),$=Ct(c,St.open),B=Ct(c,St.mounted),j=Ct(c,St.popupProps),z=Ct(c,St.transitionStatus),H=Ct(c,St.triggerElement),K=Ct(c,St.positionerElement),P=Ct(c,St.listElement),U=v.useRef(0),G=v.useRef(!1),I=v.useRef(0),Q=v.useRef(!1),le=v.useRef({}),ae=$d(),Z=We(Le=>{if(!K||!f.current||!Q.current)return;if(G.current||!M){C();return}const te=K.style.top==="0px",he=K.style.bottom==="0px",ye=K.getBoundingClientRect().height,_e=Qt(K),Ae=getComputedStyle(K),Ce=parseFloat(Ae.marginTop),Te=parseFloat(Ae.marginBottom),J=Dk(getComputedStyle(f.current)),Ee=Math.min(_e.documentElement.clientHeight-Ce-Te,J),xe=Le.scrollTop,Be=Ik(Le);let Ve=0,De=null,ut=!1,pe=!1;const Re=fe=>{K.style.height=`${fe}px`},ee=(fe,Ne)=>{const He=Ha(fe,0,Ee-ye);He>0&&Re(ye+He),Le.scrollTop=Ne,Ee-(ye+He)<=Es&&(G.current=!0),C()};if(te){const fe=Be-xe,Ne=ye+fe,He=Math.min(Ne,Ee);if(Ve=He,fe<=Es){ee(fe,Be);return}Ee-He>Es?pe=!0:ut=!0}else if(he){const fe=xe,Ne=ye+fe,He=Math.min(Ne,Ee),$e=Ne-Ee;if(Ve=He,fe<=Es){ee(fe,0);return}Ee-He>Es?De=0:(ut=!0,xe<Be&&(De=xe-(fe-$e)))}if(Ve=Math.ceil(Ve),Ve!==0&&Re(Ve),pe||De!=null){const fe=Ik(Le),Ne=pe?fe:Ha(De,0,fe);Math.abs(Le.scrollTop-Ne)>Es&&(Le.scrollTop=Ne)}(ut||Ve>=Ee-Es)&&(G.current=!0),C()});v.useImperativeHandle(R,()=>Z,[Z]),Ya({open:$,ref:f,onComplete(){$&&(d==null||d(!0))}});const ue={open:$,transitionStatus:z,side:T,align:k};qe(()=>{!K||!f.current||Object.keys(le.current).length||(le.current={top:K.style.top||"0",left:K.style.left||"0",right:K.style.right,height:K.style.height,bottom:K.style.bottom,minHeight:K.style.minHeight,maxHeight:K.style.maxHeight,marginTop:K.style.marginTop,marginBottom:K.style.marginBottom})},[f,K]),qe(()=>{$||M||(Q.current=!1,G.current=!1,U.current=0,I.current=0,Bp(K,le.current))},[$,M,K,f]),qe(()=>{const Le=f.current;if(!(!$||!H||!K||!Le||c.state.transitionStatus==="ending")){if(!M){Q.current=!0,ae.request(C),Le.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var he;const te=pQ(Le);Le.style.removeProperty("--transform-origin");try{const ye=getComputedStyle(K),_e=getComputedStyle(Le),Ae=Qt(H),Ce=Hn(K),Te=H.getBoundingClientRect(),J=K.getBoundingClientRect(),Ee=Te.left,xe=Te.height,Be=P||Le,Ve=Be.scrollHeight,De=parseFloat(_e.borderBottomWidth),ut=parseFloat(ye.marginTop)||10,pe=parseFloat(ye.marginBottom)||10,Re=parseFloat(ye.minHeight)||100,ee=Dk(_e),fe=5,Ne=5,He=20,$e=Ae.documentElement.clientHeight-ut-pe,et=Ae.documentElement.clientWidth,ze=$e-Te.bottom+xe,Ze=y.current,tt=h.current;let Rt,zt=0,yt=0;if(Ze&&tt){const Mt=tt.getBoundingClientRect();Rt=Ze.getBoundingClientRect();const X=Mt.left-Ee,ie=Rt.left-J.left,de=Mt.top-Te.top+Mt.height/2,ke=Rt.top-J.top+Rt.height/2;zt=X-ie,yt=ke-de}const Nt=ze+yt+pe+De;let it=Math.min($e,Nt);const ft=$e-ut-pe,bt=Nt-it,Ke=Math.max(fe,Ee+zt),kt=et-Ne,_t=Math.max(0,Ke+J.width-kt);K.style.left=`${Ke-_t}px`,K.style.height=`${it}px`,K.style.maxHeight="auto",K.style.marginTop=`${ut}px`,K.style.marginBottom=`${pe}px`,Le.style.height="100%";const Tt=Be.scrollHeight-Be.clientHeight,dn=bt>=Tt;dn&&(it=Math.min($e,J.height)-(bt-Tt));const Ut=Te.top<He||Te.bottom>$e-He||it<Math.min(Ve,Re),Je=(((he=Ce.visualViewport)==null?void 0:he.scale)??1)!==1&&sm;if(Ut||Je){Q.current=!0,Bp(K,le.current),pr.flushSync(()=>D(!1));return}if(dn){const Mt=Math.max(0,$e-Nt);K.style.top=J.height>=ft?"0":`${Mt}px`,K.style.height=`${it}px`,Be.scrollTop=Be.scrollHeight-Be.clientHeight,U.current=Math.max(Re,it)}else K.style.bottom="0",U.current=Math.max(Re,it),Be.scrollTop=bt;if(Rt){const Mt=J.top,X=J.height,ie=Rt.top+Rt.height/2,de=X>0?(ie-Mt)/X*100:50,ke=Ha(de,0,100);Le.style.setProperty("--transform-origin",`50% ${ke}%`)}(U.current===$e||it>=ee)&&(G.current=!0),C(),setTimeout(()=>{Q.current=!0})}finally{te()}})}},[c,$,K,H,h,y,f,C,M,D,ae,A,N,P]),v.useEffect(()=>{if(!M||!K||!$)return;const Le=Hn(K);function te(he){m(!1,xt(CH,he))}return Le.addEventListener("resize",te),()=>{Le.removeEventListener("resize",te)}},[m,M,K,$]);const ve={...P?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${V}-list`},onKeyDown(Le){g.current=!0,L&&T0.has(Le.key)&&Le.stopPropagation()},onMouseMove(){g.current=!1},onPointerLeave(Le){if(!E||UO(Le)||Le.pointerType==="touch")return;const te=Le.currentTarget;_.start(0,()=>{c.set("activeIndex",null),te.focus({preventScroll:!0})})},onScroll(Le){P||Z(Le.currentTarget)},...M&&{style:P?{height:"100%"}:HO}},Se=It("div",t,{ref:[n,f],state:ue,stateAttributesMapping:fQ,props:[j,ve,_c(z),{className:!P&&M?Md.className:void 0},l]});return S.jsxs(v.Fragment,{children:[!Y&&Md.getElement(F),S.jsx(g0,{context:q,modal:!1,disabled:!B,returnFocus:o,restoreFocus:!0,children:Se})]})});function Dk(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function Ik(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const Pk=[["transform","none"],["scale","1"],["translate","0 0"]];function pQ(e){const{style:t}=e,n={};for(const[r,a]of Pk)n[r]=t.getPropertyValue(r),t.setProperty(r,a,"important");return()=>{for(const[r]of Pk){const a=n[r];a?t.setProperty(r,a):t.removeProperty(r)}}}const mQ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l,scrollHandlerRef:c}=fa(),{alignItemWithTriggerActive:f}=sw(),d=Ct(l,St.hasScrollArrows),m=Ct(l,St.openMethod),h=Ct(l,St.multiple),g={id:`${Ct(l,St.id)}-list`,role:"listbox","aria-multiselectable":h||void 0,onScroll(C){var R;(R=c.current)==null||R.call(c,C.currentTarget)},...f&&{style:HO},className:d&&m!=="touch"?Md.className:void 0},w=We(C=>{l.set("listElement",C)});return It("div",t,{ref:[n,w],props:[g,o]})});let $O=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function lw(e={}){const{label:t,metadata:n,textRef:r,indexGuessBehavior:a,index:o}=e,{register:l,unregister:c,subscribeMapChange:f,elementsRef:d,labelsRef:m,nextIndexRef:h}=rQ(),y=v.useRef(-1),[g,w]=v.useState(o??(a===$O.GuessFromOrder?()=>{if(y.current===-1){const E=h.current;h.current+=1,y.current=E}return y.current}:-1)),C=v.useRef(null),R=v.useCallback(E=>{var T;if(C.current=E,g!==-1&&E!==null&&(d.current[g]=E,m)){const k=t!==void 0;m.current[g]=k?t:((T=r==null?void 0:r.current)==null?void 0:T.textContent)??E.textContent}},[g,d,m,t,r]);return qe(()=>{if(o!=null)return;const E=C.current;if(E)return l(E,n),()=>{c(E)}},[o,l,c,n]),qe(()=>{if(o==null)return f(E=>{var k;const T=C.current?(k=E.get(C.current))==null?void 0:k.index:null;T!=null&&w(T)})},[o,f,w]),v.useMemo(()=>({ref:R,index:g}),[g,R])}const WO=v.createContext(void 0);function cw(){const e=v.useContext(WO);if(!e)throw new Error(Cn(57));return e}const gQ=v.memo(v.forwardRef(function(t,n){const{render:r,className:a,value:o=null,label:l,disabled:c=!1,nativeButton:f=!1,...d}=t,m=v.useRef(null),h=lw({label:l,textRef:m,indexGuessBehavior:$O.GuessFromOrder}),{store:y,getItemProps:g,setOpen:w,setValue:C,selectionRef:R,typingRef:E,valuesRef:T,keyboardActiveRef:k,multiple:M,highlightItemOnHover:D}=fa(),A=Bn(),N=Ct(y,St.isActive,h.index),L=Ct(y,St.isSelected,h.index,o),q=Ct(y,St.isSelectedByFocus,h.index),F=Ct(y,St.isItemEqualToValue),Y=h.index,_=Y!==-1,V=v.useRef(null),$=sr(Y);qe(()=>{if(!_)return;const ae=T.current;return ae[Y]=o,()=>{delete ae[Y]}},[_,Y,o,T]),qe(()=>{if(!_)return;const ae=y.state.value;let Z=ae;M&&Array.isArray(ae)&&ae.length>0&&(Z=ae[ae.length-1]),Z!==void 0&&kc(o,Z,F)&&y.set("selectedIndex",Y)},[_,Y,M,F,y,o]);const B={disabled:c,selected:L,highlighted:N},j=g({active:N,selected:L});j.onFocus=void 0,j.id=void 0;const z=v.useRef(null),H=v.useRef("mouse"),K=v.useRef(!1),{getButtonProps:P,buttonRef:U}=$a({disabled:c,focusableWhenDisabled:!0,native:f});function G(ae){const Z=y.state.value;if(M){const ue=Array.isArray(Z)?Z:[],ve=L?VX(ue,o,F):[...ue,o];C(ve,xt(id,ae))}else C(o,xt(id,ae)),w(!1,xt(id,ae))}const I={role:"option","aria-selected":L,tabIndex:N?0:-1,onFocus(){y.set("activeIndex",Y)},onMouseEnter(){!k.current&&y.state.selectedIndex===null&&D&&y.set("activeIndex",Y)},onMouseMove(){D&&y.set("activeIndex",Y)},onMouseLeave(ae){!D||k.current||UO(ae)||A.start(0,()=>{y.state.activeIndex===Y&&y.set("activeIndex",null)})},onTouchStart(){R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ae){z.current=ae.key,y.set("activeIndex",Y)},onClick(ae){K.current=!1,!(ae.type==="keydown"&&z.current===null)&&(c||z.current===" "&&E.current||H.current!=="touch"&&!N||(z.current=null,G(ae.nativeEvent)))},onPointerEnter(ae){H.current=ae.pointerType},onPointerDown(ae){H.current=ae.pointerType,K.current=!0},onMouseUp(ae){if(c)return;if(K.current){K.current=!1;return}const Z=!R.current.allowSelectedMouseUp&&L,ue=!R.current.allowUnselectedMouseUp&&!L;Z||ue||H.current!=="touch"&&!N||G(ae.nativeEvent)}},Q=It("div",t,{ref:[U,n,h.ref,V],state:B,props:[j,I,d,P]}),le=v.useMemo(()=>({selected:L,indexRef:$,textRef:m,selectedByFocus:q,hasRegistered:_}),[L,$,m,q,_]);return S.jsx(WO.Provider,{value:le,children:Q})})),yQ=v.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:a}=cw();return r||a?S.jsx(bQ,{...t,ref:n}):null}),bQ=v.memo(v.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:a,...o}=e,{selected:l}=cw(),c=v.useRef(null),{transitionStatus:f,setMounted:d}=Wd(l),h=It("span",e,{ref:[t,c],state:{selected:l,transitionStatus:f},props:[{"aria-hidden":!0,children:"✔️"},o],stateAttributesMapping:Wa});return Ya({open:l,ref:c,onComplete(){l||d(!1)}}),h})),vQ=v.memo(v.forwardRef(function(t,n){const{indexRef:r,textRef:a,selectedByFocus:o,hasRegistered:l}=cw(),{selectedItemTextRef:c}=fa(),{className:f,render:d,...m}=t,h=v.useCallback(g=>{if(!g||!l)return;const w=c.current===null||!c.current.isConnected;(o||w&&r.current===0)&&(c.current=g)},[c,r,o,l]);return It("div",t,{ref:[h,n,a],props:m})})),YO=v.forwardRef(function(t,n){const{render:r,className:a,direction:o,keepMounted:l=!1,...c}=t,{store:f,popupRef:d,listRef:m,handleScrollArrowVisibility:h,scrollArrowsMountedCountRef:y}=fa(),{side:g,scrollDownArrowRef:w,scrollUpArrowRef:C}=sw(),R=o==="up"?St.scrollUpArrowVisible:St.scrollDownArrowVisible,E=Ct(f,R),T=Ct(f,St.openMethod),k=E&&T!=="touch",M=Bn(),D=o==="up"?C:w,{transitionStatus:A,setMounted:N}=Wd(k);qe(()=>(y.current+=1,f.state.hasScrollArrows||f.set("hasScrollArrows",!0),()=>{y.current=Math.max(0,y.current-1),y.current===0&&f.state.hasScrollArrows&&f.set("hasScrollArrows",!1)}),[f,y]),Ya({open:k,ref:D,onComplete(){k||N(!1)}});const F=It("div",t,{ref:[n,D],state:{direction:o,visible:k,side:g,transitionStatus:A},props:[{"aria-hidden":!0,children:o==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(_){if(_.movementX===0&&_.movementY===0||M.isStarted())return;f.set("activeIndex",null);function V(){var H;const $=f.state.listElement??d.current;if(!$)return;f.set("activeIndex",null),h();const B=$.scrollTop===0,j=Math.round($.scrollTop+$.clientHeight)>=$.scrollHeight;if(m.current.length===0&&(o==="up"?f.set("scrollUpArrowVisible",!B):f.set("scrollDownArrowVisible",!j)),o==="up"&&B||o==="down"&&j){M.clear();return}if((f.state.listElement||d.current)&&m.current&&m.current.length>0){const K=m.current,P=((H=D.current)==null?void 0:H.offsetHeight)||0;if(o==="up"){let U=0;const G=$.scrollTop+P;for(let Q=0;Q<K.length;Q+=1){const le=K[Q];if(le&&le.offsetTop>=G){U=Q;break}}const I=Math.max(0,U-1);if(I<U){const Q=K[I];Q&&($.scrollTop=Math.max(0,Q.offsetTop-P))}else $.scrollTop=0}else{let U=K.length-1;const G=$.scrollTop+$.clientHeight-P;for(let Q=0;Q<K.length;Q+=1){const le=K[Q];if(le&&le.offsetTop+le.offsetHeight>G){U=Math.max(0,Q-1);break}}const I=Math.min(K.length-1,U+1);if(I>U){const Q=K[I];Q&&($.scrollTop=Q.offsetTop+Q.offsetHeight-$.clientHeight+P)}else $.scrollTop=$.scrollHeight-$.clientHeight}}M.start(40,V)}M.start(40,V)},onMouseLeave(){M.clear()}},c]});return k||l?F:null}),xQ=v.forwardRef(function(t,n){return S.jsx(YO,{...t,ref:n,direction:"down"})}),wQ=v.forwardRef(function(t,n){return S.jsx(YO,{...t,ref:n,direction:"up"})}),KO=v.createContext(void 0);function SQ(){const e=v.useContext(KO);if(e===void 0)throw new Error(Cn(56));return e}const EQ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,[l,c]=v.useState(),f=v.useMemo(()=>({labelId:l,setLabelId:c}),[l,c]),d=It("div",t,{ref:n,props:[{role:"group","aria-labelledby":l},o]});return S.jsx(KO.Provider,{value:f,children:d})}),CQ=v.forwardRef(function(t,n){const{className:r,render:a,id:o,...l}=t,{setLabelId:c}=SQ(),f=Vi(o);return qe(()=>{c(f)},[f,c]),It("div",t,{ref:n,props:[{id:f},l]})}),up=KX;function RQ({className:e,...t}){return S.jsx(EQ,{"data-slot":"select-group",className:Pe("scroll-my-1 p-1",e),...t})}function Gb({className:e,...t}){return S.jsx(JX,{"data-slot":"select-value",className:Pe("flex flex-1 text-left",e),...t})}function dp({className:e,size:t="default",children:n,...r}){return S.jsxs(QX,{"data-slot":"select-trigger","data-size":t,className:Pe("border-input data-placeholder:text-muted-foreground dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none focus-visible:ring-2 aria-invalid:ring-2 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)] *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-4 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r,children:[n,S.jsx(eQ,{render:S.jsx(aN,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function fp({className:e,children:t,side:n="bottom",sideOffset:r=4,align:a="center",alignOffset:o=0,alignItemWithTrigger:l=!0,...c}){return S.jsx(nQ,{children:S.jsx(lQ,{side:n,sideOffset:r,align:a,alignOffset:o,alignItemWithTrigger:l,className:"isolate z-50",children:S.jsxs(hQ,{"data-slot":"select-content","data-align-trigger":l,className:Pe("bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 min-w-36 rounded-lg shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto data-[align-trigger=true]:animate-none",e),...c,children:[S.jsx(kQ,{}),S.jsx(mQ,{children:t}),S.jsx(MQ,{})]})})})}function TQ({className:e,...t}){return S.jsx(CQ,{"data-slot":"select-label",className:Pe("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function La({className:e,children:t,...n}){return S.jsxs(gQ,{"data-slot":"select-item",className:Pe("focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...n,children:[S.jsx(vQ,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),S.jsx(yQ,{render:S.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:S.jsx(Ip,{className:"pointer-events-none"})})]})}function kQ({className:e,...t}){return S.jsx(wQ,{"data-slot":"select-scroll-up-button",className:Pe("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 top-0 w-full",e),...t,children:S.jsx(f8,{})})}function MQ({className:e,...t}){return S.jsx(xQ,{"data-slot":"select-scroll-down-button",className:Pe("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4 bottom-0 w-full",e),...t,children:S.jsx(aN,{})})}const ux="::";function Lk(e,t){return`${e??""}${ux}${t}`}function AQ(e){const t=e.indexOf(ux);return t<0?{providerId:null,modelId:e}:{providerId:e.slice(0,t)||null,modelId:e.slice(t+ux.length)}}function NQ({providerId:e,modelId:t,onChange:n,disabled:r,className:a}){var C;const{t:o}=mn(),{data:l}=Ei({queryKey:["llm-providers"],queryFn:async()=>{const R=await fetch("/api/llm/providers");if(!R.ok)throw new Error("Failed to load providers");return await R.json()},throwOnError:!1}),{data:c}=Ei({queryKey:["llm-settings"],queryFn:async()=>{const R=await fetch("/api/llm/settings");if(!R.ok)throw new Error("Failed to load settings");return await R.json()},throwOnError:!1}),f=((l==null?void 0:l.providers)??[]).filter(R=>R.enabled&&R.models.length>0),d=e??(c==null?void 0:c.settings.defaultProviderId)??null,m=t??(c==null?void 0:c.settings.defaultModelId)??null,h=m?Lk(d,m):"",y=f.some(R=>R.id===d&&R.models.includes(m??"")),g=((C=f.find(R=>R.id===d))==null?void 0:C.name)??null,w=m?g?`${g}/${m}`:m:o("agent.model.placeholder");return S.jsxs(up,{value:h,onValueChange:R=>{if(typeof R!="string"||!R)return;const E=AQ(R);n(E.providerId,E.modelId)},disabled:r||f.length===0,children:[S.jsx(dp,{size:"sm",className:Pe("h-7 w-full min-w-0 border-transparent bg-transparent text-muted-foreground text-xs hover:border-border/40 dark:bg-transparent dark:hover:bg-transparent",a),"data-testid":"agent-model-picker","aria-label":o("agent.model.select"),children:S.jsx("span",{className:"min-w-0 truncate",children:w})}),S.jsxs(fp,{children:[!y&&m&&S.jsx(La,{value:h,className:"text-muted-foreground",children:m}),f.map(R=>S.jsxs(RQ,{children:[S.jsx(TQ,{children:R.name}),R.models.map(E=>S.jsx(La,{value:Lk(R.id,E),children:E},`${R.id}:${E}`))]},R.id))]})]})}function OQ({queued:e,onEdit:t,onWithdraw:n,onSteer:r}){const{t:a}=mn(),[o,l]=v.useState(null),[c,f]=v.useState("");if(e.length===0)return null;const d=h=>{l(h.id),f(h.text)},m=h=>{const y=c.trim();y&&t(h,y),l(null)};return S.jsxs("div",{"data-testid":"agent-queue",className:"bg-muted/50 mx-3 mb-2 flex shrink-0 flex-col gap-1.5 rounded-xl px-2.5 py-2",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("span",{className:"text-muted-foreground text-xs font-medium",children:a("agent.queue.title",{count:e.length})}),S.jsxs(Ht,{"data-testid":"agent-queue-steer",size:"xs",variant:"outline",onClick:r,title:a("agent.queue.steerHint"),children:[S.jsx(uN,{}),a("agent.queue.steer")]})]}),S.jsx("ul",{className:"flex flex-col gap-1",children:e.map(h=>S.jsx("li",{"data-testid":`agent-queue-item-${h.id}`,className:"bg-background/60 flex items-start gap-1.5 rounded-lg px-2 py-1",children:o===h.id?S.jsxs(S.Fragment,{children:[S.jsx(H0,{value:c,onChange:y=>f(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.shiftKey&&(y.preventDefault(),m(h.id)),y.key==="Escape"&&l(null)},rows:1,className:"max-h-32 min-h-7 flex-1 resize-none text-xs",autoFocus:!0}),S.jsx(Ht,{size:"icon-sm",variant:"ghost",onClick:()=>m(h.id),"aria-label":a("common.save"),children:S.jsx(Ip,{})})]}):S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:h.text}),S.jsx(Ht,{size:"icon-sm",variant:"ghost",onClick:()=>d(h),"aria-label":a("common.edit"),children:S.jsx(xm,{})}),S.jsx(Ht,{"data-testid":`agent-queue-withdraw-${h.id}`,size:"icon-sm",variant:"ghost",onClick:()=>n(h.id),"aria-label":a("agent.queue.withdraw"),children:S.jsx(Va,{})})]})},h.id))})]})}function DQ({onSend:e,onSteer:t,onStop:n,running:r,steerable:a,disabled:o,modelPicker:l,writeModeControl:c}){const{t:f}=mn(),[d,m]=v.useState(""),h=an(C=>{var R;return((R=C.draft)==null?void 0:R.prompt)??null}),y=v.useRef(null);v.useEffect(()=>{h&&h!==y.current&&(y.current=h,m(h))},[h]);const g=()=>{const C=d.trim();!C||o||(e==null||e(C),m(""))},w=()=>{const C=d.trim();!C||o||(t==null||t(C),m(""))};return S.jsxs("div",{"data-testid":"agent-chat-input",className:"bg-chat-surface flex shrink-0 flex-col gap-2 mx-3 mb-2.5 rounded-xl mt-1.5 focus-within:ring-1 focus-within:ring-ring/30",children:[S.jsx(H0,{"data-testid":"agent-chat-input-textarea",value:d,onChange:C=>m(C.target.value),onKeyDown:C=>{C.key==="Enter"&&!C.shiftKey&&!C.nativeEvent.isComposing&&(C.preventDefault(),g())},placeholder:f("agent.panel.inputPlaceholder"),disabled:o,className:"max-h-40 min-h-[4.5rem] w-full resize-none border-transparent bg-transparent p-3 text-[13px] shadow-none focus-visible:border-transparent focus-visible:ring-0 disabled:bg-transparent dark:bg-transparent dark:disabled:bg-transparent",rows:3}),S.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 px-2.5 pb-2.5",children:[S.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[c,l&&S.jsx("div",{className:"min-w-0 flex-1",children:l})]}),r?S.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1.5",children:[a&&S.jsx(Ht,{"data-testid":"agent-chat-steer",size:"icon",variant:"outline",disabled:o||d.trim().length===0,onClick:w,"aria-label":f("agent.queue.steer"),title:f("agent.queue.steerHint"),children:S.jsx(uN,{})}),S.jsx(Ht,{"data-testid":"agent-chat-send",size:"icon",variant:"secondary",disabled:o||d.trim().length===0,onClick:g,"aria-label":f("agent.panel.send"),children:S.jsx(CT,{})}),S.jsx(Ht,{"data-testid":"agent-chat-stop",size:"icon",variant:"destructive",onClick:()=>n==null?void 0:n(),"aria-label":f("agent.panel.stop"),children:S.jsx(S9,{})})]}):S.jsx(Ht,{"data-testid":"agent-chat-send",size:"icon",className:"ml-auto shrink-0",disabled:o||d.trim().length===0,onClick:g,"aria-label":f("agent.panel.send"),children:S.jsx(CT,{})})]})]})}function IQ(e,t,n){var o;if(!e.deviceId||!e.paneId)return null;const r=((o=n==null?void 0:n.find(l=>l.id===e.deviceId))==null?void 0:o.name)??null,a=t[e.deviceId];if(!(a!=null&&a.session))return{label:`${e.paneId}@${r??"?"}`,state:"unknown",windowId:null};for(const l of a.session.windows){const c=l.panes.find(f=>f.id===e.paneId);if(c)return{label:DV({paneIdx:c.index,windowIdx:l.index,paneTitle:c.title,windowName:l.name,windowCustomName:l.customName,deviceName:r}),state:"valid",windowId:l.id}}return{label:`${e.paneId}@${r??"?"}`,state:"invalid",windowId:null}}function PQ(){var ae;const{t:e}=mn(),t=Hd(),n=Bi(Z=>Z.setSidebarTab),r=P4("/devices/:deviceId/windows/:windowId/panes/:paneId"),a=(r==null?void 0:r.params.deviceId)??null,o=(r==null?void 0:r.params.paneId)??null,l=an(Z=>Z.sessions),c=an(Z=>Z.activeSessionId),f=an(Z=>Z.draft),d=an(Z=>Z.activeSessionId?Z.messages[Z.activeSessionId]:void 0),m=an(Z=>Z.activeSessionId?Z.inProgress[Z.activeSessionId]:void 0),h=an(Z=>Z.activeSessionId?Z.pendingConfirmations[Z.activeSessionId]:void 0),y=an(Z=>Z.activeSessionId?Z.sending[Z.activeSessionId]:void 0),g=an(Z=>Z.activeSessionId?Z.queued[Z.activeSessionId]:void 0),w=an(Z=>Z.defaultWriteMode),C=kn(Z=>Z.snapshots),{data:R}=Ei({queryKey:["devices"],queryFn:async()=>{const Z=await fetch("/api/devices");if(!Z.ok)throw new Error("Failed to load devices");return Z.json()},throwOnError:!1});v.useEffect(()=>{const Z=an.getState();Z.ensureInitialized(),Z.loadSessions()},[]);const E=c?l[c]:void 0,T=v.useMemo(()=>{var ue,ve;if(!a||!o)return null;const Z=(ve=(ue=C[a])==null?void 0:ue.session)==null?void 0:ve.windows;for(const Se of Z??[]){const Le=Se.panes.find(te=>te.id===o);if(Le)return Le.title??null}return null},[a,o,C]);v.useEffect(()=>{!E&&!f&&a&&o&&an.getState().startDraft(a,o,T)},[E,f,a,o,T]);const k=v.useMemo(()=>{const Z=new Map;for(const ue of h??[])Z.set(ue.toolCallId,ue.id);return Z},[h]),M=v.useMemo(()=>{const Z=CV(d,m),ue=new Set;for(const Se of Z)Se.kind==="tool-call"&&ue.add(Se.call.toolCallId);const ve=[];for(const Se of h??[])ue.has(Se.toolCallId)||ve.push({kind:"tool-call",key:`confirmation-${Se.id}`,call:{toolCallId:Se.toolCallId,toolName:Se.toolName,input:Se.input,isError:!1,denied:!1,resolved:!1}});return ve.length>0?[...Z,...ve]:Z},[d,m,h]),D=E??(f?{deviceId:f.deviceId,paneId:f.paneId}:null),A=D?IQ(D,C,R==null?void 0:R.devices):null,N=!!(E&&o&&a&&(E.paneId!==o||E.deviceId!==a)),L=(E==null?void 0:E.status)==="running",q=RV(d),F=!!(E&&(!E.deviceId||!((ae=R==null?void 0:R.devices)!=null&&ae.some(Z=>Z.id===E.deviceId))||(A==null?void 0:A.state)==="invalid")),Y=g??[],_=(Z,ue)=>{c&&an.getState().decideConfirmation(c,Z,ue)},V=()=>{if(E!=null&&E.deviceId){if((A==null?void 0:A.state)==="valid"&&A.windowId&&E.paneId){t(`/devices/${E.deviceId}/windows/${A.windowId}/panes/${encodeURIComponent(E.paneId)}`);return}(A==null?void 0:A.state)==="unknown"&&t(`/devices/${E.deviceId}`)}},$=()=>{!a||!o||an.getState().startDraft(a,o,T)},B=(Z,ue)=>{E?an.getState().setSessionModel(E.id,Z,ue):f&&an.getState().updateDraft({providerId:Z,modelId:ue})},j=Z=>{const ue=an.getState();if(E){E.status==="running"?ue.enqueueMessage(E.id,Z):ue.sendMessage(E.id,Z);return}f&&(async()=>{const ve=await ue.materializeDraft();ve&&await ue.sendMessage(ve.id,Z)})()},z=Z=>{E&&an.getState().enqueueMessage(E.id,Z,!0)},H=()=>{if(!E)return;const Z=Y[0];if(!Z)return;const ue=an.getState();(async()=>(await ue.withdrawQueuedMessage(E.id,Z.id),await ue.enqueueMessage(E.id,Z.text,!0)))()},K=E?E.providerId:(f==null?void 0:f.providerId)??null,P=E?E.modelId:(f==null?void 0:f.modelId)??null,U=!!(E||f),G=!!(f&&!E),I=E?E.writeMode:w,Q=!!(E&&((d==null?void 0:d.length)??0)>0),le=F||!U||(E==null?void 0:E.status)==="waiting_confirmation"||!!y;return S.jsxs("div",{"data-testid":"agent-tab",className:"flex h-full min-h-0 flex-col",children:[S.jsxs("div",{className:"flex shrink-0 items-center gap-2 px-3 py-2",children:[A?S.jsxs("button",{type:"button","data-testid":"agent-binding-chip","data-binding-state":A.state,className:Pe("border-border flex min-w-0 items-center gap-1 rounded-full border px-2 py-0.5 text-xs",E&&A.state==="valid"?"hover:bg-muted cursor-pointer":"text-muted-foreground",A.state==="invalid"&&"opacity-60"),onClick:V,disabled:!E||A.state==="invalid",children:[S.jsx(T9,{className:"size-3 shrink-0"}),S.jsx("span",{className:"min-w-0 truncate",children:A.label}),A.state==="invalid"&&S.jsxs("span",{className:"shrink-0",children:["· ",e("agent.binding.invalid")]})]}):S.jsx("div",{className:"min-w-0 flex-1"}),S.jsxs("div",{className:"ml-auto flex shrink-0 items-center gap-1",children:[S.jsx(Ht,{"data-testid":"agent-session-switch",size:"icon-sm",variant:"ghost",onClick:()=>n("panes"),"aria-label":e("agent.session.switch"),title:e("agent.session.switch"),children:S.jsx(Y8,{})}),Q&&S.jsx(Ht,{"data-testid":"agent-session-new",size:"icon-sm",variant:"ghost",disabled:!a||!o,onClick:$,"aria-label":e("agent.session.new"),title:e(!a||!o?"agent.session.selectPaneHint":"agent.session.new"),children:S.jsx(wm,{})})]})]}),F&&S.jsxs("div",{"data-testid":"agent-orphan-banner",className:"bg-muted/50 text-muted-foreground mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[S.jsx(od,{className:"mt-0.5 size-3.5 shrink-0"}),S.jsx("span",{className:"min-w-0 flex-1",children:e("agent.orphan.readonly")})]}),E&&!F&&N&&S.jsxs("div",{"data-testid":"agent-pane-mismatch",className:"bg-muted/50 mx-3 mb-1.5 flex shrink-0 flex-wrap items-center gap-2 rounded-lg px-2 py-1.5 text-xs",children:[S.jsx(od,{className:"text-muted-foreground size-3.5 shrink-0"}),S.jsx("span",{className:"text-muted-foreground min-w-0 flex-1",children:e("agent.binding.mismatchTitle")}),(A==null?void 0:A.state)==="valid"&&S.jsx(Ht,{"data-testid":"agent-binding-goto",size:"xs",variant:"outline",onClick:V,children:e("agent.binding.goTo")}),o&&S.jsx(Ht,{"data-testid":"agent-binding-rebind",size:"xs",variant:"outline",onClick:()=>{an.getState().rebindPane(E.id,o)},children:e("agent.binding.rebind")})]}),(E==null?void 0:E.status)==="error"&&E.lastError&&S.jsxs("div",{"data-testid":"agent-error-banner",className:"bg-destructive/10 text-destructive mx-3 mb-1.5 flex shrink-0 items-start gap-2 rounded-lg px-2 py-1.5 text-xs",children:[S.jsx(od,{className:"mt-0.5 size-3.5 shrink-0"}),S.jsx("span",{className:"min-w-0 flex-1 break-words",children:E.lastError}),q&&!F&&S.jsx(Ht,{"data-testid":"agent-error-retry",size:"xs",variant:"outline",className:"shrink-0",disabled:!!y,onClick:()=>{an.getState().sendMessage(E.id,q)},children:e("agent.panel.retry")})]}),!G&&S.jsx(HX,{blocks:E?M:[],running:!!L,emptyText:e(U?"agent.panel.empty":"agent.session.selectPaneHint"),confirmationByToolCallId:k,onDecide:_,className:"bg-chat-surface mx-3 mb-2 overflow-hidden rounded-xl"},(E==null?void 0:E.id)??(f?"draft":"none")),E&&!F&&Y.length>0&&S.jsx(OQ,{queued:Y,onEdit:(Z,ue)=>void an.getState().editQueuedMessage(E.id,Z,ue),onWithdraw:Z=>void an.getState().withdrawQueuedMessage(E.id,Z),onSteer:H}),U&&S.jsxs("div",{className:G?"flex min-h-0 flex-1 flex-col justify-center":"contents",children:[G&&S.jsxs("div",{className:"flex flex-col items-center gap-2 px-6 pb-6 text-center",children:[S.jsx(lN,{className:"text-muted-foreground size-9"}),S.jsx("h3",{className:"text-sm font-medium",children:e("agent.welcome.title")}),S.jsx("p",{className:"text-muted-foreground text-xs",children:e("agent.welcome.subtitle")})]}),S.jsx(DQ,{disabled:le,running:!!L,steerable:!!E,onSend:j,onSteer:z,onStop:()=>{E&&an.getState().stopSession(E.id)},modelPicker:S.jsx(NQ,{providerId:K,modelId:P,onChange:B,disabled:L}),writeModeControl:S.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[S.jsx("span",{className:"text-muted-foreground text-xs",children:e(I==="auto"?"agent.writeMode.auto":"agent.writeMode.confirm")}),S.jsx(Lp,{"data-testid":"agent-write-mode-switch",checked:I==="auto",disabled:!!E&&F,onCheckedChange:Z=>{const ue=Z?"auto":"confirm";an.getState().setDefaultWriteMode(ue),E&&an.getState().setWriteMode(E.id,ue)}})]})})]})]})}const GO=v.createContext(void 0);function Om(){const e=v.useContext(GO);if(e===void 0)throw new Error(Cn(53));return e}let Hp=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Wh=500,_k=16;function Si(e,t,n){if(!e)return 0;const r=getComputedStyle(e),a=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(r[`${t}InlineStart`])*2:parseFloat(r[`${t}${a}Start`])+parseFloat(r[`${t}${a}End`])}let LQ=(function(e){return e.orientation="data-orientation",e.hovering="data-hovering",e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({}),ql=(function(e){return e.scrolling="data-scrolling",e.hasOverflowX="data-has-overflow-x",e.hasOverflowY="data-has-overflow-y",e.overflowXStart="data-overflow-x-start",e.overflowXEnd="data-overflow-x-end",e.overflowYStart="data-overflow-y-start",e.overflowYEnd="data-overflow-y-end",e})({});const uw={hasOverflowX:e=>e?{[ql.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[ql.hasOverflowY]:""}:null,overflowXStart:e=>e?{[ql.overflowXStart]:""}:null,overflowXEnd:e=>e?{[ql.overflowXEnd]:""}:null,overflowYStart:e=>e?{[ql.overflowYStart]:""}:null,overflowYEnd:e=>e?{[ql.overflowYEnd]:""}:null,cornerHidden:()=>null},_Q={x:0,y:0},jk={width:0,height:0},jQ={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},zQ={x:!1,y:!1,corner:!1},FQ=v.forwardRef(function(t,n){const{render:r,className:a,overflowEdgeThreshold:o,...l}=t,c=BQ(o),f=Vi(),d=Bn(),m=Bn(),{nonce:h,disableStyleElements:y}=VO(),[g,w]=v.useState(!1),[C,R]=v.useState(!1),[E,T]=v.useState(!1),[k,M]=v.useState(!1),[D,A]=v.useState(jk),[N,L]=v.useState(jk),[q,F]=v.useState(jQ),[Y,_]=v.useState(zQ),V=v.useRef(null),$=v.useRef(null),B=v.useRef(null),j=v.useRef(null),z=v.useRef(null),H=v.useRef(null),K=v.useRef(null),P=v.useRef(!1),U=v.useRef(0),G=v.useRef(0),I=v.useRef(0),Q=v.useRef(0),le=v.useRef("vertical"),ae=v.useRef(_Q),Z=We(Ce=>{const Te=Ce.x-ae.current.x,J=Ce.y-ae.current.y;ae.current=Ce,J!==0&&(T(!0),d.start(Wh,()=>{T(!1)})),Te!==0&&(R(!0),m.start(Wh,()=>{R(!1)}))}),ue=We(Ce=>{Ce.button===0&&(P.current=!0,U.current=Ce.clientY,G.current=Ce.clientX,le.current=Ce.currentTarget.getAttribute(LQ.orientation),$.current&&(I.current=$.current.scrollTop,Q.current=$.current.scrollLeft),z.current&&le.current==="vertical"&&z.current.setPointerCapture(Ce.pointerId),H.current&&le.current==="horizontal"&&H.current.setPointerCapture(Ce.pointerId))}),ve=We(Ce=>{if(!P.current)return;const Te=Ce.clientY-U.current,J=Ce.clientX-G.current;if($.current){const Ee=$.current.scrollHeight,xe=$.current.clientHeight,Be=$.current.scrollWidth,Ve=$.current.clientWidth;if(z.current&&B.current&&le.current==="vertical"){const De=Si(B.current,"padding","y"),ut=Si(z.current,"margin","y"),pe=z.current.offsetHeight,Re=B.current.offsetHeight-pe-De-ut,ee=Te/Re;$.current.scrollTop=I.current+ee*(Ee-xe),Ce.preventDefault(),T(!0),d.start(Wh,()=>{T(!1)})}if(H.current&&j.current&&le.current==="horizontal"){const De=Si(j.current,"padding","x"),ut=Si(H.current,"margin","x"),pe=H.current.offsetWidth,Re=j.current.offsetWidth-pe-De-ut,ee=J/Re;$.current.scrollLeft=Q.current+ee*(Be-Ve),Ce.preventDefault(),R(!0),m.start(Wh,()=>{R(!1)})}}}),Se=We(Ce=>{P.current=!1,z.current&&le.current==="vertical"&&z.current.releasePointerCapture(Ce.pointerId),H.current&&le.current==="horizontal"&&H.current.releasePointerCapture(Ce.pointerId)});function Le(Ce){M(Ce.pointerType==="touch")}function te(Ce){if(Le(Ce),Ce.pointerType!=="touch"){const Te=Dt(V.current,Ce.target);w(Te)}}const he=v.useMemo(()=>({scrolling:C||E,hasOverflowX:!Y.x,hasOverflowY:!Y.y,overflowXStart:q.xStart,overflowXEnd:q.xEnd,overflowYStart:q.yStart,overflowYEnd:q.yEnd,cornerHidden:Y.corner}),[C,E,Y.x,Y.y,Y.corner,q]),ye={role:"presentation",onPointerEnter:te,onPointerMove:te,onPointerDown:Le,onPointerLeave(){w(!1)},style:{position:"relative",[Hp.scrollAreaCornerHeight]:`${D.height}px`,[Hp.scrollAreaCornerWidth]:`${D.width}px`}},_e=It("div",t,{state:he,ref:[n,V],props:[ye,l],stateAttributesMapping:uw}),Ae=v.useMemo(()=>({handlePointerDown:ue,handlePointerMove:ve,handlePointerUp:Se,handleScroll:Z,cornerSize:D,setCornerSize:A,thumbSize:N,setThumbSize:L,touchModality:k,cornerRef:K,scrollingX:C,setScrollingX:R,scrollingY:E,setScrollingY:T,hovering:g,setHovering:w,viewportRef:$,rootRef:V,scrollbarYRef:B,scrollbarXRef:j,thumbYRef:z,thumbXRef:H,rootId:f,hiddenState:Y,setHiddenState:_,overflowEdges:q,setOverflowEdges:F,viewportState:he,overflowEdgeThreshold:c}),[ue,ve,Se,Z,D,N,k,C,R,E,T,g,w,f,Y,q,he,c]);return S.jsxs(GO.Provider,{value:Ae,children:[!y&&Md.getElement(h),_e]})});function BQ(e){if(typeof e=="number"){const t=Math.max(0,e);return{xStart:t,xEnd:t,yStart:t,yEnd:t}}return{xStart:Math.max(0,(e==null?void 0:e.xStart)||0),xEnd:Math.max(0,(e==null?void 0:e.xEnd)||0),yStart:Math.max(0,(e==null?void 0:e.yStart)||0),yEnd:Math.max(0,(e==null?void 0:e.yEnd)||0)}}const HQ=v.createContext(void 0);function UQ(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(r=>{r.forEach(a=>{a.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let zo=(function(e){return e.scrollAreaOverflowXStart="--scroll-area-overflow-x-start",e.scrollAreaOverflowXEnd="--scroll-area-overflow-x-end",e.scrollAreaOverflowYStart="--scroll-area-overflow-y-start",e.scrollAreaOverflowYEnd="--scroll-area-overflow-y-end",e})({});const zk=1;function Fk(e,t){if(t<=0)return 0;const n=Ha(e,0,t),r=n,a=t-n,o=r<=zk,l=a<=zk;return o&&l?r<=a?0:t:o?0:l?t:n}let Bk=!1;function qQ(){Bk||sm||(typeof CSS<"u"&&"registerProperty"in CSS&&[zo.scrollAreaOverflowXStart,zo.scrollAreaOverflowXEnd,zo.scrollAreaOverflowYStart,zo.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),Bk=!0)}const VQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{viewportRef:l,scrollbarYRef:c,scrollbarXRef:f,thumbYRef:d,thumbXRef:m,cornerRef:h,cornerSize:y,setCornerSize:g,setThumbSize:w,rootId:C,setHiddenState:R,hiddenState:E,handleScroll:T,setHovering:k,setOverflowEdges:M,overflowEdges:D,overflowEdgeThreshold:A,scrollingX:N,scrollingY:L}=Om(),q=Lc(),F=v.useRef(!0),Y=Bn(),_=Bn(),V=We(()=>{const K=l.current,P=c.current,U=f.current,G=d.current,I=m.current,Q=h.current;if(!K)return;const le=K.scrollHeight,ae=K.scrollWidth,Z=K.clientHeight,ue=K.clientWidth,ve=K.scrollTop,Se=K.scrollLeft;if(le===0||ae===0)return;const Le=Z>=le,te=ue>=ae,he=ue/ae,ye=Z/le,_e=Math.max(0,ae-ue),Ae=Math.max(0,le-Z);let Ce=0,Te=0;if(!te){let it=0;q==="rtl"?it=Ha(-Se,0,_e):it=Ha(Se,0,_e),Ce=Fk(it,_e),Te=_e-Ce}const J=Le?0:Ha(ve,0,Ae),Ee=Le?0:Fk(J,Ae),xe=Le?0:Ae-Ee,Be=te?0:ue,Ve=Le?0:Z;let De=0,ut=0;!te&&!Le&&(De=(P==null?void 0:P.offsetWidth)||0,ut=(U==null?void 0:U.offsetHeight)||0);const pe=y.width===0&&y.height===0,Re=pe?De:0,ee=pe?ut:0,fe=Si(U,"padding","x"),Ne=Si(P,"padding","y"),He=Si(I,"margin","x"),$e=Si(G,"margin","y"),et=Be-fe-He,ze=Ve-Ne-$e,Ze=U?Math.min(U.offsetWidth-Re,et):et,tt=P?Math.min(P.offsetHeight-ee,ze):ze,Rt=Math.max(_k,Ze*he),zt=Math.max(_k,tt*ye);if(w(it=>it.height===zt&&it.width===Rt?it:{width:Rt,height:zt}),P&&G){const it=P.offsetHeight-zt-Ne-$e,ft=le-Z,bt=ft===0?0:ve/ft,Ke=Math.min(it,Math.max(0,bt*it));G.style.transform=`translate3d(0,${Ke}px,0)`}if(U&&I){const it=U.offsetWidth-Rt-fe-He,ft=ae-ue,bt=ft===0?0:Se/ft,Ke=q==="rtl"?Ha(bt*it,-it,0):Ha(bt*it,0,it);I.style.transform=`translate3d(${Ke}px,0,0)`}const yt=[[zo.scrollAreaOverflowXStart,Ce],[zo.scrollAreaOverflowXEnd,Te],[zo.scrollAreaOverflowYStart,Ee],[zo.scrollAreaOverflowYEnd,xe]];for(const[it,ft]of yt)K.style.setProperty(it,`${ft}px`);Q&&(te||Le?g({width:0,height:0}):!te&&!Le&&g({width:De,height:ut})),R(it=>{const ft=Le||te;return it.y===Le&&it.x===te&&it.corner===ft?it:{y:Le,x:te,corner:ft}});const Nt={xStart:!te&&Ce>A.xStart,xEnd:!te&&Te>A.xEnd,yStart:!Le&&Ee>A.yStart,yEnd:!Le&&xe>A.yEnd};M(it=>it.xStart===Nt.xStart&&it.xEnd===Nt.xEnd&&it.yStart===Nt.yStart&&it.yEnd===Nt.yEnd?it:Nt)});qe(()=>{if(!l.current)return;qQ();let K=!1;return UQ(l.current,()=>{if(!K){K=!0;return}V()})},[V,l]),qe(()=>{queueMicrotask(V)},[V,E,q]),qe(()=>{var K;(K=l.current)!=null&&K.matches(":hover")&&k(!0)},[l,k]),v.useEffect(()=>{const K=l.current;if(typeof ResizeObserver>"u"||!K)return;let P=!1;const U=new ResizeObserver(()=>{if(!P){P=!0;return}V()});return U.observe(K),_.start(0,()=>{const G=K.getAnimations({subtree:!0});G.length!==0&&Promise.allSettled(G.map(I=>I.finished)).then(V).catch(()=>{})}),()=>{U.disconnect(),_.clear()}},[V,l,_]);function $(){F.current=!1}const B={role:"presentation",...C&&{"data-id":`${C}-viewport`},...(!E.x||!E.y)&&{tabIndex:0},className:Md.className,style:{overflow:"scroll"},onScroll(){l.current&&(V(),F.current||T({x:l.current.scrollLeft,y:l.current.scrollTop}),Y.start(100,()=>{F.current=!0}))},onWheel:$,onTouchMove:$,onPointerMove:$,onPointerEnter:$,onKeyDown:$},j=v.useMemo(()=>({scrolling:N||L,hasOverflowX:!E.x,hasOverflowY:!E.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:E.corner}),[N,L,E.x,E.y,E.corner,D]),z=It("div",t,{ref:[n,l],state:j,props:[B,o],stateAttributesMapping:uw}),H=v.useMemo(()=>({computeThumbPosition:V}),[V]);return S.jsx(HQ.Provider,{value:H,children:z})}),XO=v.createContext(void 0);function $Q(){const e=v.useContext(XO);if(e===void 0)throw new Error(Cn(54));return e}let Up=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const WQ=v.forwardRef(function(t,n){const{render:r,className:a,orientation:o="vertical",keepMounted:l=!1,...c}=t,{hovering:f,scrollingX:d,scrollingY:m,hiddenState:h,overflowEdges:y,scrollbarYRef:g,scrollbarXRef:w,viewportRef:C,thumbYRef:R,thumbXRef:E,handlePointerDown:T,handlePointerUp:k,rootId:M,thumbSize:D}=Om(),A={hovering:f,scrolling:{horizontal:d,vertical:m}[o],orientation:o,hasOverflowX:!h.x,hasOverflowY:!h.y,overflowXStart:y.xStart,overflowXEnd:y.xEnd,overflowYStart:y.yStart,overflowYEnd:y.yEnd,cornerHidden:h.corner},N=Lc();v.useEffect(()=>{const V=C.current,$=o==="vertical"?g.current:w.current;if(!$)return;function B(j){if(!(!V||!$||j.ctrlKey)){if(j.preventDefault(),o==="vertical"){if(V.scrollTop===0&&j.deltaY<0)return}else if(V.scrollLeft===0&&j.deltaX<0)return;if(o==="vertical"){if(V.scrollTop===V.scrollHeight-V.clientHeight&&j.deltaY>0)return}else if(V.scrollLeft===V.scrollWidth-V.clientWidth&&j.deltaX>0)return;o==="vertical"?V.scrollTop+=j.deltaY:V.scrollLeft+=j.deltaX}}return $.addEventListener("wheel",B,{passive:!1}),()=>{$.removeEventListener("wheel",B)}},[o,w,g,C]);const L={...M&&{"data-id":`${M}-scrollbar`},onPointerDown(V){if(V.button===0&&V.currentTarget===V.target&&C.current){if(R.current&&g.current&&o==="vertical"){const $=Si(R.current,"margin","y"),B=Si(g.current,"padding","y"),j=R.current.offsetHeight,z=g.current.getBoundingClientRect(),H=V.clientY-z.top-j/2-B+$/2,K=C.current.scrollHeight,P=C.current.clientHeight,U=g.current.offsetHeight-j-B-$,I=H/U*(K-P);C.current.scrollTop=I}if(E.current&&w.current&&o==="horizontal"){const $=Si(E.current,"margin","x"),B=Si(w.current,"padding","x"),j=E.current.offsetWidth,z=w.current.getBoundingClientRect(),H=V.clientX-z.left-j/2-B+$/2,K=C.current.scrollWidth,P=C.current.clientWidth,U=w.current.offsetWidth-j-B-$,G=H/U;let I;N==="rtl"?(I=(1-G)*(K-P),C.current.scrollLeft<=0&&(I=-I)):I=G*(K-P),C.current.scrollLeft=I}T(V)}},onPointerUp:k,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...o==="vertical"&&{top:0,bottom:`var(${Hp.scrollAreaCornerHeight})`,insetInlineEnd:0,[Up.scrollAreaThumbHeight]:`${D.height}px`},...o==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Hp.scrollAreaCornerWidth})`,bottom:0,[Up.scrollAreaThumbWidth]:`${D.width}px`}}},q=It("div",t,{ref:[n,o==="vertical"?g:w],state:A,props:[L,c],stateAttributesMapping:uw}),F=v.useMemo(()=>({orientation:o}),[o]),Y=o==="vertical"?h.y:h.x;return l||!Y?S.jsx(XO.Provider,{value:F,children:q}):null}),YQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{thumbYRef:l,thumbXRef:c,handlePointerDown:f,handlePointerMove:d,handlePointerUp:m,setScrollingX:h,setScrollingY:y}=Om(),{orientation:g}=$Q();return It("div",t,{ref:[n,g==="vertical"?l:c],state:{orientation:g},props:[{onPointerDown:f,onPointerMove:d,onPointerUp(R){g==="vertical"&&y(!1),g==="horizontal"&&h(!1),m(R)},style:{...g==="vertical"&&{height:`var(${Up.scrollAreaThumbHeight})`},...g==="horizontal"&&{width:`var(${Up.scrollAreaThumbWidth})`}}},o]})}),KQ=v.forwardRef(function(t,n){const{render:r,className:a,...o}=t,{cornerRef:l,cornerSize:c,hiddenState:f}=Om(),d=It("div",t,{ref:[n,l],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:c.width,height:c.height}},o]});return f.corner?null:d});function QO({className:e,children:t,...n}){return S.jsxs(FQ,{"data-slot":"scroll-area",className:Pe("relative",e),...n,children:[S.jsx(VQ,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:t}),S.jsx(GQ,{}),S.jsx(KQ,{})]})}function GQ({className:e,orientation:t="vertical",...n}){return S.jsx(WQ,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Pe("data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none","[@media(any-pointer:coarse)]:hidden",e),...n,children:S.jsx(YQ,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}function hp(e,t){return`${e}
|
|
455
|
-
${t}`}const pp=Jd()(B0(e=>({expanded:{},toggle:(t,n)=>e(r=>{const a=hp(t,n),o={...r.expanded};return o[a]?delete o[a]:o[a]=!0,{expanded:o}}),expand:(t,n)=>e(r=>{const a=hp(t,n);return r.expanded[a]?r:{expanded:{...r.expanded,[a]:!0}}}),collapse:(t,n)=>e(r=>{const a=hp(t,n);if(!r.expanded[a])return r;const o={...r.expanded};return delete o[a],{expanded:o}}),pruneRoot:t=>e(n=>{const r=`${t}
|
|
456
|
-
`,a={};for(const o of Object.keys(n.expanded))o.startsWith(r)||(a[o]=n.expanded[o]);return{expanded:a}}),pruneStaleRoots:t=>e(n=>{const r=new Set(t),a={};let o=!1;for(const l of Object.keys(n.expanded)){const c=l.slice(0,l.indexOf(`
|
|
457
|
-
`));r.has(c)?a[l]=n.expanded[l]:o=!0}return o?{expanded:a}:n})}),{name:"tmex-file-tree",partialize:e=>({expanded:e.expanded})}));function XQ(e){const t=new TextEncoder().encode(e);let n="";for(const r of t)n+=String.fromCharCode(r);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function QQ(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),a=new Uint8Array(r.length);for(let o=0;o<r.length;o++)a[o]=r.charCodeAt(o);return new TextDecoder().decode(a)}function ZQ(e,t){return XQ(`${e}
|
|
458
|
-
${t}`)}function JQ(e){try{const t=QQ(e),n=t.indexOf(`
|
|
459
|
-
`);return n<0?null:{rootId:t.slice(0,n),path:t.slice(n+1)}}catch{return null}}function eZ(e,t){return`/file/${ZQ(e,t)}`}function dw(e,t,n){const r=new URLSearchParams({rootId:t});return n!=null&&r.set("path",n),`/api/files/${e}?${r.toString()}`}function tZ(e,t,n=!1){const r=new URLSearchParams({rootId:e,path:t});return n&&r.set("download","1"),`/api/files/raw?${r.toString()}`}class nZ extends Error{constructor(n,r,a){super(r);at(this,"status");at(this,"code");this.name="FileApiError",this.status=n,this.code=a}}async function il(e){let t=`HTTP ${e.status}`,n;try{const r=await e.json();r.error&&(t=r.error),n=r.code}catch{}return new nZ(e.status,t,n)}async function rZ(){const e=await fetch("/api/files/roots");if(!e.ok)throw await il(e);return await e.json()}async function Ute(e){const t=await fetch("/api/files/roots",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw await il(t);return await t.json()}async function qte(e,t){const n=await fetch(`/api/files/roots/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw await il(n);return await n.json()}async function Vte(e){const t=await fetch(`/api/files/roots/${encodeURIComponent(e)}`,{method:"DELETE"});if(!t.ok)throw await il(t)}async function iZ(e,t){const n=await fetch(dw("list",e,t));if(!n.ok)throw await il(n);return await n.json()}async function $te(e,t){const n=await fetch(dw("stat",e,t));if(!n.ok)throw await il(n);return await n.json()}async function Wte(e,t){const n=await fetch(dw("content",e,t));if(!n.ok)throw await il(n);return await n.json()}const aZ=new Set(["json","jsonc","json5"]);function ZO(e,t){if(e.type==="dir"||e.category==="directory")return t!=null&&t.expanded?j8:F8;const n=e.name.toLowerCase().split(".").pop()??"";switch(e.category){case"code":return aZ.has(n)?S8:C8;case"markdown":return Eb;case"image":return M8;case"pdf":return Eb;case"archive":return x8;case"audio":return T8;case"video":return N8;case"text":return Eb;default:return I8}}function JO(e){switch(e){case"directory":return"text-muted-foreground";case"code":return"text-blue-500/80 dark:text-blue-400/80";case"markdown":return"text-foreground/70";case"image":return"text-emerald-500/80 dark:text-emerald-400/80";case"pdf":return"text-red-500/70 dark:text-red-400/70";case"archive":return"text-amber-500/80 dark:text-amber-400/80";case"audio":return"text-purple-500/70 dark:text-purple-400/70";case"video":return"text-pink-500/70 dark:text-pink-400/70";default:return"text-muted-foreground"}}function Yte(e){return e}function fw(e){return encodeURIComponent(e)}const oZ=12e3,sZ=12e3,lZ=120;let Xb=!1;function cZ(e){var n,r;const t=((r=(n=kn.getState().snapshots[e])==null?void 0:n.session)==null?void 0:r.windows)??[];return new Set(t.map(a=>a.id))}function uZ(e,t){var r,a;const n=((a=(r=kn.getState().snapshots[e])==null?void 0:r.session)==null?void 0:a.windows)??[];for(const o of n)if(!t.has(o.id)&&o.panes.length>0){const l=o.panes.find(c=>c.active)??o.panes[0];return{windowId:o.id,paneId:l.id,paneTitle:l.title??null}}return null}async function Hk(e,t){const n=Date.now();for(;Date.now()-n<t;){const r=e();if(r)return r;await new Promise(a=>setTimeout(a,lZ))}return null}function dZ(e,t){return hn.t("files.install.prompt",{device:e,scope:t?hn.t("files.install.scopeRemote"):hn.t("files.install.scopeLocal")})}async function fZ(e,t){if(!Xb){Xb=!0;try{const n=kn.getState();if(!n.connectedDevices.has(e)&&(n.connectDevice(e),!await Hk(()=>{var l;return(l=kn.getState().snapshots[e])!=null&&l.session?!0:null},oZ))){sn.error(hn.t("files.install.connectFailed"));return}const r=cZ(e);n.createWindow(e);const a=await Hk(()=>uZ(e,r),sZ);if(!a){sn.error(hn.t("files.install.windowFailed"));return}an.getState().startDraft(e,a.paneId,a.paneTitle,t),Pq(`/devices/${e}/windows/${a.windowId}/panes/${fw(a.paneId)}`,{replace:!0}),Bi.getState().setSidebarTab("agent"),Lq()}finally{Xb=!1}}}const eD=12,hZ=2e3,pZ=3e4;function mZ(e){const t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t)}function gZ(){const e=qi();return v.useMemo(()=>{const t=Us("/file/:ref",e.pathname);return t!=null&&t.params.ref?JQ(t.params.ref):null},[e.pathname])}function yZ(e){return`files.error.${e??"unknown"}`}function bZ(){var m,h,y;const{t:e}=mn(),t=el(),n=VL({queryKey:["files"]}),r=pp(g=>g.pruneStaleRoots),a=Ei({queryKey:["files","roots"],queryFn:rZ,refetchOnWindowFocus:!0}),o=Ei({queryKey:["devices"],queryFn:async()=>{const g=await fetch("/api/devices");if(!g.ok)throw new Error("devices");return await g.json()}}),l=Ei({queryKey:["llm-providers"],queryFn:async()=>{const g=await fetch("/api/llm/providers");if(!g.ok)throw new Error("providers");return await g.json()},throwOnError:!1}),c=v.useMemo(()=>{var g;return(((g=a.data)==null?void 0:g.roots)??[]).filter(w=>w.enabled)},[a.data]);v.useEffect(()=>{a.data&&r(a.data.roots.map(g=>g.id))},[a.data,r]);const f={llmConfigured:(((m=l.data)==null?void 0:m.providers)??[]).length>0,localDeviceId:((y=(h=o.data)==null?void 0:h.devices.find(g=>g.type==="local"))==null?void 0:y.id)??null},d=()=>void t.invalidateQueries({queryKey:["files"]});return S.jsxs(F0,{className:"flex min-h-0 flex-1 flex-col pt-0","data-testid":"files-tab",children:[S.jsxs("div",{className:"flex items-center justify-between gap-2 px-2 pb-1.5",children:[S.jsx("span",{className:"truncate text-xs font-medium text-muted-foreground",children:e("files.title")}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:d,title:e("files.refresh"),"data-testid":"files-refresh",children:S.jsx(sN,{className:Pe("h-3.5 w-3.5",n>0&&"animate-spin")})})]}),S.jsx(QO,{className:"min-h-0 flex-1",children:S.jsxs("div",{className:"space-y-0.5 pr-1 pb-2 select-none [-webkit-touch-callout:none] [-webkit-user-select:none]",children:[c.map(g=>S.jsx(tD,{root:g,rootId:g.id,path:g.path,depth:0,isRoot:!0,ctx:f},g.id)),a.isLoading&&S.jsx("div",{className:"px-2 py-3 text-center text-xs text-muted-foreground",children:e("common.loading")}),!a.isLoading&&c.length===0&&S.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:e("files.noRoots")})]})})]})}function vZ({root:e}){const t=e.deviceType==="ssh"?L0:vm;return S.jsxs("span",{className:"flex shrink-0 items-center gap-1 text-[10px] text-muted-foreground/70",children:[S.jsx(t,{className:"h-3 w-3"}),S.jsx("span",{className:"max-w-24 truncate",children:e.deviceName??"—"})]})}function tD({root:e,rootId:t,path:n,depth:r,isRoot:a,ctx:o}){var R,E,T;const{t:l}=mn(),c=hp(t,n),f=pp(k=>!!k.expanded[c]),d=pp(k=>k.toggle),m=Ei({queryKey:["files","list",t,n],queryFn:()=>iZ(t,n),enabled:f,staleTime:hZ,retry:!1,refetchOnWindowFocus:!0,refetchInterval:k=>k.state.status==="error"?!1:pZ,refetchIntervalInBackground:!1}),h=(R=m.error)==null?void 0:R.code,y=v.useRef(null);v.useEffect(()=>{if(!(h==="rsync_missing_local"||h==="rsync_missing_remote")){y.current=null;return}if(y.current===c)return;y.current=c;const M=h==="rsync_missing_remote",D=M||e.deviceType==="local"?e.deviceId:o.localDeviceId,A=`rsync-missing-${c}`;sn.error(l(yZ(h)),{id:A,description:e.deviceName?`${e.deviceName}`:void 0,action:o.llmConfigured&&D?{label:l("files.install.button"),onClick:()=>{sn.dismiss(A),fZ(D,dZ(e.deviceName??e.deviceId,M))}}:void 0})},[h,c,e,o.llmConfigured,o.localDeviceId,l]),v.useEffect(()=>{if(!m.data)return;const k=new Set(m.data.entries.filter(A=>A.type==="dir").map(A=>A.path)),M=pp.getState(),D=`${t}
|
|
460
|
-
`;for(const A of Object.keys(M.expanded)){if(!A.startsWith(D))continue;const N=A.slice(D.length);N!==n&&mZ(N)===n&&!k.has(N)&&M.collapse(t,N)}},[m.data,t,n]);const g=ZO({category:"directory",name:e.name,type:"dir"},{expanded:f}),w=r*eD+4,C=w+18;return S.jsxs("div",{children:[S.jsxs("button",{type:"button",onClick:()=>d(t,n),"data-testid":`file-dir-${t}-${n}`,style:{paddingLeft:w},className:Pe("flex w-full min-w-0 items-center gap-1.5 rounded-md py-1 pr-2 text-left transition-colors hover:bg-accent/40 [@media(any-pointer:coarse)]:py-1.5",a?"font-medium text-foreground":"text-foreground"),children:[S.jsx(Qd,{className:Pe("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",f&&"rotate-90")}),S.jsx(g,{className:Pe("h-4 w-4 shrink-0",a?"text-muted-foreground":JO("directory"))}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:a?e.name:wZ(n)}),a&&S.jsx(vZ,{root:e})]}),f&&S.jsxs("div",{children:[(m.isLoading||m.isFetching&&!m.data)&&S.jsxs("div",{style:{paddingLeft:C},className:"flex items-center gap-1.5 py-1 text-[11px] text-muted-foreground",children:[S.jsx(Gs,{className:"h-3 w-3 animate-spin"}),l("common.loading")]}),m.isError&&S.jsx(xZ,{code:h,indent:C,onRetry:()=>void m.refetch()}),(E=m.data)==null?void 0:E.entries.map(k=>k.type==="dir"?S.jsx(tD,{root:e,rootId:t,path:k.path,depth:r+1,isRoot:!1,ctx:o},k.path):S.jsx(SZ,{entry:k,rootId:t,depth:r+1},k.path)),m.data&&m.data.entries.length===0&&S.jsx("div",{style:{paddingLeft:C},className:"py-1 text-[11px] text-muted-foreground/70",children:l("files.emptyDir")}),((T=m.data)==null?void 0:T.truncated)&&S.jsx("div",{style:{paddingLeft:C},className:"py-1 text-[11px] text-muted-foreground/70",children:l("files.truncated")})]})]})}function xZ({code:e,indent:t,onRetry:n}){const{t:r}=mn();return S.jsxs("div",{style:{paddingLeft:t},className:"flex items-start gap-1.5 py-1 pr-2 text-[11px] text-destructive/80",children:[S.jsx(A9,{className:"mt-0.5 h-3 w-3 shrink-0"}),S.jsx("span",{className:"min-w-0 flex-1",children:r(`files.error.${e??"unknown"}`)}),S.jsx("button",{type:"button",onClick:n,className:"shrink-0 text-muted-foreground hover:text-foreground",title:r("files.retry"),children:S.jsx(sN,{className:"h-3 w-3"})})]})}function wZ(e){const t=e.lastIndexOf("/");return(t>=0?e.slice(t+1):e)||e}function SZ({entry:e,rootId:t,depth:n}){const{t:r}=mn(),a=Hd(),{isMobile:o,setOpenMobile:l}=Ur(),c=gZ(),f=(c==null?void 0:c.rootId)===t&&(c==null?void 0:c.path)===e.path,d=ZO(e),m=n*eD+4+18,h=()=>{a(eZ(t,e.path)),o&&l(!1)};return S.jsxs("div",{className:"group/file relative flex items-center",children:[S.jsxs("button",{type:"button",onClick:h,"data-testid":`file-item-${t}-${e.path}`,title:e.name,style:{paddingLeft:m},className:Pe("flex w-full min-w-0 items-center gap-1.5 rounded-md py-1 pr-9 text-left transition-colors [@media(any-pointer:coarse)]:py-1.5",f?"bg-primary/10 text-primary":"text-muted-foreground hover:bg-accent/30"),children:[S.jsx(d,{className:Pe("h-4 w-4 shrink-0",f?"text-primary":JO(e.category))}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-xs",children:e.name}),e.isSymlink&&S.jsx("span",{className:"shrink-0 text-[9px] text-muted-foreground/60",title:"symlink",children:"↗"})]}),S.jsx("a",{href:tZ(t,e.path,!0),download:e.name,onClick:y=>y.stopPropagation(),"data-testid":`file-download-${t}-${e.path}`,title:r("files.download"),className:Pe("absolute top-1/2 right-1 flex h-6 w-6 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-opacity hover:bg-background hover:text-foreground","opacity-0 group-hover/file:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:S.jsx(m8,{className:"h-3 w-3"})})]})}const nD=v.createContext(void 0);function rD(){const e=v.useContext(nD);if(e===void 0)throw new Error(Cn(64));return e}let EZ=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const iD={tabActivationDirection:e=>({[EZ.activationDirection]:e})},CZ=v.forwardRef(function(t,n){const{className:r,defaultValue:a=0,onValueChange:o,orientation:l="horizontal",render:c,value:f,...d}=t,m=Lc(),h=Object.hasOwn(t,"defaultValue"),y=v.useRef([]),[g,w]=v.useState(()=>new Map),[C,R]=Sc({controlled:f,default:a,name:"Tabs",state:"value"}),E=f!==void 0,[T,k]=v.useState(()=>new Map),[M,D]=v.useState("none"),A=We((z,H)=>{o==null||o(z,H),!H.isCanceled&&(R(z),D(H.activationDirection))}),N=We((z,H)=>{w(K=>{if(K.get(z)===H)return K;const P=new Map(K);return P.set(z,H),P})}),L=We((z,H)=>{w(K=>{if(!K.has(z)||K.get(z)!==H)return K;const P=new Map(K);return P.delete(z),P})}),q=v.useCallback(z=>g.get(z),[g]),F=v.useCallback(z=>{for(const H of T.values())if(z===(H==null?void 0:H.value))return H==null?void 0:H.id},[T]),Y=v.useCallback(z=>{if(z===void 0)return null;for(const[H,K]of T.entries())if(K!=null&&z===(K.value??K.index))return H;return null},[T]),_=v.useMemo(()=>({direction:m,getTabElementBySelectedValue:Y,getTabIdByPanelValue:F,getTabPanelIdByValue:q,onValueChange:A,orientation:l,registerMountedTabPanel:N,setTabMap:k,unregisterMountedTabPanel:L,tabActivationDirection:M,value:C}),[m,Y,F,q,A,l,N,k,L,M,C]),V=v.useMemo(()=>{for(const z of T.values())if(z!=null&&z.value===C)return z},[T,C]),$=v.useMemo(()=>{for(const z of T.values())if(z!=null&&!z.disabled)return z.value},[T]);qe(()=>{if(E||T.size===0)return;const z=V==null?void 0:V.disabled,H=V==null&&C!==null;if(h&&z&&C===a||!z&&!H)return;const P=$??null;C!==P&&(R(P),D("none"))},[a,$,h,E,V,D,R,T,C]);const j=It("div",t,{state:{orientation:l,tabActivationDirection:M},ref:n,props:d,stateAttributesMapping:iD});return S.jsx(nD.Provider,{value:_,children:S.jsx(Nm,{elementsRef:y,children:j})})}),aD="data-composite-item-active";function oD(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=e0(),{ref:a,index:o}=lw(e),l=n===o,c=v.useRef(null),f=zi(a,c);return{compositeProps:v.useMemo(()=>({tabIndex:l?0:-1,onFocus(){r(o)},onMouseMove(){const m=c.current;if(!t||!m)return;const h=m.hasAttribute("disabled")||m.ariaDisabled==="true";!l&&!h&&m.focus()}}),[l,r,o,t]),compositeRef:f,index:o}}const sD=v.createContext(void 0);function RZ(){const e=v.useContext(sD);if(e===void 0)throw new Error(Cn(65));return e}const TZ=v.forwardRef(function(t,n){const{className:r,disabled:a=!1,render:o,value:l,id:c,nativeButton:f=!0,...d}=t,{value:m,getTabPanelIdByValue:h,orientation:y}=rD(),{activateOnFocus:g,highlightedTabIndex:w,onTabActivation:C,setHighlightedTabIndex:R,tabsListElement:E}=RZ(),T=Vi(c),k=v.useMemo(()=>({disabled:a,id:T,value:l}),[a,T,l]),{compositeProps:M,compositeRef:D,index:A}=oD({metadata:k}),N=l===m,L=v.useRef(!1);qe(()=>{if(L.current){L.current=!1;return}if(!(N&&A>-1&&w!==A))return;const K=E;if(K!=null){const P=ni(Qt(K));if(P&&Dt(K,P))return}a||R(A)},[N,A,w,R,a,E]);const{getButtonProps:q,buttonRef:F}=$a({disabled:a,native:f,focusableWhenDisabled:!0}),Y=h(l),_=v.useRef(!1),V=v.useRef(!1);function $(K){N||a||C(l,xt(Fi,K.nativeEvent,void 0,{activationDirection:"none"}))}function B(K){N||(A>-1&&!a&&R(A),!a&&g&&(!_.current||_.current&&V.current)&&C(l,xt(Fi,K.nativeEvent,void 0,{activationDirection:"none"})))}function j(K){if(N||a)return;_.current=!0;function P(){_.current=!1,V.current=!1}(!K.button||K.button===0)&&(V.current=!0,Qt(K.currentTarget).addEventListener("pointerup",P,{once:!0}))}return It("button",t,{state:{disabled:a,active:N,orientation:y},ref:[n,F,D],props:[M,{role:"tab","aria-controls":Y,"aria-selected":N,id:T,onClick:$,onFocus:B,onPointerDown:j,[aD]:N?"":void 0,onKeyDownCapture(){L.current=!0}},d,q]})});function kZ(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const MZ=[];function AZ(e){const{itemSizes:t,cols:n=1,loopFocus:r=!0,dense:a=!1,orientation:o="both",direction:l,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:d,enableHomeAndEndKeys:m=!1,stopEventPropagation:h=!1,disabledIndices:y,modifierKeys:g=MZ}=e,[w,C]=v.useState(0),R=n>1,E=v.useRef(null),T=zi(E,d),k=v.useRef([]),M=v.useRef(!1),D=c??w,A=We((q,F=!1)=>{if((f??C)(q),F){const Y=k.current[q];bT(E.current,Y,l,o)}}),N=We(q=>{if(q.size===0||M.current)return;M.current=!0;const F=Array.from(q.keys()),Y=F.find(V=>V==null?void 0:V.hasAttribute(aD))??null,_=Y?F.indexOf(Y):-1;_!==-1&&A(_),bT(E.current,Y,l,o)}),L=v.useMemo(()=>({"aria-orientation":o==="both"?void 0:o,ref:T,onFocus(q){!E.current||!yT(q.target)||q.target.setSelectionRange(0,q.target.value.length??0)},onKeyDown(q){const F=m?A6:eN;if(!F.has(q.key)||NZ(q,g)||!E.current)return;const _=l==="rtl",V=_?Cd:rc,$={horizontal:V,vertical:ks,both:V}[o],B=_?rc:Cd,j={horizontal:B,vertical:nc,both:B}[o];if(yT(q.target)&&!kZ(q.target)){const I=q.target.selectionStart,Q=q.target.selectionEnd,le=q.target.value??"";if(I==null||q.shiftKey||I!==Q||q.key!==j&&I<le.length||q.key!==$&&I>0)return}let z=D;const H=np(k,y),K=Bv(k,y);if(R){const I=t||Array.from({length:k.current.length},()=>({width:1,height:1})),Q=tA(I,n,a),le=Q.findIndex(Z=>Z!=null&&!qo(k,Z,y)),ae=Q.reduce((Z,ue,ve)=>ue!=null&&!qo(k,ue,y)?ve:Z,-1);z=Q[eA({current:Q.map(Z=>Z?k.current[Z]:null)},{event:q,orientation:o,loopFocus:r,cols:n,disabledIndices:rA([...y||k.current.map((Z,ue)=>qo(k,ue)?ue:void 0),void 0],Q),minIndex:le,maxIndex:ae,prevIndex:nA(D>K?H:D,I,Q,n,q.key===ks?"bl":q.key===rc?"tr":"tl"),rtl:_})]}const P={horizontal:[V],vertical:[ks],both:[V,ks]}[o],U={horizontal:[B],vertical:[nc],both:[B,nc]}[o],G=R?F:{horizontal:m?k6:ZA,vertical:m?M6:JA,both:F}[o];m&&(q.key===Gd?z=H:q.key===Xd&&(z=K)),z===D&&(P.includes(q.key)||U.includes(q.key))&&(r&&z===K&&P.includes(q.key)?z=H:r&&z===H&&U.includes(q.key)?z=K:z=hr(k,{startingIndex:z,decrement:U.includes(q.key),disabledIndices:y})),z!==D&&!Ql(k,z)&&(h&&q.stopPropagation(),G.has(q.key)&&q.preventDefault(),A(z,!0),queueMicrotask(()=>{var I;(I=k.current[z])==null||I.focus()}))}}),[n,a,l,y,k,m,D,R,t,r,T,g,A,o,h]);return v.useMemo(()=>({props:L,highlightedIndex:D,onHighlightedIndexChange:A,elementsRef:k,disabledIndices:y,onMapChange:N,relayKeyboardEvent:L.onKeyDown}),[L,D,A,k,y,N])}function NZ(e,t){for(const n of P6.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function OZ(e){const{render:t,className:n,refs:r=Vo,props:a=Vo,state:o=In,stateAttributesMapping:l,highlightedIndex:c,onHighlightedIndexChange:f,orientation:d,dense:m,itemSizes:h,loopFocus:y,cols:g,enableHomeAndEndKeys:w,onMapChange:C,stopEventPropagation:R=!0,rootRef:E,disabledIndices:T,modifierKeys:k,highlightItemOnHover:M=!1,tag:D="div",...A}=e,N=Lc(),{props:L,highlightedIndex:q,onHighlightedIndexChange:F,elementsRef:Y,onMapChange:_,relayKeyboardEvent:V}=AZ({itemSizes:h,cols:g,loopFocus:y,dense:m,orientation:d,highlightedIndex:c,onHighlightedIndexChange:f,rootRef:E,stopEventPropagation:R,enableHomeAndEndKeys:w,direction:N,disabledIndices:T,modifierKeys:k}),$=It(D,e,{state:o,ref:r,props:[L,...a,A],stateAttributesMapping:l}),B=v.useMemo(()=>({highlightedIndex:q,onHighlightedIndexChange:F,highlightItemOnHover:M,relayKeyboardEvent:V}),[q,F,M,V]);return S.jsx(H2.Provider,{value:B,children:S.jsx(Nm,{elementsRef:Y,onMapChange:j=>{C==null||C(j),_(j)},children:$})})}const DZ=v.forwardRef(function(t,n){const{activateOnFocus:r=!1,className:a,loopFocus:o=!0,render:l,...c}=t,{getTabElementBySelectedValue:f,onValueChange:d,orientation:m,value:h,setTabMap:y,tabActivationDirection:g}=rD(),[w,C]=v.useState(0),[R,E]=v.useState(null),T=IZ(h,m,R,f),k=We((N,L)=>{if(N!==h){const q=T(N);L.activationDirection=q,d(N,L)}}),M={orientation:m,tabActivationDirection:g},D={"aria-orientation":m==="vertical"?"vertical":void 0,role:"tablist"},A=v.useMemo(()=>({activateOnFocus:r,highlightedTabIndex:w,onTabActivation:k,setHighlightedTabIndex:C,tabsListElement:R,value:h}),[r,w,k,C,R,h]);return S.jsx(sD.Provider,{value:A,children:S.jsx(OZ,{render:l,className:a,state:M,refs:[n,E],props:[D,c],stateAttributesMapping:iD,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:o,orientation:m,onHighlightedIndexChange:C,onMapChange:y,disabledIndices:Vo})})});function Uk(e,t){const{left:n,top:r}=e.getBoundingClientRect(),{left:a,top:o}=t.getBoundingClientRect(),l=n-a,c=r-o;return{left:l,top:c}}function IZ(e,t,n,r){const[a,o]=v.useState(null);return qe(()=>{if(e==null||n==null){o(null);return}const l=r(e);if(l==null){o(null);return}const{left:c,top:f}=Uk(l,n);o(t==="horizontal"?c:f)},[t,r,n,e]),v.useCallback(l=>{if(l===e)return"none";if(l==null)return o(null),"none";if(l!=null&&n!=null){const c=r(l);if(c!=null){const{left:f,top:d}=Uk(c,n);if(a==null)return o(t==="horizontal"?f:d),"none";if(t==="horizontal"){if(f<a)return o(f),"left";if(f>a)return o(f),"right"}else{if(d<a)return o(d),"up";if(d>a)return o(d),"down"}}}return"none"},[r,t,a,n,e])}function PZ({className:e,orientation:t="horizontal",...n}){return S.jsx(CZ,{"data-slot":"tabs","data-orientation":t,className:Pe("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const LZ=em("rounded-lg p-[3px] group-data-horizontal/tabs:h-8 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function _Z({className:e,variant:t="default",...n}){return S.jsx(DZ,{"data-slot":"tabs-list","data-variant":t,className:Pe(LZ({variant:t}),e),...n})}function Qb({className:e,...t}){return S.jsx(TZ,{"data-slot":"tabs-trigger",className:Pe("gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg:not([class*='size-'])]:size-4 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center whitespace-nowrap transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent","data-active:bg-background dark:data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 data-active:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",e),...t})}function qp({children:e,onClick:t,...n}){const{isMobile:r,setOpenMobile:a}=Ur(),o=l=>{r&&a(!1),t==null||t(l)};return S.jsx(Kx,{...n,onClick:o,children:e})}function jZ({items:e}){const{t}=mn();return S.jsx(F0,{children:S.jsx(Tq,{children:e.map(n=>{var r,a;return S.jsxs(km,{defaultOpen:n.isActive,render:S.jsx(kq,{}),children:[S.jsx(qp,{to:n.url,children:S.jsxs(Aq,{tooltip:t(n.title),children:[S.jsx(n.icon,{}),S.jsx("span",{children:t(n.title)})]})}),(r=n.items)!=null&&r.length?S.jsxs(S.Fragment,{children:[S.jsxs(Mm,{render:S.jsx(Nq,{className:"data-[state=open]:rotate-90"}),children:[S.jsx(Qd,{}),S.jsx("span",{className:"sr-only",children:"Toggle"})]}),S.jsx(Am,{children:S.jsx(Oq,{children:(a=n.items)==null?void 0:a.map(o=>S.jsx(Dq,{children:S.jsx(qp,{to:o.url,children:S.jsx(Iq,{children:S.jsx("span",{children:t(o.title)})})})},o.title))})})]}):null]},n.title)})})})}const zZ={auth_failed:"authFailed",agent_unavailable:"agentUnavailable",agent_no_identity:"agentNoIdentity",ssh_config_ref_not_supported:"configRefNotSupported",network_unreachable:"networkUnreachable",connection_refused:"connectionRefused",timeout:"timeout",host_not_found:"hostNotFound",handshake_failed:"handshakeFailed",tmux_unavailable:"tmuxUnavailable",connection_closed:"connectionClosed"};function FZ({deviceId:e,className:t}){const{t:n}=mn(),r=kn(o=>o.deviceReconnecting[e]),a=kn(o=>o.deviceErrors[e]);if(r)return S.jsxs(Zs,{variant:"outline",title:r.message,className:Pe("h-5 gap-1 border-amber-400/40 bg-amber-500/10 px-1.5 text-[10px] font-normal text-amber-700 dark:text-amber-300",t),children:[S.jsx(h9,{className:"h-3 w-3 animate-spin"}),S.jsx("span",{className:"truncate max-w-[120px]",children:r.message})]});if(a){const o=zZ[a.type]??"unknown",l=n(`deviceStatus.errorBadge.${o}`),c=[l,a.message,a.rawMessage].filter(Boolean).join(`
|
|
461
|
-
`);return S.jsxs(Zs,{variant:"outline",title:c,className:Pe("h-5 gap-1 border-red-400/40 bg-red-500/10 px-1.5 text-[10px] font-normal text-red-700 dark:text-red-300",t),children:[S.jsx(od,{className:"h-3 w-3"}),S.jsx("span",{className:"truncate max-w-[120px]",children:l})]})}return null}function BZ(e){const{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:o,actionsRef:l,handle:c,triggerId:f,defaultTriggerId:d=null}=e,m=Xo(),h=!!m,y=nr(()=>(c==null?void 0:c.store)??new nN({open:r,openProp:n,activeTriggerId:d,triggerIdProp:f,modal:!0,disablePointerDismissal:!0,nested:h,role:"alertdialog"})).current;y.useControlledProp("openProp",n),y.useControlledProp("triggerIdProp",f),y.useSyncedValue("nested",h),y.useContextCallback("onOpenChange",a),y.useContextCallback("onOpenChangeComplete",o);const g=y.useState("payload");tN({store:y,actionsRef:l,parentContext:m==null?void 0:m.store.context});const w=v.useMemo(()=>({store:y}),[y]);return S.jsx(u0.Provider,{value:w,children:typeof t=="function"?t({payload:g}):t})}function dx({...e}){return S.jsx(BZ,{"data-slot":"alert-dialog",...e})}function HZ({...e}){return S.jsx(N0,{"data-slot":"alert-dialog-portal",...e})}function UZ({className:e,...t}){return S.jsx(d0,{"data-slot":"alert-dialog-overlay",className:Pe("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function fx({className:e,size:t="default",...n}){return S.jsxs(HZ,{children:[S.jsx(UZ,{}),S.jsx(k0,{"data-slot":"alert-dialog-content","data-size":t,className:Pe("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-4 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...n})]})}function hx({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-header",className:Pe("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",e),...t})}function px({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-footer",className:Pe("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",e),...t})}function qk({className:e,...t}){return S.jsx("div",{"data-slot":"alert-dialog-media",className:Pe("bg-muted mb-2 inline-flex size-10 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6",e),...t})}function mx({className:e,...t}){return S.jsx(I0,{"data-slot":"alert-dialog-title",className:Pe("text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",e),...t})}function gx({className:e,...t}){return S.jsx(f0,{"data-slot":"alert-dialog-description",className:Pe("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function yx({className:e,...t}){return S.jsx(Ht,{"data-slot":"alert-dialog-action",className:Pe(e),...t})}function bx({className:e,variant:t="outline",size:n="default",...r}){return S.jsx(fm,{"data-slot":"alert-dialog-cancel",className:Pe(e),render:S.jsx(Ht,{variant:t,size:n}),...r})}function vx({...e}){return S.jsx(rN,{"data-slot":"dialog",...e})}function qZ({...e}){return S.jsx(N0,{"data-slot":"dialog-portal",...e})}function VZ({className:e,...t}){return S.jsx(d0,{"data-slot":"dialog-overlay",className:Pe("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",e),...t})}function xx({className:e,children:t,showCloseButton:n=!0,...r}){return S.jsxs(qZ,{children:[S.jsx(VZ,{}),S.jsxs(k0,{"data-slot":"dialog-content",className:Pe("bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none",e),...r,children:[t,n&&S.jsxs(fm,{"data-slot":"dialog-close",render:S.jsx(Ht,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[S.jsx(Va,{}),S.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wx({className:e,...t}){return S.jsx("div",{"data-slot":"dialog-header",className:Pe("gap-2 flex flex-col",e),...t})}function Vk({className:e,showCloseButton:t=!1,children:n,...r}){return S.jsxs("div",{"data-slot":"dialog-footer",className:Pe("bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...r,children:[n,t&&S.jsx(fm,{render:S.jsx(Ht,{variant:"outline"}),children:"Close"})]})}function Sx({className:e,...t}){return S.jsx(I0,{"data-slot":"dialog-title",className:Pe("text-base leading-none font-medium",e),...t})}function lD({className:e,...t}){return S.jsx(f0,{"data-slot":"dialog-description",className:Pe("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const cD=v.createContext(void 0);function uD(e){const t=v.useContext(cD);if(t===void 0&&!e)throw new Error(Cn(33));return t}const dD=v.createContext(void 0);function Jo(e){const t=v.useContext(dD);if(t===void 0&&!e)throw new Error(Cn(36));return t}const $Z=v.createContext(void 0);function rf(e=!0){const t=v.useContext($Z);if(t===void 0&&!e)throw new Error(Cn(25));return t}const WZ={...ua,...Wa},YZ=v.forwardRef(function(t,n){const{className:r,render:a,...o}=t,{store:l}=Jo(),c=l.useState("open"),f=l.useState("mounted"),d=l.useState("transitionStatus"),m=l.useState("lastOpenChangeReason"),h=rf(),y={open:c,transitionStatus:d};return It("div",t,{ref:h!=null&&h.backdropRef?[n,h.backdropRef]:n,state:y,stateAttributesMapping:WZ,props:[{role:"presentation",hidden:!f,style:{pointerEvents:m===vr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},o]})});function KZ(e){const{closeOnClick:t,highlighted:n,id:r,nodeId:a,store:o,itemRef:l,itemMetadata:c}=e,{events:f}=o.useState("floatingTreeRoot"),d=rf(!0),m=d!==void 0;return v.useMemo(()=>({id:r,role:"menuitem",tabIndex:n?0:-1,onMouseMove(h){a&&f.emit("itemhover",{nodeId:a,target:h.currentTarget})},onClick(h){t&&f.emit("close",{domEvent:h,reason:id})},onMouseUp(h){if(d){const y=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,m&&y&&Math.abs(h.clientX-y.x)<=1&&Math.abs(h.clientY-y.y)<=1)return}l.current&&o.context.allowMouseUpTriggerRef.current&&(!m||h.button===2)&&(!c||c.type==="regular-item")&&l.current.click()}}),[t,n,r,f,a,o,l,d,m,c])}const GZ={type:"regular-item"};function XZ(e){const{closeOnClick:t,disabled:n=!1,highlighted:r,id:a,store:o,nativeButton:l,itemMetadata:c,nodeId:f}=e,d=v.useRef(null),{getButtonProps:m,buttonRef:h}=$a({disabled:n,focusableWhenDisabled:!0,native:l}),y=KZ({closeOnClick:t,highlighted:r,id:a,nodeId:f,store:o,itemRef:d,itemMetadata:c}),g=v.useCallback(C=>Ri(y,{onMouseEnter(){c.type==="submenu-trigger"&&c.setActive()},onKeyUp(R){R.key===" "&&o.context.typingRef.current&&R.preventBaseUIHandler()}},C,m),[y,m,o,c]),w=zi(d,h);return v.useMemo(()=>({getItemProps:g,itemRef:w}),[g,w])}const QZ=v.forwardRef(function(t,n){const{render:r,className:a,id:o,label:l,nativeButton:c=!1,disabled:f=!1,closeOnClick:d=!0,...m}=t,h=lw({label:l}),y=uD(!0),g=Vi(o),{store:w}=Jo(),C=w.useState("isActive",h.index),R=w.useState("itemProps"),{getItemProps:E,itemRef:T}=XZ({closeOnClick:d,disabled:f,highlighted:C,id:g,store:w,nativeButton:c,nodeId:y==null?void 0:y.nodeId,itemMetadata:GZ});return It("div",t,{state:{disabled:f,highlighted:C},props:[R,m,E],ref:[T,n,h.ref]})}),ZZ={...ua,...Wa},JZ=v.forwardRef(function(t,n){const{render:r,className:a,finalFocus:o,...l}=t,{store:c}=Jo(),{side:f,align:d}=uD(),m=qO()!=null,h=c.useState("open"),y=c.useState("transitionStatus"),g=c.useState("popupProps"),w=c.useState("mounted"),C=c.useState("instantType"),R=c.useState("activeTriggerElement"),E=c.useState("parent"),T=c.useState("lastOpenChangeReason"),k=c.useState("rootId"),M=c.useState("floatingRootContext"),D=c.useState("floatingTreeRoot"),A=c.useState("closeDelay"),N=c.useState("activeTriggerElement"),L=E.type==="context-menu";Ya({open:h,ref:c.context.popupRef,onComplete(){var $,B;h&&((B=($=c.context).onOpenChangeComplete)==null||B.call($,!0))}}),v.useEffect(()=>{function $(B){c.setOpen(!1,xt(B.reason,B.domEvent))}return D.events.on("close",$),()=>{D.events.off("close",$)}},[D.events,c]);const q=c.useState("hoverEnabled"),F=c.useState("disabled");$A(M,{enabled:q&&!F&&!L&&E.type!=="menubar",closeDelay:A});const Y={transitionStatus:y,side:f,align:d,open:h,nested:E.type==="menu",instant:C},_=It("div",t,{state:Y,ref:[n,c.context.popupRef],stateAttributesMapping:ZZ,props:[g,{onKeyDown($){m&&T0.has($.key)&&$.stopPropagation()}},_c(y),l,{"data-rootownerid":k}]});let V=E.type===void 0||L;return(R||E.type==="menubar"&&T!==um)&&(V=!0),S.jsx(g0,{context:M,modal:L,disabled:!w,returnFocus:o===void 0?V:o,initialFocus:E.type!=="menu",restoreFocus:!0,externalTree:E.type!=="menubar"?D:void 0,previousFocusableElement:N,nextFocusableElement:E.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:E.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:_})}),fD=v.createContext(void 0);function eJ(){const e=v.useContext(fD);if(e===void 0)throw new Error(Cn(32));return e}const tJ=v.forwardRef(function(t,n){const{keepMounted:r=!1,...a}=t,{store:o}=Jo();return o.useState("mounted")||r?S.jsx(fD.Provider,{value:r,children:S.jsx(p0,{ref:n,...a})}):null}),nJ=v.forwardRef(function(t,n){var Le;const{anchor:r,positionMethod:a="absolute",className:o,render:l,side:c,align:f,sideOffset:d=0,alignOffset:m=0,collisionBoundary:h="clipping-ancestors",collisionPadding:y=5,arrowPadding:g=5,sticky:w=!1,disableAnchorTracking:C=!1,collisionAvoidance:R=C2,...E}=t,{store:T}=Jo(),k=eJ(),M=rf(!0),D=T.useState("parent"),A=T.useState("floatingRootContext"),N=T.useState("floatingTreeRoot"),L=T.useState("mounted"),q=T.useState("open"),F=T.useState("modal"),Y=T.useState("activeTriggerElement"),_=T.useState("transitionStatus"),V=T.useState("lastOpenChangeReason"),$=T.useState("floatingNodeId"),B=T.useState("floatingParentNodeId");let j=r,z=d,H=m,K=f,P=R;D.type==="context-menu"&&(j=r??((Le=D.context)==null?void 0:Le.anchor),K=K??"start",!c&&K!=="center"&&(H=t.alignOffset??2,z=t.sideOffset??-5));let U=c,G=K;D.type==="menu"?(U=U??"inline-end",G=G??"start",P=t.collisionAvoidance??R2):D.type==="menubar"&&(U=U??"bottom",G=G??"start");const I=D.type==="context-menu",Q=z0({anchor:j,floatingRootContext:A,positionMethod:M?"fixed":a,mounted:L,side:U,sideOffset:z,align:G,alignOffset:H,arrowPadding:I?0:g,collisionBoundary:h,collisionPadding:y,sticky:w,nodeId:$,keepMounted:k,disableAnchorTracking:C,collisionAvoidance:P,shiftCrossAxis:I&&!("side"in P&&P.side==="flip"),externalTree:N}),le=v.useMemo(()=>{const te={};return q||(te.pointerEvents="none"),{role:"presentation",hidden:!L,style:{...Q.positionerStyles,...te}}},[q,L,Q.positionerStyles]);v.useEffect(()=>{function te(he){he.open&&(he.parentNodeId===$&&T.set("hoverEnabled",!1),he.nodeId!==$&&he.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,xt(ip)))}return N.events.on("menuopenchange",te),()=>{N.events.off("menuopenchange",te)}},[T,N.events,$]),v.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function te(he){if(he.open||he.nodeId!==T.select("floatingParentNodeId"))return;const ye=he.reason??ip;T.setOpen(!1,xt(ye))}return N.events.on("menuopenchange",te),()=>{N.events.off("menuopenchange",te)}},[N.events,T]),v.useEffect(()=>{function te(he){!q||he.nodeId!==T.select("floatingParentNodeId")||he.target&&Y&&Y!==he.target&&T.setOpen(!1,xt(ip))}return N.events.on("itemhover",te),()=>{N.events.off("itemhover",te)}},[N.events,q,Y,T]),v.useEffect(()=>{const te={open:q,nodeId:$,parentNodeId:B,reason:T.select("lastOpenChangeReason")};N.events.emit("menuopenchange",te)},[N.events,q,T,$,B]);const ae={open:q,side:Q.side,align:Q.align,anchorHidden:Q.anchorHidden,nested:D.type==="menu"},Z=v.useMemo(()=>({side:Q.side,align:Q.align,arrowRef:Q.arrowRef,arrowUncentered:Q.arrowUncentered,arrowStyles:Q.arrowStyles,nodeId:Q.context.nodeId}),[Q.side,Q.align,Q.arrowRef,Q.arrowUncentered,Q.arrowStyles,Q.context.nodeId]),ue=It("div",t,{state:ae,stateAttributesMapping:ua,ref:[n,T.useStateSetter("positionerElement")],props:[le,_c(_),E]}),ve=L&&D.type!=="menu"&&(D.type!=="menubar"&&F&&V!==vr||D.type==="menubar"&&D.context.modal);let Se=null;return D.type==="menubar"?Se=D.context.contentElement:D.type===void 0&&(Se=Y),S.jsxs(cD.Provider,{value:Z,children:[ve&&S.jsx(A0,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:M0(!q),cutout:Se}),S.jsx(LH,{id:$,children:S.jsx(Nm,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:ue})})]})}),rJ=v.createContext(null);function hD(e){return v.useContext(rJ)}const iJ={...E0,disabled:Ge(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:Ge(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:Ge(e=>e.allowMouseEnter),stickIfOpen:Ge(e=>e.stickIfOpen),parent:Ge(e=>e.parent),rootId:Ge(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:Ge(e=>e.activeIndex),isActive:Ge((e,t)=>e.activeIndex===t),hoverEnabled:Ge(e=>e.hoverEnabled),instantType:Ge(e=>e.instantType),lastOpenChangeReason:Ge(e=>e.openChangeReason),floatingTreeRoot:Ge(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:Ge(e=>e.floatingNodeId),floatingParentNodeId:Ge(e=>e.floatingParentNodeId),itemProps:Ge(e=>e.itemProps),closeDelay:Ge(e=>e.closeDelay),keyboardEventRelay:Ge(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class hw extends gm{constructor(n){super({...aJ(),...n},{positionerRef:v.createRef(),popupRef:v.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:v.createRef(),beforeContentFocusGuardRef:v.createRef(),onOpenChangeComplete:void 0,triggerElements:new Yd},iJ);at(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",r=>{var a;if((a=this.unsubscribeParentListener)==null||a.call(this),r.type==="menu"){this.unsubscribeParentListener=r.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=r.store.context.allowMouseUpTriggerRef;return}r.type!==void 0&&(this.context.allowMouseUpTriggerRef=r.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,r){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:r})}static useStore(n,r){const a=nr(()=>new hw(r)).current;return n??a}}function aJ(){return{...S0(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new h0,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:In,keyboardEventRelay:void 0,closeDelay:0}}const oJ=v.createContext(void 0);function sJ(){return v.useContext(oJ)}const lJ=b0(function(t){const{children:n,open:r,onOpenChange:a,onOpenChangeComplete:o,defaultOpen:l=!1,disabled:c=!1,modal:f,loopFocus:d=!0,orientation:m="vertical",actionsRef:h,closeParentOnEsc:y=!1,handle:g,triggerId:w,defaultTriggerId:C=null,highlightItemOnHover:R=!0}=t,E=rf(!0),T=Jo(!0),k=hD(!0),M=sJ(),D=v.useMemo(()=>M&&T?{type:"menu",store:T.store}:k?{type:"menubar",context:k}:E&&!T?{type:"context-menu",context:E}:{type:void 0},[E,T,k,M]),A=hw.useStore(g==null?void 0:g.store,{open:l,openProp:r,activeTriggerId:C,triggerIdProp:w,parent:D});bm(()=>{r===void 0&&A.state.open===!1&&l===!0&&A.update({open:!0,activeTriggerId:C})}),A.useControlledProp("openProp",r),A.useControlledProp("triggerIdProp",w),A.useContextCallback("onOpenChangeComplete",o);const N=A.useState("floatingTreeRoot"),L=wA(N),q=Ka();qe(()=>{E&&!T?A.update({parent:{type:"context-menu",context:E},floatingNodeId:L,floatingParentNodeId:q}):T&&A.update({floatingNodeId:L,floatingParentNodeId:q})},[E,T,L,q,A]);const F=A.useState("open"),Y=A.useState("activeTriggerElement"),_=A.useState("positionerElement"),V=A.useState("hoverEnabled"),$=A.useState("modal"),B=A.useState("disabled"),j=A.useState("lastOpenChangeReason"),z=A.useState("parent"),H=A.useState("activeIndex"),K=A.useState("payload"),P=A.useState("floatingParentNodeId"),U=v.useRef(null),G=P!=null;let I;A.useSyncedValues({disabled:c,modal:z.type===void 0?f:void 0,rootId:nl()});const{openMethod:Q,triggerProps:le,reset:ae}=D0(F);x0(A);const{forceUnmount:Z}=w0(F,A,()=>{A.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),ue=v.useRef(z.type!=="context-menu"),ve=Bn();v.useEffect(()=>{if(F||(U.current=null),z.type==="context-menu"){if(!F){ve.clear(),ue.current=!1;return}ve.start(500,()=>{ue.current=!0})}},[ve,F,z.type]),O0(F&&$&&j!==vr&&Q!=="touch",_),qe(()=>{!F&&!V&&A.set("hoverEnabled",!0)},[F,V,A]);const Se=v.useRef(!0),Le=Bn(),te=We((ze,Ze)=>{var bt;const tt=Ze.reason;if(F===ze&&Ze.trigger===Y&&j===tt||(Ze.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},!ze&&Ze.trigger==null&&(Ze.trigger=Y??void 0),a==null||a(ze,Ze),Ze.isCanceled))return;const Rt={open:ze,nativeEvent:Ze.event,reason:Ze.reason,nested:G};I==null||I.emit("openchange",Rt);const zt=Ze.event;if(ze===!1&&(zt==null?void 0:zt.type)==="click"&&zt.pointerType==="touch"&&!Se.current)return;if(!ze&&H!==null){const Ke=A.context.itemDomElements.current[H];queueMicrotask(()=>{Ke==null||Ke.setAttribute("tabindex","-1")})}ze&&tt===Jl?(Se.current=!1,Le.start(300,()=>{Se.current=!0})):(Se.current=!0,Le.clear());const yt=(tt===Ws||tt===id)&&zt.detail===0&&(zt==null?void 0:zt.isTrusted),Nt=!ze&&(tt===dm||tt==null),it={open:ze,openChangeReason:tt};U.current=Ze.event??null;const ft=((bt=Ze.trigger)==null?void 0:bt.id)??null;(ft||ze)&&(it.activeTriggerId=ft,it.activeTriggerElement=Ze.trigger??null),A.update(it),z.type==="menubar"&&(tt===Jl||tt===Ys||tt===vr||tt===rp||tt===ip)?A.set("instantType","group"):yt||Nt?A.set("instantType",yt?"click":"dismiss"):A.set("instantType",void 0)}),he=v.useCallback(ze=>{const Ze=xt(ze);return Ze.preventUnmountOnClose=()=>{A.set("preventUnmountingOnClose",!0)},Ze},[A]),ye=v.useCallback(()=>{A.setOpen(!1,he(c0))},[A,he]);v.useImperativeHandle(h,()=>({unmount:Z,close:ye}),[Z,ye]);let _e;z.type==="context-menu"&&(_e=z.context),v.useImperativeHandle(_e==null?void 0:_e.positionerRef,()=>_,[_]),v.useImperativeHandle(_e==null?void 0:_e.actionsRef,()=>({setOpen:te}),[te]);const Ae=C0({popupStore:A,onOpenChange:te});I=Ae.context.events,v.useEffect(()=>{const ze=({open:Ze,eventDetails:tt})=>te(Ze,tt);return I.on("setOpen",ze),()=>{I==null||I.off("setOpen",ze)}},[I,te]);const Ce=mm(Ae,{enabled:!B,bubbles:{escapeKey:y&&z.type==="menu"},outsidePress(){var ze;return z.type!=="context-menu"||((ze=U.current)==null?void 0:ze.type)==="contextmenu"?!0:ue.current},externalTree:G?N:void 0}),Te=KA(Ae,{role:"menu"}),J=Lc(),Ee=v.useCallback(ze=>{A.select("activeIndex")!==ze&&A.set("activeIndex",ze)},[A]),xe=YA(Ae,{enabled:!B,listRef:A.context.itemDomElements,activeIndex:H,nested:z.type!==void 0,loopFocus:d,orientation:m,parentOrientation:z.type==="menubar"?z.context.orientation:void 0,rtl:J==="rtl",disabledIndices:Vo,onNavigate:Ee,openOnArrowKeyDown:z.type!=="context-menu",externalTree:G?N:void 0,focusItemOnHover:R}),Be=v.useCallback(ze=>{A.context.typingRef.current=ze},[A]),Ve=GA(Ae,{listRef:A.context.itemLabels,activeIndex:H,resetMs:pF,onMatch:ze=>{F&&ze!==H&&A.set("activeIndex",ze)},onTypingChange:Be}),{getReferenceProps:De,getFloatingProps:ut,getItemProps:pe,getTriggerProps:Re}=Kd([Ce,Te,xe,Ve]),ee=v.useMemo(()=>{const ze=Ri(De(),{onMouseMove(){A.set("allowMouseEnter",!0)}},le);return delete ze.role,ze},[De,A,le]),fe=v.useMemo(()=>{const ze=Re();if(!ze)return ze;const Ze=Ri(ze,le);return delete Ze.role,delete Ze["aria-controls"],Ze},[Re,le]),Ne=v.useMemo(()=>ut({onMouseMove(){A.set("allowMouseEnter",!0),z.type==="menu"&&A.set("hoverEnabled",!1)},onClick(){A.select("hoverEnabled")&&A.set("hoverEnabled",!1)},onKeyDown(ze){const Ze=A.select("keyboardEventRelay");Ze&&!ze.isPropagationStopped()&&Ze(ze)}}),[ut,z.type,A]),He=v.useMemo(()=>pe(),[pe]);A.useSyncedValues({floatingRootContext:Ae,activeTriggerProps:ee,inactiveTriggerProps:fe,popupProps:Ne,itemProps:He});const $e=v.useMemo(()=>({store:A,parent:D}),[A,D]),et=S.jsx(dD.Provider,{value:$e,children:typeof n=="function"?n({payload:K}):n});return z.type===void 0||z.type==="context-menu"?S.jsx(_H,{externalTree:N,children:et}):et});function cJ(e){const{render:t,className:n,state:r=In,props:a=Vo,refs:o=Vo,metadata:l,stateAttributesMapping:c,tag:f="div",...d}=e,{compositeProps:m,compositeRef:h}=oD({metadata:l});return It(f,e,{state:r,ref:[...o,h],props:[m,...a,d],stateAttributesMapping:c})}function pD(e){if(Mn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!ra(e))return pD(oa(e))}function uJ(e){const{enabled:t=!0,mouseDownAction:n,open:r}=e,a=v.useRef(!1);return v.useMemo(()=>t?{onMouseDown:o=>{(n==="open"&&!r||n==="close"&&r)&&(a.current=!0,Qt(o.currentTarget).addEventListener("click",()=>{a.current=!1},{once:!0}))},onClick:o=>{a.current&&(a.current=!1,o.preventBaseUIHandler())}}:In,[t,n,r])}const Yh=2,dJ=FA(function(t,n){const{render:r,className:a,disabled:o=!1,nativeButton:l=!0,id:c,openOnHover:f,delay:d=100,closeDelay:m=0,handle:h,payload:y,...g}=t,w=Jo(!0),C=(h==null?void 0:h.store)??(w==null?void 0:w.store);if(!C)throw new Error(Cn(85));const R=Vi(c),E=C.useState("isTriggerActive",R),T=C.useState("floatingRootContext"),k=C.useState("isOpenedByTrigger",R),M=v.useRef(null),D=hJ(),A=e0(!0),N=Qo(),L=v.useMemo(()=>N??new h0,[N]),q=wA(L),F=Ka(),{registerTrigger:Y,isMountedByThisTrigger:_}=HA(R,M,C,{payload:y,closeDelay:m,parent:D,floatingTreeRoot:L,floatingNodeId:q,floatingParentNodeId:F,keyboardEventRelay:A==null?void 0:A.relayKeyboardEvent}),V=D.type==="menubar",$=C.useState("disabled"),B=o||$||V&&D.context.disabled,{getButtonProps:j,buttonRef:z}=$a({disabled:B,native:l});v.useEffect(()=>{!k&&D.type===void 0&&(C.context.allowMouseUpTriggerRef.current=!1)},[C,k,D.type]);const H=v.useRef(null),K=Bn(),P=We(Ce=>{if(!H.current)return;K.clear(),C.context.allowMouseUpTriggerRef.current=!1;const Te=Ce.target;if(Dt(H.current,Te)||Dt(C.select("positionerElement"),Te)||Te===H.current||Te!=null&&pD(Te)===C.select("rootId"))return;const J=zO(H.current);Ce.clientX>=J.left-Yh&&Ce.clientX<=J.right+Yh&&Ce.clientY>=J.top-Yh&&Ce.clientY<=J.bottom+Yh||L.events.emit("close",{domEvent:Ce,reason:mA})});v.useEffect(()=>{k&&C.select("lastOpenChangeReason")===vr&&Qt(H.current).addEventListener("mouseup",P,{once:!0})},[k,P,C]);const U=V&&D.context.hasSubmenuOpen,I=WA(T,{enabled:(f??U)&&!B&&D.type!=="context-menu"&&(!V||U&&!_),handleClose:XA({blockPointerEvents:!V}),mouseOnly:!0,move:!1,restMs:D.type===void 0?d:void 0,delay:{close:m},triggerElementRef:M,externalTree:L,isActiveTrigger:E}),Q=fJ(k,C.select("lastOpenChangeReason")),le=MA(T,{enabled:!B&&D.type!=="context-menu",event:k&&V?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?Q:!1}),ae=qA(T,{enabled:!B&&U}),Z=uJ({open:k,enabled:V,mouseDownAction:"open"}),ue=Kd([le,ae]),ve={disabled:B,open:k},Se=C.useState("triggerProps",_),Le=[H,n,z,Y,M],te=[ue.getReferenceProps(),I??In,Se,{"aria-haspopup":"menu",id:R,onMouseDown:Ce=>{if(C.select("open"))return;K.start(200,()=>{C.context.allowMouseUpTriggerRef.current=!0}),Qt(Ce.currentTarget).addEventListener("mouseup",P,{once:!0})}},V?{role:"menuitem"}:{},Z,g,j],he=v.useRef(null),ye=We(Ce=>{pr.flushSync(()=>{C.setOpen(!1,xt(Ys,Ce.nativeEvent,Ce.currentTarget))});const Te=yH(he.current);Te==null||Te.focus()}),_e=We(Ce=>{var J;const Te=C.select("positionerElement");if(Te&&Zl(Ce,Te))(J=C.context.beforeContentFocusGuardRef.current)==null||J.focus();else{pr.flushSync(()=>{C.setOpen(!1,xt(Ys,Ce.nativeEvent,Ce.currentTarget))});let Ee=gH(C.context.triggerFocusTargetRef.current||M.current);for(;Ee!==null&&Dt(Te,Ee);){const xe=Ee;if(Ee=s0(Ee),Ee===xe)break}Ee==null||Ee.focus()}}),Ae=It("button",t,{enabled:!V,stateAttributesMapping:qv,state:ve,ref:Le,props:te});return V?S.jsx(cJ,{tag:"button",render:r,className:a,state:ve,refs:Le,props:te,stateAttributesMapping:qv}):k?S.jsxs(v.Fragment,{children:[S.jsx(Cc,{ref:he,onFocus:ye},`${R}-pre-focus-guard`),S.jsx(v.Fragment,{children:Ae},R),S.jsx(Cc,{ref:C.context.triggerFocusTargetRef,onFocus:_e},`${R}-post-focus-guard`)]}):S.jsx(v.Fragment,{children:Ae},R)});function fJ(e,t){const n=Bn(),[r,a]=v.useState(!1);return qe(()=>{e&&t==="trigger-hover"?(a(!0),n.start(mF,()=>{a(!1)})):e||(n.clear(),a(!1))},[e,t,n]),r}function hJ(){const e=rf(!0),t=Jo(!0),n=hD();return v.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function pw({...e}){return S.jsx(lJ,{"data-slot":"dropdown-menu",...e})}function mw({...e}){return S.jsx(dJ,{"data-slot":"dropdown-menu-trigger",...e})}function gw({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:r=4,backdrop:a=!1,className:o,...l}){return S.jsxs(tJ,{children:[a&&S.jsx(YZ,{className:"fixed inset-0 z-50"}),S.jsx(nJ,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:r,children:S.jsx(JZ,{"data-slot":"dropdown-menu-content",className:Pe("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 data-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",o),...l})})]})}function ac({className:e,inset:t,variant:n="default",...r}){return S.jsx(QZ,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Pe("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-1.5 rounded-md px-1.5 py-1 text-sm data-inset:pl-7 [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",e),...r})}function Kte({className:e,...t}){return S.jsx(gA,{"data-slot":"dropdown-menu-separator",className:Pe("bg-border -mx-1 my-1 h-px",e),...t})}const pJ=(e,t)=>["watch-rules",e,t],mD=e=>["watch-rule-state",e];async function Fc(e,t){try{return(await e.json()).error??t}catch{return t}}async function mJ(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),r=await fetch(`/api/watch/rules?${n}`);if(!r.ok)throw new Error(await Fc(r,"Failed to load watch rules"));return(await r.json()).rules}async function gJ(e){const t=await fetch("/api/watch/rules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Fc(t,"Failed to create watch rule"));return await t.json()}async function gD(e,t){const n=await fetch(`/api/watch/rules/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok)throw new Error(await Fc(n,"Failed to update watch rule"));return await n.json()}async function yJ(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await Fc(t,"Failed to delete watch rule"))}async function yD(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await Fc(t,"Failed to load watch rule state"));return await t.json()}async function bJ(e){const t=await fetch("/api/watch/assist-regex",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await Fc(t,"Failed to generate regex"));return await t.json()}const vJ=["match","unchanged","llm"],Zb="__default__";function $k(e){return e==="llm"?30:5}function xJ({deviceId:e,paneId:t,rule:n,onSaved:r,onCancel:a}){var Te;const{t:o}=mn(),l=v.useId(),[c,f]=v.useState((n==null?void 0:n.name)??""),[d,m]=v.useState((n==null?void 0:n.triggerType)??"match"),[h,y]=v.useState((n==null?void 0:n.pattern)??""),[g,w]=v.useState((n==null?void 0:n.patternFlags)??""),[C,R]=v.useState((n==null?void 0:n.extractGroup)??0),[E,T]=v.useState((n==null?void 0:n.unchangedMinutes)??10),[k,M]=v.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,A]=v.useState((n==null?void 0:n.conditionPrompt)??""),[N,L]=v.useState((n==null?void 0:n.providerId)??null),[q,F]=v.useState((n==null?void 0:n.modelId)??""),[Y,_]=v.useState((n==null?void 0:n.confirmWithLlm)??!1),[V,$]=v.useState((n==null?void 0:n.summarizeWithLlm)??!1),[B,j]=v.useState((n==null?void 0:n.intervalSeconds)??30),[z,H]=v.useState((n==null?void 0:n.fireMode)??"once"),[K,P]=v.useState((n==null?void 0:n.cooldownSeconds)??600),[U,G]=v.useState(""),[I,Q]=v.useState(null),ae=((Te=Ei({queryKey:["llm-providers"],queryFn:async()=>{const J=await fetch("/api/llm/providers");if(!J.ok)throw new Error("Failed to load providers");return await J.json()},throwOnError:!1}).data)==null?void 0:Te.providers)??[],Z=ae.filter(J=>J.enabled),ue=ae.find(J=>J.id===N),ve=(ue==null?void 0:ue.models)??[],Se=d==="match"||d==="unchanged",Le=d==="llm"||Y||V,te=$k(d),he=J=>{m(J);const Ee=$k(J);j(xe=>xe<Ee?J==="llm"?60:30:xe)},ye=()=>{if(!c.trim())return o("watch.validation.nameRequired");if(Se){if(!h)return o("watch.validation.patternRequired");try{new RegExp(h,g.replace(/g/g,""))}catch(J){return o("watch.validation.patternInvalid",{detail:J instanceof Error?J.message:String(J)})}if(d==="unchanged"&&(!E||E<=0))return o("watch.validation.unchangedMinutesInvalid")}else if(!D.trim())return o("watch.validation.conditionPromptRequired");return!Number.isInteger(B)||B<te?o("watch.validation.intervalMin",{min:te}):null},_e=yd({mutationFn:async()=>{const J={name:c.trim(),triggerType:d,pattern:Se?h:null,patternFlags:Se?g:"",extractGroup:C,conditionPrompt:d==="llm"?D:null,providerId:N,modelId:N&&q.trim()||null,confirmWithLlm:Se?Y:!1,summarizeWithLlm:Se?V:!1,intervalSeconds:B,unchangedMinutes:d==="unchanged"?E:null,noMatchBehavior:k,fireMode:z,cooldownSeconds:K};if(n){const xe=J;return await gD(n.id,xe),!1}const Ee={...J,deviceId:e,paneId:t,enabled:!0};return await gJ(Ee),!0},onSuccess:J=>{sn.success(o(J?"watch.toast.created":"watch.toast.updated")),r(J)},onError:J=>{sn.error(J instanceof Error?J.message:String(J))}}),Ae=yd({mutationFn:async()=>bJ({description:U.trim(),deviceId:e,paneId:t,providerId:N,modelId:N&&q.trim()||null}),onSuccess:J=>{y(J.pattern),w(J.flags),R(J.extractGroup),Q(J)},onError:J=>{sn.error(J instanceof Error?J.message:String(J))}}),Ce=()=>{const J=ye();if(J){sn.error(J);return}_e.mutate()};return S.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:J=>{J.preventDefault(),Ce()},children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-name`,children:o("watch.form.name")}),S.jsx(Pi,{id:`${l}-name`,"data-testid":"watch-form-name",value:c,maxLength:120,onChange:J=>f(J.target.value),placeholder:o("watch.form.namePlaceholder")})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.triggerType")}),S.jsx("div",{className:"grid gap-2",children:vJ.map(J=>S.jsxs("button",{type:"button","data-testid":`watch-form-type-${J}`,onClick:()=>he(J),className:Pe("rounded-lg border px-3 py-2 text-left transition-colors",d===J?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[S.jsx("span",{className:"block text-sm font-medium",children:o(`watch.type.${J}`)}),S.jsx("span",{className:"block text-xs text-muted-foreground",children:o(`watch.typeDesc.${J}`)})]},J))})]}),Se&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-assist`,children:o("watch.form.assistLabel")}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx(Pi,{id:`${l}-assist`,"data-testid":"watch-form-assist-input",value:U,onChange:J=>G(J.target.value),placeholder:o("watch.form.assistPlaceholder")}),S.jsxs(Ht,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!U.trim()||Ae.isPending,onClick:()=>Ae.mutate(),children:[Ae.isPending?S.jsx(Gs,{className:"h-4 w-4 animate-spin"}):S.jsx(lN,{className:"h-4 w-4"}),o("watch.form.assistButton")]})]}),I&&S.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[S.jsxs("p",{className:"text-muted-foreground",children:[S.jsxs("span",{className:"font-medium text-foreground",children:[o("watch.form.assistExplanation"),":"]})," ",I.explanation]}),S.jsxs("p",{className:"font-medium text-foreground",children:[o("watch.form.assistPreview"),":"]}),I.preview.length===0?S.jsx("p",{className:"text-muted-foreground",children:o("watch.form.assistPreviewEmpty")}):S.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:I.preview.map((J,Ee)=>S.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:J},Ee))})]})]}),S.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-pattern`,children:o("watch.form.pattern")}),S.jsx(Pi,{id:`${l}-pattern`,"data-testid":"watch-form-pattern",value:h,onChange:J=>y(J.target.value),placeholder:o("watch.form.patternPlaceholder"),className:"font-mono"})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-flags`,children:o("watch.form.flags")}),S.jsx(Pi,{id:`${l}-flags`,"data-testid":"watch-form-flags",value:g,onChange:J=>w(J.target.value),placeholder:o("watch.form.flagsPlaceholder"),className:"font-mono"})]})]})]}),d==="unchanged"&&S.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-extract-group`,children:o("watch.form.extractGroup")}),S.jsx(Pi,{id:`${l}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:C,onChange:J=>R(Math.max(0,Number(J.target.value)||0))}),S.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.extractGroupHint")})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-unchanged-minutes`,children:o("watch.form.unchangedMinutes")}),S.jsx(Pi,{id:`${l}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:E,onChange:J=>T(Math.max(1,Number(J.target.value)||1))})]}),S.jsxs("div",{className:"col-span-2 space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.noMatchBehavior")}),S.jsxs(up,{value:k,onValueChange:J=>{(J==="reset"||J==="ignore")&&M(J)},children:[S.jsx(dp,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:S.jsx(Gb,{children:o(k==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),S.jsxs(fp,{children:[S.jsx(La,{value:"reset",children:o("watch.form.noMatchReset")}),S.jsx(La,{value:"ignore",children:o("watch.form.noMatchIgnore")})]})]})]})]}),d==="llm"&&S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-condition`,children:o("watch.form.conditionPrompt")}),S.jsx(H0,{id:`${l}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:J=>A(J.target.value),placeholder:o("watch.form.conditionPromptPlaceholder"),rows:3})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.model")}),S.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[S.jsxs(up,{value:N??Zb,onValueChange:J=>{if(!J)return;const Ee=J===Zb?null:J;L(Ee),Ee===null&&F("")},children:[S.jsx(dp,{className:"w-full","data-testid":"watch-form-provider",children:S.jsx(Gb,{children:N?(ue==null?void 0:ue.name)??o("watch.form.providerUnavailable"):o("watch.form.followGlobalDefault")})}),S.jsxs(fp,{children:[S.jsx(La,{value:Zb,children:o("watch.form.followGlobalDefault")}),N&&!Z.some(J=>J.id===N)&&S.jsx(La,{value:N,children:ue?`${ue.name} (${o("watch.form.providerDisabled")})`:o("watch.form.providerUnavailable")}),Z.map(J=>S.jsx(La,{value:J.id,children:J.name},J.id))]})]}),S.jsx(Pi,{"data-testid":"watch-form-model",list:`${l}-model-options`,value:q,disabled:!N,onChange:J=>F(J.target.value),placeholder:o("watch.form.modelPlaceholder")}),S.jsx("datalist",{id:`${l}-model-options`,children:ve.map(J=>S.jsx("option",{value:J},J))})]}),Le&&S.jsx("p",{className:"rounded-md bg-primary/10 px-2 py-1.5 text-xs text-primary","data-testid":"watch-form-model-hint",children:o("watch.form.modelRequiredHint")})]}),Se&&S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.confirmWithLlm")}),S.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.confirmWithLlmDesc")})]}),S.jsx(Lp,{checked:Y,onCheckedChange:J=>_(!!J),"data-testid":"watch-form-confirm-llm"})]}),S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.summarizeWithLlm")}),S.jsx("span",{className:"block text-xs text-muted-foreground",children:o("watch.form.summarizeWithLlmDesc")})]}),S.jsx(Lp,{checked:V,onCheckedChange:J=>$(!!J),"data-testid":"watch-form-summarize-llm"})]})]}),S.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[S.jsxs("div",{className:"space-y-2",children:[S.jsx("label",{className:"block text-sm font-medium",htmlFor:`${l}-interval`,children:o("watch.form.intervalSeconds")}),S.jsx(Pi,{id:`${l}-interval`,"data-testid":"watch-form-interval",type:"number",min:te,step:1,value:B,onChange:J=>j(Number(J.target.value)||0)}),S.jsx("p",{className:"text-xs text-muted-foreground",children:o("watch.form.intervalHint",{min:te})})]}),S.jsxs("div",{className:"space-y-2",children:[S.jsx("span",{className:"block text-sm font-medium",children:o("watch.form.fireMode")}),S.jsxs(up,{value:z,onValueChange:J=>{(J==="once"||J==="repeat")&&H(J)},children:[S.jsx(dp,{className:"w-full","data-testid":"watch-form-fire-mode",children:S.jsx(Gb,{children:o(z==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),S.jsxs(fp,{children:[S.jsx(La,{value:"once",children:o("watch.form.fireOnce")}),S.jsx(La,{value:"repeat",children:o("watch.form.fireRepeat")})]})]}),z==="repeat"&&S.jsx(Pi,{"data-testid":"watch-form-cooldown",type:"number",min:0,step:1,value:K,onChange:J=>P(Math.max(0,Number(J.target.value)||0)),"aria-label":o("watch.form.cooldownSeconds"),placeholder:o("watch.form.cooldownSeconds")})]})]}),S.jsxs("div",{className:"flex justify-end gap-2",children:[S.jsx(Ht,{type:"button",variant:"outline",onClick:a,"data-testid":"watch-form-cancel",children:o("common.cancel")}),S.jsxs(Ht,{type:"submit",disabled:_e.isPending,"data-testid":"watch-form-save",children:[_e.isPending&&S.jsx(Gs,{className:"h-4 w-4 animate-spin"}),o(n?"watch.form.save":"watch.form.create")]})]})]})}function Ju(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function wJ({open:e,onOpenChange:t,deviceId:n,paneId:r}){const{t:a}=mn(),o=el(),[l,c]=v.useState({mode:"list"}),[f,d]=v.useState(null),[m,h]=v.useState(!1);v.useEffect(()=>{e||(c({mode:"list"}),d(null),h(!1))},[e]);const y=Ei({queryKey:pJ(n,r),queryFn:()=>mJ(n,r),enabled:e,throwOnError:!1}),g=()=>{o.invalidateQueries({queryKey:["watch-rules"]})},w=yd({mutationFn:async({rule:T,enabled:k})=>{await gD(T.id,{enabled:k})},onSuccess:g,onError:T=>{sn.error(T instanceof Error?T.message:String(T)),g()}}),C=yd({mutationFn:async T=>{await yJ(T.id)},onSuccess:()=>{sn.success(a("watch.toast.deleted")),g()},onError:T=>{sn.error(T instanceof Error?T.message:String(T))}}),R=T=>{g(),c({mode:"list"}),T&&typeof Notification<"u"&&Notification.permission==="default"&&h(!0)},E=y.data??[];return S.jsxs(S.Fragment,{children:[S.jsx(vx,{open:e,onOpenChange:t,children:S.jsxs(xx,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[S.jsxs(wx,{children:[S.jsxs(Sx,{children:[l.mode==="list"&&a("watch.title"),l.mode==="form"&&(l.rule?a("watch.form.editTitle"):a("watch.form.createTitle")),l.mode==="state"&&a("watch.state.title")]}),S.jsx(lD,{children:l.mode==="list"?a("watch.dialogDesc"):null})]}),S.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[l.mode==="list"&&S.jsxs("div",{className:"space-y-3",children:[m&&S.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-primary/30 bg-primary/10 p-3","data-testid":"watch-notif-banner",children:[S.jsx(i8,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),S.jsxs("div",{className:"min-w-0 flex-1",children:[S.jsx("p",{className:"text-sm font-medium",children:a("watch.notifPermission.title")}),S.jsx("p",{className:"text-xs text-muted-foreground",children:a("watch.notifPermission.desc")}),S.jsxs("div",{className:"mt-2 flex gap-2",children:[S.jsx(Ht,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>h(!1))},children:a("watch.notifPermission.enable")}),S.jsx(Ht,{size:"sm",variant:"ghost",onClick:()=>h(!1),children:a("watch.notifPermission.dismiss")})]})]})]}),y.isLoading&&S.jsx("div",{className:"flex justify-center py-6",children:S.jsx(Gs,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!y.isLoading&&E.length===0&&S.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:a("watch.rules.empty")}),E.map(T=>S.jsx(SJ,{rule:T,onToggle:k=>w.mutate({rule:T,enabled:k}),onEdit:()=>c({mode:"form",rule:T}),onViewState:()=>c({mode:"state",rule:T}),onDelete:()=>d(T)},T.id)),S.jsxs(Ht,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>c({mode:"form",rule:null}),children:[S.jsx(wm,{className:"h-4 w-4"}),a("watch.rules.addRule")]})]}),l.mode==="form"&&S.jsx(xJ,{deviceId:n,paneId:r,rule:l.rule,onSaved:R,onCancel:()=>c({mode:"list"})}),l.mode==="state"&&S.jsx(EJ,{rule:l.rule,onBack:()=>c({mode:"list"})})]})]})}),S.jsx(dx,{open:f!==null,onOpenChange:T=>!T&&d(null),children:S.jsxs(fx,{"data-testid":"watch-rule-delete-dialog",children:[S.jsxs(hx,{children:[S.jsx(mx,{children:a("watch.rules.deleteTitle")}),S.jsx(gx,{children:a("watch.rules.deleteDesc",{name:(f==null?void 0:f.name)??""})})]}),S.jsxs(px,{children:[S.jsx(bx,{children:a("common.cancel")}),S.jsx(yx,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{f&&C.mutate(f),d(null)},children:a("watch.rules.deleteConfirm")})]})]})})]})}function SJ({rule:e,onToggle:t,onEdit:n,onViewState:r,onDelete:a}){var f,d;const{t:o}=mn(),l=Ei({queryKey:mD(e.id),queryFn:()=>yD(e.id),throwOnError:!1}),c=Ju((d=(f=l.data)==null?void 0:f.state)==null?void 0:d.lastTriggeredAt);return S.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),S.jsx(Zs,{variant:"secondary",children:o(`watch.type.${e.triggerType}`)}),S.jsx(Lp,{checked:e.enabled,onCheckedChange:m=>t(!!m),"data-testid":`watch-rule-toggle-${e.id}`})]}),S.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[S.jsx("span",{className:"truncate text-xs text-muted-foreground",children:c?o("watch.rules.lastTriggered",{time:c}):o("watch.rules.neverTriggered")}),S.jsxs("div",{className:"flex shrink-0 gap-1",children:[S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:r,title:o("watch.rules.viewState"),"aria-label":o("watch.rules.viewState"),"data-testid":`watch-rule-state-${e.id}`,children:S.jsx(Z6,{className:"h-3.5 w-3.5"})}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:n,title:o("watch.rules.edit"),"aria-label":o("watch.rules.edit"),"data-testid":`watch-rule-edit-${e.id}`,children:S.jsx(xm,{className:"h-3.5 w-3.5"})}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:a,title:o("watch.rules.delete"),"aria-label":o("watch.rules.delete"),"data-testid":`watch-rule-delete-${e.id}`,children:S.jsx(cN,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function EJ({rule:e,onBack:t}){var f,d;const{t:n}=mn(),r=Ei({queryKey:mD(e.id),queryFn:()=>yD(e.id),refetchInterval:5e3,throwOnError:!1}),a=((f=r.data)==null?void 0:f.state)??null,o=((d=r.data)==null?void 0:d.samples)??[],l=n("watch.state.none"),c=[{label:n("watch.state.lastSampledAt"),value:Ju(a==null?void 0:a.lastSampledAt)??l},{label:n("watch.state.lastValue"),value:(a==null?void 0:a.lastValue)??l},{label:n("watch.state.lastValueChangedAt"),value:Ju(a==null?void 0:a.lastValueChangedAt)??l},{label:n("watch.state.lastTriggeredAt"),value:Ju(a==null?void 0:a.lastTriggeredAt)??l},{label:n("watch.state.consecutiveErrors"),value:a?String(a.consecutiveErrors):l},{label:n("watch.state.lastError"),value:(a==null?void 0:a.lastError)??l}];return S.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx(Ht,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:S.jsx(n8,{className:"h-4 w-4"})}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),S.jsx(Zs,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),r.isLoading?S.jsx("div",{className:"flex justify-center py-6",children:S.jsx(Gs,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):S.jsxs(S.Fragment,{children:[S.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:c.map(m=>S.jsxs("div",{className:"contents",children:[S.jsx("dt",{className:"text-muted-foreground",children:m.label}),S.jsx("dd",{className:"min-w-0 break-all",children:m.value})]},m.label))}),S.jsxs("div",{className:"space-y-1.5",children:[S.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),o.length===0?S.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):S.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...o].reverse().map(m=>S.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[S.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:Ju(m.at)??m.at}),S.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:m.value??l}),m.hit&&S.jsx(Zs,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},m.at))})]})]})]})}function CJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>r=>{t.forEach(a=>a(r))},t)}const Dm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Bc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function yw(e){return"nodeType"in e}function Vr(e){var t,n;return e?Bc(e)?e:yw(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function bw(e){const{Document:t}=Vr(e);return e instanceof t}function af(e){return Bc(e)?!1:e instanceof Vr(e).HTMLElement}function bD(e){return e instanceof Vr(e).SVGElement}function Hc(e){return e?Bc(e)?e.document:yw(e)?bw(e)?e:af(e)||bD(e)?e.ownerDocument:document:document:document}const la=Dm?v.useLayoutEffect:v.useEffect;function vw(e){const t=v.useRef(e);return la(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}function RJ(){const e=v.useRef(null),t=v.useCallback((r,a)=>{e.current=setInterval(r,a)},[]),n=v.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Ad(e,t){t===void 0&&(t=[e]);const n=v.useRef(e);return la(()=>{n.current!==e&&(n.current=e)},t),n}function of(e,t){const n=v.useRef();return v.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Vp(e){const t=vw(e),n=v.useRef(null),r=v.useCallback(a=>{a!==n.current&&(t==null||t(a,n.current)),n.current=a},[]);return[n,r]}function Ex(e){const t=v.useRef();return v.useEffect(()=>{t.current=e},[e]),t.current}let Jb={};function sf(e,t){return v.useMemo(()=>{if(t)return t;const n=Jb[e]==null?0:Jb[e]+1;return Jb[e]=n,e+"-"+n},[e,t])}function vD(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];return r.reduce((o,l)=>{const c=Object.entries(l);for(const[f,d]of c){const m=o[f];m!=null&&(o[f]=m+e*d)}return o},{...t})}}const oc=vD(1),Nd=vD(-1);function TJ(e){return"clientX"in e&&"clientY"in e}function xw(e){if(!e)return!1;const{KeyboardEvent:t}=Vr(e.target);return t&&e instanceof t}function kJ(e){if(!e)return!1;const{TouchEvent:t}=Vr(e.target);return t&&e instanceof t}function Cx(e){if(kJ(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return TJ(e)?{x:e.clientX,y:e.clientY}:null}const Js=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Js.Translate.toString(e),Js.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),Wk="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function MJ(e){return e.matches(Wk)?e:e.querySelector(Wk)}const AJ={display:"none"};function NJ(e){let{id:t,value:n}=e;return Fe.createElement("div",{id:t,style:AJ},n)}function OJ(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const a={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Fe.createElement("div",{id:t,style:a,role:"status","aria-live":r,"aria-atomic":!0},n)}function DJ(){const[e,t]=v.useState("");return{announce:v.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const xD=v.createContext(null);function IJ(e){const t=v.useContext(xD);v.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function PJ(){const[e]=v.useState(()=>new Set),t=v.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[v.useCallback(r=>{let{type:a,event:o}=r;e.forEach(l=>{var c;return(c=l[a])==null?void 0:c.call(l,o)})},[e]),t]}const LJ={draggable:`
|
|
462
|
-
To pick up a draggable item, press the space bar.
|
|
463
|
-
While dragging, use the arrow keys to move the item.
|
|
464
|
-
Press space again to drop the item in its new position, or press escape to cancel.
|
|
465
|
-
`},_J={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function jJ(e){let{announcements:t=_J,container:n,hiddenTextDescribedById:r,screenReaderInstructions:a=LJ}=e;const{announce:o,announcement:l}=DJ(),c=sf("DndLiveRegion"),[f,d]=v.useState(!1);if(v.useEffect(()=>{d(!0)},[]),IJ(v.useMemo(()=>({onDragStart(h){let{active:y}=h;o(t.onDragStart({active:y}))},onDragMove(h){let{active:y,over:g}=h;t.onDragMove&&o(t.onDragMove({active:y,over:g}))},onDragOver(h){let{active:y,over:g}=h;o(t.onDragOver({active:y,over:g}))},onDragEnd(h){let{active:y,over:g}=h;o(t.onDragEnd({active:y,over:g}))},onDragCancel(h){let{active:y,over:g}=h;o(t.onDragCancel({active:y,over:g}))}}),[o,t])),!f)return null;const m=Fe.createElement(Fe.Fragment,null,Fe.createElement(NJ,{id:r,value:a.draggable}),Fe.createElement(OJ,{id:c,announcement:l}));return n?pr.createPortal(m,n):m}var er;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(er||(er={}));function $p(){}function ev(e,t){return v.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function zJ(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return v.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Hi=Object.freeze({x:0,y:0});function wD(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function SD(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function FJ(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Yk(e){let{left:t,top:n,height:r,width:a}=e;return[{x:t,y:n},{x:t+a,y:n},{x:t,y:n+r},{x:t+a,y:n+r}]}function ED(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Kk(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const ww=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Kk(t,t.left,t.top),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=wD(Kk(f),a);o.push({id:c,data:{droppableContainer:l,value:d}})}}return o.sort(SD)},BJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=Yk(t),o=[];for(const l of r){const{id:c}=l,f=n.get(c);if(f){const d=Yk(f),m=a.reduce((y,g,w)=>y+wD(d[w],g),0),h=Number((m/4).toFixed(4));o.push({id:c,data:{droppableContainer:l,value:h}})}}return o.sort(SD)};function HJ(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),l=a-r,c=o-n;if(r<a&&n<o){const f=t.width*t.height,d=e.width*e.height,m=l*c,h=m/(f+d-m);return Number(h.toFixed(4))}return 0}const UJ=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const a=[];for(const o of r){const{id:l}=o,c=n.get(l);if(c){const f=HJ(c,t);f>0&&a.push({id:l,data:{droppableContainer:o,value:f}})}}return a.sort(FJ)};function qJ(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function CD(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Hi}function VJ(e){return function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return a.reduce((l,c)=>({...l,top:l.top+e*c.y,bottom:l.bottom+e*c.y,left:l.left+e*c.x,right:l.right+e*c.x}),{...n})}}const $J=VJ(1);function WJ(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function YJ(e,t,n){const r=WJ(t);if(!r)return e;const{scaleX:a,scaleY:o,x:l,y:c}=r,f=e.left-l-(1-a)*parseFloat(n),d=e.top-c-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),m=a?e.width/a:e.width,h=o?e.height/o:e.height;return{width:m,height:h,top:d,right:f+m,bottom:d+h,left:f}}const KJ={ignoreTransform:!1};function Uc(e,t){t===void 0&&(t=KJ);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:d,transformOrigin:m}=Vr(e).getComputedStyle(e);d&&(n=YJ(n,d,m))}const{top:r,left:a,width:o,height:l,bottom:c,right:f}=n;return{top:r,left:a,width:o,height:l,bottom:c,right:f}}function Gk(e){return Uc(e,{ignoreTransform:!0})}function GJ(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function XJ(e,t){return t===void 0&&(t=Vr(e).getComputedStyle(e)),t.position==="fixed"}function QJ(e,t){t===void 0&&(t=Vr(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(a=>{const o=t[a];return typeof o=="string"?n.test(o):!1})}function Im(e,t){const n=[];function r(a){if(t!=null&&n.length>=t||!a)return n;if(bw(a)&&a.scrollingElement!=null&&!n.includes(a.scrollingElement))return n.push(a.scrollingElement),n;if(!af(a)||bD(a)||n.includes(a))return n;const o=Vr(e).getComputedStyle(a);return a!==e&&QJ(a,o)&&n.push(a),XJ(a,o)?n:r(a.parentNode)}return e?r(e):n}function RD(e){const[t]=Im(e,1);return t??null}function tv(e){return!Dm||!e?null:Bc(e)?e:yw(e)?bw(e)||e===Hc(e).scrollingElement?window:af(e)?e:null:null}function TD(e){return Bc(e)?e.scrollX:e.scrollLeft}function kD(e){return Bc(e)?e.scrollY:e.scrollTop}function Rx(e){return{x:TD(e),y:kD(e)}}var or;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(or||(or={}));function MD(e){return!Dm||!e?!1:e===document.scrollingElement}function AD(e){const t={x:0,y:0},n=MD(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},a=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,l=e.scrollTop>=r.y,c=e.scrollLeft>=r.x;return{isTop:a,isLeft:o,isBottom:l,isRight:c,maxScroll:r,minScroll:t}}const ZJ={x:.2,y:.2};function JJ(e,t,n,r,a){let{top:o,left:l,right:c,bottom:f}=n;r===void 0&&(r=10),a===void 0&&(a=ZJ);const{isTop:d,isBottom:m,isLeft:h,isRight:y}=AD(e),g={x:0,y:0},w={x:0,y:0},C={height:t.height*a.y,width:t.width*a.x};return!d&&o<=t.top+C.height?(g.y=or.Backward,w.y=r*Math.abs((t.top+C.height-o)/C.height)):!m&&f>=t.bottom-C.height&&(g.y=or.Forward,w.y=r*Math.abs((t.bottom-C.height-f)/C.height)),!y&&c>=t.right-C.width?(g.x=or.Forward,w.x=r*Math.abs((t.right-C.width-c)/C.width)):!h&&l<=t.left+C.width&&(g.x=or.Backward,w.x=r*Math.abs((t.left+C.width-l)/C.width)),{direction:g,speed:w}}function eee(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:l}=window;return{top:0,left:0,right:o,bottom:l,width:o,height:l}}const{top:t,left:n,right:r,bottom:a}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:a,width:e.clientWidth,height:e.clientHeight}}function ND(e){return e.reduce((t,n)=>oc(t,Rx(n)),Hi)}function tee(e){return e.reduce((t,n)=>t+TD(n),0)}function nee(e){return e.reduce((t,n)=>t+kD(n),0)}function ree(e,t){if(t===void 0&&(t=Uc),!e)return;const{top:n,left:r,bottom:a,right:o}=t(e);RD(e)&&(a<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const iee=[["x",["left","right"],tee],["y",["top","bottom"],nee]];class Sw{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Im(n),a=ND(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[o,l,c]of iee)for(const f of l)Object.defineProperty(this,f,{get:()=>{const d=c(r),m=a[o]-d;return this.rect[f]+m},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class hd{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var a;(a=this.target)==null||a.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function aee(e){const{EventTarget:t}=Vr(e);return e instanceof t?e:Hc(e)}function nv(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var vi;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(vi||(vi={}));function Xk(e){e.preventDefault()}function oee(e){e.stopPropagation()}var rn;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(rn||(rn={}));const OD={start:[rn.Space,rn.Enter],cancel:[rn.Esc],end:[rn.Space,rn.Enter,rn.Tab]},see=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case rn.Right:return{...n,x:n.x+25};case rn.Left:return{...n,x:n.x-25};case rn.Down:return{...n,y:n.y+25};case rn.Up:return{...n,y:n.y-25}}};class Ew{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new hd(Hc(n)),this.windowListeners=new hd(Vr(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(vi.Resize,this.handleCancel),this.windowListeners.add(vi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(vi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ree(r),n(Hi)}handleKeyDown(t){if(xw(t)){const{active:n,context:r,options:a}=this.props,{keyboardCodes:o=OD,coordinateGetter:l=see,scrollBehavior:c="smooth"}=a,{code:f}=t;if(o.end.includes(f)){this.handleEnd(t);return}if(o.cancel.includes(f)){this.handleCancel(t);return}const{collisionRect:d}=r.current,m=d?{x:d.left,y:d.top}:Hi;this.referenceCoordinates||(this.referenceCoordinates=m);const h=l(t,{active:n,context:r.current,currentCoordinates:m});if(h){const y=Nd(h,m),g={x:0,y:0},{scrollableAncestors:w}=r.current;for(const C of w){const R=t.code,{isTop:E,isRight:T,isLeft:k,isBottom:M,maxScroll:D,minScroll:A}=AD(C),N=eee(C),L={x:Math.min(R===rn.Right?N.right-N.width/2:N.right,Math.max(R===rn.Right?N.left:N.left+N.width/2,h.x)),y:Math.min(R===rn.Down?N.bottom-N.height/2:N.bottom,Math.max(R===rn.Down?N.top:N.top+N.height/2,h.y))},q=R===rn.Right&&!T||R===rn.Left&&!k,F=R===rn.Down&&!M||R===rn.Up&&!E;if(q&&L.x!==h.x){const Y=C.scrollLeft+y.x,_=R===rn.Right&&Y<=D.x||R===rn.Left&&Y>=A.x;if(_&&!y.y){C.scrollTo({left:Y,behavior:c});return}_?g.x=C.scrollLeft-Y:g.x=R===rn.Right?C.scrollLeft-D.x:C.scrollLeft-A.x,g.x&&C.scrollBy({left:-g.x,behavior:c});break}else if(F&&L.y!==h.y){const Y=C.scrollTop+y.y,_=R===rn.Down&&Y<=D.y||R===rn.Up&&Y>=A.y;if(_&&!y.x){C.scrollTo({top:Y,behavior:c});return}_?g.y=C.scrollTop-Y:g.y=R===rn.Down?C.scrollTop-D.y:C.scrollTop-A.y,g.y&&C.scrollBy({top:-g.y,behavior:c});break}}this.handleMove(t,oc(Nd(h,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ew.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=OD,onActivation:a}=t,{active:o}=n;const{code:l}=e.nativeEvent;if(r.start.includes(l)){const c=o.activatorNode.current;return c&&e.target!==c?!1:(e.preventDefault(),a==null||a({event:e.nativeEvent}),!0)}return!1}}];function Qk(e){return!!(e&&"distance"in e)}function Zk(e){return!!(e&&"delay"in e)}class Cw{constructor(t,n,r){var a;r===void 0&&(r=aee(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:l}=o;this.props=t,this.events=n,this.document=Hc(l),this.documentListeners=new hd(this.document),this.listeners=new hd(r),this.windowListeners=new hd(Vr(l)),this.initialCoordinates=(a=Cx(o))!=null?a:Hi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(vi.Resize,this.handleCancel),this.windowListeners.add(vi.DragStart,Xk),this.windowListeners.add(vi.VisibilityChange,this.handleCancel),this.windowListeners.add(vi.ContextMenu,Xk),this.documentListeners.add(vi.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Zk(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Qk(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:a}=this.props;a(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(vi.Click,oee,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(vi.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:a,props:o}=this,{onMove:l,options:{activationConstraint:c}}=o;if(!a)return;const f=(n=Cx(t))!=null?n:Hi,d=Nd(a,f);if(!r&&c){if(Qk(c)){if(c.tolerance!=null&&nv(d,c.tolerance))return this.handleCancel();if(nv(d,c.distance))return this.handleStart()}if(Zk(c)&&nv(d,c.tolerance))return this.handleCancel();this.handlePending(c,d);return}t.cancelable&&t.preventDefault(),l(f)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===rn.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const lee={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class DD extends Cw{constructor(t){const{event:n}=t,r=Hc(n.target);super(t,lee,r)}}DD.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const cee={move:{name:"mousemove"},end:{name:"mouseup"}};var Tx;(function(e){e[e.RightClick=2]="RightClick"})(Tx||(Tx={}));class ID extends Cw{constructor(t){super(t,cee,Hc(t.event.target))}}ID.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Tx.RightClick?!1:(r==null||r({event:n}),!0)}}];const rv={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class PD extends Cw{constructor(t){super(t,rv)}static setup(){return window.addEventListener(rv.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(rv.move.name,t)};function t(){}}}PD.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:a}=n;return a.length>1?!1:(r==null||r({event:n}),!0)}}];var pd;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(pd||(pd={}));var Wp;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Wp||(Wp={}));function uee(e){let{acceleration:t,activator:n=pd.Pointer,canScroll:r,draggingRect:a,enabled:o,interval:l=5,order:c=Wp.TreeOrder,pointerCoordinates:f,scrollableAncestors:d,scrollableAncestorRects:m,delta:h,threshold:y}=e;const g=fee({delta:h,disabled:!o}),[w,C]=RJ(),R=v.useRef({x:0,y:0}),E=v.useRef({x:0,y:0}),T=v.useMemo(()=>{switch(n){case pd.Pointer:return f?{top:f.y,bottom:f.y,left:f.x,right:f.x}:null;case pd.DraggableRect:return a}},[n,a,f]),k=v.useRef(null),M=v.useCallback(()=>{const A=k.current;if(!A)return;const N=R.current.x*E.current.x,L=R.current.y*E.current.y;A.scrollBy(N,L)},[]),D=v.useMemo(()=>c===Wp.TreeOrder?[...d].reverse():d,[c,d]);v.useEffect(()=>{if(!o||!d.length||!T){C();return}for(const A of D){if((r==null?void 0:r(A))===!1)continue;const N=d.indexOf(A),L=m[N];if(!L)continue;const{direction:q,speed:F}=JJ(A,L,T,t,y);for(const Y of["x","y"])g[Y][q[Y]]||(F[Y]=0,q[Y]=0);if(F.x>0||F.y>0){C(),k.current=A,w(M,l),R.current=F,E.current=q;return}}R.current={x:0,y:0},E.current={x:0,y:0},C()},[t,M,r,C,o,l,JSON.stringify(T),JSON.stringify(g),w,d,D,m,JSON.stringify(y)])}const dee={x:{[or.Backward]:!1,[or.Forward]:!1},y:{[or.Backward]:!1,[or.Forward]:!1}};function fee(e){let{delta:t,disabled:n}=e;const r=Ex(t);return of(a=>{if(n||!r||!a)return dee;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[or.Backward]:a.x[or.Backward]||o.x===-1,[or.Forward]:a.x[or.Forward]||o.x===1},y:{[or.Backward]:a.y[or.Backward]||o.y===-1,[or.Forward]:a.y[or.Forward]||o.y===1}}},[n,t,r])}function hee(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return of(a=>{var o;return t==null?null:(o=r??a)!=null?o:null},[r,t])}function pee(e,t){return v.useMemo(()=>e.reduce((n,r)=>{const{sensor:a}=r,o=a.activators.map(l=>({eventName:l.eventName,handler:t(l.handler,r)}));return[...n,...o]},[]),[e,t])}var Od;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Od||(Od={}));var kx;(function(e){e.Optimized="optimized"})(kx||(kx={}));const Jk=new Map;function mee(e,t){let{dragging:n,dependencies:r,config:a}=t;const[o,l]=v.useState(null),{frequency:c,measure:f,strategy:d}=a,m=v.useRef(e),h=R(),y=Ad(h),g=v.useCallback(function(E){E===void 0&&(E=[]),!y.current&&l(T=>T===null?E:T.concat(E.filter(k=>!T.includes(k))))},[y]),w=v.useRef(null),C=of(E=>{if(h&&!n)return Jk;if(!E||E===Jk||m.current!==e||o!=null){const T=new Map;for(let k of e){if(!k)continue;if(o&&o.length>0&&!o.includes(k.id)&&k.rect.current){T.set(k.id,k.rect.current);continue}const M=k.node.current,D=M?new Sw(f(M),M):null;k.rect.current=D,D&&T.set(k.id,D)}return T}return E},[e,o,n,h,f]);return v.useEffect(()=>{m.current=e},[e]),v.useEffect(()=>{h||g()},[n,h]),v.useEffect(()=>{o&&o.length>0&&l(null)},[JSON.stringify(o)]),v.useEffect(()=>{h||typeof c!="number"||w.current!==null||(w.current=setTimeout(()=>{g(),w.current=null},c))},[c,h,g,...r]),{droppableRects:C,measureDroppableContainers:g,measuringScheduled:o!=null};function R(){switch(d){case Od.Always:return!1;case Od.BeforeDragging:return n;default:return!n}}}function LD(e,t){return of(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function gee(e,t){return LD(e,t)}function yee(e){let{callback:t,disabled:n}=e;const r=vw(t),a=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return v.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function Pm(e){let{callback:t,disabled:n}=e;const r=vw(t),a=v.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return v.useEffect(()=>()=>a==null?void 0:a.disconnect(),[a]),a}function bee(e){return new Sw(Uc(e),e)}function eM(e,t,n){t===void 0&&(t=bee);const[r,a]=v.useState(null);function o(){a(f=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=f??n)!=null?d:null}const m=t(e);return JSON.stringify(f)===JSON.stringify(m)?f:m})}const l=yee({callback(f){if(e)for(const d of f){const{type:m,target:h}=d;if(m==="childList"&&h instanceof HTMLElement&&h.contains(e)){o();break}}}}),c=Pm({callback:o});return la(()=>{o(),e?(c==null||c.observe(e),l==null||l.observe(document.body,{childList:!0,subtree:!0})):(c==null||c.disconnect(),l==null||l.disconnect())},[e]),r}function vee(e){const t=LD(e);return CD(e,t)}const tM=[];function xee(e){const t=v.useRef(e),n=of(r=>e?r&&r!==tM&&e&&t.current&&e.parentNode===t.current.parentNode?r:Im(e):tM,[e]);return v.useEffect(()=>{t.current=e},[e]),n}function wee(e){const[t,n]=v.useState(null),r=v.useRef(e),a=v.useCallback(o=>{const l=tv(o.target);l&&n(c=>c?(c.set(l,Rx(l)),new Map(c)):null)},[]);return v.useEffect(()=>{const o=r.current;if(e!==o){l(o);const c=e.map(f=>{const d=tv(f);return d?(d.addEventListener("scroll",a,{passive:!0}),[d,Rx(d)]):null}).filter(f=>f!=null);n(c.length?new Map(c):null),r.current=e}return()=>{l(e),l(o)};function l(c){c.forEach(f=>{const d=tv(f);d==null||d.removeEventListener("scroll",a)})}},[a,e]),v.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,l)=>oc(o,l),Hi):ND(e):Hi,[e,t])}function nM(e,t){t===void 0&&(t=[]);const n=v.useRef(null);return v.useEffect(()=>{n.current=null},t),v.useEffect(()=>{const r=e!==Hi;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Nd(e,n.current):Hi}function See(e){v.useEffect(()=>{if(!Dm)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Eee(e,t){return v.useMemo(()=>e.reduce((n,r)=>{let{eventName:a,handler:o}=r;return n[a]=l=>{o(l,t)},n},{}),[e,t])}function _D(e){return v.useMemo(()=>e?GJ(e):null,[e])}const rM=[];function Cee(e,t){t===void 0&&(t=Uc);const[n]=e,r=_D(n?Vr(n):null),[a,o]=v.useState(rM);function l(){o(()=>e.length?e.map(f=>MD(f)?r:new Sw(t(f),f)):rM)}const c=Pm({callback:l});return la(()=>{c==null||c.disconnect(),l(),e.forEach(f=>c==null?void 0:c.observe(f))},[e]),a}function Ree(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return af(t)?t:e}function Tee(e){let{measure:t}=e;const[n,r]=v.useState(null),a=v.useCallback(d=>{for(const{target:m}of d)if(af(m)){r(h=>{const y=t(m);return h?{...h,width:y.width,height:y.height}:y});break}},[t]),o=Pm({callback:a}),l=v.useCallback(d=>{const m=Ree(d);o==null||o.disconnect(),m&&(o==null||o.observe(m)),r(m?t(m):null)},[t,o]),[c,f]=Vp(l);return v.useMemo(()=>({nodeRef:c,rect:n,setRef:f}),[n,c,f])}const kee=[{sensor:DD,options:{}},{sensor:Ew,options:{}}],Mee={current:{}},mp={draggable:{measure:Gk},droppable:{measure:Gk,strategy:Od.WhileDragging,frequency:kx.Optimized},dragOverlay:{measure:Uc}};class md extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Aee={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new md,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:$p},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:mp,measureDroppableContainers:$p,windowRect:null,measuringScheduled:!1},Nee={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:$p,draggableNodes:new Map,over:null,measureDroppableContainers:$p},Lm=v.createContext(Nee),jD=v.createContext(Aee);function Oee(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new md}}}function Dee(e,t){switch(t.type){case er.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case er.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case er.DragEnd:case er.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case er.RegisterDroppable:{const{element:n}=t,{id:r}=n,a=new md(e.droppable.containers);return a.set(r,n),{...e,droppable:{...e.droppable,containers:a}}}case er.SetDroppableDisabled:{const{id:n,key:r,disabled:a}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const l=new md(e.droppable.containers);return l.set(n,{...o,disabled:a}),{...e,droppable:{...e.droppable,containers:l}}}case er.UnregisterDroppable:{const{id:n,key:r}=t,a=e.droppable.containers.get(n);if(!a||r!==a.key)return e;const o=new md(e.droppable.containers);return o.delete(n),{...e,droppable:{...e.droppable,containers:o}}}default:return e}}function Iee(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:a}=v.useContext(Lm),o=Ex(r),l=Ex(n==null?void 0:n.id);return v.useEffect(()=>{if(!t&&!r&&o&&l!=null){if(!xw(o)||document.activeElement===o.target)return;const c=a.get(l);if(!c)return;const{activatorNode:f,node:d}=c;if(!f.current&&!d.current)return;requestAnimationFrame(()=>{for(const m of[f.current,d.current]){if(!m)continue;const h=MJ(m);if(h){h.focus();break}}})}},[r,t,a,l,o]),null}function Pee(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((a,o)=>o({transform:a,...r}),n):n}function Lee(e){return v.useMemo(()=>({draggable:{...mp.draggable,...e==null?void 0:e.draggable},droppable:{...mp.droppable,...e==null?void 0:e.droppable},dragOverlay:{...mp.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function _ee(e){let{activeNode:t,measure:n,initialRect:r,config:a=!0}=e;const o=v.useRef(!1),{x:l,y:c}=typeof a=="boolean"?{x:a,y:a}:a;la(()=>{if(!l&&!c||!t){o.current=!1;return}if(o.current||!r)return;const d=t==null?void 0:t.node.current;if(!d||d.isConnected===!1)return;const m=n(d),h=CD(m,r);if(l||(h.x=0),c||(h.y=0),o.current=!0,Math.abs(h.x)>0||Math.abs(h.y)>0){const y=RD(d);y&&y.scrollBy({top:h.y,left:h.x})}},[t,l,c,r,n])}const zD=v.createContext({...Hi,scaleX:1,scaleY:1});var Co;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Co||(Co={}));const Rw=v.memo(function(t){var n,r,a,o;let{id:l,accessibility:c,autoScroll:f=!0,children:d,sensors:m=kee,collisionDetection:h=UJ,measuring:y,modifiers:g,...w}=t;const C=v.useReducer(Dee,void 0,Oee),[R,E]=C,[T,k]=PJ(),[M,D]=v.useState(Co.Uninitialized),A=M===Co.Initialized,{draggable:{active:N,nodes:L,translate:q},droppable:{containers:F}}=R,Y=N!=null?L.get(N):null,_=v.useRef({initial:null,translated:null}),V=v.useMemo(()=>{var ft;return N!=null?{id:N,data:(ft=Y==null?void 0:Y.data)!=null?ft:Mee,rect:_}:null},[N,Y]),$=v.useRef(null),[B,j]=v.useState(null),[z,H]=v.useState(null),K=Ad(w,Object.values(w)),P=sf("DndDescribedBy",l),U=v.useMemo(()=>F.getEnabled(),[F]),G=Lee(y),{droppableRects:I,measureDroppableContainers:Q,measuringScheduled:le}=mee(U,{dragging:A,dependencies:[q.x,q.y],config:G.droppable}),ae=hee(L,N),Z=v.useMemo(()=>z?Cx(z):null,[z]),ue=it(),ve=gee(ae,G.draggable.measure);_ee({activeNode:N!=null?L.get(N):null,config:ue.layoutShiftCompensation,initialRect:ve,measure:G.draggable.measure});const Se=eM(ae,G.draggable.measure,ve),Le=eM(ae?ae.parentElement:null),te=v.useRef({activatorEvent:null,active:null,activeNode:ae,collisionRect:null,collisions:null,droppableRects:I,draggableNodes:L,draggingNode:null,draggingNodeRect:null,droppableContainers:F,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),he=F.getNodeFor((n=te.current.over)==null?void 0:n.id),ye=Tee({measure:G.dragOverlay.measure}),_e=(r=ye.nodeRef.current)!=null?r:ae,Ae=A?(a=ye.rect)!=null?a:Se:null,Ce=!!(ye.nodeRef.current&&ye.rect),Te=vee(Ce?null:Se),J=_D(_e?Vr(_e):null),Ee=xee(A?he??ae:null),xe=Cee(Ee),Be=Pee(g,{transform:{x:q.x-Te.x,y:q.y-Te.y,scaleX:1,scaleY:1},activatorEvent:z,active:V,activeNodeRect:Se,containerNodeRect:Le,draggingNodeRect:Ae,over:te.current.over,overlayNodeRect:ye.rect,scrollableAncestors:Ee,scrollableAncestorRects:xe,windowRect:J}),Ve=Z?oc(Z,q):null,De=wee(Ee),ut=nM(De),pe=nM(De,[Se]),Re=oc(Be,ut),ee=Ae?$J(Ae,Be):null,fe=V&&ee?h({active:V,collisionRect:ee,droppableRects:I,droppableContainers:U,pointerCoordinates:Ve}):null,Ne=ED(fe,"id"),[He,$e]=v.useState(null),et=Ce?Be:oc(Be,pe),ze=qJ(et,(o=He==null?void 0:He.rect)!=null?o:null,Se),Ze=v.useRef(null),tt=v.useCallback((ft,bt)=>{let{sensor:Ke,options:kt}=bt;if($.current==null)return;const _t=L.get($.current);if(!_t)return;const Tt=ft.nativeEvent,dn=new Ke({active:$.current,activeNode:_t,event:Tt,options:kt,context:te,onAbort(Je){if(!L.get(Je))return;const{onDragAbort:X}=K.current,ie={id:Je};X==null||X(ie),T({type:"onDragAbort",event:ie})},onPending(Je,Mt,X,ie){if(!L.get(Je))return;const{onDragPending:ke}=K.current,je={id:Je,constraint:Mt,initialCoordinates:X,offset:ie};ke==null||ke(je),T({type:"onDragPending",event:je})},onStart(Je){const Mt=$.current;if(Mt==null)return;const X=L.get(Mt);if(!X)return;const{onDragStart:ie}=K.current,de={activatorEvent:Tt,active:{id:Mt,data:X.data,rect:_}};pr.unstable_batchedUpdates(()=>{ie==null||ie(de),D(Co.Initializing),E({type:er.DragStart,initialCoordinates:Je,active:Mt}),T({type:"onDragStart",event:de}),j(Ze.current),H(Tt)})},onMove(Je){E({type:er.DragMove,coordinates:Je})},onEnd:Ut(er.DragEnd),onCancel:Ut(er.DragCancel)});Ze.current=dn;function Ut(Je){return async function(){const{active:X,collisions:ie,over:de,scrollAdjustedTranslate:ke}=te.current;let je=null;if(X&&ke){const{cancelDrop:rt}=K.current;je={activatorEvent:Tt,active:X,collisions:ie,delta:ke,over:de},Je===er.DragEnd&&typeof rt=="function"&&await Promise.resolve(rt(je))&&(Je=er.DragCancel)}$.current=null,pr.unstable_batchedUpdates(()=>{E({type:Je}),D(Co.Uninitialized),$e(null),j(null),H(null),Ze.current=null;const rt=Je===er.DragEnd?"onDragEnd":"onDragCancel";if(je){const nt=K.current[rt];nt==null||nt(je),T({type:rt,event:je})}})}}},[L]),Rt=v.useCallback((ft,bt)=>(Ke,kt)=>{const _t=Ke.nativeEvent,Tt=L.get(kt);if($.current!==null||!Tt||_t.dndKit||_t.defaultPrevented)return;const dn={active:Tt};ft(Ke,bt.options,dn)===!0&&(_t.dndKit={capturedBy:bt.sensor},$.current=kt,tt(Ke,bt))},[L,tt]),zt=pee(m,Rt);See(m),la(()=>{Se&&M===Co.Initializing&&D(Co.Initialized)},[Se,M]),v.useEffect(()=>{const{onDragMove:ft}=K.current,{active:bt,activatorEvent:Ke,collisions:kt,over:_t}=te.current;if(!bt||!Ke)return;const Tt={active:bt,activatorEvent:Ke,collisions:kt,delta:{x:Re.x,y:Re.y},over:_t};pr.unstable_batchedUpdates(()=>{ft==null||ft(Tt),T({type:"onDragMove",event:Tt})})},[Re.x,Re.y]),v.useEffect(()=>{const{active:ft,activatorEvent:bt,collisions:Ke,droppableContainers:kt,scrollAdjustedTranslate:_t}=te.current;if(!ft||$.current==null||!bt||!_t)return;const{onDragOver:Tt}=K.current,dn=kt.get(Ne),Ut=dn&&dn.rect.current?{id:dn.id,rect:dn.rect.current,data:dn.data,disabled:dn.disabled}:null,Je={active:ft,activatorEvent:bt,collisions:Ke,delta:{x:_t.x,y:_t.y},over:Ut};pr.unstable_batchedUpdates(()=>{$e(Ut),Tt==null||Tt(Je),T({type:"onDragOver",event:Je})})},[Ne]),la(()=>{te.current={activatorEvent:z,active:V,activeNode:ae,collisionRect:ee,collisions:fe,droppableRects:I,draggableNodes:L,draggingNode:_e,draggingNodeRect:Ae,droppableContainers:F,over:He,scrollableAncestors:Ee,scrollAdjustedTranslate:Re},_.current={initial:Ae,translated:ee}},[V,ae,fe,ee,L,_e,Ae,I,F,He,Ee,Re]),uee({...ue,delta:q,draggingRect:ee,pointerCoordinates:Ve,scrollableAncestors:Ee,scrollableAncestorRects:xe});const yt=v.useMemo(()=>({active:V,activeNode:ae,activeNodeRect:Se,activatorEvent:z,collisions:fe,containerNodeRect:Le,dragOverlay:ye,draggableNodes:L,droppableContainers:F,droppableRects:I,over:He,measureDroppableContainers:Q,scrollableAncestors:Ee,scrollableAncestorRects:xe,measuringConfiguration:G,measuringScheduled:le,windowRect:J}),[V,ae,Se,z,fe,Le,ye,L,F,I,He,Q,Ee,xe,G,le,J]),Nt=v.useMemo(()=>({activatorEvent:z,activators:zt,active:V,activeNodeRect:Se,ariaDescribedById:{draggable:P},dispatch:E,draggableNodes:L,over:He,measureDroppableContainers:Q}),[z,zt,V,Se,E,P,L,He,Q]);return Fe.createElement(xD.Provider,{value:k},Fe.createElement(Lm.Provider,{value:Nt},Fe.createElement(jD.Provider,{value:yt},Fe.createElement(zD.Provider,{value:ze},d)),Fe.createElement(Iee,{disabled:(c==null?void 0:c.restoreFocus)===!1})),Fe.createElement(jJ,{...c,hiddenTextDescribedById:P}));function it(){const ft=(B==null?void 0:B.autoScrollEnabled)===!1,bt=typeof f=="object"?f.enabled===!1:f===!1,Ke=A&&!ft&&!bt;return typeof f=="object"?{...f,enabled:Ke}:{enabled:Ke}}}),jee=v.createContext(null),iM="button",zee="Draggable";function Fee(e){let{id:t,data:n,disabled:r=!1,attributes:a}=e;const o=sf(zee),{activators:l,activatorEvent:c,active:f,activeNodeRect:d,ariaDescribedById:m,draggableNodes:h,over:y}=v.useContext(Lm),{role:g=iM,roleDescription:w="draggable",tabIndex:C=0}=a??{},R=(f==null?void 0:f.id)===t,E=v.useContext(R?zD:jee),[T,k]=Vp(),[M,D]=Vp(),A=Eee(l,t),N=Ad(n);la(()=>(h.set(t,{id:t,key:o,node:T,activatorNode:M,data:N}),()=>{const q=h.get(t);q&&q.key===o&&h.delete(t)}),[h,t]);const L=v.useMemo(()=>({role:g,tabIndex:C,"aria-disabled":r,"aria-pressed":R&&g===iM?!0:void 0,"aria-roledescription":w,"aria-describedby":m.draggable}),[r,g,C,R,w,m.draggable]);return{active:f,activatorEvent:c,activeNodeRect:d,attributes:L,isDragging:R,listeners:r?void 0:A,node:T,over:y,setNodeRef:k,setActivatorNodeRef:D,transform:E}}function Bee(){return v.useContext(jD)}const Hee="Droppable",Uee={timeout:25};function qee(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:a}=e;const o=sf(Hee),{active:l,dispatch:c,over:f,measureDroppableContainers:d}=v.useContext(Lm),m=v.useRef({disabled:n}),h=v.useRef(!1),y=v.useRef(null),g=v.useRef(null),{disabled:w,updateMeasurementsFor:C,timeout:R}={...Uee,...a},E=Ad(C??r),T=v.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{d(Array.isArray(E.current)?E.current:[E.current]),g.current=null},R)},[R]),k=Pm({callback:T,disabled:w||!l}),M=v.useCallback((L,q)=>{k&&(q&&(k.unobserve(q),h.current=!1),L&&k.observe(L))},[k]),[D,A]=Vp(M),N=Ad(t);return v.useEffect(()=>{!k||!D.current||(k.disconnect(),h.current=!1,k.observe(D.current))},[D,k]),v.useEffect(()=>(c({type:er.RegisterDroppable,element:{id:r,key:o,disabled:n,node:D,rect:y,data:N}}),()=>c({type:er.UnregisterDroppable,key:o,id:r})),[r]),v.useEffect(()=>{n!==m.current.disabled&&(c({type:er.SetDroppableDisabled,id:r,key:o,disabled:n}),m.current.disabled=n)},[r,o,n,c]),{active:l,rect:y,isOver:(f==null?void 0:f.id)===r,node:D,over:f,setNodeRef:A}}function lf(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Vee(e,t){return e.reduce((n,r,a)=>{const o=t.get(r);return o&&(n[a]=o),n},Array(e.length))}function Kh(e){return e!==null&&e>=0}function $ee(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Wee(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const FD=e=>{let{rects:t,activeIndex:n,overIndex:r,index:a}=e;const o=lf(t,r,n),l=t[a],c=o[a];return!c||!l?null:{x:c.left-l.left,y:c.top-l.top,scaleX:c.width/l.width,scaleY:c.height/l.height}},Gh={scaleX:1,scaleY:1},Tw=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:a,rects:o,overIndex:l}=e;const c=(t=o[n])!=null?t:r;if(!c)return null;if(a===n){const d=o[l];return d?{x:0,y:n<l?d.top+d.height-(c.top+c.height):d.top-c.top,...Gh}:null}const f=Yee(o,a,n);return a>n&&a<=l?{x:0,y:-c.height-f,...Gh}:a<n&&a>=l?{x:0,y:c.height+f,...Gh}:{x:0,y:0,...Gh}};function Yee(e,t,n){const r=e[t],a=e[t-1],o=e[t+1];return r?n<t?a?r.top-(a.top+a.height):o?o.top-(r.top+r.height):0:o?o.top-(r.top+r.height):a?r.top-(a.top+a.height):0:0}const BD="Sortable",HD=Fe.createContext({activeIndex:-1,containerId:BD,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:FD,disabled:{draggable:!1,droppable:!1}});function kw(e){let{children:t,id:n,items:r,strategy:a=FD,disabled:o=!1}=e;const{active:l,dragOverlay:c,droppableRects:f,over:d,measureDroppableContainers:m}=Bee(),h=sf(BD,n),y=c.rect!==null,g=v.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),w=l!=null,C=l?g.indexOf(l.id):-1,R=d?g.indexOf(d.id):-1,E=v.useRef(g),T=!$ee(g,E.current),k=R!==-1&&C===-1||T,M=Wee(o);la(()=>{T&&w&&m(g)},[T,g,w,m]),v.useEffect(()=>{E.current=g},[g]);const D=v.useMemo(()=>({activeIndex:C,containerId:h,disabled:M,disableTransforms:k,items:g,overIndex:R,useDragOverlay:y,sortedRects:Vee(g,f),strategy:a}),[C,h,M.draggable,M.droppable,k,g,R,f,y,a]);return Fe.createElement(HD.Provider,{value:D},t)}const Kee=e=>{let{id:t,items:n,activeIndex:r,overIndex:a}=e;return lf(n,r,a).indexOf(t)},Gee=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:a,items:o,newIndex:l,previousItems:c,previousContainerId:f,transition:d}=e;return!d||!r||c!==o&&a===l?!1:n?!0:l!==a&&t===f},Xee={duration:200,easing:"ease"},UD="transform",Qee=Js.Transition.toString({property:UD,duration:0,easing:"linear"}),Zee={roleDescription:"sortable"};function Jee(e){let{disabled:t,index:n,node:r,rect:a}=e;const[o,l]=v.useState(null),c=v.useRef(n);return la(()=>{if(!t&&n!==c.current&&r.current){const f=a.current;if(f){const d=Uc(r.current,{ignoreTransform:!0}),m={x:f.left-d.left,y:f.top-d.top,scaleX:f.width/d.width,scaleY:f.height/d.height};(m.x||m.y)&&l(m)}}n!==c.current&&(c.current=n)},[t,n,r,a]),v.useEffect(()=>{o&&l(null)},[o]),o}function Mw(e){let{animateLayoutChanges:t=Gee,attributes:n,disabled:r,data:a,getNewIndex:o=Kee,id:l,strategy:c,resizeObserverConfig:f,transition:d=Xee}=e;const{items:m,containerId:h,activeIndex:y,disabled:g,disableTransforms:w,sortedRects:C,overIndex:R,useDragOverlay:E,strategy:T}=v.useContext(HD),k=ete(r,g),M=m.indexOf(l),D=v.useMemo(()=>({sortable:{containerId:h,index:M,items:m},...a}),[h,a,M,m]),A=v.useMemo(()=>m.slice(m.indexOf(l)),[m,l]),{rect:N,node:L,isOver:q,setNodeRef:F}=qee({id:l,data:D,disabled:k.droppable,resizeObserverConfig:{updateMeasurementsFor:A,...f}}),{active:Y,activatorEvent:_,activeNodeRect:V,attributes:$,setNodeRef:B,listeners:j,isDragging:z,over:H,setActivatorNodeRef:K,transform:P}=Fee({id:l,data:D,attributes:{...Zee,...n},disabled:k.draggable}),U=CJ(F,B),G=!!Y,I=G&&!w&&Kh(y)&&Kh(R),Q=!E&&z,le=Q&&I?P:null,Z=I?le??(c??T)({rects:C,activeNodeRect:V,activeIndex:y,overIndex:R,index:M}):null,ue=Kh(y)&&Kh(R)?o({id:l,items:m,activeIndex:y,overIndex:R}):M,ve=Y==null?void 0:Y.id,Se=v.useRef({activeId:ve,items:m,newIndex:ue,containerId:h}),Le=m!==Se.current.items,te=t({active:Y,containerId:h,isDragging:z,isSorting:G,id:l,index:M,items:m,newIndex:Se.current.newIndex,previousItems:Se.current.items,previousContainerId:Se.current.containerId,transition:d,wasDragging:Se.current.activeId!=null}),he=Jee({disabled:!te,index:M,node:L,rect:N});return v.useEffect(()=>{G&&Se.current.newIndex!==ue&&(Se.current.newIndex=ue),h!==Se.current.containerId&&(Se.current.containerId=h),m!==Se.current.items&&(Se.current.items=m)},[G,ue,h,m]),v.useEffect(()=>{if(ve===Se.current.activeId)return;if(ve!=null&&Se.current.activeId==null){Se.current.activeId=ve;return}const _e=setTimeout(()=>{Se.current.activeId=ve},50);return()=>clearTimeout(_e)},[ve]),{active:Y,activeIndex:y,attributes:$,data:D,rect:N,index:M,newIndex:ue,items:m,isOver:q,isSorting:G,isDragging:z,listeners:j,node:L,overIndex:R,over:H,setNodeRef:U,setActivatorNodeRef:K,setDroppableNodeRef:F,setDraggableNodeRef:B,transform:he??Z,transition:ye()};function ye(){if(he||Le&&Se.current.newIndex===M)return Qee;if(!(Q&&!xw(_)||!d)&&(G||te))return Js.Transition.toString({...d,property:UD})}}function ete(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Yp(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const tte=[rn.Down,rn.Right,rn.Up,rn.Left],nte=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:a,droppableContainers:o,over:l,scrollableAncestors:c}}=t;if(tte.includes(e.code)){if(e.preventDefault(),!n||!r)return;const f=[];o.getEnabled().forEach(h=>{if(!h||h!=null&&h.disabled)return;const y=a.get(h.id);if(y)switch(e.code){case rn.Down:r.top<y.top&&f.push(h);break;case rn.Up:r.top>y.top&&f.push(h);break;case rn.Left:r.left>y.left&&f.push(h);break;case rn.Right:r.left<y.left&&f.push(h);break}});const d=BJ({collisionRect:r,droppableRects:a,droppableContainers:f});let m=ED(d,"id");if(m===(l==null?void 0:l.id)&&d.length>1&&(m=d[1].id),m!=null){const h=o.get(n.id),y=o.get(m),g=y?a.get(y.id):null,w=y==null?void 0:y.node.current;if(w&&g&&h&&y){const R=Im(w).some((A,N)=>c[N]!==A),E=qD(h,y),T=rte(h,y),k=R||!E?{x:0,y:0}:{x:T?r.width-g.width:0,y:T?r.height-g.height:0},M={x:g.left,y:g.top};return k.x&&k.y?M:Nd(M,k)}}}};function qD(e,t){return!Yp(e)||!Yp(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function rte(e,t){return!Yp(e)||!Yp(t)||!qD(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function VD({status:e}){return S.jsx("span",{className:Pe("size-2 shrink-0 rounded-full",e==="running"?"bg-emerald-500 animate-pulse":e==="error"?"bg-destructive":e==="waiting_confirmation"?"bg-amber-500":"bg-muted-foreground/40")})}function Aw(){return zJ(ev(ID,{activationConstraint:{distance:8}}),ev(PD,{activationConstraint:{delay:250,tolerance:5}}),ev(Ew,{coordinateGetter:nte}))}function ite(){const{t:e}=mn(),t=qi(),n=Hd(),{isMobile:r,setOpenMobile:a}=Ur(),{toggleDevice:o}=bV(),l=an(ee=>ee.sessions),c=an(ee=>ee.activeSessionId),f=Bi(ee=>ee.setSidebarTab);v.useEffect(()=>{const ee=an.getState();ee.ensureInitialized(),ee.loadSessions()},[]);const d=Us("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),m=d==null?void 0:d.params.deviceId,h=d==null?void 0:d.params.windowId,y=d==null?void 0:d.params.paneId,g=kn(ee=>ee.snapshots),w=kn(ee=>ee.connectedDevices),C=kn(ee=>ee.closeWindow),R=kn(ee=>ee.closePane),E=kn(ee=>ee.renameWindow),T=Xs(ee=>{var fe;return((fe=ee.settings)==null?void 0:fe.language)??"en_US"}),{data:k}=Ei({queryKey:["devices"],queryFn:async()=>{const ee=await fetch("/api/devices");if(!ee.ok)throw new Error("Failed to fetch devices");return ee.json()},throwOnError:!1}),M=kn(ee=>ee.hydrateDeviceErrors);v.useEffect(()=>{k!=null&&k.devices&&M(k.devices.map(ee=>({deviceId:ee.id,lastError:ee.lastError??null,lastErrorType:ee.lastErrorType??null})))},[k,M]);const D=v.useCallback((ee,fe)=>{n(ee,{replace:(fe==null?void 0:fe.replace)??!0}),r&&!(fe!=null&&fe.keepSidebarOpen)&&a(!1)},[n,r,a]),A=v.useCallback((ee,fe,Ne,He)=>{F.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:ee,windowId:fe,paneId:Ne}})),D(`/devices/${ee}/windows/${fe}/panes/${fw(Ne)}`,{keepSidebarOpen:He==null?void 0:He.keepSidebarOpen})},[D]),N=v.useCallback(ee=>{var fe,Ne;if(an.getState().setActiveSession(ee.id),f("agent"),ee.deviceId&&ee.paneId){const He=(Ne=(fe=kn.getState().snapshots[ee.deviceId])==null?void 0:fe.session)==null?void 0:Ne.windows,$e=He==null?void 0:He.find(et=>et.panes.some(ze=>ze.id===ee.paneId));$e&&A(ee.deviceId,$e.id,ee.paneId,{keepSidebarOpen:!0})}},[f,A]),L=v.useCallback((ee,fe,Ne)=>{A(ee,fe,Ne.id,{keepSidebarOpen:!0}),an.getState().startDraft(ee,Ne.id,Ne.title??null),f("agent")},[A,f]),q=kn(ee=>ee.selectWindow),F=v.useRef(null);v.useEffect(()=>{var Ze,tt;const ee=F.current;if(!ee)return;if(Date.now()-ee.at>5e3){F.current=null;return}const{deviceId:fe,windowId:Ne}=ee,He=g[fe],$e=(Ze=He==null?void 0:He.session)==null?void 0:Ze.windows;if(!$e)return;const et=$e.find(Rt=>Rt.id===Ne);if(!((tt=et==null?void 0:et.panes)!=null&&tt.length))return;F.current=null;const ze=et.panes.find(Rt=>Rt.active)??et.panes[0];A(fe,Ne,ze.id)},[g,A]);const Y=v.useCallback((ee,fe,Ne)=>{q(ee,fe);const He=Ne.find($e=>$e.active)??Ne[0];He?(A(ee,fe,He.id),F.current=null):F.current={deviceId:ee,windowId:fe,at:Date.now()}},[A,q]),_=v.useCallback((ee,fe)=>{fe?ee===m&&D("/devices"):D(`/devices/${ee}`),o(ee,fe)},[o,m,D]),V=v.useCallback((ee,fe)=>{ee===m&&fe===h&&D("/devices"),C(ee,fe)},[C,m,h,D]),[$,B]=v.useState(null),j=v.useCallback((ee,fe)=>{var $e,et;const Ne=(et=($e=kn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Ne==null?void 0:Ne.find(ze=>ze.id===fe);B({kind:"window",deviceId:ee,windowId:fe,name:He?IV(He):""})},[]),z=v.useCallback((ee,fe,Ne)=>{var et,ze,Ze,tt;const He=(ze=(et=kn.getState().snapshots[ee])==null?void 0:et.session)==null?void 0:ze.windows,$e=(tt=(Ze=He==null?void 0:He.find(Rt=>Rt.id===fe))==null?void 0:Ze.panes)==null?void 0:tt.find(Rt=>Rt.id===Ne);B({kind:"pane",deviceId:ee,paneId:Ne,name:($e==null?void 0:$e.title)||`Pane ${($e==null?void 0:$e.index)??""}`})},[]),H=v.useCallback(()=>{$&&($.kind==="window"?V($.deviceId,$.windowId):R($.deviceId,$.paneId),B(null))},[$,V,R]),[K,P]=v.useState(null),[U,G]=v.useState(""),I=v.useCallback((ee,fe)=>{var $e,et;const Ne=(et=($e=kn.getState().snapshots[ee])==null?void 0:$e.session)==null?void 0:et.windows,He=Ne==null?void 0:Ne.find(ze=>ze.id===fe);He&&(G(He.customName??U0(He).title),P({deviceId:ee,windowId:fe,hasCustomName:!!He.customName}))},[]),Q=v.useCallback(()=>{if(!K)return;const ee=U.trim();ee&&(E(K.deviceId,K.windowId,ee),P(null))},[K,U,E]),le=v.useCallback(()=>{K&&(E(K.deviceId,K.windowId,""),P(null))},[K,E]),ae=v.useCallback(ee=>{kn.getState().createWindow(ee)},[]),[Z,ue]=v.useState(null),ve=v.useCallback((ee,fe)=>{ue({deviceId:ee,paneId:fe})},[]),[Se,Le]=v.useState(null),[te,he]=v.useState(""),[ye,_e]=v.useState(null),Ae=v.useCallback(ee=>{he(ee.title),Le(ee)},[]),Ce=v.useCallback(()=>{if(!Se)return;const ee=te.trim();ee&&(an.getState().renameSession(Se.id,ee),Le(null))},[Se,te]),Te=v.useCallback(ee=>{_e(ee)},[]),J=v.useCallback(()=>{ye&&(an.getState().deleteSession(ye.id),_e(null))},[ye]),Ee=el(),xe=Aw(),Be=yd({mutationFn:async ee=>{const fe=await fetch("/api/devices/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceIds:ee})});if(!fe.ok)throw new Error("Failed to reorder devices");return fe.json()},onMutate:async ee=>{await Ee.cancelQueries({queryKey:["devices"]});const fe=Ee.getQueryData(["devices"]);if(fe){const Ne=new Map(fe.devices.map(et=>[et.id,et])),He=ee.map((et,ze)=>{const Ze=Ne.get(et);return Ze?{...Ze,sortOrder:ze}:void 0}).filter(et=>et!==void 0),$e=fe.devices.filter(et=>!ee.includes(et.id));Ee.setQueryData(["devices"],{devices:[...He,...$e]})}return{previous:fe}},onError:(ee,fe,Ne)=>{Ne!=null&&Ne.previous&&Ee.setQueryData(["devices"],Ne.previous),sn.error(e("device.reorderFailed"))},onSettled:()=>{Ee.invalidateQueries({queryKey:["devices"]})}}),Ve=(k==null?void 0:k.devices)??[],De=v.useMemo(()=>[...Ve].sort((ee,fe)=>ee.sortOrder-fe.sortOrder||ee.name.localeCompare(fe.name,NM(T),{numeric:!0,sensitivity:"base"})),[Ve,T]),ut=v.useCallback(ee=>{const{active:fe,over:Ne}=ee;if(!Ne||fe.id===Ne.id)return;const He=De.map(ze=>ze.id),$e=He.indexOf(String(fe.id)),et=He.indexOf(String(Ne.id));$e<0||et<0||Be.mutate(lf(He,$e,et))},[De,Be]),{sessionsByPane:pe,orphanSessions:Re}=v.useMemo(()=>{const ee=new Set(Ve.map($e=>$e.id)),fe=new Map,Ne=[],He=Object.values(l).filter($e=>!!$e).sort(($e,et)=>$e.updatedAt<et.updatedAt?1:-1);for(const $e of He){if(!$e.deviceId||!$e.paneId||!ee.has($e.deviceId)){Ne.push($e);continue}const et=`${$e.deviceId}:${$e.paneId}`,ze=fe.get(et);ze?ze.push($e):fe.set(et,[$e])}return{sessionsByPane:fe,orphanSessions:Ne}},[l,Ve]);return S.jsxs(F0,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[S.jsx(Rw,{sensors:xe,collisionDetection:ww,onDragEnd:ut,children:S.jsx(QO,{className:"flex-1 min-h-0",children:S.jsxs("div",{className:"space-y-1.5 pb-2 pt-1 select-none [-webkit-user-select:none] [-webkit-touch-callout:none]",children:[S.jsx(kw,{items:De.map(ee=>ee.id),strategy:Tw,children:De.map(ee=>{var fe,Ne;return S.jsx(ate,{device:ee,windows:((Ne=(fe=g[ee.id])==null?void 0:fe.session)==null?void 0:Ne.windows)??null,isConnected:w.has(ee.id),isSelected:ee.id===m,selectedWindowId:h,selectedPaneId:y,onConnectToggle:()=>_(ee.id,w.has(ee.id)),onCreateWindow:ae,onCloseWindow:j,onClosePane:z,onRenameWindow:I,onPaneClick:A,onWindowClick:Y,onWatchPane:ve,sessionsByPane:pe,activeSessionId:c,onSelectSession:N,onCreateSessionForPane:L,onRenameSession:Ae,onDeleteSession:Te},ee.id)})}),De.length===0&&S.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),Re.length>0&&S.jsx(lte,{sessions:Re,activeSessionId:c,onSelectSession:N,onRenameSession:Ae,onDeleteSession:Te})]})})}),S.jsx(dx,{open:$!==null,onOpenChange:ee=>!ee&&B(null),children:S.jsxs(fx,{children:[S.jsxs(hx,{children:[S.jsx(qk,{className:"bg-destructive/10",children:S.jsx(Va,{className:"h-5 w-5 text-destructive"})}),S.jsx(mx,{children:($==null?void 0:$.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),S.jsx(gx,{children:e("window.closeConfirmDesc",{name:($==null?void 0:$.name)??""})})]}),S.jsxs(px,{children:[S.jsx(bx,{children:e("common.cancel")}),S.jsx(yx,{variant:"destructive",disabled:!$,onClick:H,children:e("common.close")})]})]})}),S.jsx(vx,{open:K!==null,onOpenChange:ee=>!ee&&P(null),children:S.jsx(xx,{"data-testid":"window-rename-dialog",children:S.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Q()},children:[S.jsxs(wx,{children:[S.jsx(Sx,{children:e("window.rename")}),S.jsx(lD,{children:e("window.renameDesc")})]}),S.jsx("div",{className:"py-4",children:S.jsx(Pi,{autoFocus:!0,maxLength:64,value:U,onChange:ee=>G(ee.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),S.jsxs(Vk,{children:[(K==null?void 0:K.hasCustomName)&&S.jsx(Ht,{type:"button",variant:"ghost",onClick:le,"data-testid":"window-rename-reset",children:e("window.renameReset")}),S.jsx(Ht,{type:"button",variant:"outline",onClick:()=>P(null),children:e("common.cancel")}),S.jsx(Ht,{type:"submit",disabled:!U.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),S.jsx(vx,{open:Se!==null,onOpenChange:ee=>!ee&&Le(null),children:S.jsx(xx,{"data-testid":"agent-session-rename-dialog",children:S.jsxs("form",{onSubmit:ee=>{ee.preventDefault(),Ce()},children:[S.jsx(wx,{children:S.jsx(Sx,{children:e("agent.session.renameTitle")})}),S.jsx("div",{className:"py-4",children:S.jsx(Pi,{autoFocus:!0,maxLength:120,value:te,onChange:ee=>he(ee.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),S.jsxs(Vk,{children:[S.jsx(Ht,{type:"button",variant:"outline",onClick:()=>Le(null),children:e("agent.session.cancel")}),S.jsx(Ht,{type:"submit",disabled:!te.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),S.jsx(dx,{open:ye!==null,onOpenChange:ee=>!ee&&_e(null),children:S.jsxs(fx,{children:[S.jsxs(hx,{children:[S.jsx(qk,{className:"bg-destructive/10",children:S.jsx(Va,{className:"h-5 w-5 text-destructive"})}),S.jsx(mx,{children:e("agent.session.deleteTitle")}),S.jsx(gx,{children:e("agent.session.deleteDesc",{title:(ye==null?void 0:ye.title)??""})})]}),S.jsxs(px,{children:[S.jsx(bx,{children:e("common.cancel")}),S.jsx(yx,{variant:"destructive",disabled:!ye,onClick:J,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),Z&&S.jsx(wJ,{open:!0,onOpenChange:ee=>!ee&&ue(null),deviceId:Z.deviceId,paneId:Z.paneId})]})}function ate({device:e,windows:t,isConnected:n,isSelected:r,selectedWindowId:a,selectedPaneId:o,onConnectToggle:l,onCreateWindow:c,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onPaneClick:h,onWindowClick:y,onWatchPane:g,sessionsByPane:w,activeSessionId:C,onSelectSession:R,onCreateSessionForPane:E,onRenameSession:T,onDeleteSession:k}){const{t:M}=mn(),D=e.type==="local"?vm:L0,{attributes:A,listeners:N,setNodeRef:L,setActivatorNodeRef:q,transform:F,transition:Y,isDragging:_}=Mw({id:e.id}),V=Aw(),$=B=>{const{active:j,over:z}=B;if(!z||j.id===z.id||!t)return;const H=t.map(U=>U.id),K=H.indexOf(String(j.id)),P=H.indexOf(String(z.id));K<0||P<0||kn.getState().reorderWindows(e.id,lf(H,K,P))};return S.jsxs("div",{ref:L,style:{transform:Js.Translate.toString(F),transition:Y},"data-testid":`device-item-${e.id}`,className:Pe("group/device rounded-xl border border-border/60 overflow-hidden",r?"bg-chat-surface":n?"bg-muted/40":"bg-muted/20",_&&"opacity-60 shadow-lg"),onClick:n?void 0:l,children:[S.jsxs("div",{className:"relative px-3 py-1.5",children:[r&&S.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("button",{type:"button",ref:q,...A,...N,"aria-label":M("device.dragHandle"),onClick:B=>B.stopPropagation(),className:"touch-none cursor-grab shrink-0 -ml-1 text-muted-foreground/50 hover:text-muted-foreground opacity-100",children:S.jsx(_0,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),S.jsx(D,{className:"h-4 w-4 text-muted-foreground shrink-0"}),S.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),S.jsx(FZ,{deviceId:e.id,className:"shrink-0"}),S.jsx("div",{className:Pe("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),S.jsx(Ht,{variant:"ghost",size:"icon-xs",onClick:B=>{B.stopPropagation(),l()},"data-testid":n?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:M(n?"device.disconnect":"device.connect"),children:n?S.jsx(s9,{className:"h-3.5 w-3.5 text-orange-500"}):S.jsx(c9,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&S.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&S.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("device.connecting")}),(t==null?void 0:t.length)===0&&S.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:M("window.noWindows")}),t&&t.length>0&&S.jsx(Rw,{sensors:V,collisionDetection:ww,onDragEnd:$,children:S.jsx(kw,{items:t.map(B=>B.id),strategy:Tw,children:t.map(B=>S.jsx(ote,{deviceId:e.id,window:B,isSelected:B.id===a,selectedPaneId:o,onPaneClick:h,onWindowClick:y,onCloseWindow:f,onClosePane:d,onRenameWindow:m,onWatchPane:g,sessionsByPane:w,activeSessionId:C,onSelectSession:R,onCreateSessionForPane:E,onRenameSession:T,onDeleteSession:k},B.id))})}),S.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:B=>B.stopPropagation(),onMouseDown:B=>B.stopPropagation(),onClick:()=>c(e.id),className:"w-full flex items-center gap-2 px-2 py-1.5 rounded-md text-left transition-colors text-muted-foreground hover:text-foreground hover:bg-accent/30 border border-dashed border-border/50 hover:border-border",children:[S.jsx(wm,{className:"h-3.5 w-3.5 shrink-0"}),S.jsx("span",{className:"text-xs",children:M("window.new")})]})]})]})}function ote({deviceId:e,window:t,isSelected:n,selectedPaneId:r,onPaneClick:a,onWindowClick:o,onCloseWindow:l,onClosePane:c,onRenameWindow:f,onWatchPane:d,sessionsByPane:m,activeSessionId:h,onSelectSession:y,onCreateSessionForPane:g,onRenameSession:w,onDeleteSession:C}){const{t:R}=mn(),{isMobile:E}=Ur(),T=t.panes.length>1,k=U0(t),M=t.panes.find(B=>B.id===r),D=n&&!!M,{attributes:A,listeners:N,setNodeRef:L,setActivatorNodeRef:q,transform:F,transition:Y,isDragging:_}=Mw({id:t.id}),V=Aw(),$=B=>{const{active:j,over:z}=B;if(!z||j.id===z.id)return;const H=t.panes.map(U=>U.id),K=H.indexOf(String(j.id)),P=H.indexOf(String(z.id));K<0||P<0||kn.getState().reorderPanes(e,t.id,lf(H,K,P))};return S.jsxs("div",{ref:L,style:{transform:Js.Translate.toString(F),transition:Y},className:Pe("space-y-1",_&&"opacity-60"),children:[S.jsxs("div",{className:"group relative flex items-center gap-1",children:[S.jsx("button",{type:"button",ref:q,...A,...N,"aria-label":R("window.dragHandle"),onClick:B=>B.stopPropagation(),className:Pe("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",E?"h-9 w-4":"h-6 w-3.5 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:S.jsx(_0,{className:Pe(E?"h-4 w-4":"h-3.5 w-3.5")})}),S.jsxs("button",{type:"button",onClick:()=>o(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:Pe("flex-1 min-w-0 flex items-center gap-2 px-2 py-1.5 rounded-lg text-left transition-colors pr-7 [@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:pr-12",E&&"py-2.5 pr-13",D?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:[S.jsx(Zs,{variant:D?"default":"outline",className:"h-5 text-[10px] px-1.5 shrink-0",children:t.index}),S.jsxs("span",{className:"flex-1 min-w-0",children:[S.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:k.title}),k.processName&&S.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:k.processName})]})]}),S.jsxs(pw,{children:[S.jsx(mw,{"data-testid":`window-menu-${t.id}`,"aria-label":R("window.menu"),title:R("window.menu"),className:Pe("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",E?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",D?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:S.jsx(oN,{className:Pe(E?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),S.jsxs(gw,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[S.jsxs(ac,{"data-testid":`window-menu-rename-${t.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",E&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>f(e,t.id),children:[S.jsx(xm,{className:Pe("h-4 w-4",E&&"h-5 w-5")}),R("window.rename")]}),S.jsxs(ac,{"data-testid":`window-menu-new-session-${t.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",E&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>g(e,t.id,M||t.panes[0]),children:[S.jsx(wm,{className:Pe("h-4 w-4",E&&"h-5 w-5")}),R("agent.session.new")]}),S.jsxs(ac,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",E&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>l(e,t.id),children:[S.jsx(Va,{className:Pe("h-4 w-4",E&&"h-5 w-5")}),R("window.close")]})]})]})]}),T&&S.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:S.jsx(Rw,{sensors:V,collisionDetection:ww,onDragEnd:$,children:S.jsx(kw,{items:t.panes.map(B=>B.id),strategy:Tw,children:t.panes.map(B=>S.jsx(ste,{deviceId:e,windowId:t.id,pane:B,isActive:B.id===r,isMobile:E,onPaneClick:a,onClosePane:c,onWatchPane:d,sessions:m.get(`${e}:${B.id}`),activeSessionId:h,onSelectSession:y,onRenameSession:w,onDeleteSession:C},B.id))})})}),!T&&t.panes[0]&&S.jsx("div",{className:"ml-[36px] pl-2 border-l border-border/50",children:S.jsx(WD,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:h,onSelectSession:y,onRenameSession:w,onDeleteSession:C})})]})}function ste({deviceId:e,windowId:t,pane:n,isActive:r,isMobile:a,onPaneClick:o,onClosePane:l,onWatchPane:c,sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y}){const{t:g}=mn(),{attributes:w,listeners:C,setNodeRef:R,setActivatorNodeRef:E,transform:T,transition:k,isDragging:M}=Mw({id:n.id});return S.jsxs("div",{ref:R,style:{transform:Js.Translate.toString(T),transition:k},className:Pe("group relative",M&&"opacity-60"),children:[S.jsxs("div",{className:"flex items-center gap-1",children:[S.jsx("button",{type:"button",ref:E,...w,...C,"aria-label":g("window.dragHandlePane"),onClick:D=>D.stopPropagation(),className:Pe("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",a?"h-9 w-4":"h-6 w-3 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:S.jsx(_0,{className:Pe(a?"h-4 w-4":"h-3 w-3")})}),S.jsxs("button",{type:"button",onClick:()=>o(e,t,n.id),"data-testid":`pane-item-${n.id}`,className:Pe("flex-1 min-w-0 flex items-center gap-2 px-2 py-1 rounded-lg text-left transition-colors pr-13 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-21",a&&"py-2.5 pr-24",r?"bg-primary/10 text-primary":n.active?"bg-accent text-accent-foreground":"hover:bg-accent/30 text-muted-foreground"),children:[S.jsx("span",{className:"text-[10px] font-mono opacity-60 w-4",children:n.index}),S.jsx("span",{className:"flex-1 text-xs line-clamp-2 break-all",children:n.title||`Pane ${n.index}`})]})]}),S.jsxs(pw,{children:[S.jsx(mw,{"data-testid":`pane-menu-${n.id}`,"aria-label":g("watch.openMonitor"),className:Pe("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity data-popup-open:opacity-100",a?"h-11 w-11 right-11 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-7 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-10.5 [@media(any-pointer:coarse)]:rounded-lg",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:S.jsx(oN,{className:Pe(a?"h-5 w-5":"h-3.5 w-3.5")})}),S.jsx(gw,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:S.jsxs(ac,{"data-testid":`pane-watch-${n.id}`,className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",a&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>c(e,n.id),children:[S.jsx(d9,{className:Pe("h-4 w-4",a&&"h-5 w-5")}),g("watch.openMonitor")]})})]}),S.jsx("button",{type:"button",onClick:D=>{D.stopPropagation(),l(e,t,n.id)},"data-testid":`pane-close-${n.id}`,className:Pe("absolute top-1/2 -translate-y-1/2 flex items-center justify-center rounded text-muted-foreground hover:bg-background hover:text-foreground transition-opacity",a?"h-11 w-11 right-0 rounded-lg bg-background/40 opacity-100":"h-5 w-5 right-1.5 [@media(any-pointer:coarse)]:h-10 [@media(any-pointer:coarse)]:w-10 [@media(any-pointer:coarse)]:right-0.5 [@media(any-pointer:coarse)]:rounded-lg",r?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:g("window.closePane"),children:S.jsx("span",{className:Pe("leading-none",a?"text-base":"text-xs"),children:"×"})}),S.jsx(WD,{sessions:f,activeSessionId:d,onSelectSession:m,onRenameSession:h,onDeleteSession:y})]})}function $D({session:e,onRenameSession:t,onDeleteSession:n,className:r,enlargeOnTouch:a=!1}){const{t:o}=mn(),{isMobile:l}=Ur(),c=a&&l;return S.jsxs(pw,{children:[S.jsx(mw,{render:S.jsx(Ht,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":o("agent.session.rename"),onClick:f=>f.stopPropagation(),className:Pe("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",l?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",c&&"size-9",r)}),children:S.jsx(b8,{className:Pe("size-3.5",c&&"size-5")})}),S.jsxs(gw,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[S.jsxs(ac,{"data-testid":"agent-session-rename",className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[S.jsx(xm,{className:Pe("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.rename")]}),S.jsxs(ac,{variant:"destructive","data-testid":"agent-session-delete",className:Pe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",l&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[S.jsx(cN,{className:Pe("h-4 w-4",l&&"h-5 w-5")}),o("agent.session.delete")]})]})]})}function WD({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{isMobile:o}=Ur();return S.jsx("div",{className:"mt-1 space-y-0.5 [@media(any-pointer:coarse)]:space-y-1",children:e==null?void 0:e.map(l=>{const c=l.id===t;return S.jsxs("div",{className:"group relative",children:[S.jsxs("button",{type:"button","data-testid":`agent-session-item-${l.id}`,onClick:()=>n(l),className:Pe("w-full flex items-center gap-1.5 px-2 py-1 pr-7 rounded-md text-left transition-colors [@media(any-pointer:coarse)]:min-h-11 [@media(any-pointer:coarse)]:py-2 [@media(any-pointer:coarse)]:pr-12",o&&"min-h-11 py-2 pr-12",c?"bg-primary/10 text-primary":"hover:bg-accent/30 text-muted-foreground"),children:[S.jsx(P0,{className:"size-3 shrink-0 opacity-70"}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:l.title}),S.jsx(VD,{status:l.status})]}),S.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:S.jsx($D,{session:l,onRenameSession:r,onDeleteSession:a,enlargeOnTouch:!0})})]},l.id)})})}function lte({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:r,onDeleteSession:a}){const{t:o}=mn(),[l,c]=v.useState(!1),f=Xs(d=>{var m;return((m=d.settings)==null?void 0:m.language)??"en_US"});return S.jsxs(km,{open:l,onOpenChange:c,className:"rounded-xl border border-border/60 bg-muted/20",children:[S.jsxs(Mm,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[S.jsx(q8,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),S.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:o("agent.orphan.title",{count:e.length})}),S.jsx(Qd,{className:Pe("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",l&&"rotate-90")})]}),S.jsx(Am,{className:"space-y-0.5 px-1.5 pb-1.5",children:e.map(d=>{const m=d.id===t,h=[d.originPaneTitle,d.originProcessName,d.createdAt?new Date(d.createdAt).toLocaleString(NM(f)):null].filter(y=>!!y);return S.jsxs("div",{className:"group relative",children:[S.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${d.id}`,onClick:()=>n(d),className:Pe("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",m?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[S.jsxs("span",{className:"flex items-center gap-1.5",children:[S.jsx(P0,{className:"size-3 shrink-0 opacity-70"}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:d.title}),S.jsx(VD,{status:d.status})]}),h.length>0&&S.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:h.join(" · ")})]}),S.jsx("div",{className:"absolute right-0.5 top-1.5",children:S.jsx($D,{session:d,onRenameSession:r,onDeleteSession:a})})]},d.id)})})]})}function cte(){const{t:e}=mn(),{isMobile:t,setOpenMobile:n}=Ur(),r=Xs(m=>{var h;return(h=m.settings)==null?void 0:h.siteName}),a=Xs(m=>m.fetchSettings);v.useEffect(()=>{a()},[a]);const o=r??"tmex",l=Bi(m=>m.theme),c=Bi(m=>m.setTheme),f=l==="dark",d=()=>{const m=f?"light":"dark";c(m),document.documentElement.classList.toggle("dark",m==="dark")};return S.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&S.jsx("button",{type:"button","data-testid":"mobile-sidebar-close",onClick:()=>n(!1),className:"inline-flex h-8 w-8 ml-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("nav.closeSidebar"),title:e("nav.closeSidebar"),children:S.jsx(Va,{className:"h-4 w-4"})}),S.jsxs(qp,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[S.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:S.jsx("img",{src:"/logo.png",alt:o,className:"h-full w-full object-cover"})}),S.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:o})]}),S.jsx("button",{type:"button",onClick:d,className:"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e(f?"settings.themeLight":"settings.themeDark"),title:e(f?"settings.themeLight":"settings.themeDark"),children:f?S.jsx(C9,{className:"h-4 w-4"}):S.jsx(J8,{className:"h-4 w-4"})}),S.jsx(qp,{to:"/settings",className:"inline-flex h-8 w-8 mr-[-8px] shrink-0 items-center justify-center rounded-md text-muted-foreground hover:bg-sidebar-accent hover:text-foreground","aria-label":e("sidebar.settings"),title:e("sidebar.settings"),children:S.jsx(v9,{className:"h-4 w-4"})})]})}const iv="rounded-lg data-active:bg-background data-active:text-foreground data-active:border-transparent group-data-[variant=default]/tabs-list:data-active:shadow-none dark:data-active:bg-input/60 dark:data-active:border-transparent text-[13px] transition-colors duration-200 [&_svg:not([class*='size-'])]:size-[15px]",ute=[{title:"nav.manageDevices",url:"/devices",icon:vm}];function dte({...e}){const{t}=mn(),n=Bi(a=>a.sidebarTab),r=Bi(a=>a.setSidebarTab);return S.jsxs(vq,{variant:"inset",...e,children:[S.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),S.jsxs(Eq,{className:"gap-5 pt-3 pb-0",children:[S.jsx(cte,{}),S.jsx(PZ,{className:"mb-2.5",value:n,onValueChange:a=>r(a),children:S.jsxs(_Z,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[S.jsxs(Qb,{value:"panes","data-testid":"sidebar-tab-panes",className:iv,children:[S.jsx(r9,{}),t("sidebar.tab.panes")]}),S.jsxs(Qb,{value:"agent","data-testid":"sidebar-tab-agent",className:iv,children:[S.jsx(P0,{}),t("sidebar.tab.agent")]}),S.jsxs(Qb,{value:"files","data-testid":"sidebar-tab-files",className:iv,children:[S.jsx(L8,{}),t("sidebar.tab.files")]})]})})]}),S.jsxs(Rq,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&S.jsx(ite,{}),n==="agent"&&S.jsx(PQ,{}),n==="files"&&S.jsx(bZ,{})]}),n==="panes"&&S.jsxs(Cq,{children:[S.jsx(jZ,{items:ute}),S.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let aM=!1;function fte(e,t,n){var a,o,l;let r=n;if(!r){const c=(o=(a=kn.getState().snapshots[e])==null?void 0:a.session)==null?void 0:o.windows;r=(l=c==null?void 0:c.find(f=>f.panes.some(d=>d.id===t)))==null?void 0:l.id}return r?`/devices/${e}/windows/${r}/panes/${fw(t)}`:`/devices/${e}`}function hte(e,t){const n=e.getQueriesData({queryKey:["watch-rules"]});for(const[,r]of n){const a=r==null?void 0:r.find(o=>o.id===t);if(a)return a.name}return null}async function pte(e,t){var r;const n=hte(e,t);if(n)return n;try{const a=await fetch(`/api/watch/rules/${t}`);return a.ok?((r=(await a.json()).rule)==null?void 0:r.name)??null:null}catch{return null}}function mte(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const r=new Notification(e,{body:t});r.onclick=()=>{window.focus(),window.location.href=n}}catch{}}function gte(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function yte(e,t,n,r,a){const l=await pte(e,t)??hn.t("watch.toast.triggeredTitle"),c=a.summary||a.matchedText||"",f=c.length>200?`${c.slice(0,200)}…`:c,d=fte(n,r,a.windowId);sn(l,{description:f,action:{label:hn.t("watch.toast.openTerminal"),onClick:()=>{window.location.href=d}}}),mte(l,f,d)}function bte(e){if(aM)return;aM=!0,Dn().onMessage(n=>{if(n.kind!==N_)return;let r;try{r=_a(jj,n.payload)}catch(o){console.error("[watch] failed to decode WATCH_EVENT:",o);return}let a;try{a=JSON.parse(new TextDecoder().decode(r.payload))}catch(o){console.error("[watch] failed to parse WATCH_EVENT payload:",o);return}switch(gte(e,r.ruleId),r.eventType){case V_:yte(e,r.ruleId,r.deviceId,r.paneId,a);return;case $_:{const o=a;sn.warning(hn.t("watch.toast.modelUnavailableTitle"),{description:`${o.message} ${hn.t("watch.toast.modelUnavailableHint")}`});return}case W_:{const o=a;sn.error(hn.t("watch.toast.ruleErrorTitle"),{description:o.message});return}default:return}})}function vte(){const e=el();return v.useEffect(()=>{bte(e),Dn().connect()},[e]),null}const xte=60,wte=.02;function Ste(e){if(Math.abs(e.viewportScale-1)>wte)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=xte?t:0}function Gte(){if(typeof navigator>"u")return!1;const e=navigator.userAgent,t=/iPad|iPhone|iPod/.test(e),n=navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1;return t||n}function Ete(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}function Cte(e){const[t,n]=v.useState(0);return v.useEffect(()=>{if(!Ete())return;const r=window.visualViewport;if(!r)return;let a=null;const o=()=>{if(e){n(0);return}const c=document.activeElement;if(!(c instanceof Element&&c.closest("[data-virtual-keyboard-avoid]")!==null)){n(0);return}n(Ste({windowInnerHeight:window.innerHeight,viewportHeight:r.height,viewportOffsetTop:r.offsetTop,viewportScale:r.scale}))},l=()=>{a===null&&(a=window.requestAnimationFrame(()=>{a=null,o()}))};return o(),r.addEventListener("resize",l),r.addEventListener("scroll",l),window.addEventListener("resize",l),document.addEventListener("focusin",l),document.addEventListener("focusout",l),()=>{r.removeEventListener("resize",l),r.removeEventListener("scroll",l),window.removeEventListener("resize",l),document.removeEventListener("focusin",l),document.removeEventListener("focusout",l),a!==null&&window.cancelAnimationFrame(a)}},[e]),t}console.info(`tmex ${WL("0.11.0",!0)}`);function Rte(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const n=JSON.parse(t),r=(e=n==null?void 0:n.state)==null?void 0:e.theme,a=r==="dark"||r===void 0;document.documentElement.classList.toggle("dark",a)}catch{document.documentElement.classList.add("dark")}}Rte();const Tte=new NL({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function kte(){const{openMobile:e}=Ur(),t=Bi(n=>n.theme);return v.useEffect(()=>{const n=e?"--sidebar":"--background";document.body.style.backgroundColor=`var(${n})`,requestAnimationFrame(()=>{var o;const a=getComputedStyle(document.body).backgroundColor;(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",a)})},[e,t]),null}function Mte(){return S.jsxs(vV,{children:[S.jsx(vte,{}),S.jsxs(bq,{children:[S.jsx(kte,{}),S.jsx(_q,{}),S.jsx(dte,{}),S.jsx(Ate,{})]})]})}function Ate(){const{openMobile:e}=Ur(),t=Cte(e);return S.jsxs(Sq,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:t>0?{transform:`translateY(-${t}px)`,transition:"transform 0.12s ease-out"}:void 0,children:[S.jsx(o3,{}),S.jsx("div",{style:{height:t>0?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function Vl({moduleLoader:e}){const[t,n]=v.useState(null),r=z4();v.useEffect(()=>{e().then(n)},[e]);const a=t==null?void 0:t.default,o=t==null?void 0:t.PageTitle,l=t==null?void 0:t.PageActions;return S.jsxs(S.Fragment,{children:[S.jsxs("header",{className:"sticky top-0 z-10 flex h-12 md:h-16 shrink-0 items-center justify-between gap-2 bg-background/95 backdrop-blur-sm","data-testid":"mobile-topbar",children:[S.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[S.jsx(wq,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),S.jsx(kH,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),S.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:o?S.jsx(o,{...r}):""})]}),S.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:l&&S.jsx(l,{...r})})]}),S.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:S.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:a?S.jsx(a,{}):null})})]})}const Nte=()=>Kp(()=>import("./SettingsPage-LhUD03Ln.js"),__vite__mapDeps([0,1,2,3,4])),oM=()=>Kp(()=>import("./DevicesPage-kGrzwhGj.js"),__vite__mapDeps([5,1])),sM=()=>Kp(()=>import("./DevicePage-fGI-do8S.js"),__vite__mapDeps([6,2])),Ote=()=>Kp(()=>import("./FilePage-YWma96aj.js"),__vite__mapDeps([7,3,4])),Dte=O3([{path:"/",Component:Mte,children:[{index:!0,element:S.jsx(Vl,{moduleLoader:oM})},{path:"devices",element:S.jsx(Vl,{moduleLoader:oM})},{path:"devices/:deviceId",element:S.jsx(Vl,{moduleLoader:sM})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:S.jsx(Vl,{moduleLoader:sM})},{path:"settings",element:S.jsx(Vl,{moduleLoader:Nte})},{path:"file/:ref",element:S.jsx(Vl,{moduleLoader:Ote})}]}]),YD=document.getElementById("root");if(!YD)throw new Error("Root element not found");gz.createRoot(YD).render(S.jsx(v.StrictMode,{children:S.jsxs(DL,{client:Tte,children:[S.jsx(r3,{router:Dte}),S.jsx(g5,{richColors:!0,position:"top-right",closeButton:!0,offset:{top:"calc(16px + env(safe-area-inset-top, 0px))",right:"16px",bottom:"16px",left:"16px"},mobileOffset:{top:"calc(12px + env(safe-area-inset-top, 0px))",right:"12px",bottom:"12px",left:"12px"},toastOptions:{duration:6e3}})]})}));export{Va as $,dx as A,Ht as B,vx as C,pw as D,b8 as E,xx as F,L0 as G,wx as H,Sx as I,lD as J,Pi as K,Kx as L,vm as M,up as N,dp as O,wm as P,Gb as Q,fp as R,kH as S,cN as T,La as U,H0 as V,Vk as W,Pe as X,gt as Y,uN as Z,Gp as _,el as a,zq as a0,jq as a1,jte as a2,Rd as a3,_te as a4,z4 as a5,Hd as a6,Yte as a7,Bi as a8,Gte as a9,hn as aA,JQ as aB,sN as aC,tZ as aD,Wte as aE,$te as aF,Rm as aG,nw as aH,WV as aI,Hte as aJ,Bte as aK,Qv as aL,GV as aM,V0 as aN,aO,fY as aP,Fte as aQ,jK as aR,on as aS,vt as aT,Kp as aU,$Y as aV,iX as aW,DV as aa,fw as ab,zte as ac,Gs as ad,Lp as ae,CT as af,$8 as ag,d9 as ah,wJ as ai,mJ as aj,pJ as ak,qte as al,nZ as am,Vte as an,Ute as ao,rZ as ap,m8 as aq,A9 as ar,v9 as as,i8 as at,lN as au,PZ as av,_Z as aw,Qb as ax,iv as ay,Lte as az,Xs as b,Ei as c,kn as d,yd as e,fx as f,hx as g,qk as h,mx as i,S as j,gx as k,px as l,bx as m,yx as n,sn as o,mw as p,gw as q,v as r,ac as s,NM as t,mn as u,xm as v,Kte as w,Zs as x,FZ as y,AB as z};
|
|
466
|
-
//# sourceMappingURL=index-cfY8KuW7.js.map
|