tmex-cli 0.15.1 → 0.16.0

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.
Files changed (78) hide show
  1. package/CHANGELOG.md +37 -7
  2. package/dist/runtime/server.js +886 -172
  3. package/package.json +1 -1
  4. package/resources/fe-dist/assets/DevicePage-CxCVolw8.js +24 -0
  5. package/resources/fe-dist/assets/{DevicesPage-Ngrej5Ot.js → DevicesPage-_SYGKgwy.js} +1 -1
  6. package/resources/fe-dist/assets/{FilePage-HbiQHaa9.js → FilePage-Blf_MlAq.js} +1 -1
  7. package/resources/fe-dist/assets/{SettingsPage-CPdwRwyS.js → SettingsPage-BRt22APt.js} +1 -1
  8. package/resources/fe-dist/assets/{agent-tab--8AsTl-t.js → agent-tab-DRkW6D0y.js} +4 -4
  9. package/resources/fe-dist/assets/{api-BLIQkwae.js → api-C2-crTt8.js} +1 -1
  10. package/resources/fe-dist/assets/{arc-BxPdcU4u.js → arc-Bzi-2Wgo.js} +1 -1
  11. package/resources/fe-dist/assets/{architectureDiagram-3BPJPVTR-BTgMKoOk.js → architectureDiagram-3BPJPVTR-DZYFrhja.js} +1 -1
  12. package/resources/fe-dist/assets/{blockDiagram-GPEHLZMM-DGbVoBx0.js → blockDiagram-GPEHLZMM-lpc1A1G1.js} +1 -1
  13. package/resources/fe-dist/assets/{c4Diagram-AAUBKEIU-6Xsfbwgs.js → c4Diagram-AAUBKEIU-DOc1BzPY.js} +1 -1
  14. package/resources/fe-dist/assets/{card-LIHKdO48.js → card-BA66zlg1.js} +1 -1
  15. package/resources/fe-dist/assets/channel-DFyg9jlp.js +1 -0
  16. package/resources/fe-dist/assets/{chunk-2J33WTMH-gstBqLVO.js → chunk-2J33WTMH-DqycjO3G.js} +1 -1
  17. package/resources/fe-dist/assets/{chunk-4BX2VUAB-C-o3q6jv.js → chunk-4BX2VUAB-t2B-Cl6x.js} +1 -1
  18. package/resources/fe-dist/assets/{chunk-55IACEB6-DddgDLxO.js → chunk-55IACEB6-BmFdQL7n.js} +1 -1
  19. package/resources/fe-dist/assets/{chunk-727SXJPM-CXYmmkMi.js → chunk-727SXJPM-DEa9FPer.js} +1 -1
  20. package/resources/fe-dist/assets/{chunk-AQP2D5EJ-DRLECkLk.js → chunk-AQP2D5EJ-DiZ9AoB9.js} +1 -1
  21. package/resources/fe-dist/assets/{chunk-FMBD7UC4-BExWPgsD.js → chunk-FMBD7UC4-DLcIMhi1.js} +1 -1
  22. package/resources/fe-dist/assets/{chunk-ND2GUHAM-C7VdaZU9.js → chunk-ND2GUHAM-Cu1P2Ot8.js} +1 -1
  23. package/resources/fe-dist/assets/{chunk-QZHKN3VN-BzDQ08zM.js → chunk-QZHKN3VN-C8ki16q3.js} +1 -1
  24. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-CAgGMVvn.js +1 -0
  25. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-CAgGMVvn.js +1 -0
  26. package/resources/fe-dist/assets/{copy-BF0hUIaY.js → copy-C8vDYUVz.js} +1 -1
  27. package/resources/fe-dist/assets/{cose-bilkent-S5V4N54A-D6PcYL8a.js → cose-bilkent-S5V4N54A-baMBJteT.js} +1 -1
  28. package/resources/fe-dist/assets/{dagre-BM42HDAG-CRImj5gw.js → dagre-BM42HDAG-CwWSiSwb.js} +1 -1
  29. package/resources/fe-dist/assets/{diagram-2AECGRRQ-rxXesmyb.js → diagram-2AECGRRQ-CeSwouYZ.js} +1 -1
  30. package/resources/fe-dist/assets/{diagram-5GNKFQAL-1cV1ezU8.js → diagram-5GNKFQAL-DgxdcMax.js} +1 -1
  31. package/resources/fe-dist/assets/{diagram-KO2AKTUF-D_t6oZ15.js → diagram-KO2AKTUF-DrglkRZC.js} +1 -1
  32. package/resources/fe-dist/assets/{diagram-LMA3HP47-Bv2rw6Uu.js → diagram-LMA3HP47-BLHZ3p7v.js} +1 -1
  33. package/resources/fe-dist/assets/{diagram-OG6HWLK6-CDr2E2aw.js → diagram-OG6HWLK6-_I_mMaa6.js} +1 -1
  34. package/resources/fe-dist/assets/{en_US-Chxeay8F.js → en_US-CjVU4anP.js} +1 -1
  35. package/resources/fe-dist/assets/{erDiagram-TEJ5UH35-Dji-ptHQ.js → erDiagram-TEJ5UH35-Zkbnn8Kh.js} +1 -1
  36. package/resources/fe-dist/assets/{files-tab-BW0vpgW7.js → files-tab-CPud4eIT.js} +16 -21
  37. package/resources/fe-dist/assets/{flowDiagram-I6XJVG4X-CeBLfMwm.js → flowDiagram-I6XJVG4X-BnV7dZI4.js} +1 -1
  38. package/resources/fe-dist/assets/{ganttDiagram-6RSMTGT7-C0W5vjVi.js → ganttDiagram-6RSMTGT7-Cn2f5kRI.js} +1 -1
  39. package/resources/fe-dist/assets/{gitGraphDiagram-PVQCEYII-1BOW9mBR.js → gitGraphDiagram-PVQCEYII-CEswG7nI.js} +1 -1
  40. package/resources/fe-dist/assets/index-BK6c5W5S.js +314 -0
  41. package/resources/fe-dist/assets/index-CuFTSN9i.css +1 -0
  42. package/resources/fe-dist/assets/{index-BbHTMCQt.js → index-DLyPliOu.js} +1 -1
  43. package/resources/fe-dist/assets/{infoDiagram-5YYISTIA-rY2E1Qtb.js → infoDiagram-5YYISTIA-Dsx1fQI9.js} +1 -1
  44. package/resources/fe-dist/assets/{ishikawaDiagram-YF4QCWOH-bISKs9QA.js → ishikawaDiagram-YF4QCWOH-CgNMvXgO.js} +1 -1
  45. package/resources/fe-dist/assets/{ja_JP-BI-C8I9X.js → ja_JP-Bq-BwOH_.js} +1 -1
  46. package/resources/fe-dist/assets/{journeyDiagram-JHISSGLW-D5V6twg8.js → journeyDiagram-JHISSGLW-CVeui1xn.js} +1 -1
  47. package/resources/fe-dist/assets/{kanban-definition-UN3LZRKU-DqOygrx5.js → kanban-definition-UN3LZRKU-WnLUDsz4.js} +1 -1
  48. package/resources/fe-dist/assets/{linear-CvBar11D.js → linear-B0SWPrkI.js} +1 -1
  49. package/resources/fe-dist/assets/{markdown-preview-sViGxElv.js → markdown-preview-CDjnYorp.js} +3 -3
  50. package/resources/fe-dist/assets/{mermaid.core-m9JEGou3.js → mermaid.core-CXD-Pc2r.js} +5 -5
  51. package/resources/fe-dist/assets/{mindmap-definition-RKZ34NQL-DMyUzSwg.js → mindmap-definition-RKZ34NQL-DYEXXmag.js} +1 -1
  52. package/resources/fe-dist/assets/{pieDiagram-4H26LBE5-Cp3KArEr.js → pieDiagram-4H26LBE5-DkZtnbYj.js} +1 -1
  53. package/resources/fe-dist/assets/{quadrantDiagram-W4KKPZXB-B7aVg4vb.js → quadrantDiagram-W4KKPZXB-DblvGass.js} +1 -1
  54. package/resources/fe-dist/assets/{requirementDiagram-4Y6WPE33-WDLGaUPr.js → requirementDiagram-4Y6WPE33-KAX1DxRY.js} +1 -1
  55. package/resources/fe-dist/assets/{sankeyDiagram-5OEKKPKP-AElPZwq5.js → sankeyDiagram-5OEKKPKP-h9Z2LXNr.js} +1 -1
  56. package/resources/fe-dist/assets/{selection-clipboard-Dq6Zemfd.js → selection-clipboard-D3gUQQ7L.js} +1 -1
  57. package/resources/fe-dist/assets/{send-DjlZMim3.js → send-BVxB0Ywb.js} +1 -1
  58. package/resources/fe-dist/assets/{sequenceDiagram-3UESZ5HK-CUYki1W3.js → sequenceDiagram-3UESZ5HK-DUJcq5qX.js} +1 -1
  59. package/resources/fe-dist/assets/{stateDiagram-AJRCARHV-BlImbgYm.js → stateDiagram-AJRCARHV-BBT56nPD.js} +1 -1
  60. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-wyzFZc_5.js +1 -0
  61. package/resources/fe-dist/assets/{terminal-settings-panel-DCm6ZfTX.js → terminal-settings-panel-DHrIp0wf.js} +1 -1
  62. package/resources/fe-dist/assets/{timeline-definition-PNZ67QCA-DnXXxVyb.js → timeline-definition-PNZ67QCA-DLkgXxGG.js} +1 -1
  63. package/resources/fe-dist/assets/{transfer-toast-BWwT4yFg.js → transfer-toast-BYw9LLNi.js} +1 -1
  64. package/resources/fe-dist/assets/{triangle-alert-D1TuPKVl.js → triangle-alert-D4oQhgpz.js} +1 -1
  65. package/resources/fe-dist/assets/{vennDiagram-CIIHVFJN-BziXMAwl.js → vennDiagram-CIIHVFJN-CyUw7cRl.js} +1 -1
  66. package/resources/fe-dist/assets/{wardley-L42UT6IY-B6fovAcQ.js → wardley-L42UT6IY-UVd2D_HQ.js} +1 -1
  67. package/resources/fe-dist/assets/{wardleyDiagram-YWT4CUSO-DdAfrCkO.js → wardleyDiagram-YWT4CUSO-B6As-5ml.js} +1 -1
  68. package/resources/fe-dist/assets/{xychartDiagram-2RQKCTM6-CWuCpr0w.js → xychartDiagram-2RQKCTM6-DFypVaEh.js} +1 -1
  69. package/resources/fe-dist/assets/{zap-CCdOD6uR.js → zap-DxVtkroR.js} +1 -1
  70. package/resources/fe-dist/assets/{zh_CN-DE-BaQ3P.js → zh_CN-BuxyXhCT.js} +1 -1
  71. package/resources/fe-dist/index.html +2 -2
  72. package/resources/fe-dist/assets/DevicePage--HOY0kN6.js +0 -19
  73. package/resources/fe-dist/assets/channel-BGHWdKHN.js +0 -1
  74. package/resources/fe-dist/assets/classDiagram-4FO5ZUOK-B47Acuru.js +0 -1
  75. package/resources/fe-dist/assets/classDiagram-v2-Q7XG4LA2-B47Acuru.js +0 -1
  76. package/resources/fe-dist/assets/index-B3aiK6xC.js +0 -299
  77. package/resources/fe-dist/assets/index-CHeveVji.css +0 -1
  78. package/resources/fe-dist/assets/stateDiagram-v2-BHNVJYJU-CzqYErp9.js +0 -1
@@ -0,0 +1,314 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-tab-DRkW6D0y.js","assets/index-DLyPliOu.js","assets/send-BVxB0Ywb.js","assets/zap-DxVtkroR.js","assets/files-tab-CPud4eIT.js","assets/selection-clipboard-D3gUQQ7L.js","assets/api-C2-crTt8.js","assets/transfer-toast-BYw9LLNi.js","assets/copy-C8vDYUVz.js","assets/triangle-alert-D4oQhgpz.js","assets/SettingsPage-BRt22APt.js","assets/card-BA66zlg1.js","assets/terminal-settings-panel-DHrIp0wf.js","assets/markdown-preview-CDjnYorp.js","assets/markdown-preview-Bf_6UH9R.css","assets/DevicesPage-_SYGKgwy.js","assets/DevicePage-CxCVolw8.js","assets/FilePage-Blf_MlAq.js"])))=>i.map(i=>d[i]);
2
+ var dD=Object.defineProperty;var oE=e=>{throw TypeError(e)};var fD=(e,t,n)=>t in e?dD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var We=(e,t,n)=>fD(e,typeof t!="symbol"?t+"":t,n),Mg=(e,t,n)=>t.has(e)||oE("Cannot "+n);var ne=(e,t,n)=>(Mg(e,t,"read from private field"),n?n.call(e):t.get(e)),dt=(e,t,n)=>t.has(e)?oE("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ge=(e,t,n,a)=>(Mg(e,t,"write to private field"),a?a.call(e,n):t.set(e,n),n),It=(e,t,n)=>(Mg(e,t,"access private method"),n);var Mf=(e,t,n,a)=>({set _(s){Ge(e,t,s,n)},get _(){return ne(e,t,a)}});function hD(e,t){for(var n=0;n<t.length;n++){const a=t[n];if(typeof a!="string"&&!Array.isArray(a)){for(const s in a)if(s!=="default"&&!(s in e)){const i=Object.getOwnPropertyDescriptor(a,s);i&&Object.defineProperty(e,s,i.get?i:{enumerable:!0,get:()=>a[s]})}}}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 s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const mD="modulepreload",pD=function(e){return"/"+e},sE={},Ro=function(t,n,a){let s=Promise.resolve();if(n&&n.length>0){let c=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));s=c(n.map(f=>{if(f=pD(f),f in sE)return;sE[f]=!0;const g=f.endsWith(".css"),m=g?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":mD,g||(b.as="script"),b.crossOrigin="",b.href=f,h&&b.setAttribute("nonce",h),document.head.appendChild(b),g)return new Promise((x,w)=>{b.addEventListener("load",x),b.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${f}`)))})}))}function i(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return s.then(c=>{for(const d of c||[])d.status==="rejected"&&i(d.reason);return t().catch(i)})};function ET(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ng={exports:{}},Jc={};/**
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 iE;function gD(){if(iE)return Jc;iE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,s,i){var c=null;if(i!==void 0&&(c=""+i),s.key!==void 0&&(c=""+s.key),"key"in s){i={};for(var d in s)d!=="key"&&(i[d]=s[d])}else i=s;return s=i.ref,{$$typeof:e,type:a,key:c,ref:s!==void 0?s:null,props:i}}return Jc.Fragment=t,Jc.jsx=n,Jc.jsxs=n,Jc}var lE;function yD(){return lE||(lE=1,Ng.exports=gD()),Ng.exports}var E=yD(),Ql=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(){}},vD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ss,Bv,fT,bD=(fT=class{constructor(){dt(this,ss,vD);dt(this,Bv,!1)}setTimeoutProvider(e){Ge(this,ss,e)}setTimeout(e,t){return ne(this,ss).setTimeout(e,t)}clearTimeout(e){ne(this,ss).clearTimeout(e)}setInterval(e,t){return ne(this,ss).setInterval(e,t)}clearInterval(e){ne(this,ss).clearInterval(e)}},ss=new WeakMap,Bv=new WeakMap,fT),ni=new bD;function xD(e){setTimeout(e,0)}var yi=typeof window>"u"||"Deno"in globalThis;function pr(){}function wD(e,t){return typeof e=="function"?e(t):e}function Ny(e){return typeof e=="number"&&e>=0&&e!==1/0}function RT(e,t){return Math.max(e+(t||0)-Date.now(),0)}function vs(e,t){return typeof e=="function"?e(t):e}function aa(e,t){return typeof e=="function"?e(t):e}function cE(e,t){const{type:n="all",exact:a,fetchStatus:s,predicate:i,queryKey:c,stale:d}=e;if(c){if(a){if(t.queryHash!==Fv(c,t.options))return!1}else if(!Nu(t.queryKey,c))return!1}if(n!=="all"){const h=t.isActive();if(n==="active"&&!h||n==="inactive"&&h)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||s&&s!==t.state.fetchStatus||i&&!i(t))}function uE(e,t){const{exact:n,status:a,predicate:s,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(vi(t.options.mutationKey)!==vi(i))return!1}else if(!Nu(t.options.mutationKey,i))return!1}return!(a&&t.state.status!==a||s&&!s(t))}function Fv(e,t){return((t==null?void 0:t.queryKeyHashFn)||vi)(e)}function vi(e){return JSON.stringify(e,(t,n)=>Ay(n)?Object.keys(n).sort().reduce((a,s)=>(a[s]=n[s],a),{}):n)}function Nu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>Nu(e[n],t[n])):!1}var SD=Object.prototype.hasOwnProperty;function TT(e,t,n=0){if(e===t)return e;if(n>500)return t;const a=dE(e)&&dE(t);if(!a&&!(Ay(e)&&Ay(t)))return t;const i=(a?e:Object.keys(e)).length,c=a?t:Object.keys(t),d=c.length,h=a?new Array(d):{};let f=0;for(let g=0;g<d;g++){const m=a?g:c[g],b=e[m],x=t[m];if(b===x){h[m]=b,(a?g<i:SD.call(e,m))&&f++;continue}if(b===null||x===null||typeof b!="object"||typeof x!="object"){h[m]=x;continue}const w=TT(b,x,n+1);h[m]=w,w===b&&f++}return i===d&&f===i?e:h}function gh(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 dE(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ay(e){if(!fE(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!fE(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function fE(e){return Object.prototype.toString.call(e)==="[object Object]"}function ED(e){return new Promise(t=>{ni.setTimeout(t,e)})}function Dy(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?TT(e,t):t}function RD(e,t,n=0){const a=[...e,t];return n&&a.length>n?a.slice(1):a}function TD(e,t,n=0){const a=[t,...e];return n&&a.length>n?a.slice(0,-1):a}var Vv=Symbol();function CT(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Vv?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Yv(e,t){return typeof e=="function"?e(...t):!!e}function CD(e,t,n){let a=!1,s;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(s??(s=t()),a||(a=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),e}var si,is,Al,hT,OD=(hT=class extends Ql{constructor(){super();dt(this,si);dt(this,is);dt(this,Al);Ge(this,Al,t=>{if(!yi&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){ne(this,is)||this.setEventListener(ne(this,Al))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,is))==null||t.call(this),Ge(this,is,void 0))}setEventListener(t){var n;Ge(this,Al,t),(n=ne(this,is))==null||n.call(this),Ge(this,is,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){ne(this,si)!==t&&(Ge(this,si,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof ne(this,si)=="boolean"?ne(this,si):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},si=new WeakMap,is=new WeakMap,Al=new WeakMap,hT),qv=new OD;function ky(){let e,t;const n=new Promise((s,i)=>{e=s,t=i});n.status="pending",n.catch(()=>{});function a(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{a({status:"fulfilled",value:s}),e(s)},n.reject=s=>{a({status:"rejected",reason:s}),t(s)},n}var MD=xD;function ND(){let e=[],t=0,n=d=>{d()},a=d=>{d()},s=MD;const i=d=>{t?e.push(d):s(()=>{n(d)})},c=()=>{const d=e;e=[],d.length&&s(()=>{a(()=>{d.forEach(h=>{n(h)})})})};return{batch:d=>{let h;t++;try{h=d()}finally{t--,t||c()}return h},batchCalls:d=>(...h)=>{i(()=>{d(...h)})},schedule:i,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{a=d},setScheduler:d=>{s=d}}}var $n=ND(),Dl,ls,kl,mT,AD=(mT=class extends Ql{constructor(){super();dt(this,Dl,!0);dt(this,ls);dt(this,kl);Ge(this,kl,t=>{if(!yi&&window.addEventListener){const n=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",a)}}})}onSubscribe(){ne(this,ls)||this.setEventListener(ne(this,kl))}onUnsubscribe(){var t;this.hasListeners()||((t=ne(this,ls))==null||t.call(this),Ge(this,ls,void 0))}setEventListener(t){var n;Ge(this,kl,t),(n=ne(this,ls))==null||n.call(this),Ge(this,ls,t(this.setOnline.bind(this)))}setOnline(t){ne(this,Dl)!==t&&(Ge(this,Dl,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return ne(this,Dl)}},Dl=new WeakMap,ls=new WeakMap,kl=new WeakMap,mT),yh=new AD;function DD(e){return Math.min(1e3*2**e,3e4)}function OT(e){return(e??"online")==="online"?yh.isOnline():!0}var jy=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function MT(e){let t=!1,n=0,a;const s=ky(),i=()=>s.status!=="pending",c=S=>{var R;if(!i()){const T=new jy(S);b(T),(R=e.onCancel)==null||R.call(e,T)}},d=()=>{t=!0},h=()=>{t=!1},f=()=>qv.isFocused()&&(e.networkMode==="always"||yh.isOnline())&&e.canRun(),g=()=>OT(e.networkMode)&&e.canRun(),m=S=>{i()||(a==null||a(),s.resolve(S))},b=S=>{i()||(a==null||a(),s.reject(S))},x=()=>new Promise(S=>{var R;a=T=>{(i()||f())&&S(T)},(R=e.onPause)==null||R.call(e)}).then(()=>{var S;a=void 0,i()||(S=e.onContinue)==null||S.call(e)}),w=()=>{if(i())return;let S;const R=n===0?e.initialPromise:void 0;try{S=R??e.fn()}catch(T){S=Promise.reject(T)}Promise.resolve(S).then(m).catch(T=>{var k;if(i())return;const C=e.retry??(yi?0:3),M=e.retryDelay??DD,O=typeof M=="function"?M(n,T):M,D=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,T);if(t||!D){b(T);return}n++,(k=e.onFail)==null||k.call(e,n,T),ED(O).then(()=>f()?void 0:x()).then(()=>{t?b(T):w()})})};return{promise:s,status:()=>s.status,cancel:c,continue:()=>(a==null||a(),s),cancelRetry:d,continueRetry:h,canStart:g,start:()=>(g()?w():x().then(w),s)}}var ii,pT,NT=(pT=class{constructor(){dt(this,ii)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ny(this.gcTime)&&Ge(this,ii,ni.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(yi?1/0:300*1e3))}clearGcTimeout(){ne(this,ii)&&(ni.clearTimeout(ne(this,ii)),Ge(this,ii,void 0))}},ii=new WeakMap,pT),li,jl,na,ci,Wn,Yu,ui,ba,po,gT,kD=(gT=class extends NT{constructor(t){super();dt(this,ba);dt(this,li);dt(this,jl);dt(this,na);dt(this,ci);dt(this,Wn);dt(this,Yu);dt(this,ui);Ge(this,ui,!1),Ge(this,Yu,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ge(this,ci,t.client),Ge(this,na,ne(this,ci).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ge(this,li,mE(this.options)),this.state=t.state??ne(this,li),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=ne(this,Wn))==null?void 0:t.promise}setOptions(t){if(this.options={...ne(this,Yu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=mE(this.options);n.data!==void 0&&(this.setState(hE(n.data,n.dataUpdatedAt)),Ge(this,li,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&ne(this,na).remove(this)}setData(t,n){const a=Dy(this.state.data,t,this.options);return It(this,ba,po).call(this,{data:a,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),a}setState(t,n){It(this,ba,po).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var a,s;const n=(a=ne(this,Wn))==null?void 0:a.promise;return(s=ne(this,Wn))==null||s.cancel(t),n?n.then(pr).catch(pr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(ne(this,li))}isActive(){return this.observers.some(t=>aa(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Vv||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>vs(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:!RT(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,Wn))==null||n.continue()}onOnline(){var n;const t=this.observers.find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=ne(this,Wn))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),ne(this,na).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(ne(this,Wn)&&(ne(this,ui)?ne(this,Wn).cancel({revert:!0}):ne(this,Wn).cancelRetry()),this.scheduleGc()),ne(this,na).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||It(this,ba,po).call(this,{type:"invalidate"})}async fetch(t,n){var h,f,g,m,b,x,w,S,R,T,C,M;if(this.state.fetchStatus!=="idle"&&((h=ne(this,Wn))==null?void 0:h.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(ne(this,Wn))return ne(this,Wn).continueRetry(),ne(this,Wn).promise}if(t&&this.setOptions(t),!this.options.queryFn){const O=this.observers.find(D=>D.options.queryFn);O&&this.setOptions(O.options)}const a=new AbortController,s=O=>{Object.defineProperty(O,"signal",{enumerable:!0,get:()=>(Ge(this,ui,!0),a.signal)})},i=()=>{const O=CT(this.options,n),k=(()=>{const A={client:ne(this,ci),queryKey:this.queryKey,meta:this.meta};return s(A),A})();return Ge(this,ui,!1),this.options.persister?this.options.persister(O,k,this):O(k)},d=(()=>{const O={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:ne(this,ci),state:this.state,fetchFn:i};return s(O),O})();(f=this.options.behavior)==null||f.onFetch(d,this),Ge(this,jl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=d.fetchOptions)==null?void 0:g.meta))&&It(this,ba,po).call(this,{type:"fetch",meta:(m=d.fetchOptions)==null?void 0:m.meta}),Ge(this,Wn,MT({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:O=>{O instanceof jy&&O.revert&&this.setState({...ne(this,jl),fetchStatus:"idle"}),a.abort()},onFail:(O,D)=>{It(this,ba,po).call(this,{type:"failed",failureCount:O,error:D})},onPause:()=>{It(this,ba,po).call(this,{type:"pause"})},onContinue:()=>{It(this,ba,po).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const O=await ne(this,Wn).start();if(O===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(O),(x=(b=ne(this,na).config).onSuccess)==null||x.call(b,O,this),(S=(w=ne(this,na).config).onSettled)==null||S.call(w,O,this.state.error,this),O}catch(O){if(O instanceof jy){if(O.silent)return ne(this,Wn).promise;if(O.revert){if(this.state.data===void 0)throw O;return this.state.data}}throw It(this,ba,po).call(this,{type:"error",error:O}),(T=(R=ne(this,na).config).onError)==null||T.call(R,O,this),(M=(C=ne(this,na).config).onSettled)==null||M.call(C,this.state.data,O,this),O}finally{this.scheduleGc()}}},li=new WeakMap,jl=new WeakMap,na=new WeakMap,ci=new WeakMap,Wn=new WeakMap,Yu=new WeakMap,ui=new WeakMap,ba=new WeakSet,po=function(t){const n=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...AT(a.data,this.options),fetchMeta:t.meta??null};case"success":const s={...a,...hE(t.data,t.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ge(this,jl,t.manual?s:void 0),s;case"error":const i=t.error;return{...a,error:i,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=n(this.state),$n.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),ne(this,na).notify({query:this,type:"updated",action:t})})},gT);function AT(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:OT(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function hE(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function mE(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,a=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Tr,Qt,qu,mr,di,_l,vo,cs,$u,Ll,Il,fi,hi,us,Pl,ln,du,_y,Ly,Iy,Py,zy,Uy,Hy,DT,yT,jD=(yT=class extends Ql{constructor(t,n){super();dt(this,ln);dt(this,Tr);dt(this,Qt);dt(this,qu);dt(this,mr);dt(this,di);dt(this,_l);dt(this,vo);dt(this,cs);dt(this,$u);dt(this,Ll);dt(this,Il);dt(this,fi);dt(this,hi);dt(this,us);dt(this,Pl,new Set);this.options=n,Ge(this,Tr,t),Ge(this,cs,null),Ge(this,vo,ky()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(ne(this,Qt).addObserver(this),pE(ne(this,Qt),this.options)?It(this,ln,du).call(this):this.updateResult(),It(this,ln,Py).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return By(ne(this,Qt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return By(ne(this,Qt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,It(this,ln,zy).call(this),It(this,ln,Uy).call(this),ne(this,Qt).removeObserver(this)}setOptions(t){const n=this.options,a=ne(this,Qt);if(this.options=ne(this,Tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof aa(this.options.enabled,ne(this,Qt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");It(this,ln,Hy).call(this),ne(this,Qt).setOptions(this.options),n._defaulted&&!gh(this.options,n)&&ne(this,Tr).getQueryCache().notify({type:"observerOptionsUpdated",query:ne(this,Qt),observer:this});const s=this.hasListeners();s&&gE(ne(this,Qt),a,this.options,n)&&It(this,ln,du).call(this),this.updateResult(),s&&(ne(this,Qt)!==a||aa(this.options.enabled,ne(this,Qt))!==aa(n.enabled,ne(this,Qt))||vs(this.options.staleTime,ne(this,Qt))!==vs(n.staleTime,ne(this,Qt)))&&It(this,ln,_y).call(this);const i=It(this,ln,Ly).call(this);s&&(ne(this,Qt)!==a||aa(this.options.enabled,ne(this,Qt))!==aa(n.enabled,ne(this,Qt))||i!==ne(this,us))&&It(this,ln,Iy).call(this,i)}getOptimisticResult(t){const n=ne(this,Tr).getQueryCache().build(ne(this,Tr),t),a=this.createResult(n,t);return LD(this,a)&&(Ge(this,mr,a),Ge(this,_l,this.options),Ge(this,di,ne(this,Qt).state)),a}getCurrentResult(){return ne(this,mr)}trackResult(t,n){return new Proxy(t,{get:(a,s)=>(this.trackProp(s),n==null||n(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&ne(this,vo).status==="pending"&&ne(this,vo).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,s))})}trackProp(t){ne(this,Pl).add(t)}getCurrentQuery(){return ne(this,Qt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=ne(this,Tr).defaultQueryOptions(t),a=ne(this,Tr).getQueryCache().build(ne(this,Tr),n);return a.fetch().then(()=>this.createResult(a,n))}fetch(t){return It(this,ln,du).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),ne(this,mr)))}createResult(t,n){var B;const a=ne(this,Qt),s=this.options,i=ne(this,mr),c=ne(this,di),d=ne(this,_l),f=t!==a?t.state:ne(this,qu),{state:g}=t;let m={...g},b=!1,x;if(n._optimisticResults){const W=this.hasListeners(),K=!W&&pE(t,n),I=W&&gE(t,a,n,s);(K||I)&&(m={...m,...AT(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:w,errorUpdatedAt:S,status:R}=m;x=m.data;let T=!1;if(n.placeholderData!==void 0&&x===void 0&&R==="pending"){let W;i!=null&&i.isPlaceholderData&&n.placeholderData===(d==null?void 0:d.placeholderData)?(W=i.data,T=!0):W=typeof n.placeholderData=="function"?n.placeholderData((B=ne(this,Il))==null?void 0:B.state.data,ne(this,Il)):n.placeholderData,W!==void 0&&(R="success",x=Dy(i==null?void 0:i.data,W,n),b=!0)}if(n.select&&x!==void 0&&!T)if(i&&x===(c==null?void 0:c.data)&&n.select===ne(this,$u))x=ne(this,Ll);else try{Ge(this,$u,n.select),x=n.select(x),x=Dy(i==null?void 0:i.data,x,n),Ge(this,Ll,x),Ge(this,cs,null)}catch(W){Ge(this,cs,W)}ne(this,cs)&&(w=ne(this,cs),x=ne(this,Ll),S=Date.now(),R="error");const C=m.fetchStatus==="fetching",M=R==="pending",O=R==="error",D=M&&C,k=x!==void 0,j={status:R,fetchStatus:m.fetchStatus,isPending:M,isSuccess:R==="success",isError:O,isInitialLoading:D,isLoading:D,data:x,dataUpdatedAt:m.dataUpdatedAt,error:w,errorUpdatedAt:S,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>f.dataUpdateCount||m.errorUpdateCount>f.errorUpdateCount,isFetching:C,isRefetching:C&&!M,isLoadingError:O&&!k,isPaused:m.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:O&&k,isStale:$v(t,n),refetch:this.refetch,promise:ne(this,vo),isEnabled:aa(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const W=j.data!==void 0,K=j.status==="error"&&!W,I=q=>{K?q.reject(j.error):W&&q.resolve(j.data)},H=()=>{const q=Ge(this,vo,j.promise=ky());I(q)},F=ne(this,vo);switch(F.status){case"pending":t.queryHash===a.queryHash&&I(F);break;case"fulfilled":(K||j.data!==F.value)&&H();break;case"rejected":(!K||j.error!==F.reason)&&H();break}}return j}updateResult(){const t=ne(this,mr),n=this.createResult(ne(this,Qt),this.options);if(Ge(this,di,ne(this,Qt).state),Ge(this,_l,this.options),ne(this,di).data!==void 0&&Ge(this,Il,ne(this,Qt)),gh(n,t))return;Ge(this,mr,n);const a=()=>{if(!t)return!0;const{notifyOnChangeProps:s}=this.options,i=typeof s=="function"?s():s;if(i==="all"||!i&&!ne(this,Pl).size)return!0;const c=new Set(i??ne(this,Pl));return this.options.throwOnError&&c.add("error"),Object.keys(ne(this,mr)).some(d=>{const h=d;return ne(this,mr)[h]!==t[h]&&c.has(h)})};It(this,ln,DT).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&It(this,ln,Py).call(this)}},Tr=new WeakMap,Qt=new WeakMap,qu=new WeakMap,mr=new WeakMap,di=new WeakMap,_l=new WeakMap,vo=new WeakMap,cs=new WeakMap,$u=new WeakMap,Ll=new WeakMap,Il=new WeakMap,fi=new WeakMap,hi=new WeakMap,us=new WeakMap,Pl=new WeakMap,ln=new WeakSet,du=function(t){It(this,ln,Hy).call(this);let n=ne(this,Qt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(pr)),n},_y=function(){It(this,ln,zy).call(this);const t=vs(this.options.staleTime,ne(this,Qt));if(yi||ne(this,mr).isStale||!Ny(t))return;const a=RT(ne(this,mr).dataUpdatedAt,t)+1;Ge(this,fi,ni.setTimeout(()=>{ne(this,mr).isStale||this.updateResult()},a))},Ly=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(ne(this,Qt)):this.options.refetchInterval)??!1},Iy=function(t){It(this,ln,Uy).call(this),Ge(this,us,t),!(yi||aa(this.options.enabled,ne(this,Qt))===!1||!Ny(ne(this,us))||ne(this,us)===0)&&Ge(this,hi,ni.setInterval(()=>{(this.options.refetchIntervalInBackground||qv.isFocused())&&It(this,ln,du).call(this)},ne(this,us)))},Py=function(){It(this,ln,_y).call(this),It(this,ln,Iy).call(this,It(this,ln,Ly).call(this))},zy=function(){ne(this,fi)&&(ni.clearTimeout(ne(this,fi)),Ge(this,fi,void 0))},Uy=function(){ne(this,hi)&&(ni.clearInterval(ne(this,hi)),Ge(this,hi,void 0))},Hy=function(){const t=ne(this,Tr).getQueryCache().build(ne(this,Tr),this.options);if(t===ne(this,Qt))return;const n=ne(this,Qt);Ge(this,Qt,t),Ge(this,qu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},DT=function(t){$n.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(ne(this,mr))}),ne(this,Tr).getQueryCache().notify({query:ne(this,Qt),type:"observerResultsUpdated"})})},yT);function _D(e,t){return aa(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function pE(e,t){return _D(e,t)||e.state.data!==void 0&&By(e,t,t.refetchOnMount)}function By(e,t,n){if(aa(t.enabled,e)!==!1&&vs(t.staleTime,e)!=="static"){const a=typeof n=="function"?n(e):n;return a==="always"||a!==!1&&$v(e,t)}return!1}function gE(e,t,n,a){return(e!==t||aa(a.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&$v(e,n)}function $v(e,t){return aa(t.enabled,e)!==!1&&e.isStaleByTime(vs(t.staleTime,e))}function LD(e,t){return!gh(e.getCurrentResult(),t)}function yE(e){return{onFetch:(t,n)=>{var g,m,b,x,w;const a=t.options,s=(b=(m=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:b.direction,i=((x=t.state.data)==null?void 0:x.pages)||[],c=((w=t.state.data)==null?void 0:w.pageParams)||[];let d={pages:[],pageParams:[]},h=0;const f=async()=>{let S=!1;const R=M=>{CD(M,()=>t.signal,()=>S=!0)},T=CT(t.options,t.fetchOptions),C=async(M,O,D)=>{if(S)return Promise.reject();if(O==null&&M.pages.length)return Promise.resolve(M);const A=(()=>{const K={client:t.client,queryKey:t.queryKey,pageParam:O,direction:D?"backward":"forward",meta:t.options.meta};return R(K),K})(),j=await T(A),{maxPages:B}=t.options,W=D?TD:RD;return{pages:W(M.pages,j,B),pageParams:W(M.pageParams,O,B)}};if(s&&i.length){const M=s==="backward",O=M?ID:vE,D={pages:i,pageParams:c},k=O(a,D);d=await C(D,k,M)}else{const M=e??i.length;do{const O=h===0?c[0]??a.initialPageParam:vE(a,d);if(h>0&&O==null)break;d=await C(d,O),h++}while(h<M)}return d};t.options.persister?t.fetchFn=()=>{var S,R;return(R=(S=t.options).persister)==null?void 0:R.call(S,f,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=f}}}function vE(e,{pages:t,pageParams:n}){const a=t.length-1;return t.length>0?e.getNextPageParam(t[a],t,n[a],n):void 0}function ID(e,{pages:t,pageParams:n}){var a;return t.length>0?(a=e.getPreviousPageParam)==null?void 0:a.call(e,t[0],t,n[0],n):void 0}var Ku,ka,ir,mi,ja,ts,vT,PD=(vT=class extends NT{constructor(t){super();dt(this,ja);dt(this,Ku);dt(this,ka);dt(this,ir);dt(this,mi);Ge(this,Ku,t.client),this.mutationId=t.mutationId,Ge(this,ir,t.mutationCache),Ge(this,ka,[]),this.state=t.state||kT(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){ne(this,ka).includes(t)||(ne(this,ka).push(t),this.clearGcTimeout(),ne(this,ir).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ge(this,ka,ne(this,ka).filter(n=>n!==t)),this.scheduleGc(),ne(this,ir).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){ne(this,ka).length||(this.state.status==="pending"?this.scheduleGc():ne(this,ir).remove(this))}continue(){var t;return((t=ne(this,mi))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var c,d,h,f,g,m,b,x,w,S,R,T,C,M,O,D,k,A;const n=()=>{It(this,ja,ts).call(this,{type:"continue"})},a={client:ne(this,Ku),meta:this.options.meta,mutationKey:this.options.mutationKey};Ge(this,mi,MT({fn:()=>this.options.mutationFn?this.options.mutationFn(t,a):Promise.reject(new Error("No mutationFn found")),onFail:(j,B)=>{It(this,ja,ts).call(this,{type:"failed",failureCount:j,error:B})},onPause:()=>{It(this,ja,ts).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>ne(this,ir).canRun(this)}));const s=this.state.status==="pending",i=!ne(this,mi).canStart();try{if(s)n();else{It(this,ja,ts).call(this,{type:"pending",variables:t,isPaused:i}),ne(this,ir).config.onMutate&&await ne(this,ir).config.onMutate(t,this,a);const B=await((d=(c=this.options).onMutate)==null?void 0:d.call(c,t,a));B!==this.state.context&&It(this,ja,ts).call(this,{type:"pending",context:B,variables:t,isPaused:i})}const j=await ne(this,mi).start();return await((f=(h=ne(this,ir).config).onSuccess)==null?void 0:f.call(h,j,t,this.state.context,this,a)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,j,t,this.state.context,a)),await((x=(b=ne(this,ir).config).onSettled)==null?void 0:x.call(b,j,null,this.state.variables,this.state.context,this,a)),await((S=(w=this.options).onSettled)==null?void 0:S.call(w,j,null,t,this.state.context,a)),It(this,ja,ts).call(this,{type:"success",data:j}),j}catch(j){try{await((T=(R=ne(this,ir).config).onError)==null?void 0:T.call(R,j,t,this.state.context,this,a))}catch(B){Promise.reject(B)}try{await((M=(C=this.options).onError)==null?void 0:M.call(C,j,t,this.state.context,a))}catch(B){Promise.reject(B)}try{await((D=(O=ne(this,ir).config).onSettled)==null?void 0:D.call(O,void 0,j,this.state.variables,this.state.context,this,a))}catch(B){Promise.reject(B)}try{await((A=(k=this.options).onSettled)==null?void 0:A.call(k,void 0,j,t,this.state.context,a))}catch(B){Promise.reject(B)}throw It(this,ja,ts).call(this,{type:"error",error:j}),j}finally{ne(this,ir).runNext(this)}}},Ku=new WeakMap,ka=new WeakMap,ir=new WeakMap,mi=new WeakMap,ja=new WeakSet,ts=function(t){const n=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,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{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),$n.batch(()=>{ne(this,ka).forEach(a=>{a.onMutationUpdate(t)}),ne(this,ir).notify({mutation:this,type:"updated",action:t})})},vT);function kT(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var bo,xa,Gu,bT,zD=(bT=class extends Ql{constructor(t={}){super();dt(this,bo);dt(this,xa);dt(this,Gu);this.config=t,Ge(this,bo,new Set),Ge(this,xa,new Map),Ge(this,Gu,0)}build(t,n,a){const s=new PD({client:t,mutationCache:this,mutationId:++Mf(this,Gu)._,options:t.defaultMutationOptions(n),state:a});return this.add(s),s}add(t){ne(this,bo).add(t);const n=Nf(t);if(typeof n=="string"){const a=ne(this,xa).get(n);a?a.push(t):ne(this,xa).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(ne(this,bo).delete(t)){const n=Nf(t);if(typeof n=="string"){const a=ne(this,xa).get(n);if(a)if(a.length>1){const s=a.indexOf(t);s!==-1&&a.splice(s,1)}else a[0]===t&&ne(this,xa).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=Nf(t);if(typeof n=="string"){const a=ne(this,xa).get(n),s=a==null?void 0:a.find(i=>i.state.status==="pending");return!s||s===t}else return!0}runNext(t){var a;const n=Nf(t);if(typeof n=="string"){const s=(a=ne(this,xa).get(n))==null?void 0:a.find(i=>i!==t&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){$n.batch(()=>{ne(this,bo).forEach(t=>{this.notify({type:"removed",mutation:t})}),ne(this,bo).clear(),ne(this,xa).clear()})}getAll(){return Array.from(ne(this,bo))}find(t){const n={exact:!0,...t};return this.getAll().find(a=>uE(n,a))}findAll(t={}){return this.getAll().filter(n=>uE(t,n))}notify(t){$n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return $n.batch(()=>Promise.all(t.map(n=>n.continue().catch(pr))))}},bo=new WeakMap,xa=new WeakMap,Gu=new WeakMap,bT);function Nf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var xo,ds,Cr,wo,To,nh,Fy,xT,UD=(xT=class extends Ql{constructor(n,a){super();dt(this,To);dt(this,xo);dt(this,ds);dt(this,Cr);dt(this,wo);Ge(this,xo,n),this.setOptions(a),this.bindMethods(),It(this,To,nh).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var s;const a=this.options;this.options=ne(this,xo).defaultMutationOptions(n),gh(this.options,a)||ne(this,xo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:ne(this,Cr),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&vi(a.mutationKey)!==vi(this.options.mutationKey)?this.reset():((s=ne(this,Cr))==null?void 0:s.state.status)==="pending"&&ne(this,Cr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=ne(this,Cr))==null||n.removeObserver(this)}onMutationUpdate(n){It(this,To,nh).call(this),It(this,To,Fy).call(this,n)}getCurrentResult(){return ne(this,ds)}reset(){var n;(n=ne(this,Cr))==null||n.removeObserver(this),Ge(this,Cr,void 0),It(this,To,nh).call(this),It(this,To,Fy).call(this)}mutate(n,a){var s;return Ge(this,wo,a),(s=ne(this,Cr))==null||s.removeObserver(this),Ge(this,Cr,ne(this,xo).getMutationCache().build(ne(this,xo),this.options)),ne(this,Cr).addObserver(this),ne(this,Cr).execute(n)}},xo=new WeakMap,ds=new WeakMap,Cr=new WeakMap,wo=new WeakMap,To=new WeakSet,nh=function(){var a;const n=((a=ne(this,Cr))==null?void 0:a.state)??kT();Ge(this,ds,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Fy=function(n){$n.batch(()=>{var a,s,i,c,d,h,f,g;if(ne(this,wo)&&this.hasListeners()){const m=ne(this,ds).variables,b=ne(this,ds).context,x={client:ne(this,xo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(s=(a=ne(this,wo)).onSuccess)==null||s.call(a,n.data,m,b,x)}catch(w){Promise.reject(w)}try{(c=(i=ne(this,wo)).onSettled)==null||c.call(i,n.data,null,m,b,x)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(h=(d=ne(this,wo)).onError)==null||h.call(d,n.error,m,b,x)}catch(w){Promise.reject(w)}try{(g=(f=ne(this,wo)).onSettled)==null||g.call(f,void 0,n.error,m,b,x)}catch(w){Promise.reject(w)}}}this.listeners.forEach(m=>{m(ne(this,ds))})})},xT),_a,wT,HD=(wT=class extends Ql{constructor(t={}){super();dt(this,_a);this.config=t,Ge(this,_a,new Map)}build(t,n,a){const s=n.queryKey,i=n.queryHash??Fv(s,n);let c=this.get(i);return c||(c=new kD({client:t,queryKey:s,queryHash:i,options:t.defaultQueryOptions(n),state:a,defaultOptions:t.getQueryDefaults(s)}),this.add(c)),c}add(t){ne(this,_a).has(t.queryHash)||(ne(this,_a).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=ne(this,_a).get(t.queryHash);n&&(t.destroy(),n===t&&ne(this,_a).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){$n.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return ne(this,_a).get(t)}getAll(){return[...ne(this,_a).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(a=>cE(n,a))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(a=>cE(t,a)):n}notify(t){$n.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){$n.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){$n.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},_a=new WeakMap,wT),Dn,fs,hs,zl,Ul,ms,Hl,Bl,ST,BD=(ST=class{constructor(e={}){dt(this,Dn);dt(this,fs);dt(this,hs);dt(this,zl);dt(this,Ul);dt(this,ms);dt(this,Hl);dt(this,Bl);Ge(this,Dn,e.queryCache||new HD),Ge(this,fs,e.mutationCache||new zD),Ge(this,hs,e.defaultOptions||{}),Ge(this,zl,new Map),Ge(this,Ul,new Map),Ge(this,ms,0)}mount(){Mf(this,ms)._++,ne(this,ms)===1&&(Ge(this,Hl,qv.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,Dn).onFocus())})),Ge(this,Bl,yh.subscribe(async e=>{e&&(await this.resumePausedMutations(),ne(this,Dn).onOnline())})))}unmount(){var e,t;Mf(this,ms)._--,ne(this,ms)===0&&((e=ne(this,Hl))==null||e.call(this),Ge(this,Hl,void 0),(t=ne(this,Bl))==null||t.call(this),Ge(this,Bl,void 0))}isFetching(e){return ne(this,Dn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return ne(this,fs).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ne(this,Dn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=ne(this,Dn).build(this,t),a=n.state.data;return a===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(vs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(a))}getQueriesData(e){return ne(this,Dn).findAll(e).map(({queryKey:t,state:n})=>{const a=n.data;return[t,a]})}setQueryData(e,t,n){const a=this.defaultQueryOptions({queryKey:e}),s=ne(this,Dn).get(a.queryHash),i=s==null?void 0:s.state.data,c=wD(t,i);if(c!==void 0)return ne(this,Dn).build(this,a).setData(c,{...n,manual:!0})}setQueriesData(e,t,n){return $n.batch(()=>ne(this,Dn).findAll(e).map(({queryKey:a})=>[a,this.setQueryData(a,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=ne(this,Dn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=ne(this,Dn);$n.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=ne(this,Dn);return $n.batch(()=>(n.findAll(e).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},a=$n.batch(()=>ne(this,Dn).findAll(e).map(s=>s.cancel(n)));return Promise.all(a).then(pr).catch(pr)}invalidateQueries(e,t={}){return $n.batch(()=>(ne(this,Dn).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},a=$n.batch(()=>ne(this,Dn).findAll(e).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(pr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(a).then(pr)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=ne(this,Dn).build(this,t);return n.isStaleByTime(vs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(pr).catch(pr)}fetchInfiniteQuery(e){return e.behavior=yE(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(pr).catch(pr)}ensureInfiniteQueryData(e){return e.behavior=yE(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return yh.isOnline()?ne(this,fs).resumePausedMutations():Promise.resolve()}getQueryCache(){return ne(this,Dn)}getMutationCache(){return ne(this,fs)}getDefaultOptions(){return ne(this,hs)}setDefaultOptions(e){Ge(this,hs,e)}setQueryDefaults(e,t){ne(this,zl).set(vi(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...ne(this,zl).values()],n={};return t.forEach(a=>{Nu(e,a.queryKey)&&Object.assign(n,a.defaultOptions)}),n}setMutationDefaults(e,t){ne(this,Ul).set(vi(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...ne(this,Ul).values()],n={};return t.forEach(a=>{Nu(e,a.mutationKey)&&Object.assign(n,a.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...ne(this,hs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fv(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===Vv&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...ne(this,hs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){ne(this,Dn).clear(),ne(this,fs).clear()}},Dn=new WeakMap,fs=new WeakMap,hs=new WeakMap,zl=new WeakMap,Ul=new WeakMap,ms=new WeakMap,Hl=new WeakMap,Bl=new WeakMap,ST),Ag={exports:{}},At={};/**
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 bE;function FD(){if(bE)return At;bE=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),i=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),b=Symbol.iterator;function x(z){return z===null||typeof z!="object"?null:(z=b&&z[b]||z["@@iterator"],typeof z=="function"?z:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,R={};function T(z,Y,X){this.props=z,this.context=Y,this.refs=R,this.updater=X||w}T.prototype.isReactComponent={},T.prototype.setState=function(z,Y){if(typeof z!="object"&&typeof z!="function"&&z!=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,z,Y,"setState")},T.prototype.forceUpdate=function(z){this.updater.enqueueForceUpdate(this,z,"forceUpdate")};function C(){}C.prototype=T.prototype;function M(z,Y,X){this.props=z,this.context=Y,this.refs=R,this.updater=X||w}var O=M.prototype=new C;O.constructor=M,S(O,T.prototype),O.isPureReactComponent=!0;var D=Array.isArray;function k(){}var A={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function B(z,Y,X){var G=X.ref;return{$$typeof:e,type:z,key:Y,ref:G!==void 0?G:null,props:X}}function W(z,Y){return B(z.type,Y,z.props)}function K(z){return typeof z=="object"&&z!==null&&z.$$typeof===e}function I(z){var Y={"=":"=0",":":"=2"};return"$"+z.replace(/[=:]/g,function(X){return Y[X]})}var H=/\/+/g;function F(z,Y){return typeof z=="object"&&z!==null&&z.key!=null?I(""+z.key):Y.toString(36)}function q(z){switch(z.status){case"fulfilled":return z.value;case"rejected":throw z.reason;default:switch(typeof z.status=="string"?z.then(k,k):(z.status="pending",z.then(function(Y){z.status==="pending"&&(z.status="fulfilled",z.value=Y)},function(Y){z.status==="pending"&&(z.status="rejected",z.reason=Y)})),z.status){case"fulfilled":return z.value;case"rejected":throw z.reason}}throw z}function _(z,Y,X,G,ce){var oe=typeof z;(oe==="undefined"||oe==="boolean")&&(z=null);var de=!1;if(z===null)de=!0;else switch(oe){case"bigint":case"string":case"number":de=!0;break;case"object":switch(z.$$typeof){case e:case t:de=!0;break;case g:return de=z._init,_(de(z._payload),Y,X,G,ce)}}if(de)return ce=ce(z),de=G===""?"."+F(z,0):G,D(ce)?(X="",de!=null&&(X=de.replace(H,"$&/")+"/"),_(ce,Y,X,"",function(Ne){return Ne})):ce!=null&&(K(ce)&&(ce=W(ce,X+(ce.key==null||z&&z.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+de)),Y.push(ce)),1;de=0;var ve=G===""?".":G+":";if(D(z))for(var xe=0;xe<z.length;xe++)G=z[xe],oe=ve+F(G,xe),de+=_(G,Y,X,oe,ce);else if(xe=x(z),typeof xe=="function")for(z=xe.call(z),xe=0;!(G=z.next()).done;)G=G.value,oe=ve+F(G,xe++),de+=_(G,Y,X,oe,ce);else if(oe==="object"){if(typeof z.then=="function")return _(q(z),Y,X,G,ce);throw Y=String(z),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(z).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return de}function L(z,Y,X){if(z==null)return z;var G=[],ce=0;return _(z,G,"","",function(oe){return Y.call(X,oe,ce++)}),G}function P(z){if(z._status===-1){var Y=z._result;Y=Y(),Y.then(function(X){(z._status===0||z._status===-1)&&(z._status=1,z._result=X)},function(X){(z._status===0||z._status===-1)&&(z._status=2,z._result=X)}),z._status===-1&&(z._status=0,z._result=Y)}if(z._status===1)return z._result.default;throw z._result}var V=typeof reportError=="function"?reportError:function(z){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof z=="object"&&z!==null&&typeof z.message=="string"?String(z.message):String(z),error:z});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",z);return}console.error(z)},Q={map:L,forEach:function(z,Y,X){L(z,function(){Y.apply(this,arguments)},X)},count:function(z){var Y=0;return L(z,function(){Y++}),Y},toArray:function(z){return L(z,function(Y){return Y})||[]},only:function(z){if(!K(z))throw Error("React.Children.only expected to receive a single React element child.");return z}};return At.Activity=m,At.Children=Q,At.Component=T,At.Fragment=n,At.Profiler=s,At.PureComponent=M,At.StrictMode=a,At.Suspense=h,At.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,At.__COMPILER_RUNTIME={__proto__:null,c:function(z){return A.H.useMemoCache(z)}},At.cache=function(z){return function(){return z.apply(null,arguments)}},At.cacheSignal=function(){return null},At.cloneElement=function(z,Y,X){if(z==null)throw Error("The argument must be a React element, but you passed "+z+".");var G=S({},z.props),ce=z.key;if(Y!=null)for(oe in Y.key!==void 0&&(ce=""+Y.key),Y)!j.call(Y,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&Y.ref===void 0||(G[oe]=Y[oe]);var oe=arguments.length-2;if(oe===1)G.children=X;else if(1<oe){for(var de=Array(oe),ve=0;ve<oe;ve++)de[ve]=arguments[ve+2];G.children=de}return B(z.type,ce,G)},At.createContext=function(z){return z={$$typeof:c,_currentValue:z,_currentValue2:z,_threadCount:0,Provider:null,Consumer:null},z.Provider=z,z.Consumer={$$typeof:i,_context:z},z},At.createElement=function(z,Y,X){var G,ce={},oe=null;if(Y!=null)for(G in Y.key!==void 0&&(oe=""+Y.key),Y)j.call(Y,G)&&G!=="key"&&G!=="__self"&&G!=="__source"&&(ce[G]=Y[G]);var de=arguments.length-2;if(de===1)ce.children=X;else if(1<de){for(var ve=Array(de),xe=0;xe<de;xe++)ve[xe]=arguments[xe+2];ce.children=ve}if(z&&z.defaultProps)for(G in de=z.defaultProps,de)ce[G]===void 0&&(ce[G]=de[G]);return B(z,oe,ce)},At.createRef=function(){return{current:null}},At.forwardRef=function(z){return{$$typeof:d,render:z}},At.isValidElement=K,At.lazy=function(z){return{$$typeof:g,_payload:{_status:-1,_result:z},_init:P}},At.memo=function(z,Y){return{$$typeof:f,type:z,compare:Y===void 0?null:Y}},At.startTransition=function(z){var Y=A.T,X={};A.T=X;try{var G=z(),ce=A.S;ce!==null&&ce(X,G),typeof G=="object"&&G!==null&&typeof G.then=="function"&&G.then(k,V)}catch(oe){V(oe)}finally{Y!==null&&X.types!==null&&(Y.types=X.types),A.T=Y}},At.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},At.use=function(z){return A.H.use(z)},At.useActionState=function(z,Y,X){return A.H.useActionState(z,Y,X)},At.useCallback=function(z,Y){return A.H.useCallback(z,Y)},At.useContext=function(z){return A.H.useContext(z)},At.useDebugValue=function(){},At.useDeferredValue=function(z,Y){return A.H.useDeferredValue(z,Y)},At.useEffect=function(z,Y){return A.H.useEffect(z,Y)},At.useEffectEvent=function(z){return A.H.useEffectEvent(z)},At.useId=function(){return A.H.useId()},At.useImperativeHandle=function(z,Y,X){return A.H.useImperativeHandle(z,Y,X)},At.useInsertionEffect=function(z,Y){return A.H.useInsertionEffect(z,Y)},At.useLayoutEffect=function(z,Y){return A.H.useLayoutEffect(z,Y)},At.useMemo=function(z,Y){return A.H.useMemo(z,Y)},At.useOptimistic=function(z,Y){return A.H.useOptimistic(z,Y)},At.useReducer=function(z,Y,X){return A.H.useReducer(z,Y,X)},At.useRef=function(z){return A.H.useRef(z)},At.useState=function(z){return A.H.useState(z)},At.useSyncExternalStore=function(z,Y,X){return A.H.useSyncExternalStore(z,Y,X)},At.useTransition=function(){return A.H.useTransition()},At.version="19.2.4",At}var xE;function Xu(){return xE||(xE=1,Ag.exports=FD()),Ag.exports}var y=Xu();const Pe=ET(y),Kv=hD({__proto__:null,default:Pe},[y]);var jT=y.createContext(void 0),Wu=e=>{const t=y.useContext(jT);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},VD=({client:e,children:t})=>(y.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),E.jsx(jT.Provider,{value:e,children:t})),_T=y.createContext(!1),YD=()=>y.useContext(_T);_T.Provider;function qD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var $D=y.createContext(qD()),KD=()=>y.useContext($D),GD=(e,t,n)=>{const a=n!=null&&n.state.error&&typeof e.throwOnError=="function"?Yv(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||a)&&(t.isReset()||(e.retryOnMount=!1))},XD=e=>{y.useEffect(()=>{e.clearReset()},[e])},WD=({result:e,errorResetBoundary:t,throwOnError:n,query:a,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&a&&(s&&e.data===void 0||Yv(n,[e.error,a])),QD=e=>{if(e.suspense){const n=s=>s==="static"?s:Math.max(s??1e3,1e3),a=e.staleTime;e.staleTime=typeof a=="function"?(...s)=>n(a(...s)):n(a),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ZD=(e,t)=>e.isLoading&&e.isFetching&&!t,JD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,wE=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function ek(e,t,n){var b,x,w,S;const a=YD(),s=KD(),i=Wu(),c=i.defaultQueryOptions(e);(x=(b=i.getDefaultOptions().queries)==null?void 0:b._experimental_beforeQuery)==null||x.call(b,c);const d=i.getQueryCache().get(c.queryHash);c._optimisticResults=a?"isRestoring":"optimistic",QD(c),GD(c,s,d),XD(s);const h=!i.getQueryCache().get(c.queryHash),[f]=y.useState(()=>new t(i,c)),g=f.getOptimisticResult(c),m=!a&&e.subscribed!==!1;if(y.useSyncExternalStore(y.useCallback(R=>{const T=m?f.subscribe($n.batchCalls(R)):pr;return f.updateResult(),T},[f,m]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),y.useEffect(()=>{f.setOptions(c)},[c,f]),JD(c,g))throw wE(c,f,s);if(WD({result:g,errorResetBoundary:s,throwOnError:c.throwOnError,query:d,suspense:c.suspense}))throw g.error;if((S=(w=i.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||S.call(w,c,g),c.experimental_prefetchInRender&&!yi&&ZD(g,a)){const R=h?wE(c,f,s):d==null?void 0:d.promise;R==null||R.catch(pr).finally(()=>{f.updateResult()})}return c.notifyOnChangeProps?g:f.trackResult(g)}function Qu(e,t){return ek(e,jD)}function Au(e,t){const n=Wu(),[a]=y.useState(()=>new UD(n,e));y.useEffect(()=>{a.setOptions(e)},[a,e]);const s=y.useSyncExternalStore(y.useCallback(c=>a.subscribe($n.batchCalls(c)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),i=y.useCallback((c,d)=>{a.mutate(c,d).catch(pr)},[a]);if(s.error&&Yv(a.options.throwOnError,[s.error]))throw s.error;return{...s,mutate:i,mutateAsync:s.mutate}}const Gv="en_US",_Y={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 LT(e){return e.replace("_","-")}function tk(e,t){const n=(e==null?void 0:e.trim())||"unknown";return t?n:`${n}_dev`}var Dg={},Ws={},Qs={},SE;function nk(){if(SE)return Qs;SE=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.BinaryReader=Qs.BinaryWriter=void 0;class e{constructor(a=1024){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=new Uint8Array(a),this.view=new DataView(this.buffer.buffer)}ensureCapacity(a){const s=this.offset+a;if(s<=this.buffer.length)return;let i=this.buffer.length;for(;i<s;)i*=2;const c=new Uint8Array(i);c.set(this.buffer),this.buffer=c,this.view=new DataView(this.buffer.buffer)}writeUint8(a){this.ensureCapacity(1),this.view.setUint8(this.offset,a),this.offset+=1}writeUint16(a){this.ensureCapacity(2),this.view.setUint16(this.offset,a,!0),this.offset+=2}writeUint32(a){this.ensureCapacity(4),this.view.setUint32(this.offset,a,!0),this.offset+=4}writeUint64(a){this.ensureCapacity(8),this.view.setBigUint64(this.offset,a,!0),this.offset+=8}writeUint128(a){this.ensureCapacity(16);const s=a&BigInt("0xFFFFFFFFFFFFFFFF"),i=a>>BigInt(64);this.writeUint64(s),this.writeUint64(i)}writeInt8(a){this.ensureCapacity(1),this.view.setInt8(this.offset,a),this.offset+=1}writeInt16(a){this.ensureCapacity(2),this.view.setInt16(this.offset,a,!0),this.offset+=2}writeInt32(a){this.ensureCapacity(4),this.view.setInt32(this.offset,a,!0),this.offset+=4}writeInt64(a){this.ensureCapacity(8),this.view.setBigInt64(this.offset,a,!0),this.offset+=8}writeInt128(a){this.ensureCapacity(16);const s=a&BigInt("0xFFFFFFFFFFFFFFFF"),i=a>>BigInt(64);this.writeInt64(s),this.writeInt64(i)}writeFloat32(a){this.ensureCapacity(4),this.view.setFloat32(this.offset,a,!0),this.offset+=4}writeFloat64(a){this.ensureCapacity(8),this.view.setFloat64(this.offset,a,!0),this.offset+=8}writeBool(a){this.writeUint8(a?1:0)}writeString(a){const s=new TextEncoder().encode(a);this.writeUint32(s.length),this.ensureCapacity(s.length),this.buffer.set(s,this.offset),this.offset+=s.length}getBuffer(){return this.buffer.slice(0,this.offset)}}Qs.BinaryWriter=e;class t{constructor(a){We(this,"buffer");We(this,"view");We(this,"offset",0);this.buffer=a,this.view=new DataView(a.buffer,a.byteOffset,a.byteLength)}readUint8(){const a=this.view.getUint8(this.offset);return this.offset+=1,a}readUint16(){const a=this.view.getUint16(this.offset,!0);return this.offset+=2,a}readUint32(){const a=this.view.getUint32(this.offset,!0);return this.offset+=4,a}readUint64(){const a=this.view.getBigUint64(this.offset,!0);return this.offset+=8,a}readUint128(){const a=this.readUint64();return this.readUint64()<<BigInt(64)|a}readInt8(){const a=this.view.getInt8(this.offset);return this.offset+=1,a}readInt16(){const a=this.view.getInt16(this.offset,!0);return this.offset+=2,a}readInt32(){const a=this.view.getInt32(this.offset,!0);return this.offset+=4,a}readInt64(){const a=this.view.getBigInt64(this.offset,!0);return this.offset+=8,a}readInt128(){const a=this.readUint64();return this.readInt64()<<BigInt(64)|a}readFloat32(){const a=this.view.getFloat32(this.offset,!0);return this.offset+=4,a}readFloat64(){const a=this.view.getFloat64(this.offset,!0);return this.offset+=8,a}readBool(){return!!this.readUint8()}readString(){const a=this.readUint32(),s=this.buffer.slice(this.offset,this.offset+a);return this.offset+=a,new TextDecoder().decode(s)}getOffset(){return this.offset}}return Qs.BinaryReader=t,Qs}var kg={},EE;function rk(){return EE||(EE=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.registry=e.TypeRegistry=void 0;class t{constructor(){We(this,"handlers",new Map)}register(a,s){this.handlers.set(a,s)}getHandler(a){const s=this.handlers.get(a);if(!s)throw new Error(`No handler registered for type: ${a}`);return s}}e.TypeRegistry=t,e.registry=new t,e.registry.register("u8",{write:(n,a)=>{if(a<0||a>255||!Number.isInteger(a))throw new Error("Value out of range for u8");n.writeUint8(a)},read:n=>n.readUint8()}),e.registry.register("u16",{write:(n,a)=>{if(a<0||a>65535||!Number.isInteger(a))throw new Error("Value out of range for u16");n.writeUint16(a)},read:n=>n.readUint16()}),e.registry.register("u32",{write:(n,a)=>{if(a<0||a>4294967295||!Number.isInteger(a))throw new Error("Value out of range for u32");n.writeUint32(a)},read:n=>n.readUint32()}),e.registry.register("u64",{write:(n,a)=>{if(a<0n||a>18446744073709551615n)throw new Error("Value out of range for u64");n.writeUint64(a)},read:n=>n.readUint64()}),e.registry.register("u128",{write:(n,a)=>{if(a<0n||a>340282366920938463463374607431768211455n)throw new Error("Value out of range for u128");n.writeUint128(a)},read:n=>n.readUint128()}),e.registry.register("i8",{write:(n,a)=>{if(a<-128||a>127||!Number.isInteger(a))throw new Error("Value out of range for i8");n.writeInt8(a)},read:n=>n.readInt8()}),e.registry.register("i16",{write:(n,a)=>{if(a<-32768||a>32767||!Number.isInteger(a))throw new Error("Value out of range for i16");n.writeInt16(a)},read:n=>n.readInt16()}),e.registry.register("i32",{write:(n,a)=>{if(a<-2147483648||a>2147483647||!Number.isInteger(a))throw new Error("Value out of range for i32");n.writeInt32(a)},read:n=>n.readInt32()}),e.registry.register("i64",{write:(n,a)=>{if(a<-9223372036854775808n||a>9223372036854775807n)throw new Error("Value out of range for i64");n.writeInt64(a)},read:n=>n.readInt64()}),e.registry.register("i128",{write:(n,a)=>{if(a<-170141183460469231731687303715884105728n||a>170141183460469231731687303715884105727n)throw new Error("Value out of range for i128");n.writeInt128(a)},read:n=>n.readInt128()}),e.registry.register("f32",{write:(n,a)=>n.writeFloat32(a),read:n=>n.readFloat32()}),e.registry.register("f64",{write:(n,a)=>{if(Number.isNaN(a))throw new Error("For portability reasons we do not allow serializing NaN values.");n.writeFloat64(a)},read:n=>n.readFloat64()}),e.registry.register("bool",{write:(n,a)=>n.writeBool(a),read:n=>n.readBool()}),e.registry.register("string",{write:(n,a)=>n.writeString(a),read:n=>n.readString()}),e.registry.register("unit",{write:()=>{},read:()=>({})}),e.registry.register("struct",{write:(n,a,s)=>{if(s)for(const[i,c]of Object.entries(s))e.registry.getHandler(c.type).write(n,a[i],c.options)},read:(n,a)=>{if(!a)return{};const s={};for(const[i,c]of Object.entries(a)){const d=e.registry.getHandler(c.type);s[i]=d.read(n,c.options)}return s}}),e.registry.register("vec",{write:(n,a,s)=>{if(!s)return;const{elementType:i,elementOptions:c}=s,d=(ArrayBuffer.isView(a),a.length);n.writeUint32(d);const h=e.registry.getHandler(i);if(ArrayBuffer.isView(a))for(let f=0;f<d;f++)h.write(n,a[f],c);else for(const f of a)h.write(n,f,c)},read:(n,a)=>{if(!a)return[];const{elementType:s,elementOptions:i}=a,c=n.readUint32(),d=e.registry.getHandler(s),h=Array.from({length:c},()=>d.read(n,i));switch(s){case"u8":return new Uint8Array(h);case"u16":return new Uint16Array(h);case"u32":return new Uint32Array(h);case"i8":return new Int8Array(h);case"i16":return new Int16Array(h);case"i32":return new Int32Array(h);case"i64":return new BigInt64Array(h);case"f32":return new Float32Array(h);case"f64":return new Float64Array(h);default:return h}}}),e.registry.register("set",{write:(n,a,s)=>{if(!s)return;const{elementType:i,elementOptions:c}=s,d=Array.from(a).sort();n.writeUint32(d.length);const h=e.registry.getHandler(i);for(const f of d)h.write(n,f,c)},read:(n,a)=>{if(!a)return new Set;const{elementType:s,elementOptions:i}=a,c=n.readUint32(),d=e.registry.getHandler(s),h=Array.from({length:c},()=>d.read(n,i));return new Set(h)}}),e.registry.register("map",{write:(n,a,s)=>{if(!s)return;const{keyType:i,keyOptions:c,valueType:d,valueOptions:h}=s,f=Array.from(a.entries()).sort();n.writeUint32(f.length);const g=e.registry.getHandler(i),m=e.registry.getHandler(d);for(const[b,x]of f)g.write(n,b,c),m.write(n,x,h)},read:(n,a)=>{if(!a)return new Map;const{keyType:s,keyOptions:i,valueType:c,valueOptions:d}=a,h=n.readUint32(),f=e.registry.getHandler(s),g=e.registry.getHandler(c),m=Array.from({length:h},()=>{const b=f.read(n,i),x=g.read(n,d);return[b,x]});return new Map(m)}}),e.registry.register("option",{write:(n,a,s)=>{if(!s)return;const{valueType:i,valueOptions:c}=s,d=a!==null;n.writeUint8(d?1:0),d&&e.registry.getHandler(i).write(n,a,c)},read:(n,a)=>{if(!a)return null;const{valueType:s,valueOptions:i}=a;return n.readUint8()===1?e.registry.getHandler(s).read(n,i):null}}),e.registry.register("enum",{write:(n,a,s)=>{if(!s)return;const i=Object.keys(a)[0],c=a[i],d=s.variants.find(h=>h.name===i);if(!d)throw new Error(`Unknown enum variant: ${i}`);n.writeUint8(d.index),d.type!=="unit"&&e.registry.getHandler(d.type).write(n,c,d.options)},read:(n,a)=>{if(!a)return{};const s=n.readUint8(),i=a.variants.find(h=>h.index===s);if(!i)throw new Error(`Unknown enum variant index: ${s}`);if(i.type==="unit")return{[i.name]:{}};const d=e.registry.getHandler(i.type).read(n,i.options);return{[i.name]:d}}}),e.registry.register("tuple",{write:(n,a,s)=>{if(s){if(a.length!==s.length)throw new Error(`Tuple length mismatch: expected ${s.length}, got ${a.length}`);for(let i=0;i<s.length;i++){const c=s[i];if(!c)throw new Error(`Missing type information for tuple element at index ${i}`);e.registry.getHandler(c.type).write(n,a[i],c.options)}}},read:(n,a)=>{if(!a)return[];const s=[];for(const i of a){const c=e.registry.getHandler(i.type);s.push(c.read(n,i.options))}return s}}),e.registry.register("array",{write:(n,a,s)=>{if(!s)return;const{elementType:i,elementOptions:c,length:d}=s;if(a.length!==d)throw new Error(`Array length mismatch: expected ${d}, got ${a.length}`);const h=e.registry.getHandler(i);for(const f of a)h.write(n,f,c)},read:(n,a)=>{if(!a)return[];const{elementType:s,elementOptions:i,length:c}=a,d=e.registry.getHandler(s);return Array.from({length:c},()=>d.read(n,i))}}),e.registry.register("bytes",{write:(n,a,s)=>{const i=a.length;if((s==null?void 0:s.length)!=null){if(i!==s.length)throw new Error(`Bytes length mismatch: expected ${s.length}, got ${i}`);for(let c=0;c<i;c++)n.writeUint8(a[c])}else{n.writeUint32(i);for(let c=0;c<i;c++)n.writeUint8(a[c])}},read:(n,a)=>{const s=(a==null?void 0:a.length)!=null?a.length:n.readUint32(),i=new Uint8Array(s);for(let c=0;c<s;c++)i[c]=n.readUint8();return i}}),e.registry.register("nativeEnum",{write:(n,a,s)=>{if(!s)return;const{valueToIndexMap:i}=s,c=a,d=i.get(c);if(d===void 0)throw new Error(`Invalid enum value: ${String(a)}`);n.writeUint8(d)},read:(n,a)=>{if(!a)return null;const{indexToValueMap:s}=a,i=n.readUint8(),c=s.get(i);if(c===void 0)throw new Error(`Invalid enum index: ${i}`);return c}})})(kg)),kg}var RE;function ak(){if(RE)return Ws;RE=1,Object.defineProperty(Ws,"__esModule",{value:!0}),Ws.b=Ws.Schema=void 0;const e=nk(),t=rk();class n{constructor(s,i,c){We(this,"type");We(this,"options");We(this,"registry");this.type=s,this.options=i,this.registry=c}serialize(s){const i=new e.BinaryWriter;return this.registry.getHandler(this.type).write(i,s,this.options),i.getBuffer()}deserialize(s){const i=new e.BinaryReader(s);return this.registry.getHandler(this.type).read(i,this.options)}}return Ws.Schema=n,Ws.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:a=>new n("vec",{elementType:a.type,elementOptions:a.options},t.registry),hashSet:a=>new n("set",{elementType:a.type,elementOptions:a.options},t.registry),hashMap:(a,s)=>new n("map",{keyType:a.type,keyOptions:a.options,valueType:s.type,valueOptions:s.options},t.registry),option:a=>new n("option",{valueType:a.type,valueOptions:a.options},t.registry),array:(a,s)=>new n("array",{elementType:a.type,elementOptions:a.options,length:s},t.registry),bytes:a=>new n("bytes",a!=null?{length:a}:{},t.registry),enum:a=>{const s=Object.entries(a).map(([i,c],d)=>({index:d,name:i,type:c.type,options:c.options}));return new n("enum",{variants:s},t.registry)},struct:a=>{const s=Object.fromEntries(Object.entries(a).map(([i,c])=>[i,{type:c.type,options:c.options}]));return new n("struct",s,t.registry)},tuple:(...a)=>{const s=a.map(i=>({type:i.type,options:i.options}));return new n("tuple",s,t.registry)},nativeEnum:a=>{const s=Object.entries(a).filter(([g])=>typeof g=="string"&&Number.isNaN(Number(g))),i=s.map(([g,m])=>m),c=i.some(g=>typeof g=="string"),d=i.some(g=>typeof g=="number");if(c&&d)throw new Error("Mixed string/numeric enums are not supported");const h=new Map,f=new Map;if(s.forEach(([g,m],b)=>{h.set(m,b),f.set(b,m)}),s.length>255)throw new Error("Borsh only supports enums with up to 255 variants");return new n("nativeEnum",{enumObj:a,valueToIndexMap:h,indexToValueMap:f},t.registry)}},Ws}var TE;function ok(){return TE||(TE=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.Schema=e.b=void 0;var t=ak();Object.defineProperty(e,"b",{enumerable:!0,get:function(){return t.b}}),Object.defineProperty(e,"Schema",{enumerable:!0,get:function(){return t.Schema}})})(Dg)),Dg}var J=ok();const sk=1,ik=2,lk=3,ck=4,uk=5,dk=257,fk=258,hk=259,mk=260,pk=261,gk=513,yk=514,vk=515,bk=516,xk=517,wk=518,Sk=519,Ek=520,Rk=522,Tk=523,Ck=524,Ok=525,Mk=526,Nk=527,Ak=528,Dk=529,kk=530,jk=531,_k=532,Lk=533,Ik=769,Pk=770,zk=771,Uk=772,Hk=773,Bk=774,Fk=775,Vk=1025,Yk=1026,qk=1281,$k=1537,Kk=1538,Gk=1539,Xk=1793,Wk=1,Qk=2,Zk=3,Jk=4,ej=5,tj=6,nj=7,rj=8,aj=9,oj=10,sj=11,ij=12,lj=13,cj=1,uj=2,dj=3,fj=1001,La=1002,hj=1003,IT=1004,rh=1005,mj=1101,pj=1102,gj=1201,yj=1202,vj=1301,bj=1302,xj=1401,wj={[fj]:"Unsupported protocol version",[La]:"Invalid frame format",[hj]:"Unknown message kind",[IT]:"Failed to decode payload",[rh]:"Frame exceeds maximum size",[mj]:"Device not found",[pj]:"Failed to connect device",[gj]:"Tmux target not found",[yj]:"Tmux not ready",[vj]:"Select conflict",[bj]:"Select token mismatch",[xj]:"Internal server error"};function Sj(e){return wj[e]??`Unknown error code: ${e}`}class Hr extends Error{constructor(t,n=!1,a){super(a??Sj(t)),this.code=t,this.retryable=n,this.name="WsBorshError"}}const PT=J.b.struct({magic:J.b.bytes(2),version:J.b.u16(),kind:J.b.u16(),flags:J.b.u16(),seq:J.b.u32(),payload:J.b.bytes()}),Ej=J.b.option(J.b.u32()),Ha=J.b.option(J.b.u16()),xn=J.b.option(J.b.string()),Rj=J.b.struct({clientImpl:J.b.string(),clientVersion:J.b.string(),maxFrameBytes:J.b.u32(),supportsCompression:J.b.bool(),supportsDiffSnapshot:J.b.bool()}),Tj=J.b.struct({serverImpl:J.b.string(),serverVersion:J.b.string(),selectedVersion:J.b.u16(),maxFrameBytes:J.b.u32(),heartbeatIntervalMs:J.b.u32(),capabilities:J.b.vec(J.b.string())}),Cj=J.b.struct({nonce:J.b.u32(),timeMs:J.b.u64()});J.b.struct({refSeq:Ej,code:J.b.u16(),message:J.b.string(),retryable:J.b.bool()});const Oj=J.b.struct({deviceId:J.b.string()}),Mj=J.b.struct({deviceId:J.b.string()}),Nj=J.b.struct({deviceId:J.b.string()}),Aj=J.b.struct({deviceId:J.b.string()}),Dj=J.b.struct({deviceId:J.b.string(),eventType:J.b.u8(),errorType:xn,message:xn,rawMessage:xn}),kj=J.b.struct({deviceId:J.b.string(),windowId:xn,paneId:xn,selectToken:J.b.bytes(16),wantHistory:J.b.bool(),cols:Ha,rows:Ha}),jj=J.b.struct({deviceId:J.b.string(),windowId:J.b.string()}),_j=J.b.struct({deviceId:J.b.string(),name:xn,cwd:xn}),Lj=J.b.struct({deviceId:J.b.string(),windowId:J.b.string()}),Ij=J.b.struct({deviceId:J.b.string(),paneId:J.b.string()}),Pj=J.b.struct({deviceId:J.b.string(),windowId:J.b.string(),name:J.b.string()}),zj=J.b.struct({deviceId:J.b.string(),style:J.b.string()}),Uj=J.b.struct({deviceId:J.b.string(),windowIds:J.b.vec(J.b.string())}),Hj=J.b.struct({deviceId:J.b.string(),windowId:J.b.string(),paneIds:J.b.vec(J.b.string())}),Bj=J.b.struct({deviceId:J.b.string(),eventType:J.b.u8(),eventData:J.b.bytes()}),Fj=J.b.struct({deviceId:J.b.string(),paneIds:J.b.vec(J.b.string())}),Vj=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),requestToken:J.b.bytes(16)}),Yj=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),cols:Ha,rows:Ha}),qj=J.b.struct({deviceId:J.b.string(),windowId:J.b.string(),cols:J.b.u16(),rows:J.b.u16()}),$j=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),direction:J.b.u8(),cwd:xn}),Kj=J.b.struct({deviceId:J.b.string(),windowId:J.b.string(),paneId:J.b.string()}),Gj=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),name:J.b.string()}),Xj=J.b.struct({deviceId:J.b.string(),srcPaneId:J.b.string(),dstPaneId:J.b.string(),position:J.b.u8()}),Wj=J.b.struct({deviceId:J.b.string(),paneId:J.b.string()}),Qj=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),encoding:J.b.u8(),data:J.b.bytes(),isComposing:J.b.bool()}),Zj=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),encoding:J.b.u8(),data:J.b.bytes(),isComposing:J.b.bool()}),zT=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),cols:J.b.u16(),rows:J.b.u16()}),Jj=zT,e_=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),encoding:J.b.u8(),data:J.b.bytes()}),t_=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),selectToken:J.b.bytes(16),encoding:J.b.u8(),alternateScreen:J.b.bool(),data:J.b.bytes()}),n_=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),text:J.b.string()}),r_=J.b.struct({deviceId:J.b.string(),windowId:J.b.string(),paneId:J.b.string(),selectToken:J.b.bytes(16)}),a_=J.b.struct({deviceId:J.b.string(),paneId:J.b.string(),selectToken:J.b.bytes(16)}),UT=J.b.struct({chunkStreamId:J.b.u32(),originalKind:J.b.u16(),originalSeq:J.b.u32(),totalChunks:J.b.u16(),chunkIndex:J.b.u16(),data:J.b.bytes()}),o_=J.b.struct({id:J.b.string(),windowId:J.b.string(),index:J.b.u16(),title:xn,customName:xn,active:J.b.bool(),width:J.b.u16(),height:J.b.u16(),currentPath:xn,currentCommand:xn,left:Ha,top:Ha}),s_=J.b.struct({id:J.b.string(),name:J.b.string(),customName:xn,index:J.b.u16(),active:J.b.bool(),layout:xn,panes:J.b.vec(o_)}),i_=J.b.struct({id:J.b.string(),name:J.b.string(),windows:J.b.vec(s_)}),l_=J.b.struct({deviceId:J.b.string(),session:J.b.option(i_)});J.b.struct({deviceId:J.b.string(),baseRevision:J.b.u32(),revision:J.b.u32(),diffFormat:J.b.u8(),diffBytes:J.b.bytes()});const c_=J.b.struct({sessionId:J.b.string()}),u_=J.b.struct({sessionId:J.b.string()}),d_=J.b.struct({sessionId:J.b.string(),seq:J.b.u32(),eventType:J.b.u8(),payload:J.b.bytes()}),f_=J.b.struct({ruleId:J.b.string(),deviceId:J.b.string(),paneId:J.b.string(),eventType:J.b.u8(),payload:J.b.bytes()}),h_=J.b.struct({windowId:J.b.string()}),m_=J.b.struct({windowId:J.b.string()}),p_=J.b.struct({windowId:J.b.string(),name:J.b.string()}),g_=J.b.struct({windowId:J.b.string()}),y_=J.b.struct({paneId:J.b.string(),windowId:J.b.string()}),v_=J.b.struct({paneId:J.b.string()}),b_=J.b.struct({windowId:J.b.string(),paneId:J.b.string()}),x_=J.b.struct({windowId:J.b.string(),layout:J.b.string()}),w_=J.b.struct({windowId:xn,paneId:xn,windowIndex:Ha,paneIndex:Ha,paneUrl:xn,paneTitle:xn,paneCurrentCommand:xn}),S_=J.b.struct({source:J.b.u8(),title:xn,body:J.b.string(),windowId:xn,paneId:xn,windowIndex:Ha,paneIndex:Ha,paneUrl:xn,paneTitle:xn,paneCurrentCommand:xn}),Du=new Uint8Array([84,88]),E_=1;function ah(e,t,n,a=0,s=E_){const i={magic:Du,version:s,kind:e,flags:a,seq:n,payload:t};return PT.serialize(i)}function pn(e,t){return e.serialize(t)}function R_(e){if(e.length<12)throw new Hr(La,!1,"Envelope too small");if(e[0]!==Du[0]||e[1]!==Du[1])throw new Hr(La,!1,"Invalid magic bytes");try{return PT.deserialize(e)}catch(t){throw new Hr(La,!1,t instanceof Error?t.message:"Failed to decode envelope")}}function Da(e,t){try{return e.deserialize(t)}catch(n){throw new Hr(IT,!1,n instanceof Error?n.message:"Failed to decode payload")}}function T_(e,t){const n=UT.serialize(e);return ah(1281,n,t)}function C_(e){return UT.deserialize(e)}function O_(e){return e.length>=2&&e[0]===Du[0]&&e[1]===Du[1]}const M_=5e3,CE=100,Vy=1e3;class N_{constructor(){We(this,"streams",new Map);We(this,"lastCleanup",Date.now())}addChunk(t){if(this.cleanup(),t.totalChunks>Vy)throw new Hr(La,!1,`Too many chunks: ${t.totalChunks} > ${Vy}`);if(t.chunkIndex>=t.totalChunks)throw new Hr(La,!1,`Chunk index out of bounds: ${t.chunkIndex} >= ${t.totalChunks}`);let n=this.streams.get(t.chunkStreamId);if(!n){if(this.streams.size>=CE&&(this.cleanup(!0),this.streams.size>=CE))throw new Hr(La,!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 Hr(La,!1,"Chunk total count mismatch");if(n.chunks.has(t.chunkIndex))throw new Hr(La,!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 a=[];let s=0;for(let d=0;d<n.totalChunks;d++){const h=n.chunks.get(d);if(!h)throw this.streams.delete(t),new Hr(La,!1,`Missing chunk index: ${d}`);a.push(h.data),s+=h.data.length}const i=new Uint8Array(s);let c=0;for(const d of a)i.set(d,c),c+=d.length;return this.streams.delete(t),{kind:n.originalKind,seq:n.originalSeq,payload:i}}cleanup(t=!1){const n=Date.now();if(!t&&n-this.lastCleanup<5e3)return;this.lastCleanup=n;const a=n-M_;for(const[s,i]of this.streams)i.createdAt<a&&this.streams.delete(s)}getActiveStreamCount(){return this.streams.size}clear(){this.streams.clear()}}function A_(e,t,n,a){const{maxFrameBytes:s,chunkStreamId:i}=a,c=16,d=18,h=s-c;if(h<=0)throw new Hr(rh,!1,`maxFrameBytes too small: ${s}`);if(e.length<=h)return{chunks:[],totalChunks:0};const f=s-c-d;if(f<=0)throw new Hr(rh,!1,`maxFrameBytes too small for chunking: ${s}`);const g=Math.ceil(e.length/f);if(g>Vy)throw new Hr(rh,!1,`Too many chunks: ${g}`);const m=[];for(let b=0;b<g;b++){const x=b*f,w=Math.min(x+f,e.length);m.push({chunkStreamId:i,originalKind:t,originalSeq:n,totalChunks:g,chunkIndex:b,data:e.slice(x,w)})}return{chunks:m,totalChunks:g}}let jg=1;function D_(){const e=jg;return jg=jg%4294967295+1,e}const k_={1:"osc9",2:"osc777",3:"osc1337",4:"osc99"};function j_(e){const t=Dj.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 __(e){const t=Bj.deserialize(e),a={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(!a)throw new Error(`Unknown tmux event type: ${t.eventType}`);return{deviceId:t.deviceId,type:a,data:L_(a,t.eventData)}}function L_(e,t){if(t.length===0)return{};try{switch(e){case"window-add":return h_.deserialize(t);case"window-close":return m_.deserialize(t);case"window-renamed":return p_.deserialize(t);case"window-active":return g_.deserialize(t);case"pane-add":return y_.deserialize(t);case"pane-close":return v_.deserialize(t);case"pane-active":return b_.deserialize(t);case"layout-change":return x_.deserialize(t);case"bell":{const n=w_.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,paneTitle:n.paneTitle??void 0,paneCurrentCommand:n.paneCurrentCommand??void 0}}case"notification":{const n=S_.deserialize(t);return{source:k_[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,paneTitle:n.paneTitle??void 0,paneCurrentCommand:n.paneCurrentCommand??void 0}}default:return{}}}catch{return{}}}function I_(e){const t=l_.deserialize(e);return{deviceId:t.deviceId,session:t.session?P_(t.session):null}}function P_(e){return{id:e.id,name:e.name,windows:e.windows.map(z_)}}function z_(e){return{id:e.id,name:e.name,customName:e.customName??void 0,index:e.index,active:e.active,layout:e.layout??void 0,panes:e.panes.map(U_)}}function U_(e){return{id:e.id,windowId:e.windowId,index:e.index,title:e.title??void 0,customName:e.customName??void 0,active:e.active,width:e.width,height:e.height,currentPath:e.currentPath??void 0,currentCommand:e.currentCommand??void 0,left:e.left??void 0,top:e.top??void 0}}var _g={exports:{}},eu={},Lg={exports:{}},Ig={};/**
19
+ * @license React
20
+ * scheduler.production.js
21
+ *
22
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
23
+ *
24
+ * This source code is licensed under the MIT license found in the
25
+ * LICENSE file in the root directory of this source tree.
26
+ */var OE;function H_(){return OE||(OE=1,(function(e){function t(_,L){var P=_.length;_.push(L);e:for(;0<P;){var V=P-1>>>1,Q=_[V];if(0<s(Q,L))_[V]=L,_[P]=Q,P=V;else break e}}function n(_){return _.length===0?null:_[0]}function a(_){if(_.length===0)return null;var L=_[0],P=_.pop();if(P!==L){_[0]=P;e:for(var V=0,Q=_.length,z=Q>>>1;V<z;){var Y=2*(V+1)-1,X=_[Y],G=Y+1,ce=_[G];if(0>s(X,P))G<Q&&0>s(ce,X)?(_[V]=ce,_[G]=P,V=G):(_[V]=X,_[Y]=P,V=Y);else if(G<Q&&0>s(ce,P))_[V]=ce,_[G]=P,V=G;else break e}}return L}function s(_,L){var P=_.sortIndex-L.sortIndex;return P!==0?P:_.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],f=[],g=1,m=null,b=3,x=!1,w=!1,S=!1,R=!1,T=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function O(_){for(var L=n(f);L!==null;){if(L.callback===null)a(f);else if(L.startTime<=_)a(f),L.sortIndex=L.expirationTime,t(h,L);else break;L=n(f)}}function D(_){if(S=!1,O(_),!w)if(n(h)!==null)w=!0,k||(k=!0,I());else{var L=n(f);L!==null&&q(D,L.startTime-_)}}var k=!1,A=-1,j=5,B=-1;function W(){return R?!0:!(e.unstable_now()-B<j)}function K(){if(R=!1,k){var _=e.unstable_now();B=_;var L=!0;try{e:{w=!1,S&&(S=!1,C(A),A=-1),x=!0;var P=b;try{t:{for(O(_),m=n(h);m!==null&&!(m.expirationTime>_&&W());){var V=m.callback;if(typeof V=="function"){m.callback=null,b=m.priorityLevel;var Q=V(m.expirationTime<=_);if(_=e.unstable_now(),typeof Q=="function"){m.callback=Q,O(_),L=!0;break t}m===n(h)&&a(h),O(_)}else a(h);m=n(h)}if(m!==null)L=!0;else{var z=n(f);z!==null&&q(D,z.startTime-_),L=!1}}break e}finally{m=null,b=P,x=!1}L=void 0}}finally{L?I():k=!1}}}var I;if(typeof M=="function")I=function(){M(K)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,F=H.port2;H.port1.onmessage=K,I=function(){F.postMessage(null)}}else I=function(){T(K,0)};function q(_,L){A=T(function(){_(e.unstable_now())},L)}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(_){_.callback=null},e.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(_){switch(b){case 1:case 2:case 3:var L=3;break;default:L=b}var P=b;b=L;try{return _()}finally{b=P}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(_,L){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var P=b;b=_;try{return L()}finally{b=P}},e.unstable_scheduleCallback=function(_,L,P){var V=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?V+P:V):P=V,_){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=P+Q,_={id:g++,callback:L,priorityLevel:_,startTime:P,expirationTime:Q,sortIndex:-1},P>V?(_.sortIndex=P,t(f,_),n(h)===null&&_===n(f)&&(S?(C(A),A=-1):S=!0,q(D,P-V))):(_.sortIndex=Q,t(h,_),w||x||(w=!0,k||(k=!0,I()))),_},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(_){var L=b;return function(){var P=b;b=L;try{return _.apply(this,arguments)}finally{b=P}}}})(Ig)),Ig}var ME;function B_(){return ME||(ME=1,Lg.exports=H_()),Lg.exports}var Pg={exports:{}},sr={};/**
27
+ * @license React
28
+ * react-dom.production.js
29
+ *
30
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */var NE;function F_(){if(NE)return sr;NE=1;var e=Xu();function t(h){var f="https://react.dev/errors/"+h;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={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},s=Symbol.for("react.portal");function i(h,f,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:h,containerInfo:f,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,f){if(h==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return sr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,sr.createPortal=function(h,f){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return i(h,f,null,g)},sr.flushSync=function(h){var f=c.T,g=a.p;try{if(c.T=null,a.p=2,h)return h()}finally{c.T=f,a.p=g,a.d.f()}},sr.preconnect=function(h,f){typeof h=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,a.d.C(h,f))},sr.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},sr.preinit=function(h,f){if(typeof h=="string"&&f&&typeof f.as=="string"){var g=f.as,m=d(g,f.crossOrigin),b=typeof f.integrity=="string"?f.integrity:void 0,x=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;g==="style"?a.d.S(h,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:b,fetchPriority:x}):g==="script"&&a.d.X(h,{crossOrigin:m,integrity:b,fetchPriority:x,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},sr.preinitModule=function(h,f){if(typeof h=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var g=d(f.as,f.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&a.d.M(h)},sr.preload=function(h,f){if(typeof h=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var g=f.as,m=d(g,f.crossOrigin);a.d.L(h,g,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},sr.preloadModule=function(h,f){if(typeof h=="string")if(f){var g=d(f.as,f.crossOrigin);a.d.m(h,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else a.d.m(h)},sr.requestFormReset=function(h){a.d.r(h)},sr.unstable_batchedUpdates=function(h,f){return h(f)},sr.useFormState=function(h,f,g){return c.H.useFormState(h,f,g)},sr.useFormStatus=function(){return c.H.useHostTransitionStatus()},sr.version="19.2.4",sr}var AE;function HT(){if(AE)return Pg.exports;AE=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(),Pg.exports=F_(),Pg.exports}/**
35
+ * @license React
36
+ * react-dom-client.production.js
37
+ *
38
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
39
+ *
40
+ * This source code is licensed under the MIT license found in the
41
+ * LICENSE file in the root directory of this source tree.
42
+ */var DE;function V_(){if(DE)return eu;DE=1;var e=B_(),t=Xu(),n=HT();function a(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)o+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function i(r){var o=r,l=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(l=o.return),r=o.return;while(r)}return o.tag===3?l:null}function c(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function d(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function h(r){if(i(r)!==r)throw Error(a(188))}function f(r){var o=r.alternate;if(!o){if(o=i(r),o===null)throw Error(a(188));return o!==r?null:r}for(var l=r,u=o;;){var p=l.return;if(p===null)break;var v=p.alternate;if(v===null){if(u=p.return,u!==null){l=u;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===l)return h(p),r;if(v===u)return h(p),o;v=v.sibling}throw Error(a(188))}if(l.return!==u.return)l=p,u=v;else{for(var N=!1,U=p.child;U;){if(U===l){N=!0,l=p,u=v;break}if(U===u){N=!0,u=p,l=v;break}U=U.sibling}if(!N){for(U=v.child;U;){if(U===l){N=!0,l=v,u=p;break}if(U===u){N=!0,u=v,l=p;break}U=U.sibling}if(!N)throw Error(a(189))}}if(l.alternate!==u)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?r:o}function g(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=g(r),o!==null)return o;r=r.sibling}return null}var m=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),M=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),D=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function I(r){return r===null||typeof r!="object"?null:(r=K&&r[K]||r["@@iterator"],typeof r=="function"?r:null)}var H=Symbol.for("react.client.reference");function F(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===H?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case S:return"Fragment";case T:return"Profiler";case R:return"StrictMode";case D:return"Suspense";case k:return"SuspenseList";case B:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case w:return"Portal";case M:return r.displayName||"Context";case C:return(r._context.displayName||"Context")+".Consumer";case O:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case A:return o=r.displayName||null,o!==null?o:F(r.type)||"Memo";case j:o=r._payload,r=r._init;try{return F(r(o))}catch{}}return null}var q=Array.isArray,_=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P={pending:!1,data:null,method:null,action:null},V=[],Q=-1;function z(r){return{current:r}}function Y(r){0>Q||(r.current=V[Q],V[Q]=null,Q--)}function X(r,o){Q++,V[Q]=r.current,r.current=o}var G=z(null),ce=z(null),oe=z(null),de=z(null);function ve(r,o){switch(X(oe,o),X(ce,r),X(G,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?MS(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=MS(o),r=NS(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}Y(G),X(G,r)}function xe(){Y(G),Y(ce),Y(oe)}function Ne(r){r.memoizedState!==null&&X(de,r);var o=G.current,l=NS(o,r.type);o!==l&&(X(ce,r),X(G,l))}function _e(r){ce.current===r&&(Y(G),Y(ce)),de.current===r&&(Y(de),Xc._currentValue=P)}var ee,ue;function pe(r){if(ee===void 0)try{throw Error()}catch(l){var o=l.stack.trim().match(/\n( *(at )?)/);ee=o&&o[1]||"",ue=-1<l.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+ee+r+ue}var ke=!1;function Te(r,o){if(!r||ke)return"";ke=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var u={DetermineComponentFrameRoot:function(){try{if(o){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(ye){var me=ye}Reflect.construct(r,[],Ae)}else{try{Ae.call()}catch(ye){me=ye}r.call(Ae.prototype)}}else{try{throw Error()}catch(ye){me=ye}(Ae=r())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(ye){if(ye&&me&&typeof ye.stack=="string")return[ye.stack,me.stack]}return[null,null]}};u.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(u.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(u.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=u.DetermineComponentFrameRoot(),N=v[0],U=v[1];if(N&&U){var te=N.split(`
45
+ `),he=U.split(`
46
+ `);for(p=u=0;u<te.length&&!te[u].includes("DetermineComponentFrameRoot");)u++;for(;p<he.length&&!he[p].includes("DetermineComponentFrameRoot");)p++;if(u===te.length||p===he.length)for(u=te.length-1,p=he.length-1;1<=u&&0<=p&&te[u]!==he[p];)p--;for(;1<=u&&0<=p;u--,p--)if(te[u]!==he[p]){if(u!==1||p!==1)do if(u--,p--,0>p||te[u]!==he[p]){var Re=`
47
+ `+te[u].replace(" at new "," at ");return r.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",r.displayName)),Re}while(1<=u&&0<=p);break}}}finally{ke=!1,Error.prepareStackTrace=l}return(l=r?r.displayName||r.name:"")?pe(l):""}function be(r,o){switch(r.tag){case 26:case 27:case 5:return pe(r.type);case 16:return pe("Lazy");case 13:return r.child!==o&&o!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return Te(r.type,!1);case 11:return Te(r.type.render,!1);case 1:return Te(r.type,!0);case 31:return pe("Activity");default:return""}}function we(r){try{var o="",l=null;do o+=be(r,l),l=r,r=r.return;while(r);return o}catch(u){return`
48
+ Error generating stack: `+u.message+`
49
+ `+u.stack}}var Z=Object.prototype.hasOwnProperty,Se=e.unstable_scheduleCallback,ge=e.unstable_cancelCallback,ze=e.unstable_shouldYield,He=e.unstable_requestPaint,De=e.unstable_now,st=e.unstable_getCurrentPriorityLevel,xt=e.unstable_ImmediatePriority,vt=e.unstable_UserBlockingPriority,Je=e.unstable_NormalPriority,Qe=e.unstable_LowPriority,ft=e.unstable_IdlePriority,se=e.log,je=e.unstable_setDisableYieldValue,Ke=null,Me=null;function Ie(r){if(typeof se=="function"&&je(r),Me&&typeof Me.setStrictMode=="function")try{Me.setStrictMode(Ke,r)}catch{}}var Fe=Math.clz32?Math.clz32:ct,ht=Math.log,Lt=Math.LN2;function ct(r){return r>>>=0,r===0?32:31-(ht(r)/Lt|0)|0}var pt=256,tt=262144,lt=4194304;function gt(r){var o=r&42;if(o!==0)return o;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function Ye(r,o,l){var u=r.pendingLanes;if(u===0)return 0;var p=0,v=r.suspendedLanes,N=r.pingedLanes;r=r.warmLanes;var U=u&134217727;return U!==0?(u=U&~v,u!==0?p=gt(u):(N&=U,N!==0?p=gt(N):l||(l=U&~r,l!==0&&(p=gt(l))))):(U=u&~v,U!==0?p=gt(U):N!==0?p=gt(N):l||(l=u&~r,l!==0&&(p=gt(l)))),p===0?0:o!==0&&o!==p&&(o&v)===0&&(v=p&-p,l=o&-o,v>=l||v===32&&(l&4194048)!==0)?o:p}function Tt(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function kt(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+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 o+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 Rt(){var r=lt;return lt<<=1,(lt&62914560)===0&&(lt=4194304),r}function on(r){for(var o=[],l=0;31>l;l++)o.push(r);return o}function Pt(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function Xe(r,o,l,u,p,v){var N=r.pendingLanes;r.pendingLanes=l,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=l,r.entangledLanes&=l,r.errorRecoveryDisabledLanes&=l,r.shellSuspendCounter=0;var U=r.entanglements,te=r.expirationTimes,he=r.hiddenUpdates;for(l=N&~l;0<l;){var Re=31-Fe(l),Ae=1<<Re;U[Re]=0,te[Re]=-1;var me=he[Re];if(me!==null)for(he[Re]=null,Re=0;Re<me.length;Re++){var ye=me[Re];ye!==null&&(ye.lane&=-536870913)}l&=~Ae}u!==0&&Ct(r,u,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(N&~o))}function Ct(r,o,l){r.pendingLanes|=o,r.suspendedLanes&=~o;var u=31-Fe(o);r.entangledLanes|=o,r.entanglements[u]=r.entanglements[u]|1073741824|l&261930}function $(r,o){var l=r.entangledLanes|=o;for(r=r.entanglements;l;){var u=31-Fe(l),p=1<<u;p&o|r[u]&o&&(r[u]|=o),l&=~p}}function re(r,o){var l=o&-o;return l=(l&42)!==0?1:le(l),(l&(r.suspendedLanes|o))!==0?0:l}function le(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function Ee(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Le(){var r=L.p;return r!==0?r:(r=window.event,r===void 0?32:ZS(r.type))}function et(r,o){var l=L.p;try{return L.p=r,o()}finally{L.p=l}}var Ze=Math.random().toString(36).slice(2),Ve="__reactFiber$"+Ze,$e="__reactProps$"+Ze,nt="__reactContainer$"+Ze,St="__reactEvents$"+Ze,ut="__reactListeners$"+Ze,Dt="__reactHandles$"+Ze,Ht="__reactResources$"+Ze,Rn="__reactMarker$"+Ze;function On(r){delete r[Ve],delete r[$e],delete r[St],delete r[ut],delete r[Dt]}function Mn(r){var o=r[Ve];if(o)return o;for(var l=r.parentNode;l;){if(o=l[nt]||l[Ve]){if(l=o.alternate,o.child!==null||l!==null&&l.child!==null)for(r=IS(r);r!==null;){if(l=r[Ve])return l;r=IS(r)}return o}r=l,l=r.parentNode}return null}function Kt(r){if(r=r[Ve]||r[nt]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function Gn(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(a(33))}function vr(r){var o=r[Ht];return o||(o=r[Ht]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function Sn(r){r[Rn]=!0}var da=new Set,Dr={};function fa(r,o){$r(r,o),$r(r+"Capture",o)}function $r(r,o){for(Dr[r]=o,r=0;r<o.length;r++)da.add(o[r])}var Xa=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]*$"),Ds={},ks={};function Gt(r){return Z.call(ks,r)?!0:Z.call(Ds,r)?!1:Xa.test(r)?ks[r]=!0:(Ds[r]=!0,!1)}function Ln(r,o,l){if(Gt(o))if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var u=o.toLowerCase().slice(0,5);if(u!=="data-"&&u!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+l)}}function ha(r,o,l){if(l===null)r.removeAttribute(o);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+l)}}function Jn(r,o,l,u){if(u===null)r.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(l);return}r.setAttributeNS(o,l,""+u)}}function Xt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function js(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function gd(r,o,l){var u=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var p=u.get,v=u.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return p.call(this)},set:function(N){l=""+N,v.call(this,N)}}),Object.defineProperty(r,o,{enumerable:u.enumerable}),{getValue:function(){return l},setValue:function(N){l=""+N},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function dc(r){if(!r._valueTracker){var o=js(r)?"checked":"value";r._valueTracker=gd(r,o,""+r[o])}}function w0(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var l=o.getValue(),u="";return r&&(u=js(r)?r.checked?"true":"false":r.value),r=u,r!==l?(o.setValue(r),!0):!1}function yd(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var oN=/[\n"\\]/g;function Kr(r){return r.replace(oN,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Sm(r,o,l,u,p,v,N,U){r.name="",N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?r.type=N:r.removeAttribute("type"),o!=null?N==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+Xt(o)):r.value!==""+Xt(o)&&(r.value=""+Xt(o)):N!=="submit"&&N!=="reset"||r.removeAttribute("value"),o!=null?Em(r,N,Xt(o)):l!=null?Em(r,N,Xt(l)):u!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?r.name=""+Xt(U):r.removeAttribute("name")}function S0(r,o,l,u,p,v,N,U){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),o!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||o!=null)){dc(r);return}l=l!=null?""+Xt(l):"",o=o!=null?""+Xt(o):l,U||o===r.value||(r.value=o),r.defaultValue=o}u=u??p,u=typeof u!="function"&&typeof u!="symbol"&&!!u,r.checked=U?r.checked:!!u,r.defaultChecked=!!u,N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(r.name=N),dc(r)}function Em(r,o,l){o==="number"&&yd(r.ownerDocument)===r||r.defaultValue===""+l||(r.defaultValue=""+l)}function Di(r,o,l,u){if(r=r.options,o){o={};for(var p=0;p<l.length;p++)o["$"+l[p]]=!0;for(l=0;l<r.length;l++)p=o.hasOwnProperty("$"+r[l].value),r[l].selected!==p&&(r[l].selected=p),p&&u&&(r[l].defaultSelected=!0)}else{for(l=""+Xt(l),o=null,p=0;p<r.length;p++){if(r[p].value===l){r[p].selected=!0,u&&(r[p].defaultSelected=!0);return}o!==null||r[p].disabled||(o=r[p])}o!==null&&(o.selected=!0)}}function E0(r,o,l){if(o!=null&&(o=""+Xt(o),o!==r.value&&(r.value=o),l==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=l!=null?""+Xt(l):""}function R0(r,o,l,u){if(o==null){if(u!=null){if(l!=null)throw Error(a(92));if(q(u)){if(1<u.length)throw Error(a(93));u=u[0]}l=u}l==null&&(l=""),o=l}l=Xt(o),r.defaultValue=l,u=r.textContent,u===l&&u!==""&&u!==null&&(r.value=u),dc(r)}function ki(r,o){if(o){var l=r.firstChild;if(l&&l===r.lastChild&&l.nodeType===3){l.nodeValue=o;return}}r.textContent=o}var sN=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 T0(r,o,l){var u=o.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?u?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":u?r.setProperty(o,l):typeof l!="number"||l===0||sN.has(o)?o==="float"?r.cssFloat=l:r[o]=(""+l).trim():r[o]=l+"px"}function C0(r,o,l){if(o!=null&&typeof o!="object")throw Error(a(62));if(r=r.style,l!=null){for(var u in l)!l.hasOwnProperty(u)||o!=null&&o.hasOwnProperty(u)||(u.indexOf("--")===0?r.setProperty(u,""):u==="float"?r.cssFloat="":r[u]="");for(var p in o)u=o[p],o.hasOwnProperty(p)&&l[p]!==u&&T0(r,p,u)}else for(var v in o)o.hasOwnProperty(v)&&T0(r,v,o[v])}function Rm(r){if(r.indexOf("-")===-1)return!1;switch(r){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 iN=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"]]),lN=/^[\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 vd(r){return lN.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Wa(){}var Tm=null;function Cm(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ji=null,_i=null;function O0(r){var o=Kt(r);if(o&&(r=o.stateNode)){var l=r[$e]||null;e:switch(r=o.stateNode,o.type){case"input":if(Sm(r,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),o=l.name,l.type==="radio"&&o!=null){for(l=r;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Kr(""+o)+'"][type="radio"]'),o=0;o<l.length;o++){var u=l[o];if(u!==r&&u.form===r.form){var p=u[$e]||null;if(!p)throw Error(a(90));Sm(u,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(o=0;o<l.length;o++)u=l[o],u.form===r.form&&w0(u)}break e;case"textarea":E0(r,l.value,l.defaultValue);break e;case"select":o=l.value,o!=null&&Di(r,!!l.multiple,o,!1)}}}var Om=!1;function M0(r,o,l){if(Om)return r(o,l);Om=!0;try{var u=r(o);return u}finally{if(Om=!1,(ji!==null||_i!==null)&&(of(),ji&&(o=ji,r=_i,_i=ji=null,O0(o),r)))for(o=0;o<r.length;o++)O0(r[o])}}function fc(r,o){var l=r.stateNode;if(l===null)return null;var u=l[$e]||null;if(u===null)return null;l=u[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(l&&typeof l!="function")throw Error(a(231,o,typeof l));return l}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mm=!1;if(Qa)try{var hc={};Object.defineProperty(hc,"passive",{get:function(){Mm=!0}}),window.addEventListener("test",hc,hc),window.removeEventListener("test",hc,hc)}catch{Mm=!1}var Do=null,Nm=null,bd=null;function N0(){if(bd)return bd;var r,o=Nm,l=o.length,u,p="value"in Do?Do.value:Do.textContent,v=p.length;for(r=0;r<l&&o[r]===p[r];r++);var N=l-r;for(u=1;u<=N&&o[l-u]===p[v-u];u++);return bd=p.slice(r,1<u?1-u:void 0)}function xd(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function wd(){return!0}function A0(){return!1}function br(r){function o(l,u,p,v,N){this._reactName=l,this._targetInst=p,this.type=u,this.nativeEvent=v,this.target=N,this.currentTarget=null;for(var U in r)r.hasOwnProperty(U)&&(l=r[U],this[U]=l?l(v):v[U]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?wd:A0,this.isPropagationStopped=A0,this}return m(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=wd)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=wd)},persist:function(){},isPersistent:wd}),o}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sd=br(_s),mc=m({},_s,{view:0,detail:0}),cN=br(mc),Am,Dm,pc,Ed=m({},mc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jm,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==pc&&(pc&&r.type==="mousemove"?(Am=r.screenX-pc.screenX,Dm=r.screenY-pc.screenY):Dm=Am=0,pc=r),Am)},movementY:function(r){return"movementY"in r?r.movementY:Dm}}),D0=br(Ed),uN=m({},Ed,{dataTransfer:0}),dN=br(uN),fN=m({},mc,{relatedTarget:0}),km=br(fN),hN=m({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),mN=br(hN),pN=m({},_s,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),gN=br(pN),yN=m({},_s,{data:0}),k0=br(yN),vN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bN={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"},xN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wN(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=xN[r])?!!o[r]:!1}function jm(){return wN}var SN=m({},mc,{key:function(r){if(r.key){var o=vN[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=xd(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?bN[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jm,charCode:function(r){return r.type==="keypress"?xd(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?xd(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),EN=br(SN),RN=m({},Ed,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),j0=br(RN),TN=m({},mc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jm}),CN=br(TN),ON=m({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),MN=br(ON),NN=m({},Ed,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),AN=br(NN),DN=m({},_s,{newState:0,oldState:0}),kN=br(DN),jN=[9,13,27,32],_m=Qa&&"CompositionEvent"in window,gc=null;Qa&&"documentMode"in document&&(gc=document.documentMode);var _N=Qa&&"TextEvent"in window&&!gc,_0=Qa&&(!_m||gc&&8<gc&&11>=gc),L0=" ",I0=!1;function P0(r,o){switch(r){case"keyup":return jN.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function z0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Li=!1;function LN(r,o){switch(r){case"compositionend":return z0(o);case"keypress":return o.which!==32?null:(I0=!0,L0);case"textInput":return r=o.data,r===L0&&I0?null:r;default:return null}}function IN(r,o){if(Li)return r==="compositionend"||!_m&&P0(r,o)?(r=N0(),bd=Nm=Do=null,Li=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return _0&&o.locale!=="ko"?null:o.data;default:return null}}var PN={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 U0(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!PN[r.type]:o==="textarea"}function H0(r,o,l,u){ji?_i?_i.push(u):_i=[u]:ji=u,o=hf(o,"onChange"),0<o.length&&(l=new Sd("onChange","change",null,l,u),r.push({event:l,listeners:o}))}var yc=null,vc=null;function zN(r){SS(r,0)}function Rd(r){var o=Gn(r);if(w0(o))return r}function B0(r,o){if(r==="change")return o}var F0=!1;if(Qa){var Lm;if(Qa){var Im="oninput"in document;if(!Im){var V0=document.createElement("div");V0.setAttribute("oninput","return;"),Im=typeof V0.oninput=="function"}Lm=Im}else Lm=!1;F0=Lm&&(!document.documentMode||9<document.documentMode)}function Y0(){yc&&(yc.detachEvent("onpropertychange",q0),vc=yc=null)}function q0(r){if(r.propertyName==="value"&&Rd(vc)){var o=[];H0(o,vc,r,Cm(r)),M0(zN,o)}}function UN(r,o,l){r==="focusin"?(Y0(),yc=o,vc=l,yc.attachEvent("onpropertychange",q0)):r==="focusout"&&Y0()}function HN(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Rd(vc)}function BN(r,o){if(r==="click")return Rd(o)}function FN(r,o){if(r==="input"||r==="change")return Rd(o)}function VN(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var kr=typeof Object.is=="function"?Object.is:VN;function bc(r,o){if(kr(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var l=Object.keys(r),u=Object.keys(o);if(l.length!==u.length)return!1;for(u=0;u<l.length;u++){var p=l[u];if(!Z.call(o,p)||!kr(r[p],o[p]))return!1}return!0}function $0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function K0(r,o){var l=$0(r);r=0;for(var u;l;){if(l.nodeType===3){if(u=r+l.textContent.length,r<=o&&u>=o)return{node:l,offset:o-r};r=u}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=$0(l)}}function G0(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?G0(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function X0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=yd(r.document);o instanceof r.HTMLIFrameElement;){try{var l=typeof o.contentWindow.location.href=="string"}catch{l=!1}if(l)r=o.contentWindow;else break;o=yd(r.document)}return o}function Pm(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var YN=Qa&&"documentMode"in document&&11>=document.documentMode,Ii=null,zm=null,xc=null,Um=!1;function W0(r,o,l){var u=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Um||Ii==null||Ii!==yd(u)||(u=Ii,"selectionStart"in u&&Pm(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),xc&&bc(xc,u)||(xc=u,u=hf(zm,"onSelect"),0<u.length&&(o=new Sd("onSelect","select",null,o,l),r.push({event:o,listeners:u}),o.target=Ii)))}function Ls(r,o){var l={};return l[r.toLowerCase()]=o.toLowerCase(),l["Webkit"+r]="webkit"+o,l["Moz"+r]="moz"+o,l}var Pi={animationend:Ls("Animation","AnimationEnd"),animationiteration:Ls("Animation","AnimationIteration"),animationstart:Ls("Animation","AnimationStart"),transitionrun:Ls("Transition","TransitionRun"),transitionstart:Ls("Transition","TransitionStart"),transitioncancel:Ls("Transition","TransitionCancel"),transitionend:Ls("Transition","TransitionEnd")},Hm={},Q0={};Qa&&(Q0=document.createElement("div").style,"AnimationEvent"in window||(delete Pi.animationend.animation,delete Pi.animationiteration.animation,delete Pi.animationstart.animation),"TransitionEvent"in window||delete Pi.transitionend.transition);function Is(r){if(Hm[r])return Hm[r];if(!Pi[r])return r;var o=Pi[r],l;for(l in o)if(o.hasOwnProperty(l)&&l in Q0)return Hm[r]=o[l];return r}var Z0=Is("animationend"),J0=Is("animationiteration"),ex=Is("animationstart"),qN=Is("transitionrun"),$N=Is("transitionstart"),KN=Is("transitioncancel"),tx=Is("transitionend"),nx=new Map,Bm="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(" ");Bm.push("scrollEnd");function ma(r,o){nx.set(r,o),fa(o,[r])}var Td=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Gr=[],zi=0,Fm=0;function Cd(){for(var r=zi,o=Fm=zi=0;o<r;){var l=Gr[o];Gr[o++]=null;var u=Gr[o];Gr[o++]=null;var p=Gr[o];Gr[o++]=null;var v=Gr[o];if(Gr[o++]=null,u!==null&&p!==null){var N=u.pending;N===null?p.next=p:(p.next=N.next,N.next=p),u.pending=p}v!==0&&rx(l,p,v)}}function Od(r,o,l,u){Gr[zi++]=r,Gr[zi++]=o,Gr[zi++]=l,Gr[zi++]=u,Fm|=u,r.lanes|=u,r=r.alternate,r!==null&&(r.lanes|=u)}function Vm(r,o,l,u){return Od(r,o,l,u),Md(r)}function Ps(r,o){return Od(r,null,null,o),Md(r)}function rx(r,o,l){r.lanes|=l;var u=r.alternate;u!==null&&(u.lanes|=l);for(var p=!1,v=r.return;v!==null;)v.childLanes|=l,u=v.alternate,u!==null&&(u.childLanes|=l),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&o!==null&&(p=31-Fe(l),r=v.hiddenUpdates,u=r[p],u===null?r[p]=[o]:u.push(o),o.lane=l|536870912),v):null}function Md(r){if(50<Fc)throw Fc=0,Zp=null,Error(a(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var Ui={};function GN(r,o,l,u){this.tag=r,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jr(r,o,l,u){return new GN(r,o,l,u)}function Ym(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Za(r,o){var l=r.alternate;return l===null?(l=jr(r.tag,o,r.key,r.mode),l.elementType=r.elementType,l.type=r.type,l.stateNode=r.stateNode,l.alternate=r,r.alternate=l):(l.pendingProps=o,l.type=r.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=r.flags&65011712,l.childLanes=r.childLanes,l.lanes=r.lanes,l.child=r.child,l.memoizedProps=r.memoizedProps,l.memoizedState=r.memoizedState,l.updateQueue=r.updateQueue,o=r.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},l.sibling=r.sibling,l.index=r.index,l.ref=r.ref,l.refCleanup=r.refCleanup,l}function ax(r,o){r.flags&=65011714;var l=r.alternate;return l===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=l.childLanes,r.lanes=l.lanes,r.child=l.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=l.memoizedProps,r.memoizedState=l.memoizedState,r.updateQueue=l.updateQueue,r.type=l.type,o=l.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function Nd(r,o,l,u,p,v){var N=0;if(u=r,typeof r=="function")Ym(r)&&(N=1);else if(typeof r=="string")N=JA(r,l,G.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case B:return r=jr(31,l,o,p),r.elementType=B,r.lanes=v,r;case S:return zs(l.children,p,v,o);case R:N=8,p|=24;break;case T:return r=jr(12,l,o,p|2),r.elementType=T,r.lanes=v,r;case D:return r=jr(13,l,o,p),r.elementType=D,r.lanes=v,r;case k:return r=jr(19,l,o,p),r.elementType=k,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case M:N=10;break e;case C:N=9;break e;case O:N=11;break e;case A:N=14;break e;case j:N=16,u=null;break e}N=29,l=Error(a(130,r===null?"null":typeof r,"")),u=null}return o=jr(N,l,o,p),o.elementType=r,o.type=u,o.lanes=v,o}function zs(r,o,l,u){return r=jr(7,r,u,o),r.lanes=l,r}function qm(r,o,l){return r=jr(6,r,null,o),r.lanes=l,r}function ox(r){var o=jr(18,null,null,0);return o.stateNode=r,o}function $m(r,o,l){return o=jr(4,r.children!==null?r.children:[],r.key,o),o.lanes=l,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var sx=new WeakMap;function Xr(r,o){if(typeof r=="object"&&r!==null){var l=sx.get(r);return l!==void 0?l:(o={value:r,source:o,stack:we(o)},sx.set(r,o),o)}return{value:r,source:o,stack:we(o)}}var Hi=[],Bi=0,Ad=null,wc=0,Wr=[],Qr=0,ko=null,Ca=1,Oa="";function Ja(r,o){Hi[Bi++]=wc,Hi[Bi++]=Ad,Ad=r,wc=o}function ix(r,o,l){Wr[Qr++]=Ca,Wr[Qr++]=Oa,Wr[Qr++]=ko,ko=r;var u=Ca;r=Oa;var p=32-Fe(u)-1;u&=~(1<<p),l+=1;var v=32-Fe(o)+p;if(30<v){var N=p-p%5;v=(u&(1<<N)-1).toString(32),u>>=N,p-=N,Ca=1<<32-Fe(o)+p|l<<p|u,Oa=v+r}else Ca=1<<v|l<<p|u,Oa=r}function Km(r){r.return!==null&&(Ja(r,1),ix(r,1,0))}function Gm(r){for(;r===Ad;)Ad=Hi[--Bi],Hi[Bi]=null,wc=Hi[--Bi],Hi[Bi]=null;for(;r===ko;)ko=Wr[--Qr],Wr[Qr]=null,Oa=Wr[--Qr],Wr[Qr]=null,Ca=Wr[--Qr],Wr[Qr]=null}function lx(r,o){Wr[Qr++]=Ca,Wr[Qr++]=Oa,Wr[Qr++]=ko,Ca=o.id,Oa=o.overflow,ko=r}var er=null,vn=null,Wt=!1,jo=null,Zr=!1,Xm=Error(a(519));function _o(r){var o=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sc(Xr(o,r)),Xm}function cx(r){var o=r.stateNode,l=r.type,u=r.memoizedProps;switch(o[Ve]=r,o[$e]=u,l){case"dialog":Ft("cancel",o),Ft("close",o);break;case"iframe":case"object":case"embed":Ft("load",o);break;case"video":case"audio":for(l=0;l<Yc.length;l++)Ft(Yc[l],o);break;case"source":Ft("error",o);break;case"img":case"image":case"link":Ft("error",o),Ft("load",o);break;case"details":Ft("toggle",o);break;case"input":Ft("invalid",o),S0(o,u.value,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name,!0);break;case"select":Ft("invalid",o);break;case"textarea":Ft("invalid",o),R0(o,u.value,u.defaultValue,u.children)}l=u.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||o.textContent===""+l||u.suppressHydrationWarning===!0||CS(o.textContent,l)?(u.popover!=null&&(Ft("beforetoggle",o),Ft("toggle",o)),u.onScroll!=null&&Ft("scroll",o),u.onScrollEnd!=null&&Ft("scrollend",o),u.onClick!=null&&(o.onclick=Wa),o=!0):o=!1,o||_o(r,!0)}function ux(r){for(er=r.return;er;)switch(er.tag){case 5:case 31:case 13:Zr=!1;return;case 27:case 3:Zr=!0;return;default:er=er.return}}function Fi(r){if(r!==er)return!1;if(!Wt)return ux(r),Wt=!0,!1;var o=r.tag,l;if((l=o!==3&&o!==27)&&((l=o===5)&&(l=r.type,l=!(l!=="form"&&l!=="button")||hg(r.type,r.memoizedProps)),l=!l),l&&vn&&_o(r),ux(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vn=LS(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));vn=LS(r)}else o===27?(o=vn,Go(r.type)?(r=vg,vg=null,vn=r):vn=o):vn=er?ea(r.stateNode.nextSibling):null;return!0}function Us(){vn=er=null,Wt=!1}function Wm(){var r=jo;return r!==null&&(Er===null?Er=r:Er.push.apply(Er,r),jo=null),r}function Sc(r){jo===null?jo=[r]:jo.push(r)}var Qm=z(null),Hs=null,eo=null;function Lo(r,o,l){X(Qm,o._currentValue),o._currentValue=l}function to(r){r._currentValue=Qm.current,Y(Qm)}function Zm(r,o,l){for(;r!==null;){var u=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,u!==null&&(u.childLanes|=o)):u!==null&&(u.childLanes&o)!==o&&(u.childLanes|=o),r===l)break;r=r.return}}function Jm(r,o,l,u){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var N=p.child;v=v.firstContext;e:for(;v!==null;){var U=v;v=p;for(var te=0;te<o.length;te++)if(U.context===o[te]){v.lanes|=l,U=v.alternate,U!==null&&(U.lanes|=l),Zm(v.return,l,r),u||(N=null);break e}v=U.next}}else if(p.tag===18){if(N=p.return,N===null)throw Error(a(341));N.lanes|=l,v=N.alternate,v!==null&&(v.lanes|=l),Zm(N,l,r),N=null}else N=p.child;if(N!==null)N.return=p;else for(N=p;N!==null;){if(N===r){N=null;break}if(p=N.sibling,p!==null){p.return=N.return,N=p;break}N=N.return}p=N}}function Vi(r,o,l,u){r=null;for(var p=o,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var N=p.alternate;if(N===null)throw Error(a(387));if(N=N.memoizedProps,N!==null){var U=p.type;kr(p.pendingProps.value,N.value)||(r!==null?r.push(U):r=[U])}}else if(p===de.current){if(N=p.alternate,N===null)throw Error(a(387));N.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(Xc):r=[Xc])}p=p.return}r!==null&&Jm(o,r,l,u),o.flags|=262144}function Dd(r){for(r=r.firstContext;r!==null;){if(!kr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function Bs(r){Hs=r,eo=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function tr(r){return dx(Hs,r)}function kd(r,o){return Hs===null&&Bs(r),dx(r,o)}function dx(r,o){var l=o._currentValue;if(o={context:o,memoizedValue:l,next:null},eo===null){if(r===null)throw Error(a(308));eo=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else eo=eo.next=o;return l}var XN=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(l,u){r.push(u)}};this.abort=function(){o.aborted=!0,r.forEach(function(l){return l()})}},WN=e.unstable_scheduleCallback,QN=e.unstable_NormalPriority,zn={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ep(){return{controller:new XN,data:new Map,refCount:0}}function Ec(r){r.refCount--,r.refCount===0&&WN(QN,function(){r.controller.abort()})}var Rc=null,tp=0,Yi=0,qi=null;function ZN(r,o){if(Rc===null){var l=Rc=[];tp=0,Yi=ag(),qi={status:"pending",value:void 0,then:function(u){l.push(u)}}}return tp++,o.then(fx,fx),o}function fx(){if(--tp===0&&Rc!==null){qi!==null&&(qi.status="fulfilled");var r=Rc;Rc=null,Yi=0,qi=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function JN(r,o){var l=[],u={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return r.then(function(){u.status="fulfilled",u.value=o;for(var p=0;p<l.length;p++)(0,l[p])(o)},function(p){for(u.status="rejected",u.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),u}var hx=_.S;_.S=function(r,o){Ww=De(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&ZN(r,o),hx!==null&&hx(r,o)};var Fs=z(null);function np(){var r=Fs.current;return r!==null?r:gn.pooledCache}function jd(r,o){o===null?X(Fs,Fs.current):X(Fs,o.pool)}function mx(){var r=np();return r===null?null:{parent:zn._currentValue,pool:r}}var $i=Error(a(460)),rp=Error(a(474)),_d=Error(a(542)),Ld={then:function(){}};function px(r){return r=r.status,r==="fulfilled"||r==="rejected"}function gx(r,o,l){switch(l=r[l],l===void 0?r.push(o):l!==o&&(o.then(Wa,Wa),o=l),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,vx(r),r;default:if(typeof o.status=="string")o.then(Wa,Wa);else{if(r=gn,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=o,r.status="pending",r.then(function(u){if(o.status==="pending"){var p=o;p.status="fulfilled",p.value=u}},function(u){if(o.status==="pending"){var p=o;p.status="rejected",p.reason=u}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,vx(r),r}throw Ys=o,$i}}function Vs(r){try{var o=r._init;return o(r._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Ys=l,$i):l}}var Ys=null;function yx(){if(Ys===null)throw Error(a(459));var r=Ys;return Ys=null,r}function vx(r){if(r===$i||r===_d)throw Error(a(483))}var Ki=null,Tc=0;function Id(r){var o=Tc;return Tc+=1,Ki===null&&(Ki=[]),gx(Ki,r,o)}function Cc(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function Pd(r,o){throw o.$$typeof===b?Error(a(525)):(r=Object.prototype.toString.call(o),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function bx(r){function o(ie,ae){if(r){var fe=ie.deletions;fe===null?(ie.deletions=[ae],ie.flags|=16):fe.push(ae)}}function l(ie,ae){if(!r)return null;for(;ae!==null;)o(ie,ae),ae=ae.sibling;return null}function u(ie){for(var ae=new Map;ie!==null;)ie.key!==null?ae.set(ie.key,ie):ae.set(ie.index,ie),ie=ie.sibling;return ae}function p(ie,ae){return ie=Za(ie,ae),ie.index=0,ie.sibling=null,ie}function v(ie,ae,fe){return ie.index=fe,r?(fe=ie.alternate,fe!==null?(fe=fe.index,fe<ae?(ie.flags|=67108866,ae):fe):(ie.flags|=67108866,ae)):(ie.flags|=1048576,ae)}function N(ie){return r&&ie.alternate===null&&(ie.flags|=67108866),ie}function U(ie,ae,fe,Ce){return ae===null||ae.tag!==6?(ae=qm(fe,ie.mode,Ce),ae.return=ie,ae):(ae=p(ae,fe),ae.return=ie,ae)}function te(ie,ae,fe,Ce){var mt=fe.type;return mt===S?Re(ie,ae,fe.props.children,Ce,fe.key):ae!==null&&(ae.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===j&&Vs(mt)===ae.type)?(ae=p(ae,fe.props),Cc(ae,fe),ae.return=ie,ae):(ae=Nd(fe.type,fe.key,fe.props,null,ie.mode,Ce),Cc(ae,fe),ae.return=ie,ae)}function he(ie,ae,fe,Ce){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==fe.containerInfo||ae.stateNode.implementation!==fe.implementation?(ae=$m(fe,ie.mode,Ce),ae.return=ie,ae):(ae=p(ae,fe.children||[]),ae.return=ie,ae)}function Re(ie,ae,fe,Ce,mt){return ae===null||ae.tag!==7?(ae=zs(fe,ie.mode,Ce,mt),ae.return=ie,ae):(ae=p(ae,fe),ae.return=ie,ae)}function Ae(ie,ae,fe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return ae=qm(""+ae,ie.mode,fe),ae.return=ie,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case x:return fe=Nd(ae.type,ae.key,ae.props,null,ie.mode,fe),Cc(fe,ae),fe.return=ie,fe;case w:return ae=$m(ae,ie.mode,fe),ae.return=ie,ae;case j:return ae=Vs(ae),Ae(ie,ae,fe)}if(q(ae)||I(ae))return ae=zs(ae,ie.mode,fe,null),ae.return=ie,ae;if(typeof ae.then=="function")return Ae(ie,Id(ae),fe);if(ae.$$typeof===M)return Ae(ie,kd(ie,ae),fe);Pd(ie,ae)}return null}function me(ie,ae,fe,Ce){var mt=ae!==null?ae.key:null;if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return mt!==null?null:U(ie,ae,""+fe,Ce);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return fe.key===mt?te(ie,ae,fe,Ce):null;case w:return fe.key===mt?he(ie,ae,fe,Ce):null;case j:return fe=Vs(fe),me(ie,ae,fe,Ce)}if(q(fe)||I(fe))return mt!==null?null:Re(ie,ae,fe,Ce,null);if(typeof fe.then=="function")return me(ie,ae,Id(fe),Ce);if(fe.$$typeof===M)return me(ie,ae,kd(ie,fe),Ce);Pd(ie,fe)}return null}function ye(ie,ae,fe,Ce,mt){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return ie=ie.get(fe)||null,U(ae,ie,""+Ce,mt);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case x:return ie=ie.get(Ce.key===null?fe:Ce.key)||null,te(ae,ie,Ce,mt);case w:return ie=ie.get(Ce.key===null?fe:Ce.key)||null,he(ae,ie,Ce,mt);case j:return Ce=Vs(Ce),ye(ie,ae,fe,Ce,mt)}if(q(Ce)||I(Ce))return ie=ie.get(fe)||null,Re(ae,ie,Ce,mt,null);if(typeof Ce.then=="function")return ye(ie,ae,fe,Id(Ce),mt);if(Ce.$$typeof===M)return ye(ie,ae,fe,kd(ae,Ce),mt);Pd(ae,Ce)}return null}function rt(ie,ae,fe,Ce){for(var mt=null,en=null,it=ae,_t=ae=0,Yt=null;it!==null&&_t<fe.length;_t++){it.index>_t?(Yt=it,it=null):Yt=it.sibling;var tn=me(ie,it,fe[_t],Ce);if(tn===null){it===null&&(it=Yt);break}r&&it&&tn.alternate===null&&o(ie,it),ae=v(tn,ae,_t),en===null?mt=tn:en.sibling=tn,en=tn,it=Yt}if(_t===fe.length)return l(ie,it),Wt&&Ja(ie,_t),mt;if(it===null){for(;_t<fe.length;_t++)it=Ae(ie,fe[_t],Ce),it!==null&&(ae=v(it,ae,_t),en===null?mt=it:en.sibling=it,en=it);return Wt&&Ja(ie,_t),mt}for(it=u(it);_t<fe.length;_t++)Yt=ye(it,ie,_t,fe[_t],Ce),Yt!==null&&(r&&Yt.alternate!==null&&it.delete(Yt.key===null?_t:Yt.key),ae=v(Yt,ae,_t),en===null?mt=Yt:en.sibling=Yt,en=Yt);return r&&it.forEach(function(Jo){return o(ie,Jo)}),Wt&&Ja(ie,_t),mt}function bt(ie,ae,fe,Ce){if(fe==null)throw Error(a(151));for(var mt=null,en=null,it=ae,_t=ae=0,Yt=null,tn=fe.next();it!==null&&!tn.done;_t++,tn=fe.next()){it.index>_t?(Yt=it,it=null):Yt=it.sibling;var Jo=me(ie,it,tn.value,Ce);if(Jo===null){it===null&&(it=Yt);break}r&&it&&Jo.alternate===null&&o(ie,it),ae=v(Jo,ae,_t),en===null?mt=Jo:en.sibling=Jo,en=Jo,it=Yt}if(tn.done)return l(ie,it),Wt&&Ja(ie,_t),mt;if(it===null){for(;!tn.done;_t++,tn=fe.next())tn=Ae(ie,tn.value,Ce),tn!==null&&(ae=v(tn,ae,_t),en===null?mt=tn:en.sibling=tn,en=tn);return Wt&&Ja(ie,_t),mt}for(it=u(it);!tn.done;_t++,tn=fe.next())tn=ye(it,ie,_t,tn.value,Ce),tn!==null&&(r&&tn.alternate!==null&&it.delete(tn.key===null?_t:tn.key),ae=v(tn,ae,_t),en===null?mt=tn:en.sibling=tn,en=tn);return r&&it.forEach(function(uD){return o(ie,uD)}),Wt&&Ja(ie,_t),mt}function mn(ie,ae,fe,Ce){if(typeof fe=="object"&&fe!==null&&fe.type===S&&fe.key===null&&(fe=fe.props.children),typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:e:{for(var mt=fe.key;ae!==null;){if(ae.key===mt){if(mt=fe.type,mt===S){if(ae.tag===7){l(ie,ae.sibling),Ce=p(ae,fe.props.children),Ce.return=ie,ie=Ce;break e}}else if(ae.elementType===mt||typeof mt=="object"&&mt!==null&&mt.$$typeof===j&&Vs(mt)===ae.type){l(ie,ae.sibling),Ce=p(ae,fe.props),Cc(Ce,fe),Ce.return=ie,ie=Ce;break e}l(ie,ae);break}else o(ie,ae);ae=ae.sibling}fe.type===S?(Ce=zs(fe.props.children,ie.mode,Ce,fe.key),Ce.return=ie,ie=Ce):(Ce=Nd(fe.type,fe.key,fe.props,null,ie.mode,Ce),Cc(Ce,fe),Ce.return=ie,ie=Ce)}return N(ie);case w:e:{for(mt=fe.key;ae!==null;){if(ae.key===mt)if(ae.tag===4&&ae.stateNode.containerInfo===fe.containerInfo&&ae.stateNode.implementation===fe.implementation){l(ie,ae.sibling),Ce=p(ae,fe.children||[]),Ce.return=ie,ie=Ce;break e}else{l(ie,ae);break}else o(ie,ae);ae=ae.sibling}Ce=$m(fe,ie.mode,Ce),Ce.return=ie,ie=Ce}return N(ie);case j:return fe=Vs(fe),mn(ie,ae,fe,Ce)}if(q(fe))return rt(ie,ae,fe,Ce);if(I(fe)){if(mt=I(fe),typeof mt!="function")throw Error(a(150));return fe=mt.call(fe),bt(ie,ae,fe,Ce)}if(typeof fe.then=="function")return mn(ie,ae,Id(fe),Ce);if(fe.$$typeof===M)return mn(ie,ae,kd(ie,fe),Ce);Pd(ie,fe)}return typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint"?(fe=""+fe,ae!==null&&ae.tag===6?(l(ie,ae.sibling),Ce=p(ae,fe),Ce.return=ie,ie=Ce):(l(ie,ae),Ce=qm(fe,ie.mode,Ce),Ce.return=ie,ie=Ce),N(ie)):l(ie,ae)}return function(ie,ae,fe,Ce){try{Tc=0;var mt=mn(ie,ae,fe,Ce);return Ki=null,mt}catch(it){if(it===$i||it===_d)throw it;var en=jr(29,it,null,ie.mode);return en.lanes=Ce,en.return=ie,en}finally{}}}var qs=bx(!0),xx=bx(!1),Io=!1;function ap(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function op(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Po(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function zo(r,o,l){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(sn&2)!==0){var p=u.pending;return p===null?o.next=o:(o.next=p.next,p.next=o),u.pending=o,o=Md(r),rx(r,null,l),o}return Od(r,u,o,l),Md(r)}function Oc(r,o,l){if(o=o.updateQueue,o!==null&&(o=o.shared,(l&4194048)!==0)){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,$(r,l)}}function sp(r,o){var l=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,l===u)){var p=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var N={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?p=v=N:v=v.next=N,l=l.next}while(l!==null);v===null?p=v=o:v=v.next=o}else p=v=o;l={baseState:u.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:u.shared,callbacks:u.callbacks},r.updateQueue=l;return}r=l.lastBaseUpdate,r===null?l.firstBaseUpdate=o:r.next=o,l.lastBaseUpdate=o}var ip=!1;function Mc(){if(ip){var r=qi;if(r!==null)throw r}}function Nc(r,o,l,u){ip=!1;var p=r.updateQueue;Io=!1;var v=p.firstBaseUpdate,N=p.lastBaseUpdate,U=p.shared.pending;if(U!==null){p.shared.pending=null;var te=U,he=te.next;te.next=null,N===null?v=he:N.next=he,N=te;var Re=r.alternate;Re!==null&&(Re=Re.updateQueue,U=Re.lastBaseUpdate,U!==N&&(U===null?Re.firstBaseUpdate=he:U.next=he,Re.lastBaseUpdate=te))}if(v!==null){var Ae=p.baseState;N=0,Re=he=te=null,U=v;do{var me=U.lane&-536870913,ye=me!==U.lane;if(ye?(Vt&me)===me:(u&me)===me){me!==0&&me===Yi&&(ip=!0),Re!==null&&(Re=Re.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var rt=r,bt=U;me=o;var mn=l;switch(bt.tag){case 1:if(rt=bt.payload,typeof rt=="function"){Ae=rt.call(mn,Ae,me);break e}Ae=rt;break e;case 3:rt.flags=rt.flags&-65537|128;case 0:if(rt=bt.payload,me=typeof rt=="function"?rt.call(mn,Ae,me):rt,me==null)break e;Ae=m({},Ae,me);break e;case 2:Io=!0}}me=U.callback,me!==null&&(r.flags|=64,ye&&(r.flags|=8192),ye=p.callbacks,ye===null?p.callbacks=[me]:ye.push(me))}else ye={lane:me,tag:U.tag,payload:U.payload,callback:U.callback,next:null},Re===null?(he=Re=ye,te=Ae):Re=Re.next=ye,N|=me;if(U=U.next,U===null){if(U=p.shared.pending,U===null)break;ye=U,U=ye.next,ye.next=null,p.lastBaseUpdate=ye,p.shared.pending=null}}while(!0);Re===null&&(te=Ae),p.baseState=te,p.firstBaseUpdate=he,p.lastBaseUpdate=Re,v===null&&(p.shared.lanes=0),Vo|=N,r.lanes=N,r.memoizedState=Ae}}function wx(r,o){if(typeof r!="function")throw Error(a(191,r));r.call(o)}function Sx(r,o){var l=r.callbacks;if(l!==null)for(r.callbacks=null,r=0;r<l.length;r++)wx(l[r],o)}var Gi=z(null),zd=z(0);function Ex(r,o){r=uo,X(zd,r),X(Gi,o),uo=r|o.baseLanes}function lp(){X(zd,uo),X(Gi,Gi.current)}function cp(){uo=zd.current,Y(Gi),Y(zd)}var _r=z(null),Jr=null;function Uo(r){var o=r.alternate;X(In,In.current&1),X(_r,r),Jr===null&&(o===null||Gi.current!==null||o.memoizedState!==null)&&(Jr=r)}function up(r){X(In,In.current),X(_r,r),Jr===null&&(Jr=r)}function Rx(r){r.tag===22?(X(In,In.current),X(_r,r),Jr===null&&(Jr=r)):Ho()}function Ho(){X(In,In.current),X(_r,_r.current)}function Lr(r){Y(_r),Jr===r&&(Jr=null),Y(In)}var In=z(0);function Ud(r){for(var o=r;o!==null;){if(o.tag===13){var l=o.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||gg(l)||yg(l)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var no=0,jt=null,fn=null,Un=null,Hd=!1,Xi=!1,$s=!1,Bd=0,Ac=0,Wi=null,eA=0;function Nn(){throw Error(a(321))}function dp(r,o){if(o===null)return!1;for(var l=0;l<o.length&&l<r.length;l++)if(!kr(r[l],o[l]))return!1;return!0}function fp(r,o,l,u,p,v){return no=v,jt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,_.H=r===null||r.memoizedState===null?iw:Op,$s=!1,v=l(u,p),$s=!1,Xi&&(v=Cx(o,l,u,p)),Tx(r),v}function Tx(r){_.H=jc;var o=fn!==null&&fn.next!==null;if(no=0,Un=fn=jt=null,Hd=!1,Ac=0,Wi=null,o)throw Error(a(300));r===null||Hn||(r=r.dependencies,r!==null&&Dd(r)&&(Hn=!0))}function Cx(r,o,l,u){jt=r;var p=0;do{if(Xi&&(Wi=null),Ac=0,Xi=!1,25<=p)throw Error(a(301));if(p+=1,Un=fn=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}_.H=lw,v=o(l,u)}while(Xi);return v}function tA(){var r=_.H,o=r.useState()[0];return o=typeof o.then=="function"?Dc(o):o,r=r.useState()[0],(fn!==null?fn.memoizedState:null)!==r&&(jt.flags|=1024),o}function hp(){var r=Bd!==0;return Bd=0,r}function mp(r,o,l){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~l}function pp(r){if(Hd){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Hd=!1}no=0,Un=fn=jt=null,Xi=!1,Ac=Bd=0,Wi=null}function fr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Un===null?jt.memoizedState=Un=r:Un=Un.next=r,Un}function Pn(){if(fn===null){var r=jt.alternate;r=r!==null?r.memoizedState:null}else r=fn.next;var o=Un===null?jt.memoizedState:Un.next;if(o!==null)Un=o,fn=r;else{if(r===null)throw jt.alternate===null?Error(a(467)):Error(a(310));fn=r,r={memoizedState:fn.memoizedState,baseState:fn.baseState,baseQueue:fn.baseQueue,queue:fn.queue,next:null},Un===null?jt.memoizedState=Un=r:Un=Un.next=r}return Un}function Fd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Dc(r){var o=Ac;return Ac+=1,Wi===null&&(Wi=[]),r=gx(Wi,r,o),o=jt,(Un===null?o.memoizedState:Un.next)===null&&(o=o.alternate,_.H=o===null||o.memoizedState===null?iw:Op),r}function Vd(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Dc(r);if(r.$$typeof===M)return tr(r)}throw Error(a(438,String(r)))}function gp(r){var o=null,l=jt.updateQueue;if(l!==null&&(o=l.memoCache),o==null){var u=jt.alternate;u!==null&&(u=u.updateQueue,u!==null&&(u=u.memoCache,u!=null&&(o={data:u.data.map(function(p){return p.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),l===null&&(l=Fd(),jt.updateQueue=l),l.memoCache=o,l=o.data[o.index],l===void 0)for(l=o.data[o.index]=Array(r),u=0;u<r;u++)l[u]=W;return o.index++,l}function ro(r,o){return typeof o=="function"?o(r):o}function Yd(r){var o=Pn();return yp(o,fn,r)}function yp(r,o,l){var u=r.queue;if(u===null)throw Error(a(311));u.lastRenderedReducer=l;var p=r.baseQueue,v=u.pending;if(v!==null){if(p!==null){var N=p.next;p.next=v.next,v.next=N}o.baseQueue=p=v,u.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{o=p.next;var U=N=null,te=null,he=o,Re=!1;do{var Ae=he.lane&-536870913;if(Ae!==he.lane?(Vt&Ae)===Ae:(no&Ae)===Ae){var me=he.revertLane;if(me===0)te!==null&&(te=te.next={lane:0,revertLane:0,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null}),Ae===Yi&&(Re=!0);else if((no&me)===me){he=he.next,me===Yi&&(Re=!0);continue}else Ae={lane:0,revertLane:he.revertLane,gesture:null,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},te===null?(U=te=Ae,N=v):te=te.next=Ae,jt.lanes|=me,Vo|=me;Ae=he.action,$s&&l(v,Ae),v=he.hasEagerState?he.eagerState:l(v,Ae)}else me={lane:Ae,revertLane:he.revertLane,gesture:he.gesture,action:he.action,hasEagerState:he.hasEagerState,eagerState:he.eagerState,next:null},te===null?(U=te=me,N=v):te=te.next=me,jt.lanes|=Ae,Vo|=Ae;he=he.next}while(he!==null&&he!==o);if(te===null?N=v:te.next=U,!kr(v,r.memoizedState)&&(Hn=!0,Re&&(l=qi,l!==null)))throw l;r.memoizedState=v,r.baseState=N,r.baseQueue=te,u.lastRenderedState=v}return p===null&&(u.lanes=0),[r.memoizedState,u.dispatch]}function vp(r){var o=Pn(),l=o.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=r;var u=l.dispatch,p=l.pending,v=o.memoizedState;if(p!==null){l.pending=null;var N=p=p.next;do v=r(v,N.action),N=N.next;while(N!==p);kr(v,o.memoizedState)||(Hn=!0),o.memoizedState=v,o.baseQueue===null&&(o.baseState=v),l.lastRenderedState=v}return[v,u]}function Ox(r,o,l){var u=jt,p=Pn(),v=Wt;if(v){if(l===void 0)throw Error(a(407));l=l()}else l=o();var N=!kr((fn||p).memoizedState,l);if(N&&(p.memoizedState=l,Hn=!0),p=p.queue,wp(Ax.bind(null,u,p,r),[r]),p.getSnapshot!==o||N||Un!==null&&Un.memoizedState.tag&1){if(u.flags|=2048,Qi(9,{destroy:void 0},Nx.bind(null,u,p,l,o),null),gn===null)throw Error(a(349));v||(no&127)!==0||Mx(u,o,l)}return l}function Mx(r,o,l){r.flags|=16384,r={getSnapshot:o,value:l},o=jt.updateQueue,o===null?(o=Fd(),jt.updateQueue=o,o.stores=[r]):(l=o.stores,l===null?o.stores=[r]:l.push(r))}function Nx(r,o,l,u){o.value=l,o.getSnapshot=u,Dx(o)&&kx(r)}function Ax(r,o,l){return l(function(){Dx(o)&&kx(r)})}function Dx(r){var o=r.getSnapshot;r=r.value;try{var l=o();return!kr(r,l)}catch{return!0}}function kx(r){var o=Ps(r,2);o!==null&&Rr(o,r,2)}function bp(r){var o=fr();if(typeof r=="function"){var l=r;if(r=l(),$s){Ie(!0);try{l()}finally{Ie(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:r},o}function jx(r,o,l,u){return r.baseState=l,yp(r,fn,typeof u=="function"?u:ro)}function nA(r,o,l,u,p){if(Kd(r))throw Error(a(485));if(r=o.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(N){v.listeners.push(N)}};_.T!==null?l(!0):v.isTransition=!1,u(v),l=o.pending,l===null?(v.next=o.pending=v,_x(o,v)):(v.next=l.next,o.pending=l.next=v)}}function _x(r,o){var l=o.action,u=o.payload,p=r.state;if(o.isTransition){var v=_.T,N={};_.T=N;try{var U=l(p,u),te=_.S;te!==null&&te(N,U),Lx(r,o,U)}catch(he){xp(r,o,he)}finally{v!==null&&N.types!==null&&(v.types=N.types),_.T=v}}else try{v=l(p,u),Lx(r,o,v)}catch(he){xp(r,o,he)}}function Lx(r,o,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(u){Ix(r,o,u)},function(u){return xp(r,o,u)}):Ix(r,o,l)}function Ix(r,o,l){o.status="fulfilled",o.value=l,Px(o),r.state=l,o=r.pending,o!==null&&(l=o.next,l===o?r.pending=null:(l=l.next,o.next=l,_x(r,l)))}function xp(r,o,l){var u=r.pending;if(r.pending=null,u!==null){u=u.next;do o.status="rejected",o.reason=l,Px(o),o=o.next;while(o!==u)}r.action=null}function Px(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function zx(r,o){return o}function Ux(r,o){if(Wt){var l=gn.formState;if(l!==null){e:{var u=jt;if(Wt){if(vn){t:{for(var p=vn,v=Zr;p.nodeType!==8;){if(!v){p=null;break t}if(p=ea(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){vn=ea(p.nextSibling),u=p.data==="F!";break e}}_o(u)}u=!1}u&&(o=l[0])}}return l=fr(),l.memoizedState=l.baseState=o,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zx,lastRenderedState:o},l.queue=u,l=aw.bind(null,jt,u),u.dispatch=l,u=bp(!1),v=Cp.bind(null,jt,!1,u.queue),u=fr(),p={state:o,dispatch:null,action:r,pending:null},u.queue=p,l=nA.bind(null,jt,p,v,l),p.dispatch=l,u.memoizedState=r,[o,l,!1]}function Hx(r){var o=Pn();return Bx(o,fn,r)}function Bx(r,o,l){if(o=yp(r,o,zx)[0],r=Yd(ro)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var u=Dc(o)}catch(N){throw N===$i?_d:N}else u=o;o=Pn();var p=o.queue,v=p.dispatch;return l!==o.memoizedState&&(jt.flags|=2048,Qi(9,{destroy:void 0},rA.bind(null,p,l),null)),[u,v,r]}function rA(r,o){r.action=o}function Fx(r){var o=Pn(),l=fn;if(l!==null)return Bx(o,l,r);Pn(),o=o.memoizedState,l=Pn();var u=l.queue.dispatch;return l.memoizedState=r,[o,u,!1]}function Qi(r,o,l,u){return r={tag:r,create:l,deps:u,inst:o,next:null},o=jt.updateQueue,o===null&&(o=Fd(),jt.updateQueue=o),l=o.lastEffect,l===null?o.lastEffect=r.next=r:(u=l.next,l.next=r,r.next=u,o.lastEffect=r),r}function Vx(){return Pn().memoizedState}function qd(r,o,l,u){var p=fr();jt.flags|=r,p.memoizedState=Qi(1|o,{destroy:void 0},l,u===void 0?null:u)}function $d(r,o,l,u){var p=Pn();u=u===void 0?null:u;var v=p.memoizedState.inst;fn!==null&&u!==null&&dp(u,fn.memoizedState.deps)?p.memoizedState=Qi(o,v,l,u):(jt.flags|=r,p.memoizedState=Qi(1|o,v,l,u))}function Yx(r,o){qd(8390656,8,r,o)}function wp(r,o){$d(2048,8,r,o)}function aA(r){jt.flags|=4;var o=jt.updateQueue;if(o===null)o=Fd(),jt.updateQueue=o,o.events=[r];else{var l=o.events;l===null?o.events=[r]:l.push(r)}}function qx(r){var o=Pn().memoizedState;return aA({ref:o,nextImpl:r}),function(){if((sn&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}function $x(r,o){return $d(4,2,r,o)}function Kx(r,o){return $d(4,4,r,o)}function Gx(r,o){if(typeof o=="function"){r=r();var l=o(r);return function(){typeof l=="function"?l():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function Xx(r,o,l){l=l!=null?l.concat([r]):null,$d(4,4,Gx.bind(null,o,r),l)}function Sp(){}function Wx(r,o){var l=Pn();o=o===void 0?null:o;var u=l.memoizedState;return o!==null&&dp(o,u[1])?u[0]:(l.memoizedState=[r,o],r)}function Qx(r,o){var l=Pn();o=o===void 0?null:o;var u=l.memoizedState;if(o!==null&&dp(o,u[1]))return u[0];if(u=r(),$s){Ie(!0);try{r()}finally{Ie(!1)}}return l.memoizedState=[u,o],u}function Ep(r,o,l){return l===void 0||(no&1073741824)!==0&&(Vt&261930)===0?r.memoizedState=o:(r.memoizedState=l,r=Zw(),jt.lanes|=r,Vo|=r,l)}function Zx(r,o,l,u){return kr(l,o)?l:Gi.current!==null?(r=Ep(r,l,u),kr(r,o)||(Hn=!0),r):(no&42)===0||(no&1073741824)!==0&&(Vt&261930)===0?(Hn=!0,r.memoizedState=l):(r=Zw(),jt.lanes|=r,Vo|=r,o)}function Jx(r,o,l,u,p){var v=L.p;L.p=v!==0&&8>v?v:8;var N=_.T,U={};_.T=U,Cp(r,!1,o,l);try{var te=p(),he=_.S;if(he!==null&&he(U,te),te!==null&&typeof te=="object"&&typeof te.then=="function"){var Re=JN(te,u);kc(r,o,Re,zr(r))}else kc(r,o,u,zr(r))}catch(Ae){kc(r,o,{then:function(){},status:"rejected",reason:Ae},zr())}finally{L.p=v,N!==null&&U.types!==null&&(N.types=U.types),_.T=N}}function oA(){}function Rp(r,o,l,u){if(r.tag!==5)throw Error(a(476));var p=ew(r).queue;Jx(r,p,o,P,l===null?oA:function(){return tw(r),l(u)})}function ew(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:P,baseState:P,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:P},next:null};var l={};return o.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ro,lastRenderedState:l},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function tw(r){var o=ew(r);o.next===null&&(o=r.alternate.memoizedState),kc(r,o.next.queue,{},zr())}function Tp(){return tr(Xc)}function nw(){return Pn().memoizedState}function rw(){return Pn().memoizedState}function sA(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var l=zr();r=Po(l);var u=zo(o,r,l);u!==null&&(Rr(u,o,l),Oc(u,o,l)),o={cache:ep()},r.payload=o;return}o=o.return}}function iA(r,o,l){var u=zr();l={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Kd(r)?ow(o,l):(l=Vm(r,o,l,u),l!==null&&(Rr(l,r,u),sw(l,o,u)))}function aw(r,o,l){var u=zr();kc(r,o,l,u)}function kc(r,o,l,u){var p={lane:u,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Kd(r))ow(o,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=o.lastRenderedReducer,v!==null))try{var N=o.lastRenderedState,U=v(N,l);if(p.hasEagerState=!0,p.eagerState=U,kr(U,N))return Od(r,o,p,0),gn===null&&Cd(),!1}catch{}finally{}if(l=Vm(r,o,p,u),l!==null)return Rr(l,r,u),sw(l,o,u),!0}return!1}function Cp(r,o,l,u){if(u={lane:2,revertLane:ag(),gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Kd(r)){if(o)throw Error(a(479))}else o=Vm(r,l,u,2),o!==null&&Rr(o,r,2)}function Kd(r){var o=r.alternate;return r===jt||o!==null&&o===jt}function ow(r,o){Xi=Hd=!0;var l=r.pending;l===null?o.next=o:(o.next=l.next,l.next=o),r.pending=o}function sw(r,o,l){if((l&4194048)!==0){var u=o.lanes;u&=r.pendingLanes,l|=u,o.lanes=l,$(r,l)}}var jc={readContext:tr,use:Vd,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useLayoutEffect:Nn,useInsertionEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useSyncExternalStore:Nn,useId:Nn,useHostTransitionStatus:Nn,useFormState:Nn,useActionState:Nn,useOptimistic:Nn,useMemoCache:Nn,useCacheRefresh:Nn};jc.useEffectEvent=Nn;var iw={readContext:tr,use:Vd,useCallback:function(r,o){return fr().memoizedState=[r,o===void 0?null:o],r},useContext:tr,useEffect:Yx,useImperativeHandle:function(r,o,l){l=l!=null?l.concat([r]):null,qd(4194308,4,Gx.bind(null,o,r),l)},useLayoutEffect:function(r,o){return qd(4194308,4,r,o)},useInsertionEffect:function(r,o){qd(4,2,r,o)},useMemo:function(r,o){var l=fr();o=o===void 0?null:o;var u=r();if($s){Ie(!0);try{r()}finally{Ie(!1)}}return l.memoizedState=[u,o],u},useReducer:function(r,o,l){var u=fr();if(l!==void 0){var p=l(o);if($s){Ie(!0);try{l(o)}finally{Ie(!1)}}}else p=o;return u.memoizedState=u.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},u.queue=r,r=r.dispatch=iA.bind(null,jt,r),[u.memoizedState,r]},useRef:function(r){var o=fr();return r={current:r},o.memoizedState=r},useState:function(r){r=bp(r);var o=r.queue,l=aw.bind(null,jt,o);return o.dispatch=l,[r.memoizedState,l]},useDebugValue:Sp,useDeferredValue:function(r,o){var l=fr();return Ep(l,r,o)},useTransition:function(){var r=bp(!1);return r=Jx.bind(null,jt,r.queue,!0,!1),fr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,l){var u=jt,p=fr();if(Wt){if(l===void 0)throw Error(a(407));l=l()}else{if(l=o(),gn===null)throw Error(a(349));(Vt&127)!==0||Mx(u,o,l)}p.memoizedState=l;var v={value:l,getSnapshot:o};return p.queue=v,Yx(Ax.bind(null,u,v,r),[r]),u.flags|=2048,Qi(9,{destroy:void 0},Nx.bind(null,u,v,l,o),null),l},useId:function(){var r=fr(),o=gn.identifierPrefix;if(Wt){var l=Oa,u=Ca;l=(u&~(1<<32-Fe(u)-1)).toString(32)+l,o="_"+o+"R_"+l,l=Bd++,0<l&&(o+="H"+l.toString(32)),o+="_"}else l=eA++,o="_"+o+"r_"+l.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Tp,useFormState:Ux,useActionState:Ux,useOptimistic:function(r){var o=fr();o.memoizedState=o.baseState=r;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=l,o=Cp.bind(null,jt,!0,l),l.dispatch=o,[r,o]},useMemoCache:gp,useCacheRefresh:function(){return fr().memoizedState=sA.bind(null,jt)},useEffectEvent:function(r){var o=fr(),l={impl:r};return o.memoizedState=l,function(){if((sn&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Op={readContext:tr,use:Vd,useCallback:Wx,useContext:tr,useEffect:wp,useImperativeHandle:Xx,useInsertionEffect:$x,useLayoutEffect:Kx,useMemo:Qx,useReducer:Yd,useRef:Vx,useState:function(){return Yd(ro)},useDebugValue:Sp,useDeferredValue:function(r,o){var l=Pn();return Zx(l,fn.memoizedState,r,o)},useTransition:function(){var r=Yd(ro)[0],o=Pn().memoizedState;return[typeof r=="boolean"?r:Dc(r),o]},useSyncExternalStore:Ox,useId:nw,useHostTransitionStatus:Tp,useFormState:Hx,useActionState:Hx,useOptimistic:function(r,o){var l=Pn();return jx(l,fn,r,o)},useMemoCache:gp,useCacheRefresh:rw};Op.useEffectEvent=qx;var lw={readContext:tr,use:Vd,useCallback:Wx,useContext:tr,useEffect:wp,useImperativeHandle:Xx,useInsertionEffect:$x,useLayoutEffect:Kx,useMemo:Qx,useReducer:vp,useRef:Vx,useState:function(){return vp(ro)},useDebugValue:Sp,useDeferredValue:function(r,o){var l=Pn();return fn===null?Ep(l,r,o):Zx(l,fn.memoizedState,r,o)},useTransition:function(){var r=vp(ro)[0],o=Pn().memoizedState;return[typeof r=="boolean"?r:Dc(r),o]},useSyncExternalStore:Ox,useId:nw,useHostTransitionStatus:Tp,useFormState:Fx,useActionState:Fx,useOptimistic:function(r,o){var l=Pn();return fn!==null?jx(l,fn,r,o):(l.baseState=r,[r,l.queue.dispatch])},useMemoCache:gp,useCacheRefresh:rw};lw.useEffectEvent=qx;function Mp(r,o,l,u){o=r.memoizedState,l=l(u,o),l=l==null?o:m({},o,l),r.memoizedState=l,r.lanes===0&&(r.updateQueue.baseState=l)}var Np={enqueueSetState:function(r,o,l){r=r._reactInternals;var u=zr(),p=Po(u);p.payload=o,l!=null&&(p.callback=l),o=zo(r,p,u),o!==null&&(Rr(o,r,u),Oc(o,r,u))},enqueueReplaceState:function(r,o,l){r=r._reactInternals;var u=zr(),p=Po(u);p.tag=1,p.payload=o,l!=null&&(p.callback=l),o=zo(r,p,u),o!==null&&(Rr(o,r,u),Oc(o,r,u))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var l=zr(),u=Po(l);u.tag=2,o!=null&&(u.callback=o),o=zo(r,u,l),o!==null&&(Rr(o,r,l),Oc(o,r,l))}};function cw(r,o,l,u,p,v,N){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,v,N):o.prototype&&o.prototype.isPureReactComponent?!bc(l,u)||!bc(p,v):!0}function uw(r,o,l,u){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(l,u),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(l,u),o.state!==r&&Np.enqueueReplaceState(o,o.state,null)}function Ks(r,o){var l=o;if("ref"in o){l={};for(var u in o)u!=="ref"&&(l[u]=o[u])}if(r=r.defaultProps){l===o&&(l=m({},l));for(var p in r)l[p]===void 0&&(l[p]=r[p])}return l}function dw(r){Td(r)}function fw(r){console.error(r)}function hw(r){Td(r)}function Gd(r,o){try{var l=r.onUncaughtError;l(o.value,{componentStack:o.stack})}catch(u){setTimeout(function(){throw u})}}function mw(r,o,l){try{var u=r.onCaughtError;u(l.value,{componentStack:l.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function Ap(r,o,l){return l=Po(l),l.tag=3,l.payload={element:null},l.callback=function(){Gd(r,o)},l}function pw(r){return r=Po(r),r.tag=3,r}function gw(r,o,l,u){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var v=u.value;r.payload=function(){return p(v)},r.callback=function(){mw(o,l,u)}}var N=l.stateNode;N!==null&&typeof N.componentDidCatch=="function"&&(r.callback=function(){mw(o,l,u),typeof p!="function"&&(Yo===null?Yo=new Set([this]):Yo.add(this));var U=u.stack;this.componentDidCatch(u.value,{componentStack:U!==null?U:""})})}function lA(r,o,l,u,p){if(l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){if(o=l.alternate,o!==null&&Vi(o,l,p,!0),l=_r.current,l!==null){switch(l.tag){case 31:case 13:return Jr===null?sf():l.alternate===null&&An===0&&(An=3),l.flags&=-257,l.flags|=65536,l.lanes=p,u===Ld?l.flags|=16384:(o=l.updateQueue,o===null?l.updateQueue=new Set([u]):o.add(u),tg(r,u,p)),!1;case 22:return l.flags|=65536,u===Ld?l.flags|=16384:(o=l.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([u])},l.updateQueue=o):(l=o.retryQueue,l===null?o.retryQueue=new Set([u]):l.add(u)),tg(r,u,p)),!1}throw Error(a(435,l.tag))}return tg(r,u,p),sf(),!1}if(Wt)return o=_r.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=p,u!==Xm&&(r=Error(a(422),{cause:u}),Sc(Xr(r,l)))):(u!==Xm&&(o=Error(a(423),{cause:u}),Sc(Xr(o,l))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,u=Xr(u,l),p=Ap(r.stateNode,u,p),sp(r,p),An!==4&&(An=2)),!1;var v=Error(a(520),{cause:u});if(v=Xr(v,l),Bc===null?Bc=[v]:Bc.push(v),An!==4&&(An=2),o===null)return!0;u=Xr(u,l),l=o;do{switch(l.tag){case 3:return l.flags|=65536,r=p&-p,l.lanes|=r,r=Ap(l.stateNode,u,r),sp(l,r),!1;case 1:if(o=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Yo===null||!Yo.has(v))))return l.flags|=65536,p&=-p,l.lanes|=p,p=pw(p),gw(p,r,l,u),sp(l,p),!1}l=l.return}while(l!==null);return!1}var Dp=Error(a(461)),Hn=!1;function nr(r,o,l,u){o.child=r===null?xx(o,null,l,u):qs(o,r.child,l,u)}function yw(r,o,l,u,p){l=l.render;var v=o.ref;if("ref"in u){var N={};for(var U in u)U!=="ref"&&(N[U]=u[U])}else N=u;return Bs(o),u=fp(r,o,l,N,v,p),U=hp(),r!==null&&!Hn?(mp(r,o,p),ao(r,o,p)):(Wt&&U&&Km(o),o.flags|=1,nr(r,o,u,p),o.child)}function vw(r,o,l,u,p){if(r===null){var v=l.type;return typeof v=="function"&&!Ym(v)&&v.defaultProps===void 0&&l.compare===null?(o.tag=15,o.type=v,bw(r,o,v,u,p)):(r=Nd(l.type,null,u,o,o.mode,p),r.ref=o.ref,r.return=o,o.child=r)}if(v=r.child,!Up(r,p)){var N=v.memoizedProps;if(l=l.compare,l=l!==null?l:bc,l(N,u)&&r.ref===o.ref)return ao(r,o,p)}return o.flags|=1,r=Za(v,u),r.ref=o.ref,r.return=o,o.child=r}function bw(r,o,l,u,p){if(r!==null){var v=r.memoizedProps;if(bc(v,u)&&r.ref===o.ref)if(Hn=!1,o.pendingProps=u=v,Up(r,p))(r.flags&131072)!==0&&(Hn=!0);else return o.lanes=r.lanes,ao(r,o,p)}return kp(r,o,l,u,p)}function xw(r,o,l,u){var p=u.children,v=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.mode==="hidden"){if((o.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,r!==null){for(u=o.child=r.child,p=0;u!==null;)p=p|u.lanes|u.childLanes,u=u.sibling;u=p&~v}else u=0,o.child=null;return ww(r,o,v,l,u)}if((l&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&jd(o,v!==null?v.cachePool:null),v!==null?Ex(o,v):lp(),Rx(o);else return u=o.lanes=536870912,ww(r,o,v!==null?v.baseLanes|l:l,l,u)}else v!==null?(jd(o,v.cachePool),Ex(o,v),Ho(),o.memoizedState=null):(r!==null&&jd(o,null),lp(),Ho());return nr(r,o,p,l),o.child}function _c(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function ww(r,o,l,u,p){var v=np();return v=v===null?null:{parent:zn._currentValue,pool:v},o.memoizedState={baseLanes:l,cachePool:v},r!==null&&jd(o,null),lp(),Rx(o),r!==null&&Vi(r,o,u,!0),o.childLanes=p,null}function Xd(r,o){return o=Qd({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function Sw(r,o,l){return qs(o,r.child,null,l),r=Xd(o,o.pendingProps),r.flags|=2,Lr(o),o.memoizedState=null,r}function cA(r,o,l){var u=o.pendingProps,p=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(Wt){if(u.mode==="hidden")return r=Xd(o,u),o.lanes=536870912,_c(null,r);if(up(o),(r=vn)?(r=_S(r,Zr),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:ko!==null?{id:Ca,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},l=ox(r),l.return=o,o.child=l,er=o,vn=null)):r=null,r===null)throw _o(o);return o.lanes=536870912,null}return Xd(o,u)}var v=r.memoizedState;if(v!==null){var N=v.dehydrated;if(up(o),p)if(o.flags&256)o.flags&=-257,o=Sw(r,o,l);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(a(558));else if(Hn||Vi(r,o,l,!1),p=(l&r.childLanes)!==0,Hn||p){if(u=gn,u!==null&&(N=re(u,l),N!==0&&N!==v.retryLane))throw v.retryLane=N,Ps(r,N),Rr(u,r,N),Dp;sf(),o=Sw(r,o,l)}else r=v.treeContext,vn=ea(N.nextSibling),er=o,Wt=!0,jo=null,Zr=!1,r!==null&&lx(o,r),o=Xd(o,u),o.flags|=4096;return o}return r=Za(r.child,{mode:u.mode,children:u.children}),r.ref=o.ref,o.child=r,r.return=o,r}function Wd(r,o){var l=o.ref;if(l===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(r===null||r.ref!==l)&&(o.flags|=4194816)}}function kp(r,o,l,u,p){return Bs(o),l=fp(r,o,l,u,void 0,p),u=hp(),r!==null&&!Hn?(mp(r,o,p),ao(r,o,p)):(Wt&&u&&Km(o),o.flags|=1,nr(r,o,l,p),o.child)}function Ew(r,o,l,u,p,v){return Bs(o),o.updateQueue=null,l=Cx(o,u,l,p),Tx(r),u=hp(),r!==null&&!Hn?(mp(r,o,v),ao(r,o,v)):(Wt&&u&&Km(o),o.flags|=1,nr(r,o,l,v),o.child)}function Rw(r,o,l,u,p){if(Bs(o),o.stateNode===null){var v=Ui,N=l.contextType;typeof N=="object"&&N!==null&&(v=tr(N)),v=new l(u,v),o.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Np,o.stateNode=v,v._reactInternals=o,v=o.stateNode,v.props=u,v.state=o.memoizedState,v.refs={},ap(o),N=l.contextType,v.context=typeof N=="object"&&N!==null?tr(N):Ui,v.state=o.memoizedState,N=l.getDerivedStateFromProps,typeof N=="function"&&(Mp(o,l,N,u),v.state=o.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(N=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),N!==v.state&&Np.enqueueReplaceState(v,v.state,null),Nc(o,u,v,p),Mc(),v.state=o.memoizedState),typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!0}else if(r===null){v=o.stateNode;var U=o.memoizedProps,te=Ks(l,U);v.props=te;var he=v.context,Re=l.contextType;N=Ui,typeof Re=="object"&&Re!==null&&(N=tr(Re));var Ae=l.getDerivedStateFromProps;Re=typeof Ae=="function"||typeof v.getSnapshotBeforeUpdate=="function",U=o.pendingProps!==U,Re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(U||he!==N)&&uw(o,v,u,N),Io=!1;var me=o.memoizedState;v.state=me,Nc(o,u,v,p),Mc(),he=o.memoizedState,U||me!==he||Io?(typeof Ae=="function"&&(Mp(o,l,Ae,u),he=o.memoizedState),(te=Io||cw(o,l,te,u,me,he,N))?(Re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(o.flags|=4194308)):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=u,o.memoizedState=he),v.props=u,v.state=he,v.context=N,u=te):(typeof v.componentDidMount=="function"&&(o.flags|=4194308),u=!1)}else{v=o.stateNode,op(r,o),N=o.memoizedProps,Re=Ks(l,N),v.props=Re,Ae=o.pendingProps,me=v.context,he=l.contextType,te=Ui,typeof he=="object"&&he!==null&&(te=tr(he)),U=l.getDerivedStateFromProps,(he=typeof U=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(N!==Ae||me!==te)&&uw(o,v,u,te),Io=!1,me=o.memoizedState,v.state=me,Nc(o,u,v,p),Mc();var ye=o.memoizedState;N!==Ae||me!==ye||Io||r!==null&&r.dependencies!==null&&Dd(r.dependencies)?(typeof U=="function"&&(Mp(o,l,U,u),ye=o.memoizedState),(Re=Io||cw(o,l,Re,u,me,ye,te)||r!==null&&r.dependencies!==null&&Dd(r.dependencies))?(he||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(u,ye,te),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(u,ye,te)),typeof v.componentDidUpdate=="function"&&(o.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof v.componentDidUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=1024),o.memoizedProps=u,o.memoizedState=ye),v.props=u,v.state=ye,v.context=te,u=Re):(typeof v.componentDidUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||N===r.memoizedProps&&me===r.memoizedState||(o.flags|=1024),u=!1)}return v=u,Wd(r,o),u=(o.flags&128)!==0,v||u?(v=o.stateNode,l=u&&typeof l.getDerivedStateFromError!="function"?null:v.render(),o.flags|=1,r!==null&&u?(o.child=qs(o,r.child,null,p),o.child=qs(o,null,l,p)):nr(r,o,l,p),o.memoizedState=v.state,r=o.child):r=ao(r,o,p),r}function Tw(r,o,l,u){return Us(),o.flags|=256,nr(r,o,l,u),o.child}var jp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function _p(r){return{baseLanes:r,cachePool:mx()}}function Lp(r,o,l){return r=r!==null?r.childLanes&~l:0,o&&(r|=Pr),r}function Cw(r,o,l){var u=o.pendingProps,p=!1,v=(o.flags&128)!==0,N;if((N=v)||(N=r!==null&&r.memoizedState===null?!1:(In.current&2)!==0),N&&(p=!0,o.flags&=-129),N=(o.flags&32)!==0,o.flags&=-33,r===null){if(Wt){if(p?Uo(o):Ho(),(r=vn)?(r=_S(r,Zr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:ko!==null?{id:Ca,overflow:Oa}:null,retryLane:536870912,hydrationErrors:null},l=ox(r),l.return=o,o.child=l,er=o,vn=null)):r=null,r===null)throw _o(o);return yg(r)?o.lanes=32:o.lanes=536870912,null}var U=u.children;return u=u.fallback,p?(Ho(),p=o.mode,U=Qd({mode:"hidden",children:U},p),u=zs(u,p,l,null),U.return=o,u.return=o,U.sibling=u,o.child=U,u=o.child,u.memoizedState=_p(l),u.childLanes=Lp(r,N,l),o.memoizedState=jp,_c(null,u)):(Uo(o),Ip(o,U))}var te=r.memoizedState;if(te!==null&&(U=te.dehydrated,U!==null)){if(v)o.flags&256?(Uo(o),o.flags&=-257,o=Pp(r,o,l)):o.memoizedState!==null?(Ho(),o.child=r.child,o.flags|=128,o=null):(Ho(),U=u.fallback,p=o.mode,u=Qd({mode:"visible",children:u.children},p),U=zs(U,p,l,null),U.flags|=2,u.return=o,U.return=o,u.sibling=U,o.child=u,qs(o,r.child,null,l),u=o.child,u.memoizedState=_p(l),u.childLanes=Lp(r,N,l),o.memoizedState=jp,o=_c(null,u));else if(Uo(o),yg(U)){if(N=U.nextSibling&&U.nextSibling.dataset,N)var he=N.dgst;N=he,u=Error(a(419)),u.stack="",u.digest=N,Sc({value:u,source:null,stack:null}),o=Pp(r,o,l)}else if(Hn||Vi(r,o,l,!1),N=(l&r.childLanes)!==0,Hn||N){if(N=gn,N!==null&&(u=re(N,l),u!==0&&u!==te.retryLane))throw te.retryLane=u,Ps(r,u),Rr(N,r,u),Dp;gg(U)||sf(),o=Pp(r,o,l)}else gg(U)?(o.flags|=192,o.child=r.child,o=null):(r=te.treeContext,vn=ea(U.nextSibling),er=o,Wt=!0,jo=null,Zr=!1,r!==null&&lx(o,r),o=Ip(o,u.children),o.flags|=4096);return o}return p?(Ho(),U=u.fallback,p=o.mode,te=r.child,he=te.sibling,u=Za(te,{mode:"hidden",children:u.children}),u.subtreeFlags=te.subtreeFlags&65011712,he!==null?U=Za(he,U):(U=zs(U,p,l,null),U.flags|=2),U.return=o,u.return=o,u.sibling=U,o.child=u,_c(null,u),u=o.child,U=r.child.memoizedState,U===null?U=_p(l):(p=U.cachePool,p!==null?(te=zn._currentValue,p=p.parent!==te?{parent:te,pool:te}:p):p=mx(),U={baseLanes:U.baseLanes|l,cachePool:p}),u.memoizedState=U,u.childLanes=Lp(r,N,l),o.memoizedState=jp,_c(r.child,u)):(Uo(o),l=r.child,r=l.sibling,l=Za(l,{mode:"visible",children:u.children}),l.return=o,l.sibling=null,r!==null&&(N=o.deletions,N===null?(o.deletions=[r],o.flags|=16):N.push(r)),o.child=l,o.memoizedState=null,l)}function Ip(r,o){return o=Qd({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Qd(r,o){return r=jr(22,r,null,o),r.lanes=0,r}function Pp(r,o,l){return qs(o,r.child,null,l),r=Ip(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function Ow(r,o,l){r.lanes|=o;var u=r.alternate;u!==null&&(u.lanes|=o),Zm(r.return,o,l)}function zp(r,o,l,u,p,v){var N=r.memoizedState;N===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:u,tail:l,tailMode:p,treeForkCount:v}:(N.isBackwards=o,N.rendering=null,N.renderingStartTime=0,N.last=u,N.tail=l,N.tailMode=p,N.treeForkCount=v)}function Mw(r,o,l){var u=o.pendingProps,p=u.revealOrder,v=u.tail;u=u.children;var N=In.current,U=(N&2)!==0;if(U?(N=N&1|2,o.flags|=128):N&=1,X(In,N),nr(r,o,u,l),u=Wt?wc:0,!U&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Ow(r,l,o);else if(r.tag===19)Ow(r,l,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(l=o.child,p=null;l!==null;)r=l.alternate,r!==null&&Ud(r)===null&&(p=l),l=l.sibling;l=p,l===null?(p=o.child,o.child=null):(p=l.sibling,l.sibling=null),zp(o,!1,p,l,v,u);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=o.child,o.child=null;p!==null;){if(r=p.alternate,r!==null&&Ud(r)===null){o.child=p;break}r=p.sibling,p.sibling=l,l=p,p=r}zp(o,!0,l,null,v,u);break;case"together":zp(o,!1,null,null,void 0,u);break;default:o.memoizedState=null}return o.child}function ao(r,o,l){if(r!==null&&(o.dependencies=r.dependencies),Vo|=o.lanes,(l&o.childLanes)===0)if(r!==null){if(Vi(r,o,l,!1),(l&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(a(153));if(o.child!==null){for(r=o.child,l=Za(r,r.pendingProps),o.child=l,l.return=o;r.sibling!==null;)r=r.sibling,l=l.sibling=Za(r,r.pendingProps),l.return=o;l.sibling=null}return o.child}function Up(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&Dd(r)))}function uA(r,o,l){switch(o.tag){case 3:ve(o,o.stateNode.containerInfo),Lo(o,zn,r.memoizedState.cache),Us();break;case 27:case 5:Ne(o);break;case 4:ve(o,o.stateNode.containerInfo);break;case 10:Lo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,up(o),null;break;case 13:var u=o.memoizedState;if(u!==null)return u.dehydrated!==null?(Uo(o),o.flags|=128,null):(l&o.child.childLanes)!==0?Cw(r,o,l):(Uo(o),r=ao(r,o,l),r!==null?r.sibling:null);Uo(o);break;case 19:var p=(r.flags&128)!==0;if(u=(l&o.childLanes)!==0,u||(Vi(r,o,l,!1),u=(l&o.childLanes)!==0),p){if(u)return Mw(r,o,l);o.flags|=128}if(p=o.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),X(In,In.current),u)break;return null;case 22:return o.lanes=0,xw(r,o,l,o.pendingProps);case 24:Lo(o,zn,r.memoizedState.cache)}return ao(r,o,l)}function Nw(r,o,l){if(r!==null)if(r.memoizedProps!==o.pendingProps)Hn=!0;else{if(!Up(r,l)&&(o.flags&128)===0)return Hn=!1,uA(r,o,l);Hn=(r.flags&131072)!==0}else Hn=!1,Wt&&(o.flags&1048576)!==0&&ix(o,wc,o.index);switch(o.lanes=0,o.tag){case 16:e:{var u=o.pendingProps;if(r=Vs(o.elementType),o.type=r,typeof r=="function")Ym(r)?(u=Ks(r,u),o.tag=1,o=Rw(null,o,r,u,l)):(o.tag=0,o=kp(null,o,r,u,l));else{if(r!=null){var p=r.$$typeof;if(p===O){o.tag=11,o=yw(null,o,r,u,l);break e}else if(p===A){o.tag=14,o=vw(null,o,r,u,l);break e}}throw o=F(r)||r,Error(a(306,o,""))}}return o;case 0:return kp(r,o,o.type,o.pendingProps,l);case 1:return u=o.type,p=Ks(u,o.pendingProps),Rw(r,o,u,p,l);case 3:e:{if(ve(o,o.stateNode.containerInfo),r===null)throw Error(a(387));u=o.pendingProps;var v=o.memoizedState;p=v.element,op(r,o),Nc(o,u,null,l);var N=o.memoizedState;if(u=N.cache,Lo(o,zn,u),u!==v.cache&&Jm(o,[zn],l,!0),Mc(),u=N.element,v.isDehydrated)if(v={element:u,isDehydrated:!1,cache:N.cache},o.updateQueue.baseState=v,o.memoizedState=v,o.flags&256){o=Tw(r,o,u,l);break e}else if(u!==p){p=Xr(Error(a(424)),o),Sc(p),o=Tw(r,o,u,l);break e}else{switch(r=o.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(vn=ea(r.firstChild),er=o,Wt=!0,jo=null,Zr=!0,l=xx(o,null,u,l),o.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Us(),u===p){o=ao(r,o,l);break e}nr(r,o,u,l)}o=o.child}return o;case 26:return Wd(r,o),r===null?(l=HS(o.type,null,o.pendingProps,null))?o.memoizedState=l:Wt||(l=o.type,r=o.pendingProps,u=mf(oe.current).createElement(l),u[Ve]=o,u[$e]=r,rr(u,l,r),Sn(u),o.stateNode=u):o.memoizedState=HS(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return Ne(o),r===null&&Wt&&(u=o.stateNode=PS(o.type,o.pendingProps,oe.current),er=o,Zr=!0,p=vn,Go(o.type)?(vg=p,vn=ea(u.firstChild)):vn=p),nr(r,o,o.pendingProps.children,l),Wd(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&Wt&&((p=u=vn)&&(u=HA(u,o.type,o.pendingProps,Zr),u!==null?(o.stateNode=u,er=o,vn=ea(u.firstChild),Zr=!1,p=!0):p=!1),p||_o(o)),Ne(o),p=o.type,v=o.pendingProps,N=r!==null?r.memoizedProps:null,u=v.children,hg(p,v)?u=null:N!==null&&hg(p,N)&&(o.flags|=32),o.memoizedState!==null&&(p=fp(r,o,tA,null,null,l),Xc._currentValue=p),Wd(r,o),nr(r,o,u,l),o.child;case 6:return r===null&&Wt&&((r=l=vn)&&(l=BA(l,o.pendingProps,Zr),l!==null?(o.stateNode=l,er=o,vn=null,r=!0):r=!1),r||_o(o)),null;case 13:return Cw(r,o,l);case 4:return ve(o,o.stateNode.containerInfo),u=o.pendingProps,r===null?o.child=qs(o,null,u,l):nr(r,o,u,l),o.child;case 11:return yw(r,o,o.type,o.pendingProps,l);case 7:return nr(r,o,o.pendingProps,l),o.child;case 8:return nr(r,o,o.pendingProps.children,l),o.child;case 12:return nr(r,o,o.pendingProps.children,l),o.child;case 10:return u=o.pendingProps,Lo(o,o.type,u.value),nr(r,o,u.children,l),o.child;case 9:return p=o.type._context,u=o.pendingProps.children,Bs(o),p=tr(p),u=u(p),o.flags|=1,nr(r,o,u,l),o.child;case 14:return vw(r,o,o.type,o.pendingProps,l);case 15:return bw(r,o,o.type,o.pendingProps,l);case 19:return Mw(r,o,l);case 31:return cA(r,o,l);case 22:return xw(r,o,l,o.pendingProps);case 24:return Bs(o),u=tr(zn),r===null?(p=np(),p===null&&(p=gn,v=ep(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=l),p=v),o.memoizedState={parent:u,cache:p},ap(o),Lo(o,zn,p)):((r.lanes&l)!==0&&(op(r,o),Nc(o,null,null,l),Mc()),p=r.memoizedState,v=o.memoizedState,p.parent!==u?(p={parent:u,cache:u},o.memoizedState=p,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=p),Lo(o,zn,u)):(u=v.cache,Lo(o,zn,u),u!==p.cache&&Jm(o,[zn],l,!0))),nr(r,o,o.pendingProps.children,l),o.child;case 29:throw o.pendingProps}throw Error(a(156,o.tag))}function oo(r){r.flags|=4}function Hp(r,o,l,u,p){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(nS())r.flags|=8192;else throw Ys=Ld,rp}else r.flags&=-16777217}function Aw(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!qS(o))if(nS())r.flags|=8192;else throw Ys=Ld,rp}function Zd(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?Rt():536870912,r.lanes|=o,tl|=o)}function Lc(r,o){if(!Wt)switch(r.tailMode){case"hidden":o=r.tail;for(var l=null;o!==null;)o.alternate!==null&&(l=o),o=o.sibling;l===null?r.tail=null:l.sibling=null;break;case"collapsed":l=r.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function bn(r){var o=r.alternate!==null&&r.alternate.child===r.child,l=0,u=0;if(o)for(var p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags&65011712,u|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)l|=p.lanes|p.childLanes,u|=p.subtreeFlags,u|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=u,r.childLanes=l,o}function dA(r,o,l){var u=o.pendingProps;switch(Gm(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bn(o),null;case 1:return bn(o),null;case 3:return l=o.stateNode,u=null,r!==null&&(u=r.memoizedState.cache),o.memoizedState.cache!==u&&(o.flags|=2048),to(zn),xe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(r===null||r.child===null)&&(Fi(o)?oo(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,Wm())),bn(o),null;case 26:var p=o.type,v=o.memoizedState;return r===null?(oo(o),v!==null?(bn(o),Aw(o,v)):(bn(o),Hp(o,p,null,u,l))):v?v!==r.memoizedState?(oo(o),bn(o),Aw(o,v)):(bn(o),o.flags&=-16777217):(r=r.memoizedProps,r!==u&&oo(o),bn(o),Hp(o,p,r,u,l)),null;case 27:if(_e(o),l=oe.current,p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&oo(o);else{if(!u){if(o.stateNode===null)throw Error(a(166));return bn(o),null}r=G.current,Fi(o)?cx(o):(r=PS(p,u,l),o.stateNode=r,oo(o))}return bn(o),null;case 5:if(_e(o),p=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==u&&oo(o);else{if(!u){if(o.stateNode===null)throw Error(a(166));return bn(o),null}if(v=G.current,Fi(o))cx(o);else{var N=mf(oe.current);switch(v){case 1:v=N.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=N.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=N.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=N.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=N.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof u.is=="string"?N.createElement("select",{is:u.is}):N.createElement("select"),u.multiple?v.multiple=!0:u.size&&(v.size=u.size);break;default:v=typeof u.is=="string"?N.createElement(p,{is:u.is}):N.createElement(p)}}v[Ve]=o,v[$e]=u;e:for(N=o.child;N!==null;){if(N.tag===5||N.tag===6)v.appendChild(N.stateNode);else if(N.tag!==4&&N.tag!==27&&N.child!==null){N.child.return=N,N=N.child;continue}if(N===o)break e;for(;N.sibling===null;){if(N.return===null||N.return===o)break e;N=N.return}N.sibling.return=N.return,N=N.sibling}o.stateNode=v;e:switch(rr(v,p,u),p){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}u&&oo(o)}}return bn(o),Hp(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,l),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==u&&oo(o);else{if(typeof u!="string"&&o.stateNode===null)throw Error(a(166));if(r=oe.current,Fi(o)){if(r=o.stateNode,l=o.memoizedProps,u=null,p=er,p!==null)switch(p.tag){case 27:case 5:u=p.memoizedProps}r[Ve]=o,r=!!(r.nodeValue===l||u!==null&&u.suppressHydrationWarning===!0||CS(r.nodeValue,l)),r||_o(o,!0)}else r=mf(r).createTextNode(u),r[Ve]=o,o.stateNode=r}return bn(o),null;case 31:if(l=o.memoizedState,r===null||r.memoizedState!==null){if(u=Fi(o),l!==null){if(r===null){if(!u)throw Error(a(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Ve]=o}else Us(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;bn(o),r=!1}else l=Wm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=l),r=!0;if(!r)return o.flags&256?(Lr(o),o):(Lr(o),null);if((o.flags&128)!==0)throw Error(a(558))}return bn(o),null;case 13:if(u=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Fi(o),u!==null&&u.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=o.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Ve]=o}else Us(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;bn(o),p=!1}else p=Wm(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return o.flags&256?(Lr(o),o):(Lr(o),null)}return Lr(o),(o.flags&128)!==0?(o.lanes=l,o):(l=u!==null,r=r!==null&&r.memoizedState!==null,l&&(u=o.child,p=null,u.alternate!==null&&u.alternate.memoizedState!==null&&u.alternate.memoizedState.cachePool!==null&&(p=u.alternate.memoizedState.cachePool.pool),v=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(v=u.memoizedState.cachePool.pool),v!==p&&(u.flags|=2048)),l!==r&&l&&(o.child.flags|=8192),Zd(o,o.updateQueue),bn(o),null);case 4:return xe(),r===null&&lg(o.stateNode.containerInfo),bn(o),null;case 10:return to(o.type),bn(o),null;case 19:if(Y(In),u=o.memoizedState,u===null)return bn(o),null;if(p=(o.flags&128)!==0,v=u.rendering,v===null)if(p)Lc(u,!1);else{if(An!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(v=Ud(r),v!==null){for(o.flags|=128,Lc(u,!1),r=v.updateQueue,o.updateQueue=r,Zd(o,r),o.subtreeFlags=0,r=l,l=o.child;l!==null;)ax(l,r),l=l.sibling;return X(In,In.current&1|2),Wt&&Ja(o,u.treeForkCount),o.child}r=r.sibling}u.tail!==null&&De()>rf&&(o.flags|=128,p=!0,Lc(u,!1),o.lanes=4194304)}else{if(!p)if(r=Ud(v),r!==null){if(o.flags|=128,p=!0,r=r.updateQueue,o.updateQueue=r,Zd(o,r),Lc(u,!0),u.tail===null&&u.tailMode==="hidden"&&!v.alternate&&!Wt)return bn(o),null}else 2*De()-u.renderingStartTime>rf&&l!==536870912&&(o.flags|=128,p=!0,Lc(u,!1),o.lanes=4194304);u.isBackwards?(v.sibling=o.child,o.child=v):(r=u.last,r!==null?r.sibling=v:o.child=v,u.last=v)}return u.tail!==null?(r=u.tail,u.rendering=r,u.tail=r.sibling,u.renderingStartTime=De(),r.sibling=null,l=In.current,X(In,p?l&1|2:l&1),Wt&&Ja(o,u.treeForkCount),r):(bn(o),null);case 22:case 23:return Lr(o),cp(),u=o.memoizedState!==null,r!==null?r.memoizedState!==null!==u&&(o.flags|=8192):u&&(o.flags|=8192),u?(l&536870912)!==0&&(o.flags&128)===0&&(bn(o),o.subtreeFlags&6&&(o.flags|=8192)):bn(o),l=o.updateQueue,l!==null&&Zd(o,l.retryQueue),l=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),u=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),u!==l&&(o.flags|=2048),r!==null&&Y(Fs),null;case 24:return l=null,r!==null&&(l=r.memoizedState.cache),o.memoizedState.cache!==l&&(o.flags|=2048),to(zn),bn(o),null;case 25:return null;case 30:return null}throw Error(a(156,o.tag))}function fA(r,o){switch(Gm(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return to(zn),xe(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return _e(o),null;case 31:if(o.memoizedState!==null){if(Lr(o),o.alternate===null)throw Error(a(340));Us()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(Lr(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(a(340));Us()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return Y(In),null;case 4:return xe(),null;case 10:return to(o.type),null;case 22:case 23:return Lr(o),cp(),r!==null&&Y(Fs),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return to(zn),null;case 25:return null;default:return null}}function Dw(r,o){switch(Gm(o),o.tag){case 3:to(zn),xe();break;case 26:case 27:case 5:_e(o);break;case 4:xe();break;case 31:o.memoizedState!==null&&Lr(o);break;case 13:Lr(o);break;case 19:Y(In);break;case 10:to(o.type);break;case 22:case 23:Lr(o),cp(),r!==null&&Y(Fs);break;case 24:to(zn)}}function Ic(r,o){try{var l=o.updateQueue,u=l!==null?l.lastEffect:null;if(u!==null){var p=u.next;l=p;do{if((l.tag&r)===r){u=void 0;var v=l.create,N=l.inst;u=v(),N.destroy=u}l=l.next}while(l!==p)}}catch(U){un(o,o.return,U)}}function Bo(r,o,l){try{var u=o.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var v=p.next;u=v;do{if((u.tag&r)===r){var N=u.inst,U=N.destroy;if(U!==void 0){N.destroy=void 0,p=o;var te=l,he=U;try{he()}catch(Re){un(p,te,Re)}}}u=u.next}while(u!==v)}}catch(Re){un(o,o.return,Re)}}function kw(r){var o=r.updateQueue;if(o!==null){var l=r.stateNode;try{Sx(o,l)}catch(u){un(r,r.return,u)}}}function jw(r,o,l){l.props=Ks(r.type,r.memoizedProps),l.state=r.memoizedState;try{l.componentWillUnmount()}catch(u){un(r,o,u)}}function Pc(r,o){try{var l=r.ref;if(l!==null){switch(r.tag){case 26:case 27:case 5:var u=r.stateNode;break;case 30:u=r.stateNode;break;default:u=r.stateNode}typeof l=="function"?r.refCleanup=l(u):l.current=u}}catch(p){un(r,o,p)}}function Ma(r,o){var l=r.ref,u=r.refCleanup;if(l!==null)if(typeof u=="function")try{u()}catch(p){un(r,o,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(p){un(r,o,p)}else l.current=null}function _w(r){var o=r.type,l=r.memoizedProps,u=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":l.autoFocus&&u.focus();break e;case"img":l.src?u.src=l.src:l.srcSet&&(u.srcset=l.srcSet)}}catch(p){un(r,r.return,p)}}function Bp(r,o,l){try{var u=r.stateNode;_A(u,r.type,l,o),u[$e]=o}catch(p){un(r,r.return,p)}}function Lw(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Go(r.type)||r.tag===4}function Fp(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Lw(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Go(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Vp(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(r,o):(o=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,o.appendChild(r),l=l._reactRootContainer,l!=null||o.onclick!==null||(o.onclick=Wa));else if(u!==4&&(u===27&&Go(r.type)&&(l=r.stateNode,o=null),r=r.child,r!==null))for(Vp(r,o,l),r=r.sibling;r!==null;)Vp(r,o,l),r=r.sibling}function Jd(r,o,l){var u=r.tag;if(u===5||u===6)r=r.stateNode,o?l.insertBefore(r,o):l.appendChild(r);else if(u!==4&&(u===27&&Go(r.type)&&(l=r.stateNode),r=r.child,r!==null))for(Jd(r,o,l),r=r.sibling;r!==null;)Jd(r,o,l),r=r.sibling}function Iw(r){var o=r.stateNode,l=r.memoizedProps;try{for(var u=r.type,p=o.attributes;p.length;)o.removeAttributeNode(p[0]);rr(o,u,l),o[Ve]=r,o[$e]=l}catch(v){un(r,r.return,v)}}var so=!1,Bn=!1,Yp=!1,Pw=typeof WeakSet=="function"?WeakSet:Set,Xn=null;function hA(r,o){if(r=r.containerInfo,dg=wf,r=X0(r),Pm(r)){if("selectionStart"in r)var l={start:r.selectionStart,end:r.selectionEnd};else e:{l=(l=r.ownerDocument)&&l.defaultView||window;var u=l.getSelection&&l.getSelection();if(u&&u.rangeCount!==0){l=u.anchorNode;var p=u.anchorOffset,v=u.focusNode;u=u.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var N=0,U=-1,te=-1,he=0,Re=0,Ae=r,me=null;t:for(;;){for(var ye;Ae!==l||p!==0&&Ae.nodeType!==3||(U=N+p),Ae!==v||u!==0&&Ae.nodeType!==3||(te=N+u),Ae.nodeType===3&&(N+=Ae.nodeValue.length),(ye=Ae.firstChild)!==null;)me=Ae,Ae=ye;for(;;){if(Ae===r)break t;if(me===l&&++he===p&&(U=N),me===v&&++Re===u&&(te=N),(ye=Ae.nextSibling)!==null)break;Ae=me,me=Ae.parentNode}Ae=ye}l=U===-1||te===-1?null:{start:U,end:te}}else l=null}l=l||{start:0,end:0}}else l=null;for(fg={focusedElem:r,selectionRange:l},wf=!1,Xn=o;Xn!==null;)if(o=Xn,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Xn=r;else for(;Xn!==null;){switch(o=Xn,v=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(l=0;l<r.length;l++)p=r[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,l=o,p=v.memoizedProps,v=v.memoizedState,u=l.stateNode;try{var rt=Ks(l.type,p);r=u.getSnapshotBeforeUpdate(rt,v),u.__reactInternalSnapshotBeforeUpdate=r}catch(bt){un(l,l.return,bt)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,l=r.nodeType,l===9)pg(r);else if(l===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":pg(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=o.sibling,r!==null){r.return=o.return,Xn=r;break}Xn=o.return}}function zw(r,o,l){var u=l.flags;switch(l.tag){case 0:case 11:case 15:lo(r,l),u&4&&Ic(5,l);break;case 1:if(lo(r,l),u&4)if(r=l.stateNode,o===null)try{r.componentDidMount()}catch(N){un(l,l.return,N)}else{var p=Ks(l.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(p,o,r.__reactInternalSnapshotBeforeUpdate)}catch(N){un(l,l.return,N)}}u&64&&kw(l),u&512&&Pc(l,l.return);break;case 3:if(lo(r,l),u&64&&(r=l.updateQueue,r!==null)){if(o=null,l.child!==null)switch(l.child.tag){case 27:case 5:o=l.child.stateNode;break;case 1:o=l.child.stateNode}try{Sx(r,o)}catch(N){un(l,l.return,N)}}break;case 27:o===null&&u&4&&Iw(l);case 26:case 5:lo(r,l),o===null&&u&4&&_w(l),u&512&&Pc(l,l.return);break;case 12:lo(r,l);break;case 31:lo(r,l),u&4&&Bw(r,l);break;case 13:lo(r,l),u&4&&Fw(r,l),u&64&&(r=l.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(l=SA.bind(null,l),FA(r,l))));break;case 22:if(u=l.memoizedState!==null||so,!u){o=o!==null&&o.memoizedState!==null||Bn,p=so;var v=Bn;so=u,(Bn=o)&&!v?co(r,l,(l.subtreeFlags&8772)!==0):lo(r,l),so=p,Bn=v}break;case 30:break;default:lo(r,l)}}function Uw(r){var o=r.alternate;o!==null&&(r.alternate=null,Uw(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&On(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var En=null,xr=!1;function io(r,o,l){for(l=l.child;l!==null;)Hw(r,o,l),l=l.sibling}function Hw(r,o,l){if(Me&&typeof Me.onCommitFiberUnmount=="function")try{Me.onCommitFiberUnmount(Ke,l)}catch{}switch(l.tag){case 26:Bn||Ma(l,o),io(r,o,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Bn||Ma(l,o);var u=En,p=xr;Go(l.type)&&(En=l.stateNode,xr=!1),io(r,o,l),$c(l.stateNode),En=u,xr=p;break;case 5:Bn||Ma(l,o);case 6:if(u=En,p=xr,En=null,io(r,o,l),En=u,xr=p,En!==null)if(xr)try{(En.nodeType===9?En.body:En.nodeName==="HTML"?En.ownerDocument.body:En).removeChild(l.stateNode)}catch(v){un(l,o,v)}else try{En.removeChild(l.stateNode)}catch(v){un(l,o,v)}break;case 18:En!==null&&(xr?(r=En,kS(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,l.stateNode),cl(r)):kS(En,l.stateNode));break;case 4:u=En,p=xr,En=l.stateNode.containerInfo,xr=!0,io(r,o,l),En=u,xr=p;break;case 0:case 11:case 14:case 15:Bo(2,l,o),Bn||Bo(4,l,o),io(r,o,l);break;case 1:Bn||(Ma(l,o),u=l.stateNode,typeof u.componentWillUnmount=="function"&&jw(l,o,u)),io(r,o,l);break;case 21:io(r,o,l);break;case 22:Bn=(u=Bn)||l.memoizedState!==null,io(r,o,l),Bn=u;break;default:io(r,o,l)}}function Bw(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{cl(r)}catch(l){un(o,o.return,l)}}}function Fw(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{cl(r)}catch(l){un(o,o.return,l)}}function mA(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new Pw),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new Pw),o;default:throw Error(a(435,r.tag))}}function ef(r,o){var l=mA(r);o.forEach(function(u){if(!l.has(u)){l.add(u);var p=EA.bind(null,r,u);u.then(p,p)}})}function wr(r,o){var l=o.deletions;if(l!==null)for(var u=0;u<l.length;u++){var p=l[u],v=r,N=o,U=N;e:for(;U!==null;){switch(U.tag){case 27:if(Go(U.type)){En=U.stateNode,xr=!1;break e}break;case 5:En=U.stateNode,xr=!1;break e;case 3:case 4:En=U.stateNode.containerInfo,xr=!0;break e}U=U.return}if(En===null)throw Error(a(160));Hw(v,N,p),En=null,xr=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Vw(o,r),o=o.sibling}var pa=null;function Vw(r,o){var l=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:wr(o,r),Sr(r),u&4&&(Bo(3,r,r.return),Ic(3,r),Bo(5,r,r.return));break;case 1:wr(o,r),Sr(r),u&512&&(Bn||l===null||Ma(l,l.return)),u&64&&so&&(r=r.updateQueue,r!==null&&(u=r.callbacks,u!==null&&(l=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=l===null?u:l.concat(u))));break;case 26:var p=pa;if(wr(o,r),Sr(r),u&512&&(Bn||l===null||Ma(l,l.return)),u&4){var v=l!==null?l.memoizedState:null;if(u=r.memoizedState,l===null)if(u===null)if(r.stateNode===null){e:{u=r.type,l=r.memoizedProps,p=p.ownerDocument||p;t:switch(u){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Rn]||v[Ve]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(u),p.head.insertBefore(v,p.querySelector("head > title"))),rr(v,u,l),v[Ve]=r,Sn(v),u=v;break e;case"link":var N=VS("link","href",p).get(u+(l.href||""));if(N){for(var U=0;U<N.length;U++)if(v=N[U],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){N.splice(U,1);break t}}v=p.createElement(u),rr(v,u,l),p.head.appendChild(v);break;case"meta":if(N=VS("meta","content",p).get(u+(l.content||""))){for(U=0;U<N.length;U++)if(v=N[U],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){N.splice(U,1);break t}}v=p.createElement(u),rr(v,u,l),p.head.appendChild(v);break;default:throw Error(a(468,u))}v[Ve]=r,Sn(v),u=v}r.stateNode=u}else YS(p,r.type,r.stateNode);else r.stateNode=FS(p,u,r.memoizedProps);else v!==u?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,u===null?YS(p,r.type,r.stateNode):FS(p,u,r.memoizedProps)):u===null&&r.stateNode!==null&&Bp(r,r.memoizedProps,l.memoizedProps)}break;case 27:wr(o,r),Sr(r),u&512&&(Bn||l===null||Ma(l,l.return)),l!==null&&u&4&&Bp(r,r.memoizedProps,l.memoizedProps);break;case 5:if(wr(o,r),Sr(r),u&512&&(Bn||l===null||Ma(l,l.return)),r.flags&32){p=r.stateNode;try{ki(p,"")}catch(rt){un(r,r.return,rt)}}u&4&&r.stateNode!=null&&(p=r.memoizedProps,Bp(r,p,l!==null?l.memoizedProps:p)),u&1024&&(Yp=!0);break;case 6:if(wr(o,r),Sr(r),u&4){if(r.stateNode===null)throw Error(a(162));u=r.memoizedProps,l=r.stateNode;try{l.nodeValue=u}catch(rt){un(r,r.return,rt)}}break;case 3:if(yf=null,p=pa,pa=pf(o.containerInfo),wr(o,r),pa=p,Sr(r),u&4&&l!==null&&l.memoizedState.isDehydrated)try{cl(o.containerInfo)}catch(rt){un(r,r.return,rt)}Yp&&(Yp=!1,Yw(r));break;case 4:u=pa,pa=pf(r.stateNode.containerInfo),wr(o,r),Sr(r),pa=u;break;case 12:wr(o,r),Sr(r);break;case 31:wr(o,r),Sr(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,ef(r,u)));break;case 13:wr(o,r),Sr(r),r.child.flags&8192&&r.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(nf=De()),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,ef(r,u)));break;case 22:p=r.memoizedState!==null;var te=l!==null&&l.memoizedState!==null,he=so,Re=Bn;if(so=he||p,Bn=Re||te,wr(o,r),Bn=Re,so=he,Sr(r),u&8192)e:for(o=r.stateNode,o._visibility=p?o._visibility&-2:o._visibility|1,p&&(l===null||te||so||Bn||Gs(r)),l=null,o=r;;){if(o.tag===5||o.tag===26){if(l===null){te=l=o;try{if(v=te.stateNode,p)N=v.style,typeof N.setProperty=="function"?N.setProperty("display","none","important"):N.display="none";else{U=te.stateNode;var Ae=te.memoizedProps.style,me=Ae!=null&&Ae.hasOwnProperty("display")?Ae.display:null;U.style.display=me==null||typeof me=="boolean"?"":(""+me).trim()}}catch(rt){un(te,te.return,rt)}}}else if(o.tag===6){if(l===null){te=o;try{te.stateNode.nodeValue=p?"":te.memoizedProps}catch(rt){un(te,te.return,rt)}}}else if(o.tag===18){if(l===null){te=o;try{var ye=te.stateNode;p?jS(ye,!0):jS(te.stateNode,!1)}catch(rt){un(te,te.return,rt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;l===o&&(l=null),o=o.return}l===o&&(l=null),o.sibling.return=o.return,o=o.sibling}u&4&&(u=r.updateQueue,u!==null&&(l=u.retryQueue,l!==null&&(u.retryQueue=null,ef(r,l))));break;case 19:wr(o,r),Sr(r),u&4&&(u=r.updateQueue,u!==null&&(r.updateQueue=null,ef(r,u)));break;case 30:break;case 21:break;default:wr(o,r),Sr(r)}}function Sr(r){var o=r.flags;if(o&2){try{for(var l,u=r.return;u!==null;){if(Lw(u)){l=u;break}u=u.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var p=l.stateNode,v=Fp(r);Jd(r,v,p);break;case 5:var N=l.stateNode;l.flags&32&&(ki(N,""),l.flags&=-33);var U=Fp(r);Jd(r,U,N);break;case 3:case 4:var te=l.stateNode.containerInfo,he=Fp(r);Vp(r,he,te);break;default:throw Error(a(161))}}catch(Re){un(r,r.return,Re)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function Yw(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;Yw(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function lo(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)zw(r,o.alternate,o),o=o.sibling}function Gs(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:Bo(4,o,o.return),Gs(o);break;case 1:Ma(o,o.return);var l=o.stateNode;typeof l.componentWillUnmount=="function"&&jw(o,o.return,l),Gs(o);break;case 27:$c(o.stateNode);case 26:case 5:Ma(o,o.return),Gs(o);break;case 22:o.memoizedState===null&&Gs(o);break;case 30:Gs(o);break;default:Gs(o)}r=r.sibling}}function co(r,o,l){for(l=l&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var u=o.alternate,p=r,v=o,N=v.flags;switch(v.tag){case 0:case 11:case 15:co(p,v,l),Ic(4,v);break;case 1:if(co(p,v,l),u=v,p=u.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(he){un(u,u.return,he)}if(u=v,p=u.updateQueue,p!==null){var U=u.stateNode;try{var te=p.shared.hiddenCallbacks;if(te!==null)for(p.shared.hiddenCallbacks=null,p=0;p<te.length;p++)wx(te[p],U)}catch(he){un(u,u.return,he)}}l&&N&64&&kw(v),Pc(v,v.return);break;case 27:Iw(v);case 26:case 5:co(p,v,l),l&&u===null&&N&4&&_w(v),Pc(v,v.return);break;case 12:co(p,v,l);break;case 31:co(p,v,l),l&&N&4&&Bw(p,v);break;case 13:co(p,v,l),l&&N&4&&Fw(p,v);break;case 22:v.memoizedState===null&&co(p,v,l),Pc(v,v.return);break;case 30:break;default:co(p,v,l)}o=o.sibling}}function qp(r,o){var l=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==l&&(r!=null&&r.refCount++,l!=null&&Ec(l))}function $p(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Ec(r))}function ga(r,o,l,u){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)qw(r,o,l,u),o=o.sibling}function qw(r,o,l,u){var p=o.flags;switch(o.tag){case 0:case 11:case 15:ga(r,o,l,u),p&2048&&Ic(9,o);break;case 1:ga(r,o,l,u);break;case 3:ga(r,o,l,u),p&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Ec(r)));break;case 12:if(p&2048){ga(r,o,l,u),r=o.stateNode;try{var v=o.memoizedProps,N=v.id,U=v.onPostCommit;typeof U=="function"&&U(N,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(te){un(o,o.return,te)}}else ga(r,o,l,u);break;case 31:ga(r,o,l,u);break;case 13:ga(r,o,l,u);break;case 23:break;case 22:v=o.stateNode,N=o.alternate,o.memoizedState!==null?v._visibility&2?ga(r,o,l,u):zc(r,o):v._visibility&2?ga(r,o,l,u):(v._visibility|=2,Zi(r,o,l,u,(o.subtreeFlags&10256)!==0||!1)),p&2048&&qp(N,o);break;case 24:ga(r,o,l,u),p&2048&&$p(o.alternate,o);break;default:ga(r,o,l,u)}}function Zi(r,o,l,u,p){for(p=p&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var v=r,N=o,U=l,te=u,he=N.flags;switch(N.tag){case 0:case 11:case 15:Zi(v,N,U,te,p),Ic(8,N);break;case 23:break;case 22:var Re=N.stateNode;N.memoizedState!==null?Re._visibility&2?Zi(v,N,U,te,p):zc(v,N):(Re._visibility|=2,Zi(v,N,U,te,p)),p&&he&2048&&qp(N.alternate,N);break;case 24:Zi(v,N,U,te,p),p&&he&2048&&$p(N.alternate,N);break;default:Zi(v,N,U,te,p)}o=o.sibling}}function zc(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var l=r,u=o,p=u.flags;switch(u.tag){case 22:zc(l,u),p&2048&&qp(u.alternate,u);break;case 24:zc(l,u),p&2048&&$p(u.alternate,u);break;default:zc(l,u)}o=o.sibling}}var Uc=8192;function Ji(r,o,l){if(r.subtreeFlags&Uc)for(r=r.child;r!==null;)$w(r,o,l),r=r.sibling}function $w(r,o,l){switch(r.tag){case 26:Ji(r,o,l),r.flags&Uc&&r.memoizedState!==null&&eD(l,pa,r.memoizedState,r.memoizedProps);break;case 5:Ji(r,o,l);break;case 3:case 4:var u=pa;pa=pf(r.stateNode.containerInfo),Ji(r,o,l),pa=u;break;case 22:r.memoizedState===null&&(u=r.alternate,u!==null&&u.memoizedState!==null?(u=Uc,Uc=16777216,Ji(r,o,l),Uc=u):Ji(r,o,l));break;default:Ji(r,o,l)}}function Kw(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function Hc(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Xn=u,Xw(u,r)}Kw(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Gw(r),r=r.sibling}function Gw(r){switch(r.tag){case 0:case 11:case 15:Hc(r),r.flags&2048&&Bo(9,r,r.return);break;case 3:Hc(r);break;case 12:Hc(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,tf(r)):Hc(r);break;default:Hc(r)}}function tf(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var l=0;l<o.length;l++){var u=o[l];Xn=u,Xw(u,r)}Kw(r)}for(r=r.child;r!==null;){switch(o=r,o.tag){case 0:case 11:case 15:Bo(8,o,o.return),tf(o);break;case 22:l=o.stateNode,l._visibility&2&&(l._visibility&=-3,tf(o));break;default:tf(o)}r=r.sibling}}function Xw(r,o){for(;Xn!==null;){var l=Xn;switch(l.tag){case 0:case 11:case 15:Bo(8,l,o);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var u=l.memoizedState.cachePool.pool;u!=null&&u.refCount++}break;case 24:Ec(l.memoizedState.cache)}if(u=l.child,u!==null)u.return=l,Xn=u;else e:for(l=r;Xn!==null;){u=Xn;var p=u.sibling,v=u.return;if(Uw(u),u===l){Xn=null;break e}if(p!==null){p.return=v,Xn=p;break e}Xn=v}}}var pA={getCacheForType:function(r){var o=tr(zn),l=o.data.get(r);return l===void 0&&(l=r(),o.data.set(r,l)),l},cacheSignal:function(){return tr(zn).controller.signal}},gA=typeof WeakMap=="function"?WeakMap:Map,sn=0,gn=null,Bt=null,Vt=0,cn=0,Ir=null,Fo=!1,el=!1,Kp=!1,uo=0,An=0,Vo=0,Xs=0,Gp=0,Pr=0,tl=0,Bc=null,Er=null,Xp=!1,nf=0,Ww=0,rf=1/0,af=null,Yo=null,Vn=0,qo=null,nl=null,fo=0,Wp=0,Qp=null,Qw=null,Fc=0,Zp=null;function zr(){return(sn&2)!==0&&Vt!==0?Vt&-Vt:_.T!==null?ag():Le()}function Zw(){if(Pr===0)if((Vt&536870912)===0||Wt){var r=tt;tt<<=1,(tt&3932160)===0&&(tt=262144),Pr=r}else Pr=536870912;return r=_r.current,r!==null&&(r.flags|=32),Pr}function Rr(r,o,l){(r===gn&&(cn===2||cn===9)||r.cancelPendingCommit!==null)&&(rl(r,0),$o(r,Vt,Pr,!1)),Pt(r,l),((sn&2)===0||r!==gn)&&(r===gn&&((sn&2)===0&&(Xs|=l),An===4&&$o(r,Vt,Pr,!1)),Na(r))}function Jw(r,o,l){if((sn&6)!==0)throw Error(a(327));var u=!l&&(o&127)===0&&(o&r.expiredLanes)===0||Tt(r,o),p=u?bA(r,o):eg(r,o,!0),v=u;do{if(p===0){el&&!u&&$o(r,o,0,!1);break}else{if(l=r.current.alternate,v&&!yA(l)){p=eg(r,o,!1),v=!1;continue}if(p===2){if(v=o,r.errorRecoveryDisabledLanes&v)var N=0;else N=r.pendingLanes&-536870913,N=N!==0?N:N&536870912?536870912:0;if(N!==0){o=N;e:{var U=r;p=Bc;var te=U.current.memoizedState.isDehydrated;if(te&&(rl(U,N).flags|=256),N=eg(U,N,!1),N!==2){if(Kp&&!te){U.errorRecoveryDisabledLanes|=v,Xs|=v,p=4;break e}v=Er,Er=p,v!==null&&(Er===null?Er=v:Er.push.apply(Er,v))}p=N}if(v=!1,p!==2)continue}}if(p===1){rl(r,0),$o(r,o,0,!0);break}e:{switch(u=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((o&4194048)!==o)break;case 6:$o(u,o,Pr,!Fo);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(a(329))}if((o&62914560)===o&&(p=nf+300-De(),10<p)){if($o(u,o,Pr,!Fo),Ye(u,0,!0)!==0)break e;fo=o,u.timeoutHandle=AS(eS.bind(null,u,l,Er,af,Xp,o,Pr,Xs,tl,Fo,v,"Throttled",-0,0),p);break e}eS(u,l,Er,af,Xp,o,Pr,Xs,tl,Fo,v,null,-0,0)}}break}while(!0);Na(r)}function eS(r,o,l,u,p,v,N,U,te,he,Re,Ae,me,ye){if(r.timeoutHandle=-1,Ae=o.subtreeFlags,Ae&8192||(Ae&16785408)===16785408){Ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wa},$w(o,v,Ae);var rt=(v&62914560)===v?nf-De():(v&4194048)===v?Ww-De():0;if(rt=tD(Ae,rt),rt!==null){fo=v,r.cancelPendingCommit=rt(lS.bind(null,r,o,v,l,u,p,N,U,te,Re,Ae,null,me,ye)),$o(r,v,N,!he);return}}lS(r,o,v,l,u,p,N,U,te)}function yA(r){for(var o=r;;){var l=o.tag;if((l===0||l===11||l===15)&&o.flags&16384&&(l=o.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var u=0;u<l.length;u++){var p=l[u],v=p.getSnapshot;p=p.value;try{if(!kr(v(),p))return!1}catch{return!1}}if(l=o.child,o.subtreeFlags&16384&&l!==null)l.return=o,o=l;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function $o(r,o,l,u){o&=~Gp,o&=~Xs,r.suspendedLanes|=o,r.pingedLanes&=~o,u&&(r.warmLanes|=o),u=r.expirationTimes;for(var p=o;0<p;){var v=31-Fe(p),N=1<<v;u[v]=-1,p&=~N}l!==0&&Ct(r,l,o)}function of(){return(sn&6)===0?(Vc(0),!1):!0}function Jp(){if(Bt!==null){if(cn===0)var r=Bt.return;else r=Bt,eo=Hs=null,pp(r),Ki=null,Tc=0,r=Bt;for(;r!==null;)Dw(r.alternate,r),r=r.return;Bt=null}}function rl(r,o){var l=r.timeoutHandle;l!==-1&&(r.timeoutHandle=-1,PA(l)),l=r.cancelPendingCommit,l!==null&&(r.cancelPendingCommit=null,l()),fo=0,Jp(),gn=r,Bt=l=Za(r.current,null),Vt=o,cn=0,Ir=null,Fo=!1,el=Tt(r,o),Kp=!1,tl=Pr=Gp=Xs=Vo=An=0,Er=Bc=null,Xp=!1,(o&8)!==0&&(o|=o&32);var u=r.entangledLanes;if(u!==0)for(r=r.entanglements,u&=o;0<u;){var p=31-Fe(u),v=1<<p;o|=r[p],u&=~v}return uo=o,Cd(),l}function tS(r,o){jt=null,_.H=jc,o===$i||o===_d?(o=yx(),cn=3):o===rp?(o=yx(),cn=4):cn=o===Dp?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Ir=o,Bt===null&&(An=1,Gd(r,Xr(o,r.current)))}function nS(){var r=_r.current;return r===null?!0:(Vt&4194048)===Vt?Jr===null:(Vt&62914560)===Vt||(Vt&536870912)!==0?r===Jr:!1}function rS(){var r=_.H;return _.H=jc,r===null?jc:r}function aS(){var r=_.A;return _.A=pA,r}function sf(){An=4,Fo||(Vt&4194048)!==Vt&&_r.current!==null||(el=!0),(Vo&134217727)===0&&(Xs&134217727)===0||gn===null||$o(gn,Vt,Pr,!1)}function eg(r,o,l){var u=sn;sn|=2;var p=rS(),v=aS();(gn!==r||Vt!==o)&&(af=null,rl(r,o)),o=!1;var N=An;e:do try{if(cn!==0&&Bt!==null){var U=Bt,te=Ir;switch(cn){case 8:Jp(),N=6;break e;case 3:case 2:case 9:case 6:_r.current===null&&(o=!0);var he=cn;if(cn=0,Ir=null,al(r,U,te,he),l&&el){N=0;break e}break;default:he=cn,cn=0,Ir=null,al(r,U,te,he)}}vA(),N=An;break}catch(Re){tS(r,Re)}while(!0);return o&&r.shellSuspendCounter++,eo=Hs=null,sn=u,_.H=p,_.A=v,Bt===null&&(gn=null,Vt=0,Cd()),N}function vA(){for(;Bt!==null;)oS(Bt)}function bA(r,o){var l=sn;sn|=2;var u=rS(),p=aS();gn!==r||Vt!==o?(af=null,rf=De()+500,rl(r,o)):el=Tt(r,o);e:do try{if(cn!==0&&Bt!==null){o=Bt;var v=Ir;t:switch(cn){case 1:cn=0,Ir=null,al(r,o,v,1);break;case 2:case 9:if(px(v)){cn=0,Ir=null,sS(o);break}o=function(){cn!==2&&cn!==9||gn!==r||(cn=7),Na(r)},v.then(o,o);break e;case 3:cn=7;break e;case 4:cn=5;break e;case 7:px(v)?(cn=0,Ir=null,sS(o)):(cn=0,Ir=null,al(r,o,v,7));break;case 5:var N=null;switch(Bt.tag){case 26:N=Bt.memoizedState;case 5:case 27:var U=Bt;if(N?qS(N):U.stateNode.complete){cn=0,Ir=null;var te=U.sibling;if(te!==null)Bt=te;else{var he=U.return;he!==null?(Bt=he,lf(he)):Bt=null}break t}}cn=0,Ir=null,al(r,o,v,5);break;case 6:cn=0,Ir=null,al(r,o,v,6);break;case 8:Jp(),An=6;break e;default:throw Error(a(462))}}xA();break}catch(Re){tS(r,Re)}while(!0);return eo=Hs=null,_.H=u,_.A=p,sn=l,Bt!==null?0:(gn=null,Vt=0,Cd(),An)}function xA(){for(;Bt!==null&&!ze();)oS(Bt)}function oS(r){var o=Nw(r.alternate,r,uo);r.memoizedProps=r.pendingProps,o===null?lf(r):Bt=o}function sS(r){var o=r,l=o.alternate;switch(o.tag){case 15:case 0:o=Ew(l,o,o.pendingProps,o.type,void 0,Vt);break;case 11:o=Ew(l,o,o.pendingProps,o.type.render,o.ref,Vt);break;case 5:pp(o);default:Dw(l,o),o=Bt=ax(o,uo),o=Nw(l,o,uo)}r.memoizedProps=r.pendingProps,o===null?lf(r):Bt=o}function al(r,o,l,u){eo=Hs=null,pp(o),Ki=null,Tc=0;var p=o.return;try{if(lA(r,p,o,l,Vt)){An=1,Gd(r,Xr(l,r.current)),Bt=null;return}}catch(v){if(p!==null)throw Bt=p,v;An=1,Gd(r,Xr(l,r.current)),Bt=null;return}o.flags&32768?(Wt||u===1?r=!0:el||(Vt&536870912)!==0?r=!1:(Fo=r=!0,(u===2||u===9||u===3||u===6)&&(u=_r.current,u!==null&&u.tag===13&&(u.flags|=16384))),iS(o,r)):lf(o)}function lf(r){var o=r;do{if((o.flags&32768)!==0){iS(o,Fo);return}r=o.return;var l=dA(o.alternate,o,uo);if(l!==null){Bt=l;return}if(o=o.sibling,o!==null){Bt=o;return}Bt=o=r}while(o!==null);An===0&&(An=5)}function iS(r,o){do{var l=fA(r.alternate,r);if(l!==null){l.flags&=32767,Bt=l;return}if(l=r.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!o&&(r=r.sibling,r!==null)){Bt=r;return}Bt=r=l}while(r!==null);An=6,Bt=null}function lS(r,o,l,u,p,v,N,U,te){r.cancelPendingCommit=null;do cf();while(Vn!==0);if((sn&6)!==0)throw Error(a(327));if(o!==null){if(o===r.current)throw Error(a(177));if(v=o.lanes|o.childLanes,v|=Fm,Xe(r,l,v,N,U,te),r===gn&&(Bt=gn=null,Vt=0),nl=o,qo=r,fo=l,Wp=v,Qp=p,Qw=u,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,RA(Je,function(){return hS(),null})):(r.callbackNode=null,r.callbackPriority=0),u=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||u){u=_.T,_.T=null,p=L.p,L.p=2,N=sn,sn|=4;try{hA(r,o,l)}finally{sn=N,L.p=p,_.T=u}}Vn=1,cS(),uS(),dS()}}function cS(){if(Vn===1){Vn=0;var r=qo,o=nl,l=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||l){l=_.T,_.T=null;var u=L.p;L.p=2;var p=sn;sn|=4;try{Vw(o,r);var v=fg,N=X0(r.containerInfo),U=v.focusedElem,te=v.selectionRange;if(N!==U&&U&&U.ownerDocument&&G0(U.ownerDocument.documentElement,U)){if(te!==null&&Pm(U)){var he=te.start,Re=te.end;if(Re===void 0&&(Re=he),"selectionStart"in U)U.selectionStart=he,U.selectionEnd=Math.min(Re,U.value.length);else{var Ae=U.ownerDocument||document,me=Ae&&Ae.defaultView||window;if(me.getSelection){var ye=me.getSelection(),rt=U.textContent.length,bt=Math.min(te.start,rt),mn=te.end===void 0?bt:Math.min(te.end,rt);!ye.extend&&bt>mn&&(N=mn,mn=bt,bt=N);var ie=K0(U,bt),ae=K0(U,mn);if(ie&&ae&&(ye.rangeCount!==1||ye.anchorNode!==ie.node||ye.anchorOffset!==ie.offset||ye.focusNode!==ae.node||ye.focusOffset!==ae.offset)){var fe=Ae.createRange();fe.setStart(ie.node,ie.offset),ye.removeAllRanges(),bt>mn?(ye.addRange(fe),ye.extend(ae.node,ae.offset)):(fe.setEnd(ae.node,ae.offset),ye.addRange(fe))}}}}for(Ae=[],ye=U;ye=ye.parentNode;)ye.nodeType===1&&Ae.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<Ae.length;U++){var Ce=Ae[U];Ce.element.scrollLeft=Ce.left,Ce.element.scrollTop=Ce.top}}wf=!!dg,fg=dg=null}finally{sn=p,L.p=u,_.T=l}}r.current=o,Vn=2}}function uS(){if(Vn===2){Vn=0;var r=qo,o=nl,l=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||l){l=_.T,_.T=null;var u=L.p;L.p=2;var p=sn;sn|=4;try{zw(r,o.alternate,o)}finally{sn=p,L.p=u,_.T=l}}Vn=3}}function dS(){if(Vn===4||Vn===3){Vn=0,He();var r=qo,o=nl,l=fo,u=Qw;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Vn=5:(Vn=0,nl=qo=null,fS(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Yo=null),Ee(l),o=o.stateNode,Me&&typeof Me.onCommitFiberRoot=="function")try{Me.onCommitFiberRoot(Ke,o,void 0,(o.current.flags&128)===128)}catch{}if(u!==null){o=_.T,p=L.p,L.p=2,_.T=null;try{for(var v=r.onRecoverableError,N=0;N<u.length;N++){var U=u[N];v(U.value,{componentStack:U.stack})}}finally{_.T=o,L.p=p}}(fo&3)!==0&&cf(),Na(r),p=r.pendingLanes,(l&261930)!==0&&(p&42)!==0?r===Zp?Fc++:(Fc=0,Zp=r):Fc=0,Vc(0)}}function fS(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,Ec(o)))}function cf(){return cS(),uS(),dS(),hS()}function hS(){if(Vn!==5)return!1;var r=qo,o=Wp;Wp=0;var l=Ee(fo),u=_.T,p=L.p;try{L.p=32>l?32:l,_.T=null,l=Qp,Qp=null;var v=qo,N=fo;if(Vn=0,nl=qo=null,fo=0,(sn&6)!==0)throw Error(a(331));var U=sn;if(sn|=4,Gw(v.current),qw(v,v.current,N,l),sn=U,Vc(0,!1),Me&&typeof Me.onPostCommitFiberRoot=="function")try{Me.onPostCommitFiberRoot(Ke,v)}catch{}return!0}finally{L.p=p,_.T=u,fS(r,o)}}function mS(r,o,l){o=Xr(l,o),o=Ap(r.stateNode,o,2),r=zo(r,o,2),r!==null&&(Pt(r,2),Na(r))}function un(r,o,l){if(r.tag===3)mS(r,r,l);else for(;o!==null;){if(o.tag===3){mS(o,r,l);break}else if(o.tag===1){var u=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(Yo===null||!Yo.has(u))){r=Xr(l,r),l=pw(2),u=zo(o,l,2),u!==null&&(gw(l,u,o,r),Pt(u,2),Na(u));break}}o=o.return}}function tg(r,o,l){var u=r.pingCache;if(u===null){u=r.pingCache=new gA;var p=new Set;u.set(o,p)}else p=u.get(o),p===void 0&&(p=new Set,u.set(o,p));p.has(l)||(Kp=!0,p.add(l),r=wA.bind(null,r,o,l),o.then(r,r))}function wA(r,o,l){var u=r.pingCache;u!==null&&u.delete(o),r.pingedLanes|=r.suspendedLanes&l,r.warmLanes&=~l,gn===r&&(Vt&l)===l&&(An===4||An===3&&(Vt&62914560)===Vt&&300>De()-nf?(sn&2)===0&&rl(r,0):Gp|=l,tl===Vt&&(tl=0)),Na(r)}function pS(r,o){o===0&&(o=Rt()),r=Ps(r,o),r!==null&&(Pt(r,o),Na(r))}function SA(r){var o=r.memoizedState,l=0;o!==null&&(l=o.retryLane),pS(r,l)}function EA(r,o){var l=0;switch(r.tag){case 31:case 13:var u=r.stateNode,p=r.memoizedState;p!==null&&(l=p.retryLane);break;case 19:u=r.stateNode;break;case 22:u=r.stateNode._retryCache;break;default:throw Error(a(314))}u!==null&&u.delete(o),pS(r,l)}function RA(r,o){return Se(r,o)}var uf=null,ol=null,ng=!1,df=!1,rg=!1,Ko=0;function Na(r){r!==ol&&r.next===null&&(ol===null?uf=ol=r:ol=ol.next=r),df=!0,ng||(ng=!0,CA())}function Vc(r,o){if(!rg&&df){rg=!0;do for(var l=!1,u=uf;u!==null;){if(r!==0){var p=u.pendingLanes;if(p===0)var v=0;else{var N=u.suspendedLanes,U=u.pingedLanes;v=(1<<31-Fe(42|r)+1)-1,v&=p&~(N&~U),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,bS(u,v))}else v=Vt,v=Ye(u,u===gn?v:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),(v&3)===0||Tt(u,v)||(l=!0,bS(u,v));u=u.next}while(l);rg=!1}}function TA(){gS()}function gS(){df=ng=!1;var r=0;Ko!==0&&IA()&&(r=Ko);for(var o=De(),l=null,u=uf;u!==null;){var p=u.next,v=yS(u,o);v===0?(u.next=null,l===null?uf=p:l.next=p,p===null&&(ol=l)):(l=u,(r!==0||(v&3)!==0)&&(df=!0)),u=p}Vn!==0&&Vn!==5||Vc(r),Ko!==0&&(Ko=0)}function yS(r,o){for(var l=r.suspendedLanes,u=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var N=31-Fe(v),U=1<<N,te=p[N];te===-1?((U&l)===0||(U&u)!==0)&&(p[N]=kt(U,o)):te<=o&&(r.expiredLanes|=U),v&=~U}if(o=gn,l=Vt,l=Ye(r,r===o?l:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u=r.callbackNode,l===0||r===o&&(cn===2||cn===9)||r.cancelPendingCommit!==null)return u!==null&&u!==null&&ge(u),r.callbackNode=null,r.callbackPriority=0;if((l&3)===0||Tt(r,l)){if(o=l&-l,o===r.callbackPriority)return o;switch(u!==null&&ge(u),Ee(l)){case 2:case 8:l=vt;break;case 32:l=Je;break;case 268435456:l=ft;break;default:l=Je}return u=vS.bind(null,r),l=Se(l,u),r.callbackPriority=o,r.callbackNode=l,o}return u!==null&&u!==null&&ge(u),r.callbackPriority=2,r.callbackNode=null,2}function vS(r,o){if(Vn!==0&&Vn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var l=r.callbackNode;if(cf()&&r.callbackNode!==l)return null;var u=Vt;return u=Ye(r,r===gn?u:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),u===0?null:(Jw(r,u,o),yS(r,De()),r.callbackNode!=null&&r.callbackNode===l?vS.bind(null,r):null)}function bS(r,o){if(cf())return null;Jw(r,o,!0)}function CA(){zA(function(){(sn&6)!==0?Se(xt,TA):gS()})}function ag(){if(Ko===0){var r=Yi;r===0&&(r=pt,pt<<=1,(pt&261888)===0&&(pt=256)),Ko=r}return Ko}function xS(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:vd(""+r)}function wS(r,o){var l=o.ownerDocument.createElement("input");return l.name=o.name,l.value=o.value,r.id&&l.setAttribute("form",r.id),o.parentNode.insertBefore(l,o),r=new FormData(r),l.parentNode.removeChild(l),r}function OA(r,o,l,u,p){if(o==="submit"&&l&&l.stateNode===p){var v=xS((p[$e]||null).action),N=u.submitter;N&&(o=(o=N[$e]||null)?xS(o.formAction):N.getAttribute("formAction"),o!==null&&(v=o,N=null));var U=new Sd("action","action",null,u,p);r.push({event:U,listeners:[{instance:null,listener:function(){if(u.defaultPrevented){if(Ko!==0){var te=N?wS(p,N):new FormData(p);Rp(l,{pending:!0,data:te,method:p.method,action:v},null,te)}}else typeof v=="function"&&(U.preventDefault(),te=N?wS(p,N):new FormData(p),Rp(l,{pending:!0,data:te,method:p.method,action:v},v,te))},currentTarget:p}]})}}for(var og=0;og<Bm.length;og++){var sg=Bm[og],MA=sg.toLowerCase(),NA=sg[0].toUpperCase()+sg.slice(1);ma(MA,"on"+NA)}ma(Z0,"onAnimationEnd"),ma(J0,"onAnimationIteration"),ma(ex,"onAnimationStart"),ma("dblclick","onDoubleClick"),ma("focusin","onFocus"),ma("focusout","onBlur"),ma(qN,"onTransitionRun"),ma($N,"onTransitionStart"),ma(KN,"onTransitionCancel"),ma(tx,"onTransitionEnd"),$r("onMouseEnter",["mouseout","mouseover"]),$r("onMouseLeave",["mouseout","mouseover"]),$r("onPointerEnter",["pointerout","pointerover"]),$r("onPointerLeave",["pointerout","pointerover"]),fa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fa("onBeforeInput",["compositionend","keypress","textInput","paste"]),fa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Yc="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(" "),AA=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Yc));function SS(r,o){o=(o&4)!==0;for(var l=0;l<r.length;l++){var u=r[l],p=u.event;u=u.listeners;e:{var v=void 0;if(o)for(var N=u.length-1;0<=N;N--){var U=u[N],te=U.instance,he=U.currentTarget;if(U=U.listener,te!==v&&p.isPropagationStopped())break e;v=U,p.currentTarget=he;try{v(p)}catch(Re){Td(Re)}p.currentTarget=null,v=te}else for(N=0;N<u.length;N++){if(U=u[N],te=U.instance,he=U.currentTarget,U=U.listener,te!==v&&p.isPropagationStopped())break e;v=U,p.currentTarget=he;try{v(p)}catch(Re){Td(Re)}p.currentTarget=null,v=te}}}}function Ft(r,o){var l=o[St];l===void 0&&(l=o[St]=new Set);var u=r+"__bubble";l.has(u)||(ES(o,r,2,!1),l.add(u))}function ig(r,o,l){var u=0;o&&(u|=4),ES(l,r,u,o)}var ff="_reactListening"+Math.random().toString(36).slice(2);function lg(r){if(!r[ff]){r[ff]=!0,da.forEach(function(l){l!=="selectionchange"&&(AA.has(l)||ig(l,!1,r),ig(l,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[ff]||(o[ff]=!0,ig("selectionchange",!1,o))}}function ES(r,o,l,u){switch(ZS(o)){case 2:var p=aD;break;case 8:p=oD;break;default:p=Eg}l=p.bind(null,o,l,r),p=void 0,!Mm||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(p=!0),u?p!==void 0?r.addEventListener(o,l,{capture:!0,passive:p}):r.addEventListener(o,l,!0):p!==void 0?r.addEventListener(o,l,{passive:p}):r.addEventListener(o,l,!1)}function cg(r,o,l,u,p){var v=u;if((o&1)===0&&(o&2)===0&&u!==null)e:for(;;){if(u===null)return;var N=u.tag;if(N===3||N===4){var U=u.stateNode.containerInfo;if(U===p)break;if(N===4)for(N=u.return;N!==null;){var te=N.tag;if((te===3||te===4)&&N.stateNode.containerInfo===p)return;N=N.return}for(;U!==null;){if(N=Mn(U),N===null)return;if(te=N.tag,te===5||te===6||te===26||te===27){u=v=N;continue e}U=U.parentNode}}u=u.return}M0(function(){var he=v,Re=Cm(l),Ae=[];e:{var me=nx.get(r);if(me!==void 0){var ye=Sd,rt=r;switch(r){case"keypress":if(xd(l)===0)break e;case"keydown":case"keyup":ye=EN;break;case"focusin":rt="focus",ye=km;break;case"focusout":rt="blur",ye=km;break;case"beforeblur":case"afterblur":ye=km;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=D0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=dN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=CN;break;case Z0:case J0:case ex:ye=mN;break;case tx:ye=MN;break;case"scroll":case"scrollend":ye=cN;break;case"wheel":ye=AN;break;case"copy":case"cut":case"paste":ye=gN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=j0;break;case"toggle":case"beforetoggle":ye=kN}var bt=(o&4)!==0,mn=!bt&&(r==="scroll"||r==="scrollend"),ie=bt?me!==null?me+"Capture":null:me;bt=[];for(var ae=he,fe;ae!==null;){var Ce=ae;if(fe=Ce.stateNode,Ce=Ce.tag,Ce!==5&&Ce!==26&&Ce!==27||fe===null||ie===null||(Ce=fc(ae,ie),Ce!=null&&bt.push(qc(ae,Ce,fe))),mn)break;ae=ae.return}0<bt.length&&(me=new ye(me,rt,null,l,Re),Ae.push({event:me,listeners:bt}))}}if((o&7)===0){e:{if(me=r==="mouseover"||r==="pointerover",ye=r==="mouseout"||r==="pointerout",me&&l!==Tm&&(rt=l.relatedTarget||l.fromElement)&&(Mn(rt)||rt[nt]))break e;if((ye||me)&&(me=Re.window===Re?Re:(me=Re.ownerDocument)?me.defaultView||me.parentWindow:window,ye?(rt=l.relatedTarget||l.toElement,ye=he,rt=rt?Mn(rt):null,rt!==null&&(mn=i(rt),bt=rt.tag,rt!==mn||bt!==5&&bt!==27&&bt!==6)&&(rt=null)):(ye=null,rt=he),ye!==rt)){if(bt=D0,Ce="onMouseLeave",ie="onMouseEnter",ae="mouse",(r==="pointerout"||r==="pointerover")&&(bt=j0,Ce="onPointerLeave",ie="onPointerEnter",ae="pointer"),mn=ye==null?me:Gn(ye),fe=rt==null?me:Gn(rt),me=new bt(Ce,ae+"leave",ye,l,Re),me.target=mn,me.relatedTarget=fe,Ce=null,Mn(Re)===he&&(bt=new bt(ie,ae+"enter",rt,l,Re),bt.target=fe,bt.relatedTarget=mn,Ce=bt),mn=Ce,ye&&rt)t:{for(bt=DA,ie=ye,ae=rt,fe=0,Ce=ie;Ce;Ce=bt(Ce))fe++;Ce=0;for(var mt=ae;mt;mt=bt(mt))Ce++;for(;0<fe-Ce;)ie=bt(ie),fe--;for(;0<Ce-fe;)ae=bt(ae),Ce--;for(;fe--;){if(ie===ae||ae!==null&&ie===ae.alternate){bt=ie;break t}ie=bt(ie),ae=bt(ae)}bt=null}else bt=null;ye!==null&&RS(Ae,me,ye,bt,!1),rt!==null&&mn!==null&&RS(Ae,mn,rt,bt,!0)}}e:{if(me=he?Gn(he):window,ye=me.nodeName&&me.nodeName.toLowerCase(),ye==="select"||ye==="input"&&me.type==="file")var en=B0;else if(U0(me))if(F0)en=FN;else{en=HN;var it=UN}else ye=me.nodeName,!ye||ye.toLowerCase()!=="input"||me.type!=="checkbox"&&me.type!=="radio"?he&&Rm(he.elementType)&&(en=B0):en=BN;if(en&&(en=en(r,he))){H0(Ae,en,l,Re);break e}it&&it(r,me,he),r==="focusout"&&he&&me.type==="number"&&he.memoizedProps.value!=null&&Em(me,"number",me.value)}switch(it=he?Gn(he):window,r){case"focusin":(U0(it)||it.contentEditable==="true")&&(Ii=it,zm=he,xc=null);break;case"focusout":xc=zm=Ii=null;break;case"mousedown":Um=!0;break;case"contextmenu":case"mouseup":case"dragend":Um=!1,W0(Ae,l,Re);break;case"selectionchange":if(YN)break;case"keydown":case"keyup":W0(Ae,l,Re)}var _t;if(_m)e:{switch(r){case"compositionstart":var Yt="onCompositionStart";break e;case"compositionend":Yt="onCompositionEnd";break e;case"compositionupdate":Yt="onCompositionUpdate";break e}Yt=void 0}else Li?P0(r,l)&&(Yt="onCompositionEnd"):r==="keydown"&&l.keyCode===229&&(Yt="onCompositionStart");Yt&&(_0&&l.locale!=="ko"&&(Li||Yt!=="onCompositionStart"?Yt==="onCompositionEnd"&&Li&&(_t=N0()):(Do=Re,Nm="value"in Do?Do.value:Do.textContent,Li=!0)),it=hf(he,Yt),0<it.length&&(Yt=new k0(Yt,r,null,l,Re),Ae.push({event:Yt,listeners:it}),_t?Yt.data=_t:(_t=z0(l),_t!==null&&(Yt.data=_t)))),(_t=_N?LN(r,l):IN(r,l))&&(Yt=hf(he,"onBeforeInput"),0<Yt.length&&(it=new k0("onBeforeInput","beforeinput",null,l,Re),Ae.push({event:it,listeners:Yt}),it.data=_t)),OA(Ae,r,he,l,Re)}SS(Ae,o)})}function qc(r,o,l){return{instance:r,listener:o,currentTarget:l}}function hf(r,o){for(var l=o+"Capture",u=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=fc(r,l),p!=null&&u.unshift(qc(r,p,v)),p=fc(r,o),p!=null&&u.push(qc(r,p,v))),r.tag===3)return u;r=r.return}return[]}function DA(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function RS(r,o,l,u,p){for(var v=o._reactName,N=[];l!==null&&l!==u;){var U=l,te=U.alternate,he=U.stateNode;if(U=U.tag,te!==null&&te===u)break;U!==5&&U!==26&&U!==27||he===null||(te=he,p?(he=fc(l,v),he!=null&&N.unshift(qc(l,he,te))):p||(he=fc(l,v),he!=null&&N.push(qc(l,he,te)))),l=l.return}N.length!==0&&r.push({event:o,listeners:N})}var kA=/\r\n?/g,jA=/\u0000|\uFFFD/g;function TS(r){return(typeof r=="string"?r:""+r).replace(kA,`
50
+ `).replace(jA,"")}function CS(r,o){return o=TS(o),TS(r)===o}function hn(r,o,l,u,p,v){switch(l){case"children":typeof u=="string"?o==="body"||o==="textarea"&&u===""||ki(r,u):(typeof u=="number"||typeof u=="bigint")&&o!=="body"&&ki(r,""+u);break;case"className":ha(r,"class",u);break;case"tabIndex":ha(r,"tabindex",u);break;case"dir":case"role":case"viewBox":case"width":case"height":ha(r,l,u);break;case"style":C0(r,u,v);break;case"data":if(o!=="object"){ha(r,"data",u);break}case"src":case"href":if(u===""&&(o!=="a"||l!=="href")){r.removeAttribute(l);break}if(u==null||typeof u=="function"||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=vd(""+u),r.setAttribute(l,u);break;case"action":case"formAction":if(typeof u=="function"){r.setAttribute(l,"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 v=="function"&&(l==="formAction"?(o!=="input"&&hn(r,o,"name",p.name,p,null),hn(r,o,"formEncType",p.formEncType,p,null),hn(r,o,"formMethod",p.formMethod,p,null),hn(r,o,"formTarget",p.formTarget,p,null)):(hn(r,o,"encType",p.encType,p,null),hn(r,o,"method",p.method,p,null),hn(r,o,"target",p.target,p,null)));if(u==null||typeof u=="symbol"||typeof u=="boolean"){r.removeAttribute(l);break}u=vd(""+u),r.setAttribute(l,u);break;case"onClick":u!=null&&(r.onclick=Wa);break;case"onScroll":u!=null&&Ft("scroll",r);break;case"onScrollEnd":u!=null&&Ft("scrollend",r);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"multiple":r.multiple=u&&typeof u!="function"&&typeof u!="symbol";break;case"muted":r.muted=u&&typeof u!="function"&&typeof u!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(u==null||typeof u=="function"||typeof u=="boolean"||typeof u=="symbol"){r.removeAttribute("xlink:href");break}l=vd(""+u),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""+u):r.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":u&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,""):r.removeAttribute(l);break;case"capture":case"download":u===!0?r.setAttribute(l,""):u!==!1&&u!=null&&typeof u!="function"&&typeof u!="symbol"?r.setAttribute(l,u):r.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":u!=null&&typeof u!="function"&&typeof u!="symbol"&&!isNaN(u)&&1<=u?r.setAttribute(l,u):r.removeAttribute(l);break;case"rowSpan":case"start":u==null||typeof u=="function"||typeof u=="symbol"||isNaN(u)?r.removeAttribute(l):r.setAttribute(l,u);break;case"popover":Ft("beforetoggle",r),Ft("toggle",r),Ln(r,"popover",u);break;case"xlinkActuate":Jn(r,"http://www.w3.org/1999/xlink","xlink:actuate",u);break;case"xlinkArcrole":Jn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",u);break;case"xlinkRole":Jn(r,"http://www.w3.org/1999/xlink","xlink:role",u);break;case"xlinkShow":Jn(r,"http://www.w3.org/1999/xlink","xlink:show",u);break;case"xlinkTitle":Jn(r,"http://www.w3.org/1999/xlink","xlink:title",u);break;case"xlinkType":Jn(r,"http://www.w3.org/1999/xlink","xlink:type",u);break;case"xmlBase":Jn(r,"http://www.w3.org/XML/1998/namespace","xml:base",u);break;case"xmlLang":Jn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",u);break;case"xmlSpace":Jn(r,"http://www.w3.org/XML/1998/namespace","xml:space",u);break;case"is":Ln(r,"is",u);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=iN.get(l)||l,Ln(r,l,u))}}function ug(r,o,l,u,p,v){switch(l){case"style":C0(r,u,v);break;case"dangerouslySetInnerHTML":if(u!=null){if(typeof u!="object"||!("__html"in u))throw Error(a(61));if(l=u.__html,l!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=l}}break;case"children":typeof u=="string"?ki(r,u):(typeof u=="number"||typeof u=="bigint")&&ki(r,""+u);break;case"onScroll":u!=null&&Ft("scroll",r);break;case"onScrollEnd":u!=null&&Ft("scrollend",r);break;case"onClick":u!=null&&(r.onclick=Wa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Dr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),o=l.slice(2,p?l.length-7:void 0),v=r[$e]||null,v=v!=null?v[l]:null,typeof v=="function"&&r.removeEventListener(o,v,p),typeof u=="function")){typeof v!="function"&&v!==null&&(l in r?r[l]=null:r.hasAttribute(l)&&r.removeAttribute(l)),r.addEventListener(o,u,p);break e}l in r?r[l]=u:u===!0?r.setAttribute(l,""):Ln(r,l,u)}}}function rr(r,o,l){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ft("error",r),Ft("load",r);var u=!1,p=!1,v;for(v in l)if(l.hasOwnProperty(v)){var N=l[v];if(N!=null)switch(v){case"src":u=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:hn(r,o,v,N,l,null)}}p&&hn(r,o,"srcSet",l.srcSet,l,null),u&&hn(r,o,"src",l.src,l,null);return;case"input":Ft("invalid",r);var U=v=N=p=null,te=null,he=null;for(u in l)if(l.hasOwnProperty(u)){var Re=l[u];if(Re!=null)switch(u){case"name":p=Re;break;case"type":N=Re;break;case"checked":te=Re;break;case"defaultChecked":he=Re;break;case"value":v=Re;break;case"defaultValue":U=Re;break;case"children":case"dangerouslySetInnerHTML":if(Re!=null)throw Error(a(137,o));break;default:hn(r,o,u,Re,l,null)}}S0(r,v,U,te,he,N,p,!1);return;case"select":Ft("invalid",r),u=N=v=null;for(p in l)if(l.hasOwnProperty(p)&&(U=l[p],U!=null))switch(p){case"value":v=U;break;case"defaultValue":N=U;break;case"multiple":u=U;default:hn(r,o,p,U,l,null)}o=v,l=N,r.multiple=!!u,o!=null?Di(r,!!u,o,!1):l!=null&&Di(r,!!u,l,!0);return;case"textarea":Ft("invalid",r),v=p=u=null;for(N in l)if(l.hasOwnProperty(N)&&(U=l[N],U!=null))switch(N){case"value":u=U;break;case"defaultValue":p=U;break;case"children":v=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(a(91));break;default:hn(r,o,N,U,l,null)}R0(r,u,p,v);return;case"option":for(te in l)if(l.hasOwnProperty(te)&&(u=l[te],u!=null))switch(te){case"selected":r.selected=u&&typeof u!="function"&&typeof u!="symbol";break;default:hn(r,o,te,u,l,null)}return;case"dialog":Ft("beforetoggle",r),Ft("toggle",r),Ft("cancel",r),Ft("close",r);break;case"iframe":case"object":Ft("load",r);break;case"video":case"audio":for(u=0;u<Yc.length;u++)Ft(Yc[u],r);break;case"image":Ft("error",r),Ft("load",r);break;case"details":Ft("toggle",r);break;case"embed":case"source":case"link":Ft("error",r),Ft("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(he in l)if(l.hasOwnProperty(he)&&(u=l[he],u!=null))switch(he){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,o));default:hn(r,o,he,u,l,null)}return;default:if(Rm(o)){for(Re in l)l.hasOwnProperty(Re)&&(u=l[Re],u!==void 0&&ug(r,o,Re,u,l,void 0));return}}for(U in l)l.hasOwnProperty(U)&&(u=l[U],u!=null&&hn(r,o,U,u,l,null))}function _A(r,o,l,u){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,N=null,U=null,te=null,he=null,Re=null;for(ye in l){var Ae=l[ye];if(l.hasOwnProperty(ye)&&Ae!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":te=Ae;default:u.hasOwnProperty(ye)||hn(r,o,ye,null,u,Ae)}}for(var me in u){var ye=u[me];if(Ae=l[me],u.hasOwnProperty(me)&&(ye!=null||Ae!=null))switch(me){case"type":v=ye;break;case"name":p=ye;break;case"checked":he=ye;break;case"defaultChecked":Re=ye;break;case"value":N=ye;break;case"defaultValue":U=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(a(137,o));break;default:ye!==Ae&&hn(r,o,me,ye,u,Ae)}}Sm(r,N,U,te,he,Re,v,p);return;case"select":ye=N=U=me=null;for(v in l)if(te=l[v],l.hasOwnProperty(v)&&te!=null)switch(v){case"value":break;case"multiple":ye=te;default:u.hasOwnProperty(v)||hn(r,o,v,null,u,te)}for(p in u)if(v=u[p],te=l[p],u.hasOwnProperty(p)&&(v!=null||te!=null))switch(p){case"value":me=v;break;case"defaultValue":U=v;break;case"multiple":N=v;default:v!==te&&hn(r,o,p,v,u,te)}o=U,l=N,u=ye,me!=null?Di(r,!!l,me,!1):!!u!=!!l&&(o!=null?Di(r,!!l,o,!0):Di(r,!!l,l?[]:"",!1));return;case"textarea":ye=me=null;for(U in l)if(p=l[U],l.hasOwnProperty(U)&&p!=null&&!u.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:hn(r,o,U,null,u,p)}for(N in u)if(p=u[N],v=l[N],u.hasOwnProperty(N)&&(p!=null||v!=null))switch(N){case"value":me=p;break;case"defaultValue":ye=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&hn(r,o,N,p,u,v)}E0(r,me,ye);return;case"option":for(var rt in l)if(me=l[rt],l.hasOwnProperty(rt)&&me!=null&&!u.hasOwnProperty(rt))switch(rt){case"selected":r.selected=!1;break;default:hn(r,o,rt,null,u,me)}for(te in u)if(me=u[te],ye=l[te],u.hasOwnProperty(te)&&me!==ye&&(me!=null||ye!=null))switch(te){case"selected":r.selected=me&&typeof me!="function"&&typeof me!="symbol";break;default:hn(r,o,te,me,u,ye)}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 bt in l)me=l[bt],l.hasOwnProperty(bt)&&me!=null&&!u.hasOwnProperty(bt)&&hn(r,o,bt,null,u,me);for(he in u)if(me=u[he],ye=l[he],u.hasOwnProperty(he)&&me!==ye&&(me!=null||ye!=null))switch(he){case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(a(137,o));break;default:hn(r,o,he,me,u,ye)}return;default:if(Rm(o)){for(var mn in l)me=l[mn],l.hasOwnProperty(mn)&&me!==void 0&&!u.hasOwnProperty(mn)&&ug(r,o,mn,void 0,u,me);for(Re in u)me=u[Re],ye=l[Re],!u.hasOwnProperty(Re)||me===ye||me===void 0&&ye===void 0||ug(r,o,Re,me,u,ye);return}}for(var ie in l)me=l[ie],l.hasOwnProperty(ie)&&me!=null&&!u.hasOwnProperty(ie)&&hn(r,o,ie,null,u,me);for(Ae in u)me=u[Ae],ye=l[Ae],!u.hasOwnProperty(Ae)||me===ye||me==null&&ye==null||hn(r,o,Ae,me,u,ye)}function OS(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function LA(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,l=performance.getEntriesByType("resource"),u=0;u<l.length;u++){var p=l[u],v=p.transferSize,N=p.initiatorType,U=p.duration;if(v&&U&&OS(N)){for(N=0,U=p.responseEnd,u+=1;u<l.length;u++){var te=l[u],he=te.startTime;if(he>U)break;var Re=te.transferSize,Ae=te.initiatorType;Re&&OS(Ae)&&(te=te.responseEnd,N+=Re*(te<U?1:(U-he)/(te-he)))}if(--u,o+=8*(v+N)/(p.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var dg=null,fg=null;function mf(r){return r.nodeType===9?r:r.ownerDocument}function MS(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function NS(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function hg(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var mg=null;function IA(){var r=window.event;return r&&r.type==="popstate"?r===mg?!1:(mg=r,!0):(mg=null,!1)}var AS=typeof setTimeout=="function"?setTimeout:void 0,PA=typeof clearTimeout=="function"?clearTimeout:void 0,DS=typeof Promise=="function"?Promise:void 0,zA=typeof queueMicrotask=="function"?queueMicrotask:typeof DS<"u"?function(r){return DS.resolve(null).then(r).catch(UA)}:AS;function UA(r){setTimeout(function(){throw r})}function Go(r){return r==="head"}function kS(r,o){var l=o,u=0;do{var p=l.nextSibling;if(r.removeChild(l),p&&p.nodeType===8)if(l=p.data,l==="/$"||l==="/&"){if(u===0){r.removeChild(p),cl(o);return}u--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")u++;else if(l==="html")$c(r.ownerDocument.documentElement);else if(l==="head"){l=r.ownerDocument.head,$c(l);for(var v=l.firstChild;v;){var N=v.nextSibling,U=v.nodeName;v[Rn]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=N}}else l==="body"&&$c(r.ownerDocument.body);l=p}while(l);cl(o)}function jS(r,o){var l=r;r=0;do{var u=l.nextSibling;if(l.nodeType===1?o?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(o?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),u&&u.nodeType===8)if(l=u.data,l==="/$"){if(r===0)break;r--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||r++;l=u}while(l)}function pg(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var l=o;switch(o=o.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":pg(l),On(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}r.removeChild(l)}}function HA(r,o,l,u){for(;r.nodeType===1;){var p=l;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!u&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(u){if(!r[Rn])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=ea(r.nextSibling),r===null)break}return null}function BA(r,o,l){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!l||(r=ea(r.nextSibling),r===null))return null;return r}function _S(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=ea(r.nextSibling),r===null))return null;return r}function gg(r){return r.data==="$?"||r.data==="$~"}function yg(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function FA(r,o){var l=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||l.readyState!=="loading")o();else{var u=function(){o(),l.removeEventListener("DOMContentLoaded",u)};l.addEventListener("DOMContentLoaded",u),r._reactRetry=u}}function ea(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;if(o==="/$"||o==="/&")return null}}return r}var vg=null;function LS(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="/$"||l==="/&"){if(o===0)return ea(r.nextSibling);o--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||o++}r=r.nextSibling}return null}function IS(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var l=r.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(o===0)return r;o--}else l!=="/$"&&l!=="/&"||o++}r=r.previousSibling}return null}function PS(r,o,l){switch(o=mf(l),r){case"html":if(r=o.documentElement,!r)throw Error(a(452));return r;case"head":if(r=o.head,!r)throw Error(a(453));return r;case"body":if(r=o.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function $c(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);On(r)}var ta=new Map,zS=new Set;function pf(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var ho=L.d;L.d={f:VA,r:YA,D:qA,C:$A,L:KA,m:GA,X:WA,S:XA,M:QA};function VA(){var r=ho.f(),o=of();return r||o}function YA(r){var o=Kt(r);o!==null&&o.tag===5&&o.type==="form"?tw(o):ho.r(r)}var sl=typeof document>"u"?null:document;function US(r,o,l){var u=sl;if(u&&typeof o=="string"&&o){var p=Kr(o);p='link[rel="'+r+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),zS.has(p)||(zS.add(p),r={rel:r,crossOrigin:l,href:o},u.querySelector(p)===null&&(o=u.createElement("link"),rr(o,"link",r),Sn(o),u.head.appendChild(o)))}}function qA(r){ho.D(r),US("dns-prefetch",r,null)}function $A(r,o){ho.C(r,o),US("preconnect",r,o)}function KA(r,o,l){ho.L(r,o,l);var u=sl;if(u&&r&&o){var p='link[rel="preload"][as="'+Kr(o)+'"]';o==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+Kr(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+Kr(l.imageSizes)+'"]')):p+='[href="'+Kr(r)+'"]';var v=p;switch(o){case"style":v=il(r);break;case"script":v=ll(r)}ta.has(v)||(r=m({rel:"preload",href:o==="image"&&l&&l.imageSrcSet?void 0:r,as:o},l),ta.set(v,r),u.querySelector(p)!==null||o==="style"&&u.querySelector(Kc(v))||o==="script"&&u.querySelector(Gc(v))||(o=u.createElement("link"),rr(o,"link",r),Sn(o),u.head.appendChild(o)))}}function GA(r,o){ho.m(r,o);var l=sl;if(l&&r){var u=o&&typeof o.as=="string"?o.as:"script",p='link[rel="modulepreload"][as="'+Kr(u)+'"][href="'+Kr(r)+'"]',v=p;switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=ll(r)}if(!ta.has(v)&&(r=m({rel:"modulepreload",href:r},o),ta.set(v,r),l.querySelector(p)===null)){switch(u){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Gc(v)))return}u=l.createElement("link"),rr(u,"link",r),Sn(u),l.head.appendChild(u)}}}function XA(r,o,l){ho.S(r,o,l);var u=sl;if(u&&r){var p=vr(u).hoistableStyles,v=il(r);o=o||"default";var N=p.get(v);if(!N){var U={loading:0,preload:null};if(N=u.querySelector(Kc(v)))U.loading=5;else{r=m({rel:"stylesheet",href:r,"data-precedence":o},l),(l=ta.get(v))&&bg(r,l);var te=N=u.createElement("link");Sn(te),rr(te,"link",r),te._p=new Promise(function(he,Re){te.onload=he,te.onerror=Re}),te.addEventListener("load",function(){U.loading|=1}),te.addEventListener("error",function(){U.loading|=2}),U.loading|=4,gf(N,o,u)}N={type:"stylesheet",instance:N,count:1,state:U},p.set(v,N)}}}function WA(r,o){ho.X(r,o);var l=sl;if(l&&r){var u=vr(l).hoistableScripts,p=ll(r),v=u.get(p);v||(v=l.querySelector(Gc(p)),v||(r=m({src:r,async:!0},o),(o=ta.get(p))&&xg(r,o),v=l.createElement("script"),Sn(v),rr(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function QA(r,o){ho.M(r,o);var l=sl;if(l&&r){var u=vr(l).hoistableScripts,p=ll(r),v=u.get(p);v||(v=l.querySelector(Gc(p)),v||(r=m({src:r,async:!0,type:"module"},o),(o=ta.get(p))&&xg(r,o),v=l.createElement("script"),Sn(v),rr(v,"link",r),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},u.set(p,v))}}function HS(r,o,l,u){var p=(p=oe.current)?pf(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(o=il(l.href),l=vr(p).hoistableStyles,u=l.get(o),u||(u={type:"style",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){r=il(l.href);var v=vr(p).hoistableStyles,N=v.get(r);if(N||(p=p.ownerDocument||p,N={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,N),(v=p.querySelector(Kc(r)))&&!v._p&&(N.instance=v,N.state.loading=5),ta.has(r)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ta.set(r,l),v||ZA(p,r,l,N.state))),o&&u===null)throw Error(a(528,""));return N}if(o&&u!==null)throw Error(a(529,""));return null;case"script":return o=l.async,l=l.src,typeof l=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=ll(l),l=vr(p).hoistableScripts,u=l.get(o),u||(u={type:"script",instance:null,count:0,state:null},l.set(o,u)),u):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function il(r){return'href="'+Kr(r)+'"'}function Kc(r){return'link[rel="stylesheet"]['+r+"]"}function BS(r){return m({},r,{"data-precedence":r.precedence,precedence:null})}function ZA(r,o,l,u){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?u.loading=1:(o=r.createElement("link"),u.preload=o,o.addEventListener("load",function(){return u.loading|=1}),o.addEventListener("error",function(){return u.loading|=2}),rr(o,"link",l),Sn(o),r.head.appendChild(o))}function ll(r){return'[src="'+Kr(r)+'"]'}function Gc(r){return"script[async]"+r}function FS(r,o,l){if(o.count++,o.instance===null)switch(o.type){case"style":var u=r.querySelector('style[data-href~="'+Kr(l.href)+'"]');if(u)return o.instance=u,Sn(u),u;var p=m({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return u=(r.ownerDocument||r).createElement("style"),Sn(u),rr(u,"style",p),gf(u,l.precedence,r),o.instance=u;case"stylesheet":p=il(l.href);var v=r.querySelector(Kc(p));if(v)return o.state.loading|=4,o.instance=v,Sn(v),v;u=BS(l),(p=ta.get(p))&&bg(u,p),v=(r.ownerDocument||r).createElement("link"),Sn(v);var N=v;return N._p=new Promise(function(U,te){N.onload=U,N.onerror=te}),rr(v,"link",u),o.state.loading|=4,gf(v,l.precedence,r),o.instance=v;case"script":return v=ll(l.src),(p=r.querySelector(Gc(v)))?(o.instance=p,Sn(p),p):(u=l,(p=ta.get(v))&&(u=m({},l),xg(u,p)),r=r.ownerDocument||r,p=r.createElement("script"),Sn(p),rr(p,"link",u),r.head.appendChild(p),o.instance=p);case"void":return null;default:throw Error(a(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(u=o.instance,o.state.loading|=4,gf(u,l.precedence,r));return o.instance}function gf(r,o,l){for(var u=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=u.length?u[u.length-1]:null,v=p,N=0;N<u.length;N++){var U=u[N];if(U.dataset.precedence===o)v=U;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(o=l.nodeType===9?l.head:l,o.insertBefore(r,o.firstChild))}function bg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function xg(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var yf=null;function VS(r,o,l){if(yf===null){var u=new Map,p=yf=new Map;p.set(l,u)}else p=yf,u=p.get(l),u||(u=new Map,p.set(l,u));if(u.has(r))return u;for(u.set(r,null),l=l.getElementsByTagName(r),p=0;p<l.length;p++){var v=l[p];if(!(v[Rn]||v[Ve]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var N=v.getAttribute(o)||"";N=r+N;var U=u.get(N);U?U.push(v):u.set(N,[v])}}return u}function YS(r,o,l){r=r.ownerDocument||r,r.head.insertBefore(l,o==="title"?r.querySelector("head > title"):null)}function JA(r,o,l){if(l===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return r=o.disabled,typeof o.precedence=="string"&&r==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function qS(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function eD(r,o,l,u){if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var p=il(u.href),v=o.querySelector(Kc(p));if(v){o=v._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=vf.bind(r),o.then(r,r)),l.state.loading|=4,l.instance=v,Sn(v);return}v=o.ownerDocument||o,u=BS(u),(p=ta.get(p))&&bg(u,p),v=v.createElement("link"),Sn(v);var N=v;N._p=new Promise(function(U,te){N.onload=U,N.onerror=te}),rr(v,"link",u),l.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(r.count++,l=vf.bind(r),o.addEventListener("load",l),o.addEventListener("error",l))}}var wg=0;function tD(r,o){return r.stylesheets&&r.count===0&&xf(r,r.stylesheets),0<r.count||0<r.imgCount?function(l){var u=setTimeout(function(){if(r.stylesheets&&xf(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+o);0<r.imgBytes&&wg===0&&(wg=62500*LA());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&xf(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>wg?50:800)+o);return r.unsuspend=l,function(){r.unsuspend=null,clearTimeout(u),clearTimeout(p)}}:null}function vf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)xf(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var bf=null;function xf(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,bf=new Map,o.forEach(nD,r),bf=null,vf.call(r))}function nD(r,o){if(!(o.state.loading&4)){var l=bf.get(r);if(l)var u=l.get(null);else{l=new Map,bf.set(r,l);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var N=p[v];(N.nodeName==="LINK"||N.getAttribute("media")!=="not all")&&(l.set(N.dataset.precedence,N),u=N)}u&&l.set(null,u)}p=o.instance,N=p.getAttribute("data-precedence"),v=l.get(N)||u,v===u&&l.set(null,p),l.set(N,p),this.count++,u=vf.bind(this),p.addEventListener("load",u),p.addEventListener("error",u),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),o.state.loading|=4}}var Xc={$$typeof:M,Provider:null,Consumer:null,_currentValue:P,_currentValue2:P,_threadCount:0};function rD(r,o,l,u,p,v,N,U,te){this.tag=1,this.containerInfo=r,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=on(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=on(0),this.hiddenUpdates=on(null),this.identifierPrefix=u,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=N,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=te,this.incompleteTransitions=new Map}function $S(r,o,l,u,p,v,N,U,te,he,Re,Ae){return r=new rD(r,o,l,N,te,he,Re,Ae,U),o=1,v===!0&&(o|=24),v=jr(3,null,null,o),r.current=v,v.stateNode=r,o=ep(),o.refCount++,r.pooledCache=o,o.refCount++,v.memoizedState={element:u,isDehydrated:l,cache:o},ap(v),r}function KS(r){return r?(r=Ui,r):Ui}function GS(r,o,l,u,p,v){p=KS(p),u.context===null?u.context=p:u.pendingContext=p,u=Po(o),u.payload={element:l},v=v===void 0?null:v,v!==null&&(u.callback=v),l=zo(r,u,o),l!==null&&(Rr(l,r,o),Oc(l,r,o))}function XS(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var l=r.retryLane;r.retryLane=l!==0&&l<o?l:o}}function Sg(r,o){XS(r,o),(r=r.alternate)&&XS(r,o)}function WS(r){if(r.tag===13||r.tag===31){var o=Ps(r,67108864);o!==null&&Rr(o,r,67108864),Sg(r,67108864)}}function QS(r){if(r.tag===13||r.tag===31){var o=zr();o=le(o);var l=Ps(r,o);l!==null&&Rr(l,r,o),Sg(r,o)}}var wf=!0;function aD(r,o,l,u){var p=_.T;_.T=null;var v=L.p;try{L.p=2,Eg(r,o,l,u)}finally{L.p=v,_.T=p}}function oD(r,o,l,u){var p=_.T;_.T=null;var v=L.p;try{L.p=8,Eg(r,o,l,u)}finally{L.p=v,_.T=p}}function Eg(r,o,l,u){if(wf){var p=Rg(u);if(p===null)cg(r,o,u,Sf,l),JS(r,u);else if(iD(p,r,o,l,u))u.stopPropagation();else if(JS(r,u),o&4&&-1<sD.indexOf(r)){for(;p!==null;){var v=Kt(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var N=gt(v.pendingLanes);if(N!==0){var U=v;for(U.pendingLanes|=2,U.entangledLanes|=2;N;){var te=1<<31-Fe(N);U.entanglements[1]|=te,N&=~te}Na(v),(sn&6)===0&&(rf=De()+500,Vc(0))}}break;case 31:case 13:U=Ps(v,2),U!==null&&Rr(U,v,2),of(),Sg(v,2)}if(v=Rg(u),v===null&&cg(r,o,u,Sf,l),v===p)break;p=v}p!==null&&u.stopPropagation()}else cg(r,o,u,null,l)}}function Rg(r){return r=Cm(r),Tg(r)}var Sf=null;function Tg(r){if(Sf=null,r=Mn(r),r!==null){var o=i(r);if(o===null)r=null;else{var l=o.tag;if(l===13){if(r=c(o),r!==null)return r;r=null}else if(l===31){if(r=d(o),r!==null)return r;r=null}else if(l===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return Sf=r,null}function ZS(r){switch(r){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(st()){case xt:return 2;case vt:return 8;case Je:case Qe:return 32;case ft:return 268435456;default:return 32}default:return 32}}var Cg=!1,Xo=null,Wo=null,Qo=null,Wc=new Map,Qc=new Map,Zo=[],sD="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 JS(r,o){switch(r){case"focusin":case"focusout":Xo=null;break;case"dragenter":case"dragleave":Wo=null;break;case"mouseover":case"mouseout":Qo=null;break;case"pointerover":case"pointerout":Wc.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qc.delete(o.pointerId)}}function Zc(r,o,l,u,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:o,domEventName:l,eventSystemFlags:u,nativeEvent:v,targetContainers:[p]},o!==null&&(o=Kt(o),o!==null&&WS(o)),r):(r.eventSystemFlags|=u,o=r.targetContainers,p!==null&&o.indexOf(p)===-1&&o.push(p),r)}function iD(r,o,l,u,p){switch(o){case"focusin":return Xo=Zc(Xo,r,o,l,u,p),!0;case"dragenter":return Wo=Zc(Wo,r,o,l,u,p),!0;case"mouseover":return Qo=Zc(Qo,r,o,l,u,p),!0;case"pointerover":var v=p.pointerId;return Wc.set(v,Zc(Wc.get(v)||null,r,o,l,u,p)),!0;case"gotpointercapture":return v=p.pointerId,Qc.set(v,Zc(Qc.get(v)||null,r,o,l,u,p)),!0}return!1}function eE(r){var o=Mn(r.target);if(o!==null){var l=i(o);if(l!==null){if(o=l.tag,o===13){if(o=c(l),o!==null){r.blockedOn=o,et(r.priority,function(){QS(l)});return}}else if(o===31){if(o=d(l),o!==null){r.blockedOn=o,et(r.priority,function(){QS(l)});return}}else if(o===3&&l.stateNode.current.memoizedState.isDehydrated){r.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Ef(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var l=Rg(r.nativeEvent);if(l===null){l=r.nativeEvent;var u=new l.constructor(l.type,l);Tm=u,l.target.dispatchEvent(u),Tm=null}else return o=Kt(l),o!==null&&WS(o),r.blockedOn=l,!1;o.shift()}return!0}function tE(r,o,l){Ef(r)&&l.delete(o)}function lD(){Cg=!1,Xo!==null&&Ef(Xo)&&(Xo=null),Wo!==null&&Ef(Wo)&&(Wo=null),Qo!==null&&Ef(Qo)&&(Qo=null),Wc.forEach(tE),Qc.forEach(tE)}function Rf(r,o){r.blockedOn===o&&(r.blockedOn=null,Cg||(Cg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,lD)))}var Tf=null;function nE(r){Tf!==r&&(Tf=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Tf===r&&(Tf=null);for(var o=0;o<r.length;o+=3){var l=r[o],u=r[o+1],p=r[o+2];if(typeof u!="function"){if(Tg(u||l)===null)continue;break}var v=Kt(l);v!==null&&(r.splice(o,3),o-=3,Rp(v,{pending:!0,data:p,method:l.method,action:u},u,p))}}))}function cl(r){function o(te){return Rf(te,r)}Xo!==null&&Rf(Xo,r),Wo!==null&&Rf(Wo,r),Qo!==null&&Rf(Qo,r),Wc.forEach(o),Qc.forEach(o);for(var l=0;l<Zo.length;l++){var u=Zo[l];u.blockedOn===r&&(u.blockedOn=null)}for(;0<Zo.length&&(l=Zo[0],l.blockedOn===null);)eE(l),l.blockedOn===null&&Zo.shift();if(l=(r.ownerDocument||r).$$reactFormReplay,l!=null)for(u=0;u<l.length;u+=3){var p=l[u],v=l[u+1],N=p[$e]||null;if(typeof v=="function")N||nE(l);else if(N){var U=null;if(v&&v.hasAttribute("formAction")){if(p=v,N=v[$e]||null)U=N.formAction;else if(Tg(p)!==null)continue}else U=N.action;typeof U=="function"?l[u+1]=U:(l.splice(u,3),u-=3),nE(l)}}}function rE(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(N){return p=N})},focusReset:"manual",scroll:"manual"})}function o(){p!==null&&(p(),p=null),u||setTimeout(l,20)}function l(){if(!u&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var u=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(l,100),function(){u=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),p!==null&&(p(),p=null)}}}function Og(r){this._internalRoot=r}Cf.prototype.render=Og.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(a(409));var l=o.current,u=zr();GS(l,u,r,o,null,null)},Cf.prototype.unmount=Og.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;GS(r.current,2,null,r,null,null),of(),o[nt]=null}};function Cf(r){this._internalRoot=r}Cf.prototype.unstable_scheduleHydration=function(r){if(r){var o=Le();r={blockedOn:null,target:r,priority:o};for(var l=0;l<Zo.length&&o!==0&&o<Zo[l].priority;l++);Zo.splice(l,0,r),l===0&&eE(r)}};var aE=t.version;if(aE!=="19.2.4")throw Error(a(527,aE,"19.2.4"));L.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=f(o),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var cD={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Of=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Of.isDisabled&&Of.supportsFiber)try{Ke=Of.inject(cD),Me=Of}catch{}}return eu.createRoot=function(r,o){if(!s(r))throw Error(a(299));var l=!1,u="",p=dw,v=fw,N=hw;return o!=null&&(o.unstable_strictMode===!0&&(l=!0),o.identifierPrefix!==void 0&&(u=o.identifierPrefix),o.onUncaughtError!==void 0&&(p=o.onUncaughtError),o.onCaughtError!==void 0&&(v=o.onCaughtError),o.onRecoverableError!==void 0&&(N=o.onRecoverableError)),o=$S(r,1,!1,null,null,l,u,null,p,v,N,rE),r[nt]=o.current,lg(r),new Og(o)},eu.hydrateRoot=function(r,o,l){if(!s(r))throw Error(a(299));var u=!1,p="",v=dw,N=fw,U=hw,te=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(N=l.onCaughtError),l.onRecoverableError!==void 0&&(U=l.onRecoverableError),l.formState!==void 0&&(te=l.formState)),o=$S(r,1,!0,o,l??null,u,p,te,v,N,U,rE),o.context=KS(null),l=o.current,u=zr(),u=le(u),p=Po(u),p.callback=null,zo(l,p,u),l=u,o.current.lanes=l,Pt(o,l),Na(o),r[nt]=o.current,lg(r),new Cf(o)},eu.version="19.2.4",eu}var kE;function Y_(){if(kE)return _g.exports;kE=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(),_g.exports=V_(),_g.exports}var q_=Y_();/**
51
+ * react-router v7.13.0
52
+ *
53
+ * Copyright (c) Remix Software Inc.
54
+ *
55
+ * This source code is licensed under the MIT license found in the
56
+ * LICENSE.md file in the root directory of this source tree.
57
+ *
58
+ * @license MIT
59
+ */var BT=e=>{throw TypeError(e)},$_=(e,t,n)=>t.has(e)||BT("Cannot "+n),zg=(e,t,n)=>($_(e,t,"read from private field"),n?n.call(e):t.get(e)),K_=(e,t,n)=>t.has(e)?BT("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),jE="popstate";function G_(e={}){function t(a,s){let{pathname:i,search:c,hash:d}=a.location;return ku("",{pathname:i,search:c,hash:d},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(a,s){return typeof s=="string"?s:Ba(s)}return W_(t,n,null,e)}function Ut(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function X_(){return Math.random().toString(36).substring(2,10)}function _E(e,t){return{usr:e.state,key:e.key,idx:t}}function ku(e,t,n=null,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Rs(t):t,state:n,key:t&&t.key||a||X_()}}function Ba({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 Rs(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let a=e.indexOf("?");a>=0&&(t.search=e.substring(a),e=e.substring(0,a)),e&&(t.pathname=e)}return t}function W_(e,t,n,a={}){let{window:s=document.defaultView,v5Compat:i=!1}=a,c=s.history,d="POP",h=null,f=g();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function g(){return(c.state||{idx:null}).idx}function m(){d="POP";let R=g(),T=R==null?null:R-f;f=R,h&&h({action:d,location:S.location,delta:T})}function b(R,T){d="PUSH";let C=ku(S.location,R,T);f=g()+1;let M=_E(C,f),O=S.createHref(C);try{c.pushState(M,"",O)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;s.location.assign(O)}i&&h&&h({action:d,location:S.location,delta:1})}function x(R,T){d="REPLACE";let C=ku(S.location,R,T);f=g();let M=_E(C,f),O=S.createHref(C);c.replaceState(M,"",O),i&&h&&h({action:d,location:S.location,delta:0})}function w(R){return FT(R)}let S={get action(){return d},get location(){return e(s,c)},listen(R){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(jE,m),h=R,()=>{s.removeEventListener(jE,m),h=null}},createHref(R){return t(s,R)},createURL:w,encodeLocation(R){let T=w(R);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:b,replace:x,go(R){return c.go(R)}};return S}function FT(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Ut(n,"No window.location.(origin|href) available to create URL");let a=typeof e=="string"?e:Ba(e);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=n+a),new URL(a,n)}var fu,LE=class{constructor(e){if(K_(this,fu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(zg(this,fu).has(e))return zg(this,fu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){zg(this,fu).set(e,t)}};fu=new WeakMap;var Q_=new Set(["lazy","caseSensitive","path","id","index","children"]);function Z_(e){return Q_.has(e)}var J_=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function eL(e){return J_.has(e)}function tL(e){return e.index===!0}function ju(e,t,n=[],a={},s=!1){return e.map((i,c)=>{let d=[...n,String(c)],h=typeof i.id=="string"?i.id:d.join("-");if(Ut(i.index!==!0||!i.children,"Cannot specify children on an index route"),Ut(s||!a[h],`Found a route id collision on id "${h}". Route id's must be globally unique within Data Router usages`),tL(i)){let f={...i,id:h};return a[h]=IE(f,t(f)),f}else{let f={...i,id:h,children:void 0};return a[h]=IE(f,t(f)),i.children&&(f.children=ju(i.children,t,d,a,s)),f}})}function IE(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function as(e,t,n="/"){return hu(e,t,n,!1)}function hu(e,t,n,a){let s=typeof t=="string"?Rs(t):t,i=la(s.pathname||"/",n);if(i==null)return null;let c=VT(e);rL(c);let d=null;for(let h=0;d==null&&h<c.length;++h){let f=qT(i);d=fL(c[h],f,a)}return d}function nL(e,t){let{route:n,pathname:a,params:s}=e;return{id:n.id,pathname:a,params:s,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function VT(e,t=[],n=[],a="",s=!1){let i=(c,d,h=s,f)=>{let g={relativePath:f===void 0?c.path||"":f,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(a)&&h)return;Ut(g.relativePath.startsWith(a),`Absolute route path "${g.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(a.length)}let m=Pa([a,g.relativePath]),b=n.concat(g);c.children&&c.children.length>0&&(Ut(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),VT(c.children,t,b,m,h)),!(c.path==null&&!c.index)&&t.push({path:m,score:uL(m,c.index),routesMeta:b})};return e.forEach((c,d)=>{var h;if(c.path===""||!((h=c.path)!=null&&h.includes("?")))i(c,d);else for(let f of YT(c.path))i(c,d,!0,f)}),t}function YT(e){let t=e.split("/");if(t.length===0)return[];let[n,...a]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(a.length===0)return s?[i,""]:[i];let c=YT(a.join("/")),d=[];return d.push(...c.map(h=>h===""?i:[i,h].join("/"))),s&&d.push(...c),d.map(h=>e.startsWith("/")&&h===""?"/":h)}function rL(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:dL(t.routesMeta.map(a=>a.childrenIndex),n.routesMeta.map(a=>a.childrenIndex)))}var aL=/^:[\w-]+$/,oL=3,sL=2,iL=1,lL=10,cL=-2,PE=e=>e==="*";function uL(e,t){let n=e.split("/"),a=n.length;return n.some(PE)&&(a+=cL),t&&(a+=sL),n.filter(s=>!PE(s)).reduce((s,i)=>s+(aL.test(i)?oL:i===""?iL:lL),a)}function dL(e,t){return e.length===t.length&&e.slice(0,-1).every((a,s)=>a===t[s])?e[e.length-1]-t[t.length-1]:0}function fL(e,t,n=!1){let{routesMeta:a}=e,s={},i="/",c=[];for(let d=0;d<a.length;++d){let h=a[d],f=d===a.length-1,g=i==="/"?t:t.slice(i.length)||"/",m=Fl({path:h.relativePath,caseSensitive:h.caseSensitive,end:f},g),b=h.route;if(!m&&f&&n&&!a[a.length-1].route.index&&(m=Fl({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},g)),!m)return null;Object.assign(s,m.params),c.push({params:s,pathname:Pa([i,m.pathname]),pathnameBase:gL(Pa([i,m.pathnameBase])),route:b}),m.pathnameBase!=="/"&&(i=Pa([i,m.pathnameBase]))}return c}function Fl(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,a]=hL(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let i=s[0],c=i.replace(/(.)\/+$/,"$1"),d=s.slice(1);return{params:a.reduce((f,{paramName:g,isOptional:m},b)=>{if(g==="*"){let w=d[b]||"";c=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const x=d[b];return m&&!x?f[g]=void 0:f[g]=(x||"").replace(/%2F/g,"/"),f},{}),pathname:i,pathnameBase:c,pattern:e}}function hL(e,t=!1,n=!0){Fn(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 a=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,h)=>(a.push({paramName:d,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function qT(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fn(!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 la(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,a=e.charAt(n);return a&&a!=="/"?null:e.slice(n)||"/"}function mL({basename:e,pathname:t}){return t==="/"?e:Pa([e,t])}var $T=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xv=e=>$T.test(e);function pL(e,t="/"){let{pathname:n,search:a="",hash:s=""}=typeof e=="string"?Rs(e):e,i;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?i=zE(n.substring(1),"/"):i=zE(n,t)):i=t,{pathname:i,search:yL(a),hash:vL(s)}}function zE(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function Ug(e,t,n,a){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. 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 KT(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Wv(e){let t=KT(e);return t.map((n,a)=>a===t.length-1?n.pathname:n.pathnameBase)}function Qv(e,t,n,a=!1){let s;typeof e=="string"?s=Rs(e):(s={...e},Ut(!s.pathname||!s.pathname.includes("?"),Ug("?","pathname","search",s)),Ut(!s.pathname||!s.pathname.includes("#"),Ug("#","pathname","hash",s)),Ut(!s.search||!s.search.includes("#"),Ug("#","search","hash",s)));let i=e===""||s.pathname==="",c=i?"/":s.pathname,d;if(c==null)d=n;else{let m=t.length-1;if(!a&&c.startsWith("..")){let b=c.split("/");for(;b[0]==="..";)b.shift(),m-=1;s.pathname=b.join("/")}d=m>=0?t[m]:"/"}let h=pL(s,d),f=c&&c!=="/"&&c.endsWith("/"),g=(i||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||g)&&(h.pathname+="/"),h}var Pa=e=>e.join("/").replace(/\/\/+/g,"/"),gL=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),yL=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,vL=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Zu=class{constructor(e,t,n,a=!1){this.status=e,this.statusText=t||"",this.internal=a,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function _u(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ju(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var GT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function XT(e,t){let n=e;if(typeof n!="string"||!$T.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let a=n,s=!1;if(GT)try{let i=new URL(window.location.href),c=n.startsWith("//")?new URL(i.protocol+n):new URL(n),d=la(c.pathname,t);c.origin===i.origin&&d!=null?n=d+c.search+c.hash:s=!0}catch{Fn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:n}}var ps=Symbol("Uninstrumented");function bL(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(s=>s({id:t.id,index:t.index,path:t.path,instrument(i){let c=Object.keys(n);for(let d of c)i[d]&&n[d].push(i[d])}}));let a={};if(typeof t.lazy=="function"&&n.lazy.length>0){let s=gl(n.lazy,t.lazy,()=>{});s&&(a.lazy=s)}if(typeof t.lazy=="object"){let s=t.lazy;["middleware","loader","action"].forEach(i=>{let c=s[i],d=n[`lazy.${i}`];if(typeof c=="function"&&d.length>0){let h=gl(d,c,()=>{});h&&(a.lazy=Object.assign(a.lazy||{},{[i]:h}))}})}return["loader","action"].forEach(s=>{let i=t[s];if(typeof i=="function"&&n[s].length>0){let c=i[ps]??i,d=gl(n[s],c,(...h)=>UE(h[0]));d&&(s==="loader"&&c.hydrate===!0&&(d.hydrate=!0),d[ps]=c,a[s]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(a.middleware=t.middleware.map(s=>{let i=s[ps]??s,c=gl(n.middleware,i,(...d)=>UE(d[0]));return c?(c[ps]=i,c):s})),a}function xL(e,t){let n={navigate:[],fetch:[]};if(t.forEach(a=>a({instrument(s){let i=Object.keys(s);for(let c of i)s[c]&&n[c].push(s[c])}})),n.navigate.length>0){let a=e.navigate[ps]??e.navigate,s=gl(n.navigate,a,(...i)=>{let[c,d]=i;return{to:typeof c=="number"||typeof c=="string"?c:c?Ba(c):".",...HE(e,d??{})}});s&&(s[ps]=a,e.navigate=s)}if(n.fetch.length>0){let a=e.fetch[ps]??e.fetch,s=gl(n.fetch,a,(...i)=>{let[c,,d,h]=i;return{href:d??".",fetcherKey:c,...HE(e,h??{})}});s&&(s[ps]=a,e.fetch=s)}return e}function gl(e,t,n){return e.length===0?null:async(...a)=>{let s=await WT(e,n(...a),()=>t(...a),e.length-1);if(s.type==="error")throw s.value;return s.value}}async function WT(e,t,n,a){let s=e[a],i;if(s){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=WT(e,t,n,a-1),i=await c,Ut(i,"Expected a result"),i.type==="error"&&i.value instanceof Error?{status:"error",error:i.value}:{status:"success",error:void 0});try{await s(d,t)}catch(h){console.error("An instrumentation function threw an error:",h)}c||await d(),await c}else try{i={type:"success",value:await n()}}catch(c){i={type:"error",value:c}}return i||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function UE(e){let{request:t,context:n,params:a,unstable_pattern:s}=e;return{request:wL(t),params:{...a},unstable_pattern:s,context:SL(n)}}function HE(e,t){return{currentUrl:Ba(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 wL(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function SL(e){if(RL(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var EL=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function RL(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")===EL}var QT=["POST","PUT","PATCH","DELETE"],TL=new Set(QT),CL=["GET",...QT],OL=new Set(CL),ZT=new Set([301,302,303,307,308]),ML=new Set([307,308]),Hg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},NL={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},tu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},AL=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),JT="remix-router-transitions",eC=Symbol("ResetLoaderData");function DL(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";Ut(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let a=e.hydrationRouteProperties||[],s=e.mapRouteProperties||AL,i=s;if(e.unstable_instrumentations){let $=e.unstable_instrumentations;i=re=>({...s(re),...bL($.map(le=>le.route).filter(Boolean),re)})}let c={},d=ju(e.routes,i,void 0,c),h,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let g=e.dataStrategy||IL,m={...e.future},b=null,x=new Set,w=null,S=null,R=null,T=e.hydrationData!=null,C=as(d,e.history.location,f),M=!1,O=null,D;if(C==null&&!e.patchRoutesOnNavigation){let $=ra(404,{pathname:e.history.location.pathname}),{matches:re,route:le}=Af(d);D=!0,C=re,O={[le.id]:$}}else if(C&&!e.hydrationData&&Rt(C,d,e.history.location.pathname).active&&(C=null),C)if(C.some($=>$.route.lazy))D=!1;else if(!C.some($=>Zv($.route)))D=!0;else{let $=e.hydrationData?e.hydrationData.loaderData:null,re=e.hydrationData?e.hydrationData.errors:null;if(re){let le=C.findIndex(Ee=>re[Ee.route.id]!==void 0);D=C.slice(0,le+1).every(Ee=>!qy(Ee.route,$,re))}else D=C.every(le=>!qy(le.route,$,re))}else{D=!1,C=[];let $=Rt(null,d,e.history.location.pathname);$.active&&$.matches&&(M=!0,C=$.matches)}let k,A={historyAction:e.history.action,location:e.history.location,matches:C,initialized:D,navigation:Hg,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||O,fetchers:new Map,blockers:new Map},j="POP",B=null,W=!1,K,I=!1,H=new Map,F=null,q=!1,_=!1,L=new Set,P=new Map,V=0,Q=-1,z=new Map,Y=new Set,X=new Map,G=new Map,ce=new Set,oe=new Map,de,ve=null;function xe(){if(b=e.history.listen(({action:$,location:re,delta:le})=>{if(de){de(),de=void 0;return}Fn(oe.size===0||le!=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 Ee=tt({currentLocation:A.location,nextLocation:re,historyAction:$});if(Ee&&le!=null){let Le=new Promise(et=>{de=et});e.history.go(le*-1),pt(Ee,{state:"blocked",location:re,proceed(){pt(Ee,{state:"proceeding",proceed:void 0,reset:void 0,location:re}),Le.then(()=>e.history.go(le))},reset(){let et=new Map(A.blockers);et.set(Ee,tu),ee({blockers:et})}}),B==null||B.resolve(),B=null;return}return Te($,re)}),n){eI(t,H);let $=()=>tI(t,H);t.addEventListener("pagehide",$),F=()=>t.removeEventListener("pagehide",$)}return A.initialized||Te("POP",A.location,{initialHydration:!0}),k}function Ne(){b&&b(),F&&F(),x.clear(),K&&K.abort(),A.fetchers.forEach(($,re)=>je(re)),A.blockers.forEach(($,re)=>ct(re))}function _e($){return x.add($),()=>x.delete($)}function ee($,re={}){$.matches&&($.matches=$.matches.map(Le=>{let et=c[Le.route.id],Ze=Le.route;return Ze.element!==et.element||Ze.errorElement!==et.errorElement||Ze.hydrateFallbackElement!==et.hydrateFallbackElement?{...Le,route:et}:Le})),A={...A,...$};let le=[],Ee=[];A.fetchers.forEach((Le,et)=>{Le.state==="idle"&&(ce.has(et)?le.push(et):Ee.push(et))}),ce.forEach(Le=>{!A.fetchers.has(Le)&&!P.has(Le)&&le.push(Le)}),[...x].forEach(Le=>Le(A,{deletedFetchers:le,newErrors:$.errors??null,viewTransitionOpts:re.viewTransitionOpts,flushSync:re.flushSync===!0})),le.forEach(Le=>je(Le)),Ee.forEach(Le=>A.fetchers.delete(Le))}function ue($,re,{flushSync:le}={}){var St,ut;let Ee=A.actionData!=null&&A.navigation.formMethod!=null&&lr(A.navigation.formMethod)&&A.navigation.state==="loading"&&((St=$.state)==null?void 0:St._isRedirect)!==!0,Le;re.actionData?Object.keys(re.actionData).length>0?Le=re.actionData:Le=null:Ee?Le=A.actionData:Le=null;let et=re.loaderData?WE(A.loaderData,re.loaderData,re.matches||[],re.errors):A.loaderData,Ze=A.blockers;Ze.size>0&&(Ze=new Map(Ze),Ze.forEach((Dt,Ht)=>Ze.set(Ht,tu)));let Ve=q?!1:kt($,re.matches||A.matches),$e=W===!0||A.navigation.formMethod!=null&&lr(A.navigation.formMethod)&&((ut=$.state)==null?void 0:ut._isRedirect)!==!0;h&&(d=h,h=void 0),q||j==="POP"||(j==="PUSH"?e.history.push($,$.state):j==="REPLACE"&&e.history.replace($,$.state));let nt;if(j==="POP"){let Dt=H.get(A.location.pathname);Dt&&Dt.has($.pathname)?nt={currentLocation:A.location,nextLocation:$}:H.has($.pathname)&&(nt={currentLocation:$,nextLocation:A.location})}else if(I){let Dt=H.get(A.location.pathname);Dt?Dt.add($.pathname):(Dt=new Set([$.pathname]),H.set(A.location.pathname,Dt)),nt={currentLocation:A.location,nextLocation:$}}ee({...re,actionData:Le,loaderData:et,historyAction:j,location:$,initialized:!0,navigation:Hg,revalidation:"idle",restoreScrollPosition:Ve,preventScrollReset:$e,blockers:Ze},{viewTransitionOpts:nt,flushSync:le===!0}),j="POP",W=!1,I=!1,q=!1,_=!1,B==null||B.resolve(),B=null,ve==null||ve.resolve(),ve=null}async function pe($,re){if(B==null||B.resolve(),B=null,typeof $=="number"){B||(B=e1());let Ht=B.promise;return e.history.go($),Ht}let le=Yy(A.location,A.matches,f,$,re==null?void 0:re.fromRouteId,re==null?void 0:re.relative),{path:Ee,submission:Le,error:et}=BE(!1,le,re),Ze=A.location,Ve=ku(A.location,Ee,re&&re.state);Ve={...Ve,...e.history.encodeLocation(Ve)};let $e=re&&re.replace!=null?re.replace:void 0,nt="PUSH";$e===!0?nt="REPLACE":$e===!1||Le!=null&&lr(Le.formMethod)&&Le.formAction===A.location.pathname+A.location.search&&(nt="REPLACE");let St=re&&"preventScrollReset"in re?re.preventScrollReset===!0:void 0,ut=(re&&re.flushSync)===!0,Dt=tt({currentLocation:Ze,nextLocation:Ve,historyAction:nt});if(Dt){pt(Dt,{state:"blocked",location:Ve,proceed(){pt(Dt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ve}),pe($,re)},reset(){let Ht=new Map(A.blockers);Ht.set(Dt,tu),ee({blockers:Ht})}});return}await Te(nt,Ve,{submission:Le,pendingError:et,preventScrollReset:St,replace:re&&re.replace,enableViewTransition:re&&re.viewTransition,flushSync:ut,callSiteDefaultShouldRevalidate:re&&re.unstable_defaultShouldRevalidate})}function ke(){ve||(ve=e1()),vt(),ee({revalidation:"loading"});let $=ve.promise;return A.navigation.state==="submitting"?$:A.navigation.state==="idle"?(Te(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),$):(Te(j||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:I===!0}),$)}async function Te($,re,le){K&&K.abort(),K=null,j=$,q=(le&&le.startUninterruptedRevalidation)===!0,Tt(A.location,A.matches),W=(le&&le.preventScrollReset)===!0,I=(le&&le.enableViewTransition)===!0;let Ee=h||d,Le=le&&le.overrideNavigation,et=le!=null&&le.initialHydration&&A.matches&&A.matches.length>0&&!M?A.matches:as(Ee,re,f),Ze=(le&&le.flushSync)===!0;if(et&&A.initialized&&!_&&YL(A.location,re)&&!(le&&le.submission&&lr(le.submission.formMethod))){ue(re,{matches:et},{flushSync:Ze});return}let Ve=Rt(et,Ee,re.pathname);if(Ve.active&&Ve.matches&&(et=Ve.matches),!et){let{error:On,notFoundMatches:Mn,route:Kt}=lt(re.pathname);ue(re,{matches:Mn,loaderData:{},errors:{[Kt.id]:On}},{flushSync:Ze});return}K=new AbortController;let $e=ml(e.history,re,K.signal,le&&le.submission),nt=e.getContext?await e.getContext():new LE,St;if(le&&le.pendingError)St=[os(et).route.id,{type:"error",error:le.pendingError}];else if(le&&le.submission&&lr(le.submission.formMethod)){let On=await be($e,re,le.submission,et,nt,Ve.active,le&&le.initialHydration===!0,{replace:le.replace,flushSync:Ze});if(On.shortCircuited)return;if(On.pendingActionResult){let[Mn,Kt]=On.pendingActionResult;if(Ur(Kt)&&_u(Kt.error)&&Kt.error.status===404){K=null,ue(re,{matches:On.matches,loaderData:{},errors:{[Mn]:Kt.error}});return}}et=On.matches||et,St=On.pendingActionResult,Le=Bg(re,le.submission),Ze=!1,Ve.active=!1,$e=ml(e.history,$e.url,$e.signal)}let{shortCircuited:ut,matches:Dt,loaderData:Ht,errors:Rn}=await we($e,re,et,nt,Ve.active,Le,le&&le.submission,le&&le.fetcherSubmission,le&&le.replace,le&&le.initialHydration===!0,Ze,St,le&&le.callSiteDefaultShouldRevalidate);ut||(K=null,ue(re,{matches:Dt||et,...QE(St),loaderData:Ht,errors:Rn}))}async function be($,re,le,Ee,Le,et,Ze,Ve={}){vt();let $e=ZL(re,le);if(ee({navigation:$e},{flushSync:Ve.flushSync===!0}),et){let ut=await on(Ee,re.pathname,$.signal);if(ut.type==="aborted")return{shortCircuited:!0};if(ut.type==="error"){if(ut.partialMatches.length===0){let{matches:Ht,route:Rn}=Af(d);return{matches:Ht,pendingActionResult:[Rn.id,{type:"error",error:ut.error}]}}let Dt=os(ut.partialMatches).route.id;return{matches:ut.partialMatches,pendingActionResult:[Dt,{type:"error",error:ut.error}]}}else if(ut.matches)Ee=ut.matches;else{let{notFoundMatches:Dt,error:Ht,route:Rn}=lt(re.pathname);return{matches:Dt,pendingActionResult:[Rn.id,{type:"error",error:Ht}]}}}let nt,St=oh(Ee,re);if(!St.route.action&&!St.route.lazy)nt={type:"error",error:ra(405,{method:$.method,pathname:re.pathname,routeId:St.route.id})};else{let ut=vl(i,c,$,Ee,St,Ze?[]:a,Le),Dt=await st($,ut,Le,null);if(nt=Dt[St.route.id],!nt){for(let Ht of Ee)if(Dt[Ht.route.id]){nt=Dt[Ht.route.id];break}}if($.signal.aborted)return{shortCircuited:!0}}if(ri(nt)){let ut;return Ve&&Ve.replace!=null?ut=Ve.replace:ut=KE(nt.response.headers.get("Location"),new URL($.url),f,e.history)===A.location.pathname+A.location.search,await De($,nt,!0,{submission:le,replace:ut}),{shortCircuited:!0}}if(Ur(nt)){let ut=os(Ee,St.route.id);return(Ve&&Ve.replace)!==!0&&(j="PUSH"),{matches:Ee,pendingActionResult:[ut.route.id,nt,St.route.id]}}return{matches:Ee,pendingActionResult:[St.route.id,nt]}}async function we($,re,le,Ee,Le,et,Ze,Ve,$e,nt,St,ut,Dt){let Ht=et||Bg(re,Ze),Rn=Ze||Ve||JE(Ht),On=!q&&!nt;if(Le){if(On){let Ln=Z(ut);ee({navigation:Ht,...Ln!==void 0?{actionData:Ln}:{}},{flushSync:St})}let Gt=await on(le,re.pathname,$.signal);if(Gt.type==="aborted")return{shortCircuited:!0};if(Gt.type==="error"){if(Gt.partialMatches.length===0){let{matches:ha,route:Jn}=Af(d);return{matches:ha,loaderData:{},errors:{[Jn.id]:Gt.error}}}let Ln=os(Gt.partialMatches).route.id;return{matches:Gt.partialMatches,loaderData:{},errors:{[Ln]:Gt.error}}}else if(Gt.matches)le=Gt.matches;else{let{error:Ln,notFoundMatches:ha,route:Jn}=lt(re.pathname);return{matches:ha,loaderData:{},errors:{[Jn.id]:Ln}}}}let Mn=h||d,{dsMatches:Kt,revalidatingFetchers:Gn}=FE($,Ee,i,c,e.history,A,le,Rn,re,nt?[]:a,nt===!0,_,L,ce,X,Y,Mn,f,e.patchRoutesOnNavigation!=null,ut,Dt);if(Q=++V,!e.dataStrategy&&!Kt.some(Gt=>Gt.shouldLoad)&&!Kt.some(Gt=>Gt.route.middleware&&Gt.route.middleware.length>0)&&Gn.length===0){let Gt=Fe();return ue(re,{matches:le,loaderData:{},errors:ut&&Ur(ut[1])?{[ut[0]]:ut[1].error}:null,...QE(ut),...Gt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:St}),{shortCircuited:!0}}if(On){let Gt={};if(!Le){Gt.navigation=Ht;let Ln=Z(ut);Ln!==void 0&&(Gt.actionData=Ln)}Gn.length>0&&(Gt.fetchers=Se(Gn)),ee(Gt,{flushSync:St})}Gn.forEach(Gt=>{Me(Gt.key),Gt.controller&&P.set(Gt.key,Gt.controller)});let vr=()=>Gn.forEach(Gt=>Me(Gt.key));K&&K.signal.addEventListener("abort",vr);let{loaderResults:Sn,fetcherResults:da}=await xt(Kt,Gn,$,Ee);if($.signal.aborted)return{shortCircuited:!0};K&&K.signal.removeEventListener("abort",vr),Gn.forEach(Gt=>P.delete(Gt.key));let Dr=Df(Sn);if(Dr)return await De($,Dr.result,!0,{replace:$e}),{shortCircuited:!0};if(Dr=Df(da),Dr)return Y.add(Dr.key),await De($,Dr.result,!0,{replace:$e}),{shortCircuited:!0};let{loaderData:fa,errors:$r}=XE(A,le,Sn,ut,Gn,da);nt&&A.errors&&($r={...A.errors,...$r});let Xa=Fe(),Ds=ht(Q),ks=Xa||Ds||Gn.length>0;return{matches:le,loaderData:fa,errors:$r,...ks?{fetchers:new Map(A.fetchers)}:{}}}function Z($){if($&&!Ur($[1]))return{[$[0]]:$[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Se($){return $.forEach(re=>{let le=A.fetchers.get(re.key),Ee=nu(void 0,le?le.data:void 0);A.fetchers.set(re.key,Ee)}),new Map(A.fetchers)}async function ge($,re,le,Ee){Me($);let Le=(Ee&&Ee.flushSync)===!0,et=h||d,Ze=Yy(A.location,A.matches,f,le,re,Ee==null?void 0:Ee.relative),Ve=as(et,Ze,f),$e=Rt(Ve,et,Ze);if($e.active&&$e.matches&&(Ve=$e.matches),!Ve){Qe($,re,ra(404,{pathname:Ze}),{flushSync:Le});return}let{path:nt,submission:St,error:ut}=BE(!0,Ze,Ee);if(ut){Qe($,re,ut,{flushSync:Le});return}let Dt=e.getContext?await e.getContext():new LE,Ht=(Ee&&Ee.preventScrollReset)===!0;if(St&&lr(St.formMethod)){await ze($,re,nt,Ve,Dt,$e.active,Le,Ht,St,Ee&&Ee.unstable_defaultShouldRevalidate);return}X.set($,{routeId:re,path:nt}),await He($,re,nt,Ve,Dt,$e.active,Le,Ht,St)}async function ze($,re,le,Ee,Le,et,Ze,Ve,$e,nt){vt(),X.delete($);let St=A.fetchers.get($);Je($,JL($e,St),{flushSync:Ze});let ut=new AbortController,Dt=ml(e.history,le,ut.signal,$e);if(et){let Xt=await on(Ee,new URL(Dt.url).pathname,Dt.signal,$);if(Xt.type==="aborted")return;if(Xt.type==="error"){Qe($,re,Xt.error,{flushSync:Ze});return}else if(Xt.matches)Ee=Xt.matches;else{Qe($,re,ra(404,{pathname:le}),{flushSync:Ze});return}}let Ht=oh(Ee,le);if(!Ht.route.action&&!Ht.route.lazy){let Xt=ra(405,{method:$e.formMethod,pathname:le,routeId:re});Qe($,re,Xt,{flushSync:Ze});return}P.set($,ut);let Rn=V,On=vl(i,c,Dt,Ee,Ht,a,Le),Mn=await st(Dt,On,Le,$),Kt=Mn[Ht.route.id];if(!Kt){for(let Xt of On)if(Mn[Xt.route.id]){Kt=Mn[Xt.route.id];break}}if(Dt.signal.aborted){P.get($)===ut&&P.delete($);return}if(ce.has($)){if(ri(Kt)||Ur(Kt)){Je($,go(void 0));return}}else{if(ri(Kt))if(P.delete($),Q>Rn){Je($,go(void 0));return}else return Y.add($),Je($,nu($e)),De(Dt,Kt,!1,{fetcherSubmission:$e,preventScrollReset:Ve});if(Ur(Kt)){Qe($,re,Kt.error);return}}let Gn=A.navigation.location||A.location,vr=ml(e.history,Gn,ut.signal),Sn=h||d,da=A.navigation.state!=="idle"?as(Sn,A.navigation.location,f):A.matches;Ut(da,"Didn't find any matches after fetcher action");let Dr=++V;z.set($,Dr);let fa=nu($e,Kt.data);A.fetchers.set($,fa);let{dsMatches:$r,revalidatingFetchers:Xa}=FE(vr,Le,i,c,e.history,A,da,$e,Gn,a,!1,_,L,ce,X,Y,Sn,f,e.patchRoutesOnNavigation!=null,[Ht.route.id,Kt],nt);Xa.filter(Xt=>Xt.key!==$).forEach(Xt=>{let js=Xt.key,gd=A.fetchers.get(js),dc=nu(void 0,gd?gd.data:void 0);A.fetchers.set(js,dc),Me(js),Xt.controller&&P.set(js,Xt.controller)}),ee({fetchers:new Map(A.fetchers)});let Ds=()=>Xa.forEach(Xt=>Me(Xt.key));ut.signal.addEventListener("abort",Ds);let{loaderResults:ks,fetcherResults:Gt}=await xt($r,Xa,vr,Le);if(ut.signal.aborted)return;if(ut.signal.removeEventListener("abort",Ds),z.delete($),P.delete($),Xa.forEach(Xt=>P.delete(Xt.key)),A.fetchers.has($)){let Xt=go(Kt.data);A.fetchers.set($,Xt)}let Ln=Df(ks);if(Ln)return De(vr,Ln.result,!1,{preventScrollReset:Ve});if(Ln=Df(Gt),Ln)return Y.add(Ln.key),De(vr,Ln.result,!1,{preventScrollReset:Ve});let{loaderData:ha,errors:Jn}=XE(A,da,ks,void 0,Xa,Gt);ht(Dr),A.navigation.state==="loading"&&Dr>Q?(Ut(j,"Expected pending action"),K&&K.abort(),ue(A.navigation.location,{matches:da,loaderData:ha,errors:Jn,fetchers:new Map(A.fetchers)})):(ee({errors:Jn,loaderData:WE(A.loaderData,ha,da,Jn),fetchers:new Map(A.fetchers)}),_=!1)}async function He($,re,le,Ee,Le,et,Ze,Ve,$e){let nt=A.fetchers.get($);Je($,nu($e,nt?nt.data:void 0),{flushSync:Ze});let St=new AbortController,ut=ml(e.history,le,St.signal);if(et){let Kt=await on(Ee,new URL(ut.url).pathname,ut.signal,$);if(Kt.type==="aborted")return;if(Kt.type==="error"){Qe($,re,Kt.error,{flushSync:Ze});return}else if(Kt.matches)Ee=Kt.matches;else{Qe($,re,ra(404,{pathname:le}),{flushSync:Ze});return}}let Dt=oh(Ee,le);P.set($,St);let Ht=V,Rn=vl(i,c,ut,Ee,Dt,a,Le),Mn=(await st(ut,Rn,Le,$))[Dt.route.id];if(P.get($)===St&&P.delete($),!ut.signal.aborted){if(ce.has($)){Je($,go(void 0));return}if(ri(Mn))if(Q>Ht){Je($,go(void 0));return}else{Y.add($),await De(ut,Mn,!1,{preventScrollReset:Ve});return}if(Ur(Mn)){Qe($,re,Mn.error);return}Je($,go(Mn.data))}}async function De($,re,le,{submission:Ee,fetcherSubmission:Le,preventScrollReset:et,replace:Ze}={}){le||(B==null||B.resolve(),B=null),re.response.headers.has("X-Remix-Revalidate")&&(_=!0);let Ve=re.response.headers.get("Location");Ut(Ve,"Expected a Location header on the redirect Response"),Ve=KE(Ve,new URL($.url),f,e.history);let $e=ku(A.location,Ve,{_isRedirect:!0});if(n){let Rn=!1;if(re.response.headers.has("X-Remix-Reload-Document"))Rn=!0;else if(Xv(Ve)){const On=FT(Ve,!0);Rn=On.origin!==t.location.origin||la(On.pathname,f)==null}if(Rn){Ze?t.location.replace(Ve):t.location.assign(Ve);return}}K=null;let nt=Ze===!0||re.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:St,formAction:ut,formEncType:Dt}=A.navigation;!Ee&&!Le&&St&&ut&&Dt&&(Ee=JE(A.navigation));let Ht=Ee||Le;if(ML.has(re.response.status)&&Ht&&lr(Ht.formMethod))await Te(nt,$e,{submission:{...Ht,formAction:Ve},preventScrollReset:et||W,enableViewTransition:le?I:void 0});else{let Rn=Bg($e,Ee);await Te(nt,$e,{overrideNavigation:Rn,fetcherSubmission:Le,preventScrollReset:et||W,enableViewTransition:le?I:void 0})}}async function st($,re,le,Ee){var Ze;let Le,et={};try{Le=await zL(g,$,re,Ee,le,!1)}catch(Ve){return re.filter($e=>$e.shouldLoad).forEach($e=>{et[$e.route.id]={type:"error",error:Ve}}),et}if($.signal.aborted)return et;if(!lr($.method))for(let Ve of re){if(((Ze=Le[Ve.route.id])==null?void 0:Ze.type)==="error")break;!Le.hasOwnProperty(Ve.route.id)&&!A.loaderData.hasOwnProperty(Ve.route.id)&&(!A.errors||!A.errors.hasOwnProperty(Ve.route.id))&&Ve.shouldCallHandler()&&(Le[Ve.route.id]={type:"error",result:new Error(`No result returned from dataStrategy for route ${Ve.route.id}`)})}for(let[Ve,$e]of Object.entries(Le))if(GL($e)){let nt=$e.result;et[Ve]={type:"redirect",response:FL(nt,$,Ve,re,f)}}else et[Ve]=await BL($e);return et}async function xt($,re,le,Ee){let Le=st(le,$,Ee,null),et=Promise.all(re.map(async $e=>{if($e.matches&&$e.match&&$e.request&&$e.controller){let St=(await st($e.request,$e.matches,Ee,$e.key))[$e.match.route.id];return{[$e.key]:St}}else return Promise.resolve({[$e.key]:{type:"error",error:ra(404,{pathname:$e.path})}})})),Ze=await Le,Ve=(await et).reduce(($e,nt)=>Object.assign($e,nt),{});return{loaderResults:Ze,fetcherResults:Ve}}function vt(){_=!0,X.forEach(($,re)=>{P.has(re)&&L.add(re),Me(re)})}function Je($,re,le={}){A.fetchers.set($,re),ee({fetchers:new Map(A.fetchers)},{flushSync:(le&&le.flushSync)===!0})}function Qe($,re,le,Ee={}){let Le=os(A.matches,re);je($),ee({errors:{[Le.route.id]:le},fetchers:new Map(A.fetchers)},{flushSync:(Ee&&Ee.flushSync)===!0})}function ft($){return G.set($,(G.get($)||0)+1),ce.has($)&&ce.delete($),A.fetchers.get($)||NL}function se($,re){Me($,re==null?void 0:re.reason),Je($,go(null))}function je($){let re=A.fetchers.get($);P.has($)&&!(re&&re.state==="loading"&&z.has($))&&Me($),X.delete($),z.delete($),Y.delete($),ce.delete($),L.delete($),A.fetchers.delete($)}function Ke($){let re=(G.get($)||0)-1;re<=0?(G.delete($),ce.add($)):G.set($,re),ee({fetchers:new Map(A.fetchers)})}function Me($,re){let le=P.get($);le&&(le.abort(re),P.delete($))}function Ie($){for(let re of $){let le=ft(re),Ee=go(le.data);A.fetchers.set(re,Ee)}}function Fe(){let $=[],re=!1;for(let le of Y){let Ee=A.fetchers.get(le);Ut(Ee,`Expected fetcher: ${le}`),Ee.state==="loading"&&(Y.delete(le),$.push(le),re=!0)}return Ie($),re}function ht($){let re=[];for(let[le,Ee]of z)if(Ee<$){let Le=A.fetchers.get(le);Ut(Le,`Expected fetcher: ${le}`),Le.state==="loading"&&(Me(le),z.delete(le),re.push(le))}return Ie(re),re.length>0}function Lt($,re){let le=A.blockers.get($)||tu;return oe.get($)!==re&&oe.set($,re),le}function ct($){A.blockers.delete($),oe.delete($)}function pt($,re){let le=A.blockers.get($)||tu;Ut(le.state==="unblocked"&&re.state==="blocked"||le.state==="blocked"&&re.state==="blocked"||le.state==="blocked"&&re.state==="proceeding"||le.state==="blocked"&&re.state==="unblocked"||le.state==="proceeding"&&re.state==="unblocked",`Invalid blocker state transition: ${le.state} -> ${re.state}`);let Ee=new Map(A.blockers);Ee.set($,re),ee({blockers:Ee})}function tt({currentLocation:$,nextLocation:re,historyAction:le}){if(oe.size===0)return;oe.size>1&&Fn(!1,"A router only supports one blocker at a time");let Ee=Array.from(oe.entries()),[Le,et]=Ee[Ee.length-1],Ze=A.blockers.get(Le);if(!(Ze&&Ze.state==="proceeding")&&et({currentLocation:$,nextLocation:re,historyAction:le}))return Le}function lt($){let re=ra(404,{pathname:$}),le=h||d,{matches:Ee,route:Le}=Af(le);return{notFoundMatches:Ee,route:Le,error:re}}function gt($,re,le){if(w=$,R=re,S=le||null,!T&&A.navigation===Hg){T=!0;let Ee=kt(A.location,A.matches);Ee!=null&&ee({restoreScrollPosition:Ee})}return()=>{w=null,R=null,S=null}}function Ye($,re){return S&&S($,re.map(Ee=>nL(Ee,A.loaderData)))||$.key}function Tt($,re){if(w&&R){let le=Ye($,re);w[le]=R()}}function kt($,re){if(w){let le=Ye($,re),Ee=w[le];if(typeof Ee=="number")return Ee}return null}function Rt($,re,le){if(e.patchRoutesOnNavigation)if($){if(Object.keys($[0].params).length>0)return{active:!0,matches:hu(re,le,f,!0)}}else return{active:!0,matches:hu(re,le,f,!0)||[]};return{active:!1,matches:null}}async function on($,re,le,Ee){if(!e.patchRoutesOnNavigation)return{type:"success",matches:$};let Le=$;for(;;){let et=h==null,Ze=h||d,Ve=c;try{await e.patchRoutesOnNavigation({signal:le,path:re,matches:Le,fetcherKey:Ee,patch:(St,ut)=>{le.aborted||VE(St,ut,Ze,Ve,i,!1)}})}catch(St){return{type:"error",error:St,partialMatches:Le}}finally{et&&!le.aborted&&(d=[...d])}if(le.aborted)return{type:"aborted"};let $e=as(Ze,re,f),nt=null;if($e){if(Object.keys($e[0].params).length===0)return{type:"success",matches:$e};if(nt=hu(Ze,re,f,!0),!(nt&&Le.length<nt.length&&Pt(Le,nt.slice(0,Le.length))))return{type:"success",matches:$e}}if(nt||(nt=hu(Ze,re,f,!0)),!nt||Pt(Le,nt))return{type:"success",matches:null};Le=nt}}function Pt($,re){return $.length===re.length&&$.every((le,Ee)=>le.route.id===re[Ee].route.id)}function Xe($){c={},h=ju($,i,void 0,c)}function Ct($,re,le=!1){let Ee=h==null;VE($,re,h||d,c,i,le),Ee&&(d=[...d],ee({}))}return k={get basename(){return f},get future(){return m},get state(){return A},get routes(){return d},get window(){return t},initialize:xe,subscribe:_e,enableScrollRestoration:gt,navigate:pe,fetch:ge,revalidate:ke,createHref:$=>e.history.createHref($),encodeLocation:$=>e.history.encodeLocation($),getFetcher:ft,resetFetcher:se,deleteFetcher:Ke,dispose:Ne,getBlocker:Lt,deleteBlocker:ct,patchRoutes:Ct,_internalFetchControllers:P,_internalSetRoutes:Xe,_internalSetStateDoNotUseOrYouWillBreakYourApp($){ee($)}},e.unstable_instrumentations&&(k=xL(k,e.unstable_instrumentations.map($=>$.router).filter(Boolean))),k}function kL(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Yy(e,t,n,a,s,i){let c,d;if(s){c=[];for(let f of t)if(c.push(f),f.route.id===s){d=f;break}}else c=t,d=t[t.length-1];let h=Qv(a||".",Wv(c),la(e.pathname,n)||e.pathname,i==="path");if(a==null&&(h.search=e.search,h.hash=e.hash),(a==null||a===""||a===".")&&d){let f=eb(h.search);if(d.route.index&&!f)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&f){let g=new URLSearchParams(h.search),m=g.getAll("index");g.delete("index"),m.filter(x=>x).forEach(x=>g.append("index",x));let b=g.toString();h.search=b?`?${b}`:""}}return n!=="/"&&(h.pathname=mL({basename:n,pathname:h.pathname})),Ba(h)}function BE(e,t,n){if(!n||!kL(n))return{path:t};if(n.formMethod&&!QL(n.formMethod))return{path:t,error:ra(405,{method:n.formMethod})};let a=()=>({path:t,error:ra(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),c=sC(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!lr(i))return a();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((b,[x,w])=>`${b}${x}=${w}
60
+ `,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!lr(i))return a();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:c,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return a()}}}Ut(typeof FormData=="function","FormData is not available in this environment");let d,h;if(n.formData)d=Ky(n.formData),h=n.formData;else if(n.body instanceof FormData)d=Ky(n.body),h=n.body;else if(n.body instanceof URLSearchParams)d=n.body,h=GE(d);else if(n.body==null)d=new URLSearchParams,h=new FormData;else try{d=new URLSearchParams(n.body),h=GE(d)}catch{return a()}let f={formMethod:i,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:h,json:void 0,text:void 0};if(lr(f.formMethod))return{path:t,submission:f};let g=Rs(t);return e&&g.search&&eb(g.search)&&d.append("index",""),g.search=`?${d}`,{path:Ba(g),submission:f}}function FE(e,t,n,a,s,i,c,d,h,f,g,m,b,x,w,S,R,T,C,M,O){var q;let D=M?Ur(M[1])?M[1].error:M[1].data:void 0,k=s.createURL(i.location),A=s.createURL(h),j;if(g&&i.errors){let _=Object.keys(i.errors)[0];j=c.findIndex(L=>L.route.id===_)}else if(M&&Ur(M[1])){let _=M[0];j=c.findIndex(L=>L.route.id===_)-1}let B=M?M[1].statusCode:void 0,W=B&&B>=400,K={currentUrl:k,currentParams:((q=i.matches[0])==null?void 0:q.params)||{},nextUrl:A,nextParams:c[0].params,...d,actionResult:D,actionStatus:B},I=Ju(c),H=c.map((_,L)=>{let{route:P}=_,V=null;if(j!=null&&L>j?V=!1:P.lazy?V=!0:Zv(P)?g?V=qy(P,i.loaderData,i.errors):jL(i.loaderData,i.matches[L],_)&&(V=!0):V=!1,V!==null)return $y(n,a,e,I,_,f,t,V);let Q=!1;typeof O=="boolean"?Q=O:W?Q=!1:(m||k.pathname+k.search===A.pathname+A.search||k.search!==A.search||_L(i.matches[L],_))&&(Q=!0);let z={...K,defaultShouldRevalidate:Q},Y=yu(_,z);return $y(n,a,e,I,_,f,t,Y,z,O)}),F=[];return w.forEach((_,L)=>{if(g||!c.some(ce=>ce.route.id===_.routeId)||x.has(L))return;let P=i.fetchers.get(L),V=P&&P.state!=="idle"&&P.data===void 0,Q=as(R,_.path,T);if(!Q){if(C&&V)return;F.push({key:L,routeId:_.routeId,path:_.path,matches:null,match:null,request:null,controller:null});return}if(S.has(L))return;let z=oh(Q,_.path),Y=new AbortController,X=ml(s,_.path,Y.signal),G=null;if(b.has(L))b.delete(L),G=vl(n,a,X,Q,z,f,t);else if(V)m&&(G=vl(n,a,X,Q,z,f,t));else{let ce;typeof O=="boolean"?ce=O:W?ce=!1:ce=m;let oe={...K,defaultShouldRevalidate:ce};yu(z,oe)&&(G=vl(n,a,X,Q,z,f,t,oe))}G&&F.push({key:L,routeId:_.routeId,path:_.path,matches:G,match:z,request:X,controller:Y})}),{dsMatches:H,revalidatingFetchers:F}}function Zv(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function qy(e,t,n){if(e.lazy)return!0;if(!Zv(e))return!1;let a=t!=null&&e.id in t,s=n!=null&&n[e.id]!==void 0;return!a&&s?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!a&&!s}function jL(e,t,n){let a=!t||n.route.id!==t.route.id,s=!e.hasOwnProperty(n.route.id);return a||s}function _L(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function yu(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function VE(e,t,n,a,s,i){let c;if(e){let f=a[e];Ut(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),c=f.children}else c=n;let d=[],h=[];if(t.forEach(f=>{let g=c.find(m=>tC(f,m));g?h.push({existingRoute:g,newRoute:f}):d.push(f)}),d.length>0){let f=ju(d,s,[e||"_","patch",String((c==null?void 0:c.length)||"0")],a);c.push(...f)}if(i&&h.length>0)for(let f=0;f<h.length;f++){let{existingRoute:g,newRoute:m}=h[f],b=g,[x]=ju([m],s,[],{},!0);Object.assign(b,{element:x.element?x.element:b.element,errorElement:x.errorElement?x.errorElement:b.errorElement,hydrateFallbackElement:x.hydrateFallbackElement?x.hydrateFallbackElement:b.hydrateFallbackElement})}}function tC(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,a)=>{var s;return(s=t.children)==null?void 0:s.some(i=>tC(n,i))}):!1}var YE=new WeakMap,nC=({key:e,route:t,manifest:n,mapRouteProperties:a})=>{let s=n[t.id];if(Ut(s,"No route found in manifest"),!s.lazy||typeof s.lazy!="object")return;let i=s.lazy[e];if(!i)return;let c=YE.get(s);c||(c={},YE.set(s,c));let d=c[e];if(d)return d;let h=(async()=>{let f=Z_(e),m=s[e]!==void 0&&e!=="hasErrorBoundary";if(f)Fn(!f,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(m)Fn(!1,`Route "${s.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let b=await i();b!=null&&(Object.assign(s,{[e]:b}),Object.assign(s,a(s)))}typeof s.lazy=="object"&&(s.lazy[e]=void 0,Object.values(s.lazy).every(b=>b===void 0)&&(s.lazy=void 0))})();return c[e]=h,h},qE=new WeakMap;function LL(e,t,n,a,s){let i=n[e.id];if(Ut(i,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let g=qE.get(i);if(g)return{lazyRoutePromise:g,lazyHandlerPromise:g};let m=(async()=>{Ut(typeof e.lazy=="function","No lazy route function found");let b=await e.lazy(),x={};for(let w in b){let S=b[w];if(S===void 0)continue;let R=eL(w),C=i[w]!==void 0&&w!=="hasErrorBoundary";R?Fn(!R,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):C?Fn(!C,`Route "${i.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.`):x[w]=S}Object.assign(i,x),Object.assign(i,{...a(i),lazy:void 0})})();return qE.set(i,m),m.catch(()=>{}),{lazyRoutePromise:m,lazyHandlerPromise:m}}let c=Object.keys(e.lazy),d=[],h;for(let g of c){if(s&&s.includes(g))continue;let m=nC({key:g,route:e,manifest:n,mapRouteProperties:a});m&&(d.push(m),g===t&&(h=m))}let f=d.length>0?Promise.all(d).then(()=>{}):void 0;return f==null||f.catch(()=>{}),h==null||h.catch(()=>{}),{lazyRoutePromise:f,lazyHandlerPromise:h}}async function $E(e){let t=e.matches.filter(s=>s.shouldLoad),n={};return(await Promise.all(t.map(s=>s.resolve()))).forEach((s,i)=>{n[t[i].route.id]=s}),n}async function IL(e){return e.matches.some(t=>t.route.middleware)?rC(e,()=>$E(e)):$E(e)}function rC(e,t){return PL(e,t,a=>{if(WL(a))throw a;return a},$L,n);function n(a,s,i){if(i)return Promise.resolve(Object.assign(i.value,{[s]:{type:"error",result:a}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(f=>f.route.id===s),0),Math.max(c.findIndex(f=>f.shouldCallHandler()),0)),h=os(c,c[d].route.id).route.id;return Promise.resolve({[h]:{type:"error",result:a}})}}}async function PL(e,t,n,a,s){let{matches:i,request:c,params:d,context:h,unstable_pattern:f}=e,g=i.flatMap(b=>b.route.middleware?b.route.middleware.map(x=>[b.route.id,x]):[]);return await aC({request:c,params:d,context:h,unstable_pattern:f},g,t,n,a,s)}async function aC(e,t,n,a,s,i,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let h=t[c];if(!h)return await n();let[f,g]=h,m,b=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");try{return m={value:await aC(e,t,n,a,s,i,c+1)},m.value}catch(x){return m={value:await i(x,f,m)},m.value}};try{let x=await g(e,b),w=x!=null?a(x):void 0;return s(w)?w:m?w??m.value:(m={value:await b()},m.value)}catch(x){return await i(x,f,m)}}function oC(e,t,n,a,s){let i=nC({key:"middleware",route:a.route,manifest:t,mapRouteProperties:e}),c=LL(a.route,lr(n.method)?"action":"loader",t,e,s);return{middleware:i,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function $y(e,t,n,a,s,i,c,d,h=null,f){let g=!1,m=oC(e,t,n,s,i);return{...s,_lazyPromises:m,shouldLoad:d,shouldRevalidateArgs:h,shouldCallHandler(b){return g=!0,h?typeof f=="boolean"?yu(s,{...h,defaultShouldRevalidate:f}):typeof b=="boolean"?yu(s,{...h,defaultShouldRevalidate:b}):yu(s,h):d},resolve(b){let{lazy:x,loader:w,middleware:S}=s.route,R=g||d||b&&!lr(n.method)&&(x||w),T=S&&S.length>0&&!w&&!x;return R&&(lr(n.method)||!T)?UL({request:n,unstable_pattern:a,match:s,lazyHandlerPromise:m==null?void 0:m.handler,lazyRoutePromise:m==null?void 0:m.route,handlerOverride:b,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function vl(e,t,n,a,s,i,c,d=null){return a.map(h=>h.route.id!==s.route.id?{...h,shouldLoad:!1,shouldRevalidateArgs:d,shouldCallHandler:()=>!1,_lazyPromises:oC(e,t,n,h,i),resolve:()=>Promise.resolve({type:"data",result:void 0})}:$y(e,t,n,Ju(a),h,i,c,!0,d))}async function zL(e,t,n,a,s,i){n.some(f=>{var g;return(g=f._lazyPromises)==null?void 0:g.middleware})&&await Promise.all(n.map(f=>{var g;return(g=f._lazyPromises)==null?void 0:g.middleware}));let c={request:t,unstable_pattern:Ju(n),params:n[0].params,context:s,matches:n},h=await e({...c,fetcherKey:a,runClientMiddleware:f=>{let g=c;return rC(g,()=>f({...g,fetcherKey:a,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(f=>{var g,m;return[(g=f._lazyPromises)==null?void 0:g.handler,(m=f._lazyPromises)==null?void 0:m.route]}))}catch{}return h}async function UL({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:a,lazyRoutePromise:s,handlerOverride:i,scopedContext:c}){let d,h,f=lr(e.method),g=f?"action":"loader",m=b=>{let x,w=new Promise((T,C)=>x=C);h=()=>x(),e.signal.addEventListener("abort",h);let S=T=>typeof b!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${g}" [routeId: ${n.route.id}]`)):b({request:e,unstable_pattern:t,params:n.params,context:c},...T!==void 0?[T]:[]),R=(async()=>{try{return{type:"data",result:await(i?i(C=>S(C)):S())}}catch(T){return{type:"error",result:T}}})();return Promise.race([R,w])};try{let b=f?n.route.action:n.route.loader;if(a||s)if(b){let x,[w]=await Promise.all([m(b).catch(S=>{x=S}),a,s]);if(x!==void 0)throw x;d=w}else{await a;let x=f?n.route.action:n.route.loader;if(x)[d]=await Promise.all([m(x),s]);else if(g==="action"){let w=new URL(e.url),S=w.pathname+w.search;throw ra(405,{method:e.method,pathname:S,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(b)d=await m(b);else{let x=new URL(e.url),w=x.pathname+x.search;throw ra(404,{pathname:w})}}catch(b){return{type:"error",result:b}}finally{h&&e.signal.removeEventListener("abort",h)}return d}async function HL(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 BL(e){var a,s,i,c,d;let{result:t,type:n}=e;if(Jv(t)){let h;try{h=await HL(t)}catch(f){return{type:"error",error:f}}return n==="error"?{type:"error",error:new Zu(t.status,t.statusText,h),statusCode:t.status,headers:t.headers}:{type:"data",data:h,statusCode:t.status,headers:t.headers}}return n==="error"?ZE(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(s=t.init)!=null&&s.headers?new Headers(t.init.headers):void 0}:{type:"error",error:qL(t),statusCode:_u(t)?t.status:void 0,headers:(i=t.init)!=null&&i.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:_u(t)?t.status:void 0}:ZE(t)?{type:"data",data:t.data,statusCode:(c=t.init)==null?void 0:c.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function FL(e,t,n,a,s){let i=e.headers.get("Location");if(Ut(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!Xv(i)){let c=a.slice(0,a.findIndex(d=>d.route.id===n)+1);i=Yy(new URL(t.url),c,s,i),e.headers.set("Location",i)}return e}function KE(e,t,n,a){let s=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];if(Xv(e)){let i=e,c=i.startsWith("//")?new URL(t.protocol+i):new URL(i);if(s.includes(c.protocol))throw new Error("Invalid redirect location");let d=la(c.pathname,n)!=null;if(c.origin===t.origin&&d)return c.pathname+c.search+c.hash}try{let i=a.createURL(e);if(s.includes(i.protocol))throw new Error("Invalid redirect location")}catch{}return e}function ml(e,t,n,a){let s=e.createURL(sC(t)).toString(),i={signal:n};if(a&&lr(a.formMethod)){let{formMethod:c,formEncType:d}=a;i.method=c.toUpperCase(),d==="application/json"?(i.headers=new Headers({"Content-Type":d}),i.body=JSON.stringify(a.json)):d==="text/plain"?i.body=a.text:d==="application/x-www-form-urlencoded"&&a.formData?i.body=Ky(a.formData):i.body=a.formData}return new Request(s,i)}function Ky(e){let t=new URLSearchParams;for(let[n,a]of e.entries())t.append(n,typeof a=="string"?a:a.name);return t}function GE(e){let t=new FormData;for(let[n,a]of e.entries())t.append(n,a);return t}function VL(e,t,n,a=!1,s=!1){let i={},c=null,d,h=!1,f={},g=n&&Ur(n[1])?n[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let b=m.route.id,x=t[b];if(Ut(!ri(x),"Cannot handle redirect results in processLoaderData"),Ur(x)){let w=x.error;if(g!==void 0&&(w=g,g=void 0),c=c||{},s)c[b]=w;else{let S=os(e,b);c[S.route.id]==null&&(c[S.route.id]=w)}a||(i[b]=eC),h||(h=!0,d=_u(x.error)?x.error.status:500),x.headers&&(f[b]=x.headers)}else i[b]=x.data,x.statusCode&&x.statusCode!==200&&!h&&(d=x.statusCode),x.headers&&(f[b]=x.headers)}),g!==void 0&&n&&(c={[n[0]]:g},n[2]&&(i[n[2]]=void 0)),{loaderData:i,errors:c,statusCode:d||200,loaderHeaders:f}}function XE(e,t,n,a,s,i){let{loaderData:c,errors:d}=VL(t,n,a);return s.filter(h=>!h.matches||h.matches.some(f=>f.shouldLoad)).forEach(h=>{let{key:f,match:g,controller:m}=h;if(m&&m.signal.aborted)return;let b=i[f];if(Ut(b,"Did not find corresponding fetcher result"),Ur(b)){let x=os(e.matches,g==null?void 0:g.route.id);d&&d[x.route.id]||(d={...d,[x.route.id]:b.error}),e.fetchers.delete(f)}else if(ri(b))Ut(!1,"Unhandled fetcher revalidation redirect");else{let x=go(b.data);e.fetchers.set(f,x)}}),{loaderData:c,errors:d}}function WE(e,t,n,a){let s=Object.entries(t).filter(([,i])=>i!==eC).reduce((i,[c,d])=>(i[c]=d,i),{});for(let i of n){let c=i.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&i.route.loader&&(s[c]=e[c]),a&&a.hasOwnProperty(c))break}return s}function QE(e){return e?Ur(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function os(e,t){return(t?e.slice(0,e.findIndex(a=>a.route.id===t)+1):[...e]).reverse().find(a=>a.route.hasErrorBoundary===!0)||e[0]}function Af(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 ra(e,{pathname:t,routeId:n,method:a,type:s,message:i}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",a&&t&&n?d=`You made a ${a} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",a&&t&&n?d=`You made a ${a.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:a&&(d=`Invalid request method "${a.toUpperCase()}"`)),new Zu(e||500,c,new Error(d),!0)}function Df(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[a,s]=t[n];if(ri(s))return{key:a,result:s}}}function sC(e){let t=typeof e=="string"?Rs(e):e;return Ba({...t,hash:""})}function YL(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function qL(e){var t,n;return new Zu(((t=e.init)==null?void 0:t.status)??500,((n=e.init)==null?void 0:n.statusText)??"Internal Server Error",e.data)}function $L(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&KL(n))}function KL(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function GL(e){return Jv(e.result)&&ZT.has(e.result.status)}function Ur(e){return e.type==="error"}function ri(e){return(e&&e.type)==="redirect"}function ZE(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function Jv(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function XL(e){return ZT.has(e)}function WL(e){return Jv(e)&&XL(e.status)&&e.headers.has("Location")}function QL(e){return OL.has(e.toUpperCase())}function lr(e){return TL.has(e.toUpperCase())}function eb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function oh(e,t){let n=typeof t=="string"?Rs(t).search:t.search;if(e[e.length-1].route.index&&eb(n||""))return e[e.length-1];let a=KT(e);return a[a.length-1]}function JE(e){let{formMethod:t,formAction:n,formEncType:a,text:s,formData:i,json:c}=e;if(!(!t||!n||!a)){if(s!=null)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:void 0,text:s};if(i!=null)return{formMethod:t,formAction:n,formEncType:a,formData:i,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:a,formData:void 0,json:c,text:void 0}}}function Bg(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 ZL(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 nu(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 JL(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 go(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 eI(e,t){try{let n=e.sessionStorage.getItem(JT);if(n){let a=JSON.parse(n);for(let[s,i]of Object.entries(a||{}))i&&Array.isArray(i)&&t.set(s,new Set(i||[]))}}catch{}}function tI(e,t){if(t.size>0){let n={};for(let[a,s]of t)n[a]=[...s];try{e.sessionStorage.setItem(JT,JSON.stringify(n))}catch(a){Fn(!1,`Failed to save applied view transitions in sessionStorage (${a}).`)}}}function e1(){let e,t,n=new Promise((a,s)=>{e=async i=>{a(i);try{await n}catch{}},t=async i=>{s(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Ni=y.createContext(null);Ni.displayName="DataRouter";var ed=y.createContext(null);ed.displayName="DataRouterState";var iC=y.createContext(!1);function nI(){return y.useContext(iC)}var tb=y.createContext({isTransitioning:!1});tb.displayName="ViewTransition";var lC=y.createContext(new Map);lC.displayName="Fetchers";var rI=y.createContext(null);rI.displayName="Await";var ua=y.createContext(null);ua.displayName="Navigation";var Yh=y.createContext(null);Yh.displayName="Location";var Ra=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ra.displayName="Route";var nb=y.createContext(null);nb.displayName="RouteError";var cC="REACT_ROUTER_ERROR",aI="REDIRECT",oI="ROUTE_ERROR_RESPONSE";function sI(e){if(e.startsWith(`${cC}:${aI}:{`))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 iI(e){if(e.startsWith(`${cC}:${oI}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Zu(t.status,t.statusText,t.data)}catch{}}function lI(e,{relative:t}={}){Ut(Zl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=y.useContext(ua),{hash:s,pathname:i,search:c}=td(e,{relative:t}),d=i;return n!=="/"&&(d=i==="/"?n:Pa([n,i])),a.createHref({pathname:d,search:c,hash:s})}function Zl(){return y.useContext(Yh)!=null}function qa(){return Ut(Zl(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(Yh).location}function LY(e){Ut(Zl(),"useMatch() may be used only in the context of a <Router> component.");let{pathname:t}=qa();return y.useMemo(()=>Fl(e,qT(t)),[t,e])}var uC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function dC(e){y.useContext(ua).static||y.useLayoutEffect(e)}function rb(){let{isDataRoute:e}=y.useContext(Ra);return e?RI():cI()}function cI(){Ut(Zl(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(Ni),{basename:t,navigator:n}=y.useContext(ua),{matches:a}=y.useContext(Ra),{pathname:s}=qa(),i=JSON.stringify(Wv(a)),c=y.useRef(!1);return dC(()=>{c.current=!0}),y.useCallback((h,f={})=>{if(Fn(c.current,uC),!c.current)return;if(typeof h=="number"){n.go(h);return}let g=Qv(h,JSON.parse(i),s,f.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Pa([t,g.pathname])),(f.replace?n.replace:n.push)(g,f.state,f)},[t,n,i,s,e])}var uI=y.createContext(null);function dI(e){let t=y.useContext(Ra).outlet;return y.useMemo(()=>t&&y.createElement(uI.Provider,{value:e},t),[t,e])}function fI(){let{matches:e}=y.useContext(Ra),t=e[e.length-1];return t?t.params:{}}function td(e,{relative:t}={}){let{matches:n}=y.useContext(Ra),{pathname:a}=qa(),s=JSON.stringify(Wv(n));return y.useMemo(()=>Qv(e,JSON.parse(s),a,t==="path"),[e,s,a,t])}function hI(e,t,n,a,s){Ut(Zl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=y.useContext(ua),{matches:c}=y.useContext(Ra),d=c[c.length-1],h=d?d.params:{},f=d?d.pathname:"/",g=d?d.pathnameBase:"/",m=d&&d.route;{let C=m&&m.path||"";hC(f,!m||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) 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.
61
+
62
+ Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let b=qa(),x;x=b;let w=x.pathname||"/",S=w;if(g!=="/"){let C=g.replace(/^\//,"").split("/");S="/"+w.replace(/^\//,"").split("/").slice(C.length).join("/")}let R=as(e,{pathname:S});return Fn(m||R!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Fn(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 "${x.pathname}${x.search}${x.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.`),vI(R&&R.map(C=>Object.assign({},C,{params:Object.assign({},h,C.params),pathname:Pa([g,i.encodeLocation?i.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?g:Pa([g,i.encodeLocation?i.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),c,n,a,s)}function mI(){let e=EI(),t=_u(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},i={padding:"2px 4px",backgroundColor:a},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:i},"ErrorBoundary")," or"," ",y.createElement("code",{style:i},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:s},n):null,c)}var pI=y.createElement(mI,null),fC=class extends y.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=iI(e.digest);n&&(e=n)}let t=e!==void 0?y.createElement(Ra.Provider,{value:this.props.routeContext},y.createElement(nb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?y.createElement(gI,{error:e},t):t}};fC.contextType=iC;var Fg=new WeakMap;function gI({children:e,error:t}){let{basename:n}=y.useContext(ua);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=sI(t.digest);if(a){let s=Fg.get(t);if(s)throw s;let i=XT(a.location,n);if(GT&&!Fg.get(t))if(i.isExternal||a.reloadDocument)window.location.href=i.absoluteURL||i.to;else{const c=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:a.replace}));throw Fg.set(t,c),c}return y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${i.absoluteURL||i.to}`})}}return e}function yI({routeContext:e,match:t,children:n}){let a=y.useContext(Ni);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Ra.Provider,{value:e},n)}function vI(e,t=[],n=null,a=null,s=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 i=e,c=n==null?void 0:n.errors;if(c!=null){let g=i.findIndex(m=>m.route.id&&(c==null?void 0:c[m.route.id])!==void 0);Ut(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),i=i.slice(0,Math.min(i.length,g+1))}let d=!1,h=-1;if(n)for(let g=0;g<i.length;g++){let m=i[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(h=g),m.route.id){let{loaderData:b,errors:x}=n,w=m.route.loader&&!b.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||w){d=!0,h>=0?i=i.slice(0,h+1):i=[i[0]];break}}}let f=n&&a?(g,m)=>{var b,x;a(g,{location:n.location,params:((x=(b=n.matches)==null?void 0:b[0])==null?void 0:x.params)??{},unstable_pattern:Ju(n.matches),errorInfo:m})}:void 0;return i.reduceRight((g,m,b)=>{let x,w=!1,S=null,R=null;n&&(x=c&&m.route.id?c[m.route.id]:void 0,S=m.route.errorElement||pI,d&&(h<0&&b===0?(hC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):h===b&&(w=!0,R=m.route.hydrateFallbackElement||null)));let T=t.concat(i.slice(0,b+1)),C=()=>{let M;return x?M=S:w?M=R:m.route.Component?M=y.createElement(m.route.Component,null):m.route.element?M=m.route.element:M=g,y.createElement(yI,{match:m,routeContext:{outlet:g,matches:T,isDataRoute:n!=null},children:M})};return n&&(m.route.ErrorBoundary||m.route.errorElement||b===0)?y.createElement(fC,{location:n.location,revalidation:n.revalidation,component:S,error:x,children:C(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:f}):C()},null)}function ab(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function bI(e){let t=y.useContext(Ni);return Ut(t,ab(e)),t}function xI(e){let t=y.useContext(ed);return Ut(t,ab(e)),t}function wI(e){let t=y.useContext(Ra);return Ut(t,ab(e)),t}function ob(e){let t=wI(e),n=t.matches[t.matches.length-1];return Ut(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function SI(){return ob("useRouteId")}function EI(){var a;let e=y.useContext(nb),t=xI("useRouteError"),n=ob("useRouteError");return e!==void 0?e:(a=t.errors)==null?void 0:a[n]}function RI(){let{router:e}=bI("useNavigate"),t=ob("useNavigate"),n=y.useRef(!1);return dC(()=>{n.current=!0}),y.useCallback(async(s,i={})=>{Fn(n.current,uC),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...i}))},[e,t])}var t1={};function hC(e,t,n){!t&&!t1[e]&&(t1[e]=!0,Fn(!1,n))}var n1={};function r1(e,t){!e&&!n1[t]&&(n1[t]=!0,console.warn(t))}var TI="useOptimistic",a1=Kv[TI],CI=()=>{};function OI(e){return a1?a1(e):[e,CI]}function MI(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Fn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Fn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Fn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var NI=["HydrateFallback","hydrateFallbackElement"],AI=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 DI({router:e,flushSync:t,onError:n,unstable_useTransitions:a}){a=nI()||a;let[i,c]=y.useState(e.state),[d,h]=OI(i),[f,g]=y.useState(),[m,b]=y.useState({isTransitioning:!1}),[x,w]=y.useState(),[S,R]=y.useState(),[T,C]=y.useState(),M=y.useRef(new Map),O=y.useCallback((j,{deletedFetchers:B,newErrors:W,flushSync:K,viewTransitionOpts:I})=>{W&&n&&Object.values(W).forEach(F=>{var q;return n(F,{location:j.location,params:((q=j.matches[0])==null?void 0:q.params)??{},unstable_pattern:Ju(j.matches)})}),j.fetchers.forEach((F,q)=>{F.data!==void 0&&M.current.set(q,F.data)}),B.forEach(F=>M.current.delete(F)),r1(K===!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 H=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(r1(I==null||H,"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."),!I||!H){t&&K?t(()=>c(j)):a===!1?c(j):y.startTransition(()=>{a===!0&&h(F=>o1(F,j)),c(j)});return}if(t&&K){t(()=>{S&&(x==null||x.resolve(),S.skipTransition()),b({isTransitioning:!0,flushSync:!0,currentLocation:I.currentLocation,nextLocation:I.nextLocation})});let F=e.window.document.startViewTransition(()=>{t(()=>c(j))});F.finished.finally(()=>{t(()=>{w(void 0),R(void 0),g(void 0),b({isTransitioning:!1})})}),t(()=>R(F));return}S?(x==null||x.resolve(),S.skipTransition(),C({state:j,currentLocation:I.currentLocation,nextLocation:I.nextLocation})):(g(j),b({isTransitioning:!0,flushSync:!1,currentLocation:I.currentLocation,nextLocation:I.nextLocation}))},[e.window,t,S,x,a,h,n]);y.useLayoutEffect(()=>e.subscribe(O),[e,O]),y.useEffect(()=>{m.isTransitioning&&!m.flushSync&&w(new AI)},[m]),y.useEffect(()=>{if(x&&f&&e.window){let j=f,B=x.promise,W=e.window.document.startViewTransition(async()=>{a===!1?c(j):y.startTransition(()=>{a===!0&&h(K=>o1(K,j)),c(j)}),await B});W.finished.finally(()=>{w(void 0),R(void 0),g(void 0),b({isTransitioning:!1})}),R(W)}},[f,x,e.window,a,h]),y.useEffect(()=>{x&&f&&d.location.key===f.location.key&&x.resolve()},[x,S,d.location,f]),y.useEffect(()=>{!m.isTransitioning&&T&&(g(T.state),b({isTransitioning:!0,flushSync:!1,currentLocation:T.currentLocation,nextLocation:T.nextLocation}),C(void 0))},[m.isTransitioning,T]);let D=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:j=>e.navigate(j),push:(j,B,W)=>e.navigate(j,{state:B,preventScrollReset:W==null?void 0:W.preventScrollReset}),replace:(j,B,W)=>e.navigate(j,{replace:!0,state:B,preventScrollReset:W==null?void 0:W.preventScrollReset})}),[e]),k=e.basename||"/",A=y.useMemo(()=>({router:e,navigator:D,static:!1,basename:k,onError:n}),[e,D,k,n]);return y.createElement(y.Fragment,null,y.createElement(Ni.Provider,{value:A},y.createElement(ed.Provider,{value:d},y.createElement(lC.Provider,{value:M.current},y.createElement(tb.Provider,{value:m},y.createElement(LI,{basename:k,location:d.location,navigationType:d.historyAction,navigator:D,unstable_useTransitions:a},y.createElement(kI,{routes:e.routes,future:e.future,state:d,onError:n})))))),null)}function o1(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 kI=y.memo(jI);function jI({routes:e,future:t,state:n,onError:a}){return hI(e,void 0,n,a,t)}function _I(e){return dI(e.context)}function LI({basename:e="/",children:t=null,location:n,navigationType:a="POP",navigator:s,static:i=!1,unstable_useTransitions:c}){Ut(!Zl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),h=y.useMemo(()=>({basename:d,navigator:s,static:i,unstable_useTransitions:c,future:{}}),[d,s,i,c]);typeof n=="string"&&(n=Rs(n));let{pathname:f="/",search:g="",hash:m="",state:b=null,key:x="default"}=n,w=y.useMemo(()=>{let S=la(f,d);return S==null?null:{location:{pathname:S,search:g,hash:m,state:b,key:x},navigationType:a}},[d,f,g,m,b,x,a]);return Fn(w!=null,`<Router basename="${d}"> is not able to match the URL "${f}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:y.createElement(ua.Provider,{value:h},y.createElement(Yh.Provider,{children:t,value:w}))}var sh="get",ih="application/x-www-form-urlencoded";function qh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function II(e){return qh(e)&&e.tagName.toLowerCase()==="button"}function PI(e){return qh(e)&&e.tagName.toLowerCase()==="form"}function zI(e){return qh(e)&&e.tagName.toLowerCase()==="input"}function UI(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function HI(e,t){return e.button===0&&(!t||t==="_self")&&!UI(e)}var kf=null;function BI(){if(kf===null)try{new FormData(document.createElement("form"),0),kf=!1}catch{kf=!0}return kf}var FI=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Vg(e){return e!=null&&!FI.has(e)?(Fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ih}"`),null):e}function VI(e,t){let n,a,s,i,c;if(PI(e)){let d=e.getAttribute("action");a=d?la(d,t):null,n=e.getAttribute("method")||sh,s=Vg(e.getAttribute("enctype"))||ih,i=new FormData(e)}else if(II(e)||zI(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||d.getAttribute("action");if(a=h?la(h,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||sh,s=Vg(e.getAttribute("formenctype"))||Vg(d.getAttribute("enctype"))||ih,i=new FormData(d,e),!BI()){let{name:f,type:g,value:m}=e;if(g==="image"){let b=f?`${f}.`:"";i.append(`${b}x`,"0"),i.append(`${b}y`,"0")}else f&&i.append(f,m)}}else{if(qh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=sh,a=null,s=ih,c=e}return i&&s==="text/plain"&&(c=i,i=void 0),{action:a,method:n.toLowerCase(),encType:s,formData:i,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function sb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function YI(e,t,n,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&la(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function qI(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 $I(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 KI(e,t,n){let a=await Promise.all(e.map(async s=>{let i=t.routes[s.route.id];if(i){let c=await qI(i,n);return c.links?c.links():[]}return[]}));return QI(a.flat(1).filter($I).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function s1(e,t,n,a,s,i){let c=(h,f)=>n[f]?h.route.id!==n[f].route.id:!0,d=(h,f)=>{var g;return n[f].pathname!==h.pathname||((g=n[f].route.path)==null?void 0:g.endsWith("*"))&&n[f].params["*"]!==h.params["*"]};return i==="assets"?t.filter((h,f)=>c(h,f)||d(h,f)):i==="data"?t.filter((h,f)=>{var m;let g=a.routes[h.route.id];if(!g||!g.hasLoader)return!1;if(c(h,f)||d(h,f))return!0;if(h.route.shouldRevalidate){let b=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function GI(e,t,{includeHydrateFallback:n}={}){return XI(e.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let i=[s.module];return s.clientActionModule&&(i=i.concat(s.clientActionModule)),s.clientLoaderModule&&(i=i.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(i=i.concat(s.hydrateFallbackModule)),s.imports&&(i=i.concat(s.imports)),i}).flat(1))}function XI(e){return[...new Set(e)]}function WI(e){let t={},n=Object.keys(e).sort();for(let a of n)t[a]=e[a];return t}function QI(e,t){let n=new Set;return new Set(t),e.reduce((a,s)=>{let i=JSON.stringify(WI(s));return n.has(i)||(n.add(i),a.push({key:i,link:s})),a},[])}function mC(){let e=y.useContext(Ni);return sb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function ZI(){let e=y.useContext(ed);return sb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var ib=y.createContext(void 0);ib.displayName="FrameworkContext";function pC(){let e=y.useContext(ib);return sb(e,"You must render this element inside a <HydratedRouter> element"),e}function JI(e,t){let n=y.useContext(ib),[a,s]=y.useState(!1),[i,c]=y.useState(!1),{onFocus:d,onBlur:h,onMouseEnter:f,onMouseLeave:g,onTouchStart:m}=t,b=y.useRef(null);y.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let S=T=>{T.forEach(C=>{c(C.isIntersecting)})},R=new IntersectionObserver(S,{threshold:.5});return b.current&&R.observe(b.current),()=>{R.disconnect()}}},[e]),y.useEffect(()=>{if(a){let S=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(S)}}},[a]);let x=()=>{s(!0)},w=()=>{s(!1),c(!1)};return n?e!=="intent"?[i,b,{}]:[i,b,{onFocus:ru(d,x),onBlur:ru(h,w),onMouseEnter:ru(f,x),onMouseLeave:ru(g,w),onTouchStart:ru(m,x)}]:[!1,b,{}]}function ru(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function eP({page:e,...t}){let{router:n}=mC(),a=y.useMemo(()=>as(n.routes,e,n.basename),[n.routes,e,n.basename]);return a?y.createElement(nP,{page:e,matches:a,...t}):null}function tP(e){let{manifest:t,routeModules:n}=pC(),[a,s]=y.useState([]);return y.useEffect(()=>{let i=!1;return KI(e,t,n).then(c=>{i||s(c)}),()=>{i=!0}},[e,t,n]),a}function nP({page:e,matches:t,...n}){let a=qa(),{future:s,manifest:i,routeModules:c}=pC(),{basename:d}=mC(),{loaderData:h,matches:f}=ZI(),g=y.useMemo(()=>s1(e,t,f,i,a,"data"),[e,t,f,i,a]),m=y.useMemo(()=>s1(e,t,f,i,a,"assets"),[e,t,f,i,a]),b=y.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let S=new Set,R=!1;if(t.forEach(C=>{var O;let M=i.routes[C.route.id];!M||!M.hasLoader||(!g.some(D=>D.route.id===C.route.id)&&C.route.id in h&&((O=c[C.route.id])!=null&&O.shouldRevalidate)||M.hasClientLoader?R=!0:S.add(C.route.id))}),S.size===0)return[];let T=YI(e,d,s.unstable_trailingSlashAwareDataRequests,"data");return R&&S.size>0&&T.searchParams.set("_routes",t.filter(C=>S.has(C.route.id)).map(C=>C.route.id).join(",")),[T.pathname+T.search]},[d,s.unstable_trailingSlashAwareDataRequests,h,a,i,g,t,e,c]),x=y.useMemo(()=>GI(m,i),[m,i]),w=tP(m);return y.createElement(y.Fragment,null,b.map(S=>y.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),x.map(S=>y.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),w.map(({key:S,link:R})=>y.createElement("link",{key:S,nonce:n.nonce,...R,crossOrigin:R.crossOrigin??n.crossOrigin})))}function rP(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var aP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{aP&&(window.__reactRouterVersion="7.13.0")}catch{}function oP(e,t){return DL({basename:t==null?void 0:t.basename,getContext:t==null?void 0:t.getContext,future:t==null?void 0:t.future,history:G_({window:t==null?void 0:t.window}),hydrationData:sP(),routes:e,mapRouteProperties:MI,hydrationRouteProperties:NI,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 sP(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:iP(e.errors)}),e}function iP(e){if(!e)return null;let t=Object.entries(e),n={};for(let[a,s]of t)if(s&&s.__type==="RouteErrorResponse")n[a]=new Zu(s.status,s.statusText,s.data,s.internal===!0);else if(s&&s.__type==="Error"){if(s.__subType){let i=window[s.__subType];if(typeof i=="function")try{let c=new i(s.message);c.stack="",n[a]=c}catch{}}if(n[a]==null){let i=new Error(s.message);i.stack="",n[a]=i}}else n[a]=s;return n}var gC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lb=y.forwardRef(function({onClick:t,discover:n="render",prefetch:a="none",relative:s,reloadDocument:i,replace:c,state:d,target:h,to:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:b,...x},w){let{basename:S,unstable_useTransitions:R}=y.useContext(ua),T=typeof f=="string"&&gC.test(f),C=XT(f,S);f=C.to;let M=lI(f,{relative:s}),[O,D,k]=JI(a,x),A=dP(f,{replace:c,state:d,target:h,preventScrollReset:g,relative:s,viewTransition:m,unstable_defaultShouldRevalidate:b,unstable_useTransitions:R});function j(W){t&&t(W),W.defaultPrevented||A(W)}let B=y.createElement("a",{...x,...k,href:C.absoluteURL||M,onClick:C.isExternal||i?t:j,ref:rP(w,D),target:h,"data-discover":!T&&n==="render"?"true":void 0});return O&&!T?y.createElement(y.Fragment,null,B,y.createElement(eP,{page:M})):B});lb.displayName="Link";var lP=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:a="",end:s=!1,style:i,to:c,viewTransition:d,children:h,...f},g){let m=td(c,{relative:f.relative}),b=qa(),x=y.useContext(ed),{navigator:w,basename:S}=y.useContext(ua),R=x!=null&&gP(m)&&d===!0,T=w.encodeLocation?w.encodeLocation(m).pathname:m.pathname,C=b.pathname,M=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(C=C.toLowerCase(),M=M?M.toLowerCase():null,T=T.toLowerCase()),M&&S&&(M=la(M,S)||M);const O=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let D=C===T||!s&&C.startsWith(T)&&C.charAt(O)==="/",k=M!=null&&(M===T||!s&&M.startsWith(T)&&M.charAt(T.length)==="/"),A={isActive:D,isPending:k,isTransitioning:R},j=D?t:void 0,B;typeof a=="function"?B=a(A):B=[a,D?"active":null,k?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let W=typeof i=="function"?i(A):i;return y.createElement(lb,{...f,"aria-current":j,className:B,ref:g,style:W,to:c,viewTransition:d},typeof h=="function"?h(A):h)});lP.displayName="NavLink";var cP=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:a,replace:s,state:i,method:c=sh,action:d,onSubmit:h,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:b,...x},w)=>{let{unstable_useTransitions:S}=y.useContext(ua),R=mP(),T=pP(d,{relative:f}),C=c.toLowerCase()==="get"?"get":"post",M=typeof d=="string"&&gC.test(d),O=D=>{if(h&&h(D),D.defaultPrevented)return;D.preventDefault();let k=D.nativeEvent.submitter,A=(k==null?void 0:k.getAttribute("formmethod"))||c,j=()=>R(k||D.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:s,state:i,relative:f,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:b});S&&n!==!1?y.startTransition(()=>j()):j()};return y.createElement("form",{ref:w,method:C,action:T,onSubmit:a?h:O,...x,"data-discover":!M&&e==="render"?"true":void 0})});cP.displayName="Form";function uP(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yC(e){let t=y.useContext(Ni);return Ut(t,uP(e)),t}function dP(e,{target:t,replace:n,state:a,preventScrollReset:s,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:h}={}){let f=rb(),g=qa(),m=td(e,{relative:i});return y.useCallback(b=>{if(HI(b,t)){b.preventDefault();let x=n!==void 0?n:Ba(g)===Ba(m),w=()=>f(e,{replace:x,state:a,preventScrollReset:s,relative:i,viewTransition:c,unstable_defaultShouldRevalidate:d});h?y.startTransition(()=>w()):w()}},[g,f,m,n,a,t,e,s,i,c,d,h])}var fP=0,hP=()=>`__${String(++fP)}__`;function mP(){let{router:e}=yC("useSubmit"),{basename:t}=y.useContext(ua),n=SI(),a=e.fetch,s=e.navigate;return y.useCallback(async(i,c={})=>{let{action:d,method:h,encType:f,formData:g,body:m}=VI(i,t);if(c.navigate===!1){let b=c.fetcherKey||hP();await a(b,n,c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:m,formMethod:c.method||h,formEncType:c.encType||f,flushSync:c.flushSync})}else await s(c.action||d,{unstable_defaultShouldRevalidate:c.unstable_defaultShouldRevalidate,preventScrollReset:c.preventScrollReset,formData:g,body:m,formMethod:c.method||h,formEncType:c.encType||f,replace:c.replace,state:c.state,fromRouteId:n,flushSync:c.flushSync,viewTransition:c.viewTransition})},[a,s,t,n])}function pP(e,{relative:t}={}){let{basename:n}=y.useContext(ua),a=y.useContext(Ra);Ut(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),i={...td(e||".",{relative:t})},c=qa();if(e==null){i.search=c.search;let d=new URLSearchParams(i.search),h=d.getAll("index");if(h.some(g=>g==="")){d.delete("index"),h.filter(m=>m).forEach(m=>d.append("index",m));let g=d.toString();i.search=g?`?${g}`:""}}return(!e||e===".")&&s.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Pa([n,i.pathname])),Ba(i)}function gP(e,{relative:t}={}){let n=y.useContext(tb);Ut(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=yC("useViewTransitionState"),s=td(e,{relative:t});if(!n.isTransitioning)return!1;let i=la(n.currentLocation.pathname,a)||n.currentLocation.pathname,c=la(n.nextLocation.pathname,a)||n.nextLocation.pathname;return Fl(s.pathname,c)!=null||Fl(s.pathname,i)!=null}var or=HT();const yP=ET(or);function vP(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 bP=e=>{switch(e){case"success":return SP;case"info":return RP;case"warning":return EP;case"error":return TP;default:return null}},xP=Array(12).fill(0),wP=({visible:e,className:t})=>Pe.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},Pe.createElement("div",{className:"sonner-spinner"},xP.map((n,a)=>Pe.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${a}`})))),SP=Pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Pe.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"})),EP=Pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Pe.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"})),RP=Pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Pe.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"})),TP=Pe.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Pe.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"})),CP=Pe.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"},Pe.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Pe.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),OP=()=>{const[e,t]=Pe.useState(document.hidden);return Pe.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Gy=1;class MP{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:a,...s}=t,i=typeof(t==null?void 0:t.id)=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Gy++,c=this.toasts.find(h=>h.id===i),d=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(i)&&this.dismissedToasts.delete(i),c?this.toasts=this.toasts.map(h=>h.id===i?(this.publish({...h,...t,id:i,title:a}),{...h,...t,id:i,dismissible:d,title:a}):h):this.addToast({title:a,...s,dismissible:d,id:i}),i},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(a=>a({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 a;n.loading!==void 0&&(a=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const s=Promise.resolve(t instanceof Function?t():t);let i=a!==void 0,c;const d=s.then(async f=>{if(c=["resolve",f],Pe.isValidElement(f))i=!1,this.create({id:a,type:"default",message:f});else if(AP(f)&&!f.ok){i=!1;const m=typeof n.error=="function"?await n.error(`HTTP error! status: ${f.status}`):n.error,b=typeof n.description=="function"?await n.description(`HTTP error! status: ${f.status}`):n.description,w=typeof m=="object"&&!Pe.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:b,...w})}else if(f instanceof Error){i=!1;const m=typeof n.error=="function"?await n.error(f):n.error,b=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!Pe.isValidElement(m)?m:{message:m};this.create({id:a,type:"error",description:b,...w})}else if(n.success!==void 0){i=!1;const m=typeof n.success=="function"?await n.success(f):n.success,b=typeof n.description=="function"?await n.description(f):n.description,w=typeof m=="object"&&!Pe.isValidElement(m)?m:{message:m};this.create({id:a,type:"success",description:b,...w})}}).catch(async f=>{if(c=["reject",f],n.error!==void 0){i=!1;const g=typeof n.error=="function"?await n.error(f):n.error,m=typeof n.description=="function"?await n.description(f):n.description,x=typeof g=="object"&&!Pe.isValidElement(g)?g:{message:g};this.create({id:a,type:"error",description:m,...x})}}).finally(()=>{i&&(this.dismiss(a),a=void 0),n.finally==null||n.finally.call(n)}),h=()=>new Promise((f,g)=>d.then(()=>c[0]==="reject"?g(c[1]):f(c[1])).catch(g));return typeof a!="string"&&typeof a!="number"?{unwrap:h}:Object.assign(a,{unwrap:h})},this.custom=(t,n)=>{const a=(n==null?void 0:n.id)||Gy++;return this.create({jsx:t(a),id:a,...n}),a},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const Or=new MP,NP=(e,t)=>{const n=(t==null?void 0:t.id)||Gy++;return Or.addToast({title:e,...t,id:n}),n},AP=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",DP=NP,kP=()=>Or.toasts,jP=()=>Or.getActiveToasts(),dn=Object.assign(DP,{success:Or.success,info:Or.info,warning:Or.warning,error:Or.error,custom:Or.custom,message:Or.message,promise:Or.promise,dismiss:Or.dismiss,loading:Or.loading},{getHistory:kP,getToasts:jP});vP("[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 jf(e){return e.label!==void 0}const _P=3,LP="24px",IP="16px",i1=4e3,PP=356,zP=14,UP=45,HP=200;function Aa(...e){return e.filter(Boolean).join(" ")}function BP(e){const[t,n]=e.split("-"),a=[];return t&&a.push(t),n&&a.push(n),a}const FP=e=>{var t,n,a,s,i,c,d,h,f;const{invert:g,toast:m,unstyled:b,interacting:x,setHeights:w,visibleToasts:S,heights:R,index:T,toasts:C,expanded:M,removeToast:O,defaultRichColors:D,closeButton:k,style:A,cancelButtonStyle:j,actionButtonStyle:B,className:W="",descriptionClassName:K="",duration:I,position:H,gap:F,expandByDefault:q,classNames:_,icons:L,closeButtonAriaLabel:P="Close toast"}=e,[V,Q]=Pe.useState(null),[z,Y]=Pe.useState(null),[X,G]=Pe.useState(!1),[ce,oe]=Pe.useState(!1),[de,ve]=Pe.useState(!1),[xe,Ne]=Pe.useState(!1),[_e,ee]=Pe.useState(!1),[ue,pe]=Pe.useState(0),[ke,Te]=Pe.useState(0),be=Pe.useRef(m.duration||I||i1),we=Pe.useRef(null),Z=Pe.useRef(null),Se=T===0,ge=T+1<=S,ze=m.type,He=m.dismissible!==!1,De=m.className||"",st=m.descriptionClassName||"",xt=Pe.useMemo(()=>R.findIndex(Ye=>Ye.toastId===m.id)||0,[R,m.id]),vt=Pe.useMemo(()=>{var Ye;return(Ye=m.closeButton)!=null?Ye:k},[m.closeButton,k]),Je=Pe.useMemo(()=>m.duration||I||i1,[m.duration,I]),Qe=Pe.useRef(0),ft=Pe.useRef(0),se=Pe.useRef(0),je=Pe.useRef(null),[Ke,Me]=H.split("-"),Ie=Pe.useMemo(()=>R.reduce((Ye,Tt,kt)=>kt>=xt?Ye:Ye+Tt.height,0),[R,xt]),Fe=OP(),ht=m.invert||g,Lt=ze==="loading";ft.current=Pe.useMemo(()=>xt*F+Ie,[xt,Ie]),Pe.useEffect(()=>{be.current=Je},[Je]),Pe.useEffect(()=>{G(!0)},[]),Pe.useEffect(()=>{const Ye=Z.current;if(Ye){const Tt=Ye.getBoundingClientRect().height;return Te(Tt),w(kt=>[{toastId:m.id,height:Tt,position:m.position},...kt]),()=>w(kt=>kt.filter(Rt=>Rt.toastId!==m.id))}},[w,m.id]),Pe.useLayoutEffect(()=>{if(!X)return;const Ye=Z.current,Tt=Ye.style.height;Ye.style.height="auto";const kt=Ye.getBoundingClientRect().height;Ye.style.height=Tt,Te(kt),w(Rt=>Rt.find(Pt=>Pt.toastId===m.id)?Rt.map(Pt=>Pt.toastId===m.id?{...Pt,height:kt}:Pt):[{toastId:m.id,height:kt,position:m.position},...Rt])},[X,m.title,m.description,w,m.id,m.jsx,m.action,m.cancel]);const ct=Pe.useCallback(()=>{oe(!0),pe(ft.current),w(Ye=>Ye.filter(Tt=>Tt.toastId!==m.id)),setTimeout(()=>{O(m)},HP)},[m,O,w,ft]);Pe.useEffect(()=>{if(m.promise&&ze==="loading"||m.duration===1/0||m.type==="loading")return;let Ye;return M||x||Fe?(()=>{if(se.current<Qe.current){const Rt=new Date().getTime()-Qe.current;be.current=be.current-Rt}se.current=new Date().getTime()})():(()=>{be.current!==1/0&&(Qe.current=new Date().getTime(),Ye=setTimeout(()=>{m.onAutoClose==null||m.onAutoClose.call(m,m),ct()},be.current))})(),()=>clearTimeout(Ye)},[M,x,m,ze,Fe,ct]),Pe.useEffect(()=>{m.delete&&(ct(),m.onDismiss==null||m.onDismiss.call(m,m))},[ct,m.delete]);function pt(){var Ye;if(L!=null&&L.loading){var Tt;return Pe.createElement("div",{className:Aa(_==null?void 0:_.loader,m==null||(Tt=m.classNames)==null?void 0:Tt.loader,"sonner-loader"),"data-visible":ze==="loading"},L.loading)}return Pe.createElement(wP,{className:Aa(_==null?void 0:_.loader,m==null||(Ye=m.classNames)==null?void 0:Ye.loader),visible:ze==="loading"})}const tt=m.icon||(L==null?void 0:L[ze])||bP(ze);var lt,gt;return Pe.createElement("li",{tabIndex:0,ref:Z,className:Aa(W,De,_==null?void 0:_.toast,m==null||(t=m.classNames)==null?void 0:t.toast,_==null?void 0:_.default,_==null?void 0:_[ze],m==null||(n=m.classNames)==null?void 0:n[ze]),"data-sonner-toast":"","data-rich-colors":(lt=m.richColors)!=null?lt:D,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":X,"data-promise":!!m.promise,"data-swiped":_e,"data-removed":ce,"data-visible":ge,"data-y-position":Ke,"data-x-position":Me,"data-index":T,"data-front":Se,"data-swiping":de,"data-dismissible":He,"data-type":ze,"data-invert":ht,"data-swipe-out":xe,"data-swipe-direction":z,"data-expanded":!!(M||q&&X),"data-testid":m.testId,style:{"--index":T,"--toasts-before":T,"--z-index":C.length-T,"--offset":`${ce?ue:ft.current}px`,"--initial-height":q?"auto":`${ke}px`,...A,...m.style},onDragEnd:()=>{ve(!1),Q(null),je.current=null},onPointerDown:Ye=>{Ye.button!==2&&(Lt||!He||(we.current=new Date,pe(ft.current),Ye.target.setPointerCapture(Ye.pointerId),Ye.target.tagName!=="BUTTON"&&(ve(!0),je.current={x:Ye.clientX,y:Ye.clientY})))},onPointerUp:()=>{var Ye,Tt,kt;if(xe||!He)return;je.current=null;const Rt=Number(((Ye=Z.current)==null?void 0:Ye.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),on=Number(((Tt=Z.current)==null?void 0:Tt.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Pt=new Date().getTime()-((kt=we.current)==null?void 0:kt.getTime()),Xe=V==="x"?Rt:on,Ct=Math.abs(Xe)/Pt;if(Math.abs(Xe)>=UP||Ct>.11){pe(ft.current),m.onDismiss==null||m.onDismiss.call(m,m),Y(V==="x"?Rt>0?"right":"left":on>0?"down":"up"),ct(),Ne(!0);return}else{var $,re;($=Z.current)==null||$.style.setProperty("--swipe-amount-x","0px"),(re=Z.current)==null||re.style.setProperty("--swipe-amount-y","0px")}ee(!1),ve(!1),Q(null)},onPointerMove:Ye=>{var Tt,kt,Rt;if(!je.current||!He||((Tt=window.getSelection())==null?void 0:Tt.toString().length)>0)return;const Pt=Ye.clientY-je.current.y,Xe=Ye.clientX-je.current.x;var Ct;const $=(Ct=e.swipeDirections)!=null?Ct:BP(H);!V&&(Math.abs(Xe)>1||Math.abs(Pt)>1)&&Q(Math.abs(Xe)>Math.abs(Pt)?"x":"y");let re={x:0,y:0};const le=Ee=>1/(1.5+Math.abs(Ee)/20);if(V==="y"){if($.includes("top")||$.includes("bottom"))if($.includes("top")&&Pt<0||$.includes("bottom")&&Pt>0)re.y=Pt;else{const Ee=Pt*le(Pt);re.y=Math.abs(Ee)<Math.abs(Pt)?Ee:Pt}}else if(V==="x"&&($.includes("left")||$.includes("right")))if($.includes("left")&&Xe<0||$.includes("right")&&Xe>0)re.x=Xe;else{const Ee=Xe*le(Xe);re.x=Math.abs(Ee)<Math.abs(Xe)?Ee:Xe}(Math.abs(re.x)>0||Math.abs(re.y)>0)&&ee(!0),(kt=Z.current)==null||kt.style.setProperty("--swipe-amount-x",`${re.x}px`),(Rt=Z.current)==null||Rt.style.setProperty("--swipe-amount-y",`${re.y}px`)}},vt&&!m.jsx&&ze!=="loading"?Pe.createElement("button",{"aria-label":P,"data-disabled":Lt,"data-close-button":!0,onClick:Lt||!He?()=>{}:()=>{ct(),m.onDismiss==null||m.onDismiss.call(m,m)},className:Aa(_==null?void 0:_.closeButton,m==null||(a=m.classNames)==null?void 0:a.closeButton)},(gt=L==null?void 0:L.close)!=null?gt:CP):null,(ze||m.icon||m.promise)&&m.icon!==null&&((L==null?void 0:L[ze])!==null||m.icon)?Pe.createElement("div",{"data-icon":"",className:Aa(_==null?void 0:_.icon,m==null||(s=m.classNames)==null?void 0:s.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||pt():null,m.type!=="loading"?tt:null):null,Pe.createElement("div",{"data-content":"",className:Aa(_==null?void 0:_.content,m==null||(i=m.classNames)==null?void 0:i.content)},Pe.createElement("div",{"data-title":"",className:Aa(_==null?void 0:_.title,m==null||(c=m.classNames)==null?void 0:c.title)},m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title),m.description?Pe.createElement("div",{"data-description":"",className:Aa(K,st,_==null?void 0:_.description,m==null||(d=m.classNames)==null?void 0:d.description)},typeof m.description=="function"?m.description():m.description):null),Pe.isValidElement(m.cancel)?m.cancel:m.cancel&&jf(m.cancel)?Pe.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||j,onClick:Ye=>{jf(m.cancel)&&He&&(m.cancel.onClick==null||m.cancel.onClick.call(m.cancel,Ye),ct())},className:Aa(_==null?void 0:_.cancelButton,m==null||(h=m.classNames)==null?void 0:h.cancelButton)},m.cancel.label):null,Pe.isValidElement(m.action)?m.action:m.action&&jf(m.action)?Pe.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||B,onClick:Ye=>{jf(m.action)&&(m.action.onClick==null||m.action.onClick.call(m.action,Ye),!Ye.defaultPrevented&&ct())},className:Aa(_==null?void 0:_.actionButton,m==null||(f=m.classNames)==null?void 0:f.actionButton)},m.action.label):null)};function l1(){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 VP(e,t){const n={};return[e,t].forEach((a,s)=>{const i=s===1,c=i?"--mobile-offset":"--offset",d=i?IP:LP;function h(f){["top","right","bottom","left"].forEach(g=>{n[`${c}-${g}`]=typeof f=="number"?`${f}px`:f})}typeof a=="number"||typeof a=="string"?h(a):typeof a=="object"?["top","right","bottom","left"].forEach(f=>{a[f]===void 0?n[`${c}-${f}`]=d:n[`${c}-${f}`]=typeof a[f]=="number"?`${a[f]}px`:a[f]}):h(d)}),n}const YP=Pe.forwardRef(function(t,n){const{id:a,invert:s,position:i="bottom-right",hotkey:c=["altKey","KeyT"],expand:d,closeButton:h,className:f,offset:g,mobileOffset:m,theme:b="light",richColors:x,duration:w,style:S,visibleToasts:R=_P,toastOptions:T,dir:C=l1(),gap:M=zP,icons:O,containerAriaLabel:D="Notifications"}=t,[k,A]=Pe.useState([]),j=Pe.useMemo(()=>a?k.filter(X=>X.toasterId===a):k.filter(X=>!X.toasterId),[k,a]),B=Pe.useMemo(()=>Array.from(new Set([i].concat(j.filter(X=>X.position).map(X=>X.position)))),[j,i]),[W,K]=Pe.useState([]),[I,H]=Pe.useState(!1),[F,q]=Pe.useState(!1),[_,L]=Pe.useState(b!=="system"?b:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),P=Pe.useRef(null),V=c.join("+").replace(/Key/g,"").replace(/Digit/g,""),Q=Pe.useRef(null),z=Pe.useRef(!1),Y=Pe.useCallback(X=>{A(G=>{var ce;return(ce=G.find(oe=>oe.id===X.id))!=null&&ce.delete||Or.dismiss(X.id),G.filter(({id:oe})=>oe!==X.id)})},[]);return Pe.useEffect(()=>Or.subscribe(X=>{if(X.dismiss){requestAnimationFrame(()=>{A(G=>G.map(ce=>ce.id===X.id?{...ce,delete:!0}:ce))});return}setTimeout(()=>{yP.flushSync(()=>{A(G=>{const ce=G.findIndex(oe=>oe.id===X.id);return ce!==-1?[...G.slice(0,ce),{...G[ce],...X},...G.slice(ce+1)]:[X,...G]})})})}),[k]),Pe.useEffect(()=>{if(b!=="system"){L(b);return}if(b==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;const X=window.matchMedia("(prefers-color-scheme: dark)");try{X.addEventListener("change",({matches:G})=>{L(G?"dark":"light")})}catch{X.addListener(({matches:ce})=>{try{L(ce?"dark":"light")}catch(oe){console.error(oe)}})}},[b]),Pe.useEffect(()=>{k.length<=1&&H(!1)},[k]),Pe.useEffect(()=>{const X=G=>{var ce;if(c.every(ve=>G[ve]||G.code===ve)){var de;H(!0),(de=P.current)==null||de.focus()}G.code==="Escape"&&(document.activeElement===P.current||(ce=P.current)!=null&&ce.contains(document.activeElement))&&H(!1)};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[c]),Pe.useEffect(()=>{if(P.current)return()=>{Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null,z.current=!1)}},[P.current]),Pe.createElement("section",{ref:n,"aria-label":`${D} ${V}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},B.map((X,G)=>{var ce;const[oe,de]=X.split("-");return j.length?Pe.createElement("ol",{key:X,dir:C==="auto"?l1():C,tabIndex:-1,ref:P,className:f,"data-sonner-toaster":!0,"data-sonner-theme":_,"data-y-position":oe,"data-x-position":de,style:{"--front-toast-height":`${((ce=W[0])==null?void 0:ce.height)||0}px`,"--width":`${PP}px`,"--gap":`${M}px`,...S,...VP(g,m)},onBlur:ve=>{z.current&&!ve.currentTarget.contains(ve.relatedTarget)&&(z.current=!1,Q.current&&(Q.current.focus({preventScroll:!0}),Q.current=null))},onFocus:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||z.current||(z.current=!0,Q.current=ve.relatedTarget)},onMouseEnter:()=>H(!0),onMouseMove:()=>H(!0),onMouseLeave:()=>{F||H(!1)},onDragEnd:()=>H(!1),onPointerDown:ve=>{ve.target instanceof HTMLElement&&ve.target.dataset.dismissible==="false"||q(!0)},onPointerUp:()=>q(!1)},j.filter(ve=>!ve.position&&G===0||ve.position===X).map((ve,xe)=>{var Ne,_e;return Pe.createElement(FP,{key:ve.id,icons:O,index:xe,toast:ve,defaultRichColors:x,duration:(Ne=T==null?void 0:T.duration)!=null?Ne:w,className:T==null?void 0:T.className,descriptionClassName:T==null?void 0:T.descriptionClassName,invert:s,visibleToasts:R,closeButton:(_e=T==null?void 0:T.closeButton)!=null?_e:h,interacting:F,position:X,style:T==null?void 0:T.style,unstyled:T==null?void 0:T.unstyled,classNames:T==null?void 0:T.classNames,cancelButtonStyle:T==null?void 0:T.cancelButtonStyle,actionButtonStyle:T==null?void 0:T.actionButtonStyle,closeButtonAriaLabel:T==null?void 0:T.closeButtonAriaLabel,removeToast:Y,toasts:j.filter(ee=>ee.position==ve.position),heights:W.filter(ee=>ee.position==ve.position),setHeights:K,expandByDefault:d,gap:M,expanded:I,swipeDirections:t.swipeDirections})})):null}))}),Ot=e=>typeof e=="string",au=()=>{let e,t;const n=new Promise((a,s)=>{e=a,t=s});return n.resolve=e,n.reject=t,n},c1=e=>e==null?"":""+e,qP=(e,t,n)=>{e.forEach(a=>{t[a]&&(n[a]=t[a])})},$P=/###/g,u1=e=>e&&e.indexOf("###")>-1?e.replace($P,"."):e,d1=e=>!e||Ot(e),vu=(e,t,n)=>{const a=Ot(t)?t.split("."):t;let s=0;for(;s<a.length-1;){if(d1(e))return{};const i=u1(a[s]);!e[i]&&n&&(e[i]=new n),Object.prototype.hasOwnProperty.call(e,i)?e=e[i]:e={},++s}return d1(e)?{}:{obj:e,k:u1(a[s])}},f1=(e,t,n)=>{const{obj:a,k:s}=vu(e,t,Object);if(a!==void 0||t.length===1){a[s]=n;return}let i=t[t.length-1],c=t.slice(0,t.length-1),d=vu(e,c,Object);for(;d.obj===void 0&&c.length;)i=`${c[c.length-1]}.${i}`,c=c.slice(0,c.length-1),d=vu(e,c,Object),d!=null&&d.obj&&typeof d.obj[`${d.k}.${i}`]<"u"&&(d.obj=void 0);d.obj[`${d.k}.${i}`]=n},KP=(e,t,n,a)=>{const{obj:s,k:i}=vu(e,t,Object);s[i]=s[i]||[],s[i].push(n)},vh=(e,t)=>{const{obj:n,k:a}=vu(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,a))return n[a]},GP=(e,t,n)=>{const a=vh(e,n);return a!==void 0?a:vh(t,n)},vC=(e,t,n)=>{for(const a in t)a!=="__proto__"&&a!=="constructor"&&(a in e?Ot(e[a])||e[a]instanceof String||Ot(t[a])||t[a]instanceof String?n&&(e[a]=t[a]):vC(e[a],t[a],n):e[a]=t[a]);return e},ul=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var XP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const WP=e=>Ot(e)?e.replace(/[&<>"'\/]/g,t=>XP[t]):e;class QP{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 a=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,a),this.regExpQueue.push(t),a}}const ZP=[" ",",","?","!",";"],JP=new QP(20),e5=(e,t,n)=>{t=t||"",n=n||"";const a=ZP.filter(c=>t.indexOf(c)<0&&n.indexOf(c)<0);if(a.length===0)return!0;const s=JP.getRegExp(`(${a.map(c=>c==="?"?"\\?":c).join("|")})`);let i=!s.test(e);if(!i){const c=e.indexOf(n);c>0&&!s.test(e.substring(0,c))&&(i=!0)}return i},Xy=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const a=t.split(n);let s=e;for(let i=0;i<a.length;){if(!s||typeof s!="object")return;let c,d="";for(let h=i;h<a.length;++h)if(h!==i&&(d+=n),d+=a[h],c=s[d],c!==void 0){if(["string","number","boolean"].indexOf(typeof c)>-1&&h<a.length-1)continue;i+=h-i+1;break}s=c}return s},Lu=e=>e==null?void 0:e.replace("_","-"),t5={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,a;(a=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||a.call(n,console,t)}};class bh{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||t5,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,a,s){return s&&!this.debug?null:(Ot(t[0])&&(t[0]=`${a}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new bh(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new bh(this.logger,t)}}var Ia=new bh;class $h{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(a=>{this.observers[a]||(this.observers[a]=new Map);const s=this.observers[a].get(n)||0;this.observers[a].set(n,s+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(([s,i])=>{for(let c=0;c<i;c++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,i])=>{for(let c=0;c<i;c++)s.apply(s,[t,...n])})}}class h1 extends $h{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,a,s={}){var f,g;const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,c=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let d;t.indexOf(".")>-1?d=t.split("."):(d=[t,n],a&&(Array.isArray(a)?d.push(...a):Ot(a)&&i?d.push(...a.split(i)):d.push(a)));const h=vh(this.data,d);return!h&&!n&&!a&&t.indexOf(".")>-1&&(t=d[0],n=d[1],a=d.slice(2).join(".")),h||!c||!Ot(a)?h:Xy((g=(f=this.data)==null?void 0:f[t])==null?void 0:g[n],a,i)}addResource(t,n,a,s,i={silent:!1}){const c=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let d=[t,n];a&&(d=d.concat(c?a.split(c):a)),t.indexOf(".")>-1&&(d=t.split("."),s=n,n=d[1]),this.addNamespaces(n),f1(this.data,d,s),i.silent||this.emit("added",t,n,a,s)}addResources(t,n,a,s={silent:!1}){for(const i in a)(Ot(a[i])||Array.isArray(a[i]))&&this.addResource(t,n,i,a[i],{silent:!0});s.silent||this.emit("added",t,n,a)}addResourceBundle(t,n,a,s,i,c={silent:!1,skipCopy:!1}){let d=[t,n];t.indexOf(".")>-1&&(d=t.split("."),s=a,a=n,n=d[1]),this.addNamespaces(n);let h=vh(this.data,d)||{};c.skipCopy||(a=JSON.parse(JSON.stringify(a))),s?vC(h,a,i):h={...h,...a},f1(this.data,d,h),c.silent||this.emit("added",t,n,a)}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(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var bC={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,a,s){return e.forEach(i=>{var c;t=((c=this.processors[i])==null?void 0:c.process(t,n,a,s))??t}),t}};const xC=Symbol("i18next/PATH_KEY");function n5(){const e=[],t=Object.create(null);let n;return t.get=(a,s)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),s===xC?e:(e.push(s),n=Proxy.revocable(a,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function Wy(e,t){const{[xC]:n}=e(n5());return n.join((t==null?void 0:t.keySeparator)??".")}const m1={},Yg=e=>!Ot(e)&&typeof e!="boolean"&&typeof e!="number";class xh extends $h{constructor(t,n={}){super(),qP(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ia.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const a={...n};if(t==null)return!1;const s=this.resolve(t,a);if((s==null?void 0:s.res)===void 0)return!1;const i=Yg(s.res);return!(a.returnObjects===!1&&i)}extractFromKey(t,n){let a=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;a===void 0&&(a=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const c=a&&t.indexOf(a)>-1,d=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!e5(t,a,s);if(c&&!d){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Ot(i)?[i]:i};const f=t.split(a);(a!==s||a===s&&this.options.ns.indexOf(f[0])>-1)&&(i=f.shift()),t=f.join(s)}return{key:t,namespaces:Ot(i)?[i]:i}}translate(t,n,a){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=Wy(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]);const i=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,c=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:d,namespaces:h}=this.extractFromKey(t[t.length-1],s),f=h[h.length-1];let g=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;g===void 0&&(g=":");const m=s.lng||this.language,b=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((m==null?void 0:m.toLowerCase())==="cimode")return b?i?{res:`${f}${g}${d}`,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:`${f}${g}${d}`:i?{res:d,usedKey:d,exactUsedKey:d,usedLng:m,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:d;const x=this.resolve(t,s);let w=x==null?void 0:x.res;const S=(x==null?void 0:x.usedKey)||d,R=(x==null?void 0:x.exactUsedKey)||d,T=["[object Number]","[object Function]","[object RegExp]"],C=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,M=!this.i18nFormat||this.i18nFormat.handleAsObject,O=s.count!==void 0&&!Ot(s.count),D=xh.hasDefaultValue(s),k=O?this.pluralResolver.getSuffix(m,s.count,s):"",A=s.ordinal&&O?this.pluralResolver.getSuffix(m,s.count,{ordinal:!1}):"",j=O&&!s.ordinal&&s.count===0,B=j&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${k}`]||s[`defaultValue${A}`]||s.defaultValue;let W=w;M&&!w&&D&&(W=B);const K=Yg(W),I=Object.prototype.toString.apply(W);if(M&&W&&K&&T.indexOf(I)<0&&!(Ot(C)&&Array.isArray(W))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const H=this.options.returnedObjectHandler?this.options.returnedObjectHandler(S,W,{...s,ns:h}):`key '${d} (${this.language})' returned an object instead of string.`;return i?(x.res=H,x.usedParams=this.getUsedParamsDetails(s),x):H}if(c){const H=Array.isArray(W),F=H?[]:{},q=H?R:S;for(const _ in W)if(Object.prototype.hasOwnProperty.call(W,_)){const L=`${q}${c}${_}`;D&&!w?F[_]=this.translate(L,{...s,defaultValue:Yg(B)?B[_]:void 0,joinArrays:!1,ns:h}):F[_]=this.translate(L,{...s,joinArrays:!1,ns:h}),F[_]===L&&(F[_]=W[_])}w=F}}else if(M&&Ot(C)&&Array.isArray(w))w=w.join(C),w&&(w=this.extendTranslation(w,t,s,a));else{let H=!1,F=!1;!this.isValidLookup(w)&&D&&(H=!0,w=B),this.isValidLookup(w)||(F=!0,w=d);const _=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&F?void 0:w,L=D&&B!==w&&this.options.updateMissing;if(F||H||L){if(this.logger.log(L?"updateKey":"missingKey",m,f,d,L?B:w),c){const z=this.resolve(d,{...s,keySeparator:!1});z&&z.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 P=[];const V=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&V&&V[0])for(let z=0;z<V.length;z++)P.push(V[z]);else this.options.saveMissingTo==="all"?P=this.languageUtils.toResolveHierarchy(s.lng||this.language):P.push(s.lng||this.language);const Q=(z,Y,X)=>{var ce;const G=D&&X!==w?X:_;this.options.missingKeyHandler?this.options.missingKeyHandler(z,f,Y,G,L,s):(ce=this.backendConnector)!=null&&ce.saveMissing&&this.backendConnector.saveMissing(z,f,Y,G,L,s),this.emit("missingKey",z,f,Y,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?P.forEach(z=>{const Y=this.pluralResolver.getSuffixes(z,s);j&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(X=>{Q([z],d+X,s[`defaultValue${X}`]||B)})}):Q(P,d,B))}w=this.extendTranslation(w,t,s,x,a),F&&w===d&&this.options.appendNamespaceToMissingKey&&(w=`${f}${g}${d}`),(F||H)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${g}${d}`:d,H?w:void 0,s))}return i?(x.res=w,x.usedParams=this.getUsedParamsDetails(s),x):w}extendTranslation(t,n,a,s,i){var h,f;if((h=this.i18nFormat)!=null&&h.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...a},a.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!a.skipInterpolation){a.interpolation&&this.interpolator.init({...a,interpolation:{...this.options.interpolation,...a.interpolation}});const g=Ot(t)&&(((f=a==null?void 0:a.interpolation)==null?void 0:f.skipOnVariables)!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let m;if(g){const x=t.match(this.interpolator.nestingRegexp);m=x&&x.length}let b=a.replace&&!Ot(a.replace)?a.replace:a;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),t=this.interpolator.interpolate(t,b,a.lng||this.language||s.usedLng,a),g){const x=t.match(this.interpolator.nestingRegexp),w=x&&x.length;m<w&&(a.nest=!1)}!a.lng&&s&&s.res&&(a.lng=this.language||s.usedLng),a.nest!==!1&&(t=this.interpolator.nest(t,(...x)=>(i==null?void 0:i[0])===x[0]&&!a.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${n[0]}`),null):this.translate(...x,n),a)),a.interpolation&&this.interpolator.reset()}const c=a.postProcess||this.options.postProcess,d=Ot(c)?[c]:c;return t!=null&&(d!=null&&d.length)&&a.applyPostProcessor!==!1&&(t=bC.handle(d,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(a)},...a}:a,this)),t}resolve(t,n={}){let a,s,i,c,d;return Ot(t)&&(t=[t]),t.forEach(h=>{if(this.isValidLookup(a))return;const f=this.extractFromKey(h,n),g=f.key;s=g;let m=f.namespaces;this.options.fallbackNS&&(m=m.concat(this.options.fallbackNS));const b=n.count!==void 0&&!Ot(n.count),x=b&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(Ot(n.context)||typeof n.context=="number")&&n.context!=="",S=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);m.forEach(R=>{var T,C;this.isValidLookup(a)||(d=R,!m1[`${S[0]}-${R}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((C=this.utils)!=null&&C.hasLoadedNamespace(d))&&(m1[`${S[0]}-${R}`]=!0,this.logger.warn(`key "${s}" for languages "${S.join(", ")}" won't get resolved as namespace "${d}" 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!!!")),S.forEach(M=>{var k;if(this.isValidLookup(a))return;c=M;const O=[g];if((k=this.i18nFormat)!=null&&k.addLookupKeys)this.i18nFormat.addLookupKeys(O,g,M,R,n);else{let A;b&&(A=this.pluralResolver.getSuffix(M,n.count,n));const j=`${this.options.pluralSeparator}zero`,B=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(n.ordinal&&A.indexOf(B)===0&&O.push(g+A.replace(B,this.options.pluralSeparator)),O.push(g+A),x&&O.push(g+j)),w){const W=`${g}${this.options.contextSeparator||"_"}${n.context}`;O.push(W),b&&(n.ordinal&&A.indexOf(B)===0&&O.push(W+A.replace(B,this.options.pluralSeparator)),O.push(W+A),x&&O.push(W+j))}}let D;for(;D=O.pop();)this.isValidLookup(a)||(i=D,a=this.getResource(M,R,D,n))}))})}),{res:a,usedKey:s,exactUsedKey:i,usedLng:c,usedNS:d}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,a,s={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(t,n,a,s):this.resourceStore.getResource(t,n,a,s)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],a=t.replace&&!Ot(t.replace);let s=a?t.replace:t;if(a&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!a){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(t){const n="defaultValue";for(const a in t)if(Object.prototype.hasOwnProperty.call(t,a)&&n===a.substring(0,n.length)&&t[a]!==void 0)return!0;return!1}}class p1{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ia.create("languageUtils")}getScriptPartFromCode(t){if(t=Lu(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=Lu(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Ot(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(a=>{if(n)return;const s=this.formatLanguageCode(a);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(a=>{if(n)return;const s=this.getScriptPartFromCode(a);if(this.isSupportedCode(s))return n=s;const i=this.getLanguagePartFromCode(a);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(c=>{if(c===i)return c;if(!(c.indexOf("-")<0&&i.indexOf("-")<0)&&(c.indexOf("-")>0&&i.indexOf("-")<0&&c.substring(0,c.indexOf("-"))===i||c.indexOf(i)===0&&i.length>1))return c})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Ot(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let a=t[n];return a||(a=t[this.getScriptPartFromCode(n)]),a||(a=t[this.formatLanguageCode(n)]),a||(a=t[this.getLanguagePartFromCode(n)]),a||(a=t.default),a||[]}toResolveHierarchy(t,n){const a=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),s=[],i=c=>{c&&(this.isSupportedCode(c)?s.push(c):this.logger.warn(`rejecting language code not found in supportedLngs: ${c}`))};return Ot(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(t))):Ot(t)&&i(this.formatLanguageCode(t)),a.forEach(c=>{s.indexOf(c)<0&&i(this.formatLanguageCode(c))}),s}}const g1={zero:0,one:1,two:2,few:3,many:4,other:5},y1={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class r5{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Ia.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const a=Lu(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:a,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let c;try{c=new Intl.PluralRules(a,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),y1;if(!t.match(/-|_/))return y1;const h=this.languageUtils.getLanguagePartFromCode(t);c=this.getRule(h,n)}return this.pluralRulesCache[i]=c,c}needsPlural(t,n={}){let a=this.getRule(t,n);return a||(a=this.getRule("dev",n)),(a==null?void 0:a.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,a={}){return this.getSuffixes(t,a).map(s=>`${n}${s}`)}getSuffixes(t,n={}){let a=this.getRule(t,n);return a||(a=this.getRule("dev",n)),a?a.resolvedOptions().pluralCategories.sort((s,i)=>g1[s]-g1[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n,a={}){const s=this.getRule(t,a);return s?`${this.options.prepend}${a.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,a))}}const v1=(e,t,n,a=".",s=!0)=>{let i=GP(e,t,n);return!i&&s&&Ot(n)&&(i=Xy(e,n,a),i===void 0&&(i=Xy(t,n,a))),i},qg=e=>e.replace(/\$/g,"$$$$");class b1{constructor(t={}){var n;this.logger=Ia.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(a=>a),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:a,useRawValueToEscape:s,prefix:i,prefixEscaped:c,suffix:d,suffixEscaped:h,formatSeparator:f,unescapeSuffix:g,unescapePrefix:m,nestingPrefix:b,nestingPrefixEscaped:x,nestingSuffix:w,nestingSuffixEscaped:S,nestingOptionsSeparator:R,maxReplaces:T,alwaysFormat:C}=t.interpolation;this.escape=n!==void 0?n:WP,this.escapeValue=a!==void 0?a:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?ul(i):c||"{{",this.suffix=d?ul(d):h||"}}",this.formatSeparator=f||",",this.unescapePrefix=g?"":m||"-",this.unescapeSuffix=this.unescapePrefix?"":g||"",this.nestingPrefix=b?ul(b):x||ul("$t("),this.nestingSuffix=w?ul(w):S||ul(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=T||1e3,this.alwaysFormat=C!==void 0?C:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,a)=>(n==null?void 0:n.source)===a?(n.lastIndex=0,n):new RegExp(a,"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,a,s){var x;let i,c,d;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=w=>{if(w.indexOf(this.formatSeparator)<0){const C=v1(n,h,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(C,void 0,a,{...s,...n,interpolationkey:w}):C}const S=w.split(this.formatSeparator),R=S.shift().trim(),T=S.join(this.formatSeparator).trim();return this.format(v1(n,h,R,this.options.keySeparator,this.options.ignoreJSONStructure),T,a,{...s,...n,interpolationkey:R})};this.resetRegExp();const g=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,m=((x=s==null?void 0:s.interpolation)==null?void 0:x.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>qg(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?qg(this.escape(w)):qg(w)}].forEach(w=>{for(d=0;i=w.regex.exec(t);){const S=i[1].trim();if(c=f(S),c===void 0)if(typeof g=="function"){const T=g(t,i,s);c=Ot(T)?T:""}else if(s&&Object.prototype.hasOwnProperty.call(s,S))c="";else if(m){c=i[0];continue}else this.logger.warn(`missed to pass in variable ${S} for interpolating ${t}`),c="";else!Ot(c)&&!this.useRawValueToEscape&&(c=c1(c));const R=w.safeValue(c);if(t=t.replace(i[0],R),m?(w.regex.lastIndex+=c.length,w.regex.lastIndex-=i[0].length):w.regex.lastIndex=0,d++,d>=this.maxReplaces)break}}),t}nest(t,n,a={}){let s,i,c;const d=(h,f)=>{const g=this.nestingOptionsSeparator;if(h.indexOf(g)<0)return h;const m=h.split(new RegExp(`${g}[ ]*{`));let b=`{${m[1]}`;h=m[0],b=this.interpolate(b,c);const x=b.match(/'/g),w=b.match(/"/g);(((x==null?void 0:x.length)??0)%2===0&&!w||w.length%2!==0)&&(b=b.replace(/'/g,'"'));try{c=JSON.parse(b),f&&(c={...f,...c})}catch(S){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,S),`${h}${g}${b}`}return c.defaultValue&&c.defaultValue.indexOf(this.prefix)>-1&&delete c.defaultValue,h};for(;s=this.nestingRegexp.exec(t);){let h=[];c={...a},c=c.replace&&!Ot(c.replace)?c.replace:c,c.applyPostProcessor=!1,delete c.defaultValue;const f=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(f!==-1&&(h=s[1].slice(f).split(this.formatSeparator).map(g=>g.trim()).filter(Boolean),s[1]=s[1].slice(0,f)),i=n(d.call(this,s[1].trim(),c),c),i&&s[0]===t&&!Ot(i))return i;Ot(i)||(i=c1(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),i=""),h.length&&(i=h.reduce((g,m)=>this.format(g,m,a.lng,{...a,interpolationkey:s[1].trim()}),i.trim())),t=t.replace(s[0],i),this.regexp.lastIndex=0}return t}}const a5=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const a=e.split("(");t=a[0].toLowerCase().trim();const s=a[1].substring(0,a[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(c=>{if(c){const[d,...h]=c.split(":"),f=h.join(":").trim().replace(/^'+|'+$/g,""),g=d.trim();n[g]||(n[g]=f),f==="false"&&(n[g]=!1),f==="true"&&(n[g]=!0),isNaN(f)||(n[g]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},x1=e=>{const t={};return(n,a,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const c=a+JSON.stringify(i);let d=t[c];return d||(d=e(Lu(a),s),t[c]=d),d(n)}},o5=e=>(t,n,a)=>e(Lu(n),a)(t);class s5{constructor(t={}){this.logger=Ia.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const a=n.cacheInBuiltFormats?x1:o5;this.formats={number:a((s,i)=>{const c=new Intl.NumberFormat(s,{...i});return d=>c.format(d)}),currency:a((s,i)=>{const c=new Intl.NumberFormat(s,{...i,style:"currency"});return d=>c.format(d)}),datetime:a((s,i)=>{const c=new Intl.DateTimeFormat(s,{...i});return d=>c.format(d)}),relativetime:a((s,i)=>{const c=new Intl.RelativeTimeFormat(s,{...i});return d=>c.format(d,i.range||"day")}),list:a((s,i)=>{const c=new Intl.ListFormat(s,{...i});return d=>c.format(d)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=x1(n)}format(t,n,a,s={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(d=>d.indexOf(")")>-1)){const d=i.findIndex(h=>h.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,d)].join(this.formatSeparator)}return i.reduce((d,h)=>{var m;const{formatName:f,formatOptions:g}=a5(h);if(this.formats[f]){let b=d;try{const x=((m=s==null?void 0:s.formatParams)==null?void 0:m[s.interpolationkey])||{},w=x.locale||x.lng||s.locale||s.lng||a;b=this.formats[f](d,w,{...g,...s,...x})}catch(x){this.logger.warn(x)}return b}else this.logger.warn(`there was no format function for ${f}`);return d},t)}}const i5=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class l5 extends $h{constructor(t,n,a,s={}){var i,c;super(),this.backend=t,this.store=n,this.services=a,this.languageUtils=a.languageUtils,this.options=s,this.logger=Ia.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(c=(i=this.backend)==null?void 0:i.init)==null||c.call(i,a,s.backend,s)}queueLoad(t,n,a,s){const i={},c={},d={},h={};return t.forEach(f=>{let g=!0;n.forEach(m=>{const b=`${f}|${m}`;!a.reload&&this.store.hasResourceBundle(f,m)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?c[b]===void 0&&(c[b]=!0):(this.state[b]=1,g=!1,c[b]===void 0&&(c[b]=!0),i[b]===void 0&&(i[b]=!0),h[m]===void 0&&(h[m]=!0)))}),g||(d[f]=!0)}),(Object.keys(i).length||Object.keys(c).length)&&this.queue.push({pending:c,pendingCount:Object.keys(c).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(c),toLoadLanguages:Object.keys(d),toLoadNamespaces:Object.keys(h)}}loaded(t,n,a){const s=t.split("|"),i=s[0],c=s[1];n&&this.emit("failedLoading",i,c,n),!n&&a&&this.store.addResourceBundle(i,c,a,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&a&&(this.state[t]=0);const d={};this.queue.forEach(h=>{KP(h.loaded,[i],c),i5(h,t),n&&h.errors.push(n),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(f=>{d[f]||(d[f]={});const g=h.loaded[f];g.length&&g.forEach(m=>{d[f][m]===void 0&&(d[f][m]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",d),this.queue=this.queue.filter(h=>!h.done)}read(t,n,a,s=0,i=this.retryTimeout,c){if(!t.length)return c(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:a,tried:s,wait:i,callback:c});return}this.readingCalls++;const d=(f,g)=>{if(this.readingCalls--,this.waitingReads.length>0){const m=this.waitingReads.shift();this.read(m.lng,m.ns,m.fcName,m.tried,m.wait,m.callback)}if(f&&g&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,a,s+1,i*2,c)},i);return}c(f,g)},h=this.backend[a].bind(this.backend);if(h.length===2){try{const f=h(t,n);f&&typeof f.then=="function"?f.then(g=>d(null,g)).catch(d):d(null,f)}catch(f){d(f)}return}return h(t,n,d)}prepareLoading(t,n,a={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Ot(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ot(n)&&(n=[n]);const i=this.queueLoad(t,n,a,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(c=>{this.loadOne(c)})}load(t,n,a){this.prepareLoading(t,n,{},a)}reload(t,n,a){this.prepareLoading(t,n,{reload:!0},a)}loadOne(t,n=""){const a=t.split("|"),s=a[0],i=a[1];this.read(s,i,"read",void 0,void 0,(c,d)=>{c&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,c),!c&&d&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,d),this.loaded(t,c,d)})}saveMissing(t,n,a,s,i,c={},d=()=>{}){var h,f,g,m,b;if((f=(h=this.services)==null?void 0:h.utils)!=null&&f.hasLoadedNamespace&&!((m=(g=this.services)==null?void 0:g.utils)!=null&&m.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${a}" 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(!(a==null||a==="")){if((b=this.backend)!=null&&b.create){const x={...c,isUpdate:i},w=this.backend.create.bind(this.backend);if(w.length<6)try{let S;w.length===5?S=w(t,n,a,s,x):S=w(t,n,a,s),S&&typeof S.then=="function"?S.then(R=>d(null,R)).catch(d):d(null,S)}catch(S){d(S)}else w(t,n,a,s,d,x)}!t||!t[0]||this.store.addResource(t[0],n,a,s)}}}const $g=()=>({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]),Ot(e[1])&&(t.defaultValue=e[1]),Ot(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(a=>{t[a]=n[a]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),w1=e=>{var t,n;return Ot(e.ns)&&(e.ns=[e.ns]),Ot(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ot(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},_f=()=>{},c5=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},u5=e=>{var t,n,a,s,i,c,d,h,f;return!!(((a=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:a.indexOf("Locize"))>0||((d=(c=(i=(s=e==null?void 0:e.modules)==null?void 0:s.backend)==null?void 0:i.constructor)==null?void 0:c.name)==null?void 0:d.indexOf("Locize"))>0||(f=(h=e==null?void 0:e.options)==null?void 0:h.backend)!=null&&f.backends&&e.options.backend.backends.some(g=>{var m,b,x;return((m=g==null?void 0:g.name)==null?void 0:m.indexOf("Locize"))>0||((x=(b=g==null?void 0:g.constructor)==null?void 0:b.name)==null?void 0:x.indexOf("Locize"))>0}))};class bu extends $h{constructor(t={},n){if(super(),this.options=w1(t),this.services={},this.logger=Ia,this.modules={external:[]},c5(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&&(Ot(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const a=$g();this.options={...a,...this.options,...w1(t)},this.options.interpolation={...a.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=a.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!u5(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 s=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?Ia.init(s(this.modules.logger),this.options):Ia.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=s5;const g=new p1(this.options);this.store=new h1(this.options.resources,this.options);const m=this.services;m.logger=Ia,m.resourceStore=this.store,m.languageUtils=g,m.pluralResolver=new r5(g,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==a.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"),f&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(m.formatter=s(f),m.formatter.init&&m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new b1(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new l5(s(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",(x,...w)=>{this.emit(x,...w)}),this.modules.languageDetector&&(m.languageDetector=s(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=s(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new xh(this.services,this.options),this.translator.on("*",(x,...w)=>{this.emit(x,...w)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,n||(n=_f),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[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(f=>{this[f]=(...g)=>this.store[f](...g)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...g)=>(this.store[f](...g),this)});const d=au(),h=()=>{const f=(g,m)=>{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),d.resolve(m),n(g,m)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),d}loadResources(t,n=_f){var i,c;let a=n;const s=Ot(t)?t:this.language;if(typeof t=="function"&&(a=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return a();const d=[],h=f=>{if(!f||f==="cimode")return;this.services.languageUtils.toResolveHierarchy(f).forEach(m=>{m!=="cimode"&&d.indexOf(m)<0&&d.push(m)})};s?h(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(g=>h(g)),(c=(i=this.options.preload)==null?void 0:i.forEach)==null||c.call(i,f=>h(f)),this.services.backendConnector.load(d,this.options.ns,f=>{!f&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),a(f)})}else a(null)}reloadResources(t,n,a){const s=au();return typeof t=="function"&&(a=t,t=void 0),typeof n=="function"&&(a=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),a||(a=_f),this.services.backendConnector.reload(t,n,i=>{s.resolve(),a(i)}),s}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"&&bC.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 a=this.languages[n];if(!(["cimode","dev"].indexOf(a)>-1)&&this.store.hasLanguageSomeTranslations(a)){this.resolvedLanguage=a;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 a=au();this.emit("languageChanging",t);const s=d=>{this.language=d,this.languages=this.services.languageUtils.toResolveHierarchy(d),this.resolvedLanguage=void 0,this.setResolvedLanguage(d)},i=(d,h)=>{h?this.isLanguageChangingTo===t&&(s(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,a.resolve((...f)=>this.t(...f)),n&&n(d,(...f)=>this.t(...f))},c=d=>{var g,m;!t&&!d&&this.services.languageDetector&&(d=[]);const h=Ot(d)?d:d&&d[0],f=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Ot(d)?[d]:d);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),(m=(g=this.services.languageDetector)==null?void 0:g.cacheUserLanguage)==null||m.call(g,f)),this.loadResources(f,b=>{i(b,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?c(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(c):this.services.languageDetector.detect(c):c(t),a}getFixedT(t,n,a){const s=(i,c,...d)=>{let h;typeof c!="object"?h=this.options.overloadTranslationOptionHandler([i,c].concat(d)):h={...c},h.lng=h.lng||s.lng,h.lngs=h.lngs||s.lngs,h.ns=h.ns||s.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||a||s.keyPrefix);const f=this.options.keySeparator||".";let g;return h.keyPrefix&&Array.isArray(i)?g=i.map(m=>(typeof m=="function"&&(m=Wy(m,{...this.options,...c})),`${h.keyPrefix}${f}${m}`)):(typeof i=="function"&&(i=Wy(i,{...this.options,...c})),g=h.keyPrefix?`${h.keyPrefix}${f}${i}`:i),this.t(g,h)};return Ot(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=a,s}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 a=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;const c=(d,h)=>{const f=this.services.backendConnector.state[`${d}|${h}`];return f===-1||f===0||f===2};if(n.precheck){const d=n.precheck(this,c);if(d!==void 0)return d}return!!(this.hasResourceBundle(a,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||c(a,t)&&(!s||c(i,t)))}loadNamespaces(t,n){const a=au();return this.options.ns?(Ot(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{a.resolve(),n&&n(s)}),a):(n&&n(),Promise.resolve())}loadLanguages(t,n){const a=au();Ot(t)&&(t=[t]);const s=this.options.preload||[],i=t.filter(c=>s.indexOf(c)<0&&this.services.languageUtils.isSupportedCode(c));return i.length?(this.options.preload=s.concat(i),this.loadResources(c=>{a.resolve(),n&&n(c)}),a):(n&&n(),Promise.resolve())}dir(t){var s,i;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const c=new Intl.Locale(t);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.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"],a=((i=this.services)==null?void 0:i.languageUtils)||new p1($g());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(a.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const a=new bu(t,n);return a.createInstance=bu.createInstance,a}cloneInstance(t={},n=_f){const a=t.forkResourceStore;a&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},i=new bu(s);if((t.debug!==void 0||t.prefix!==void 0)&&(i.logger=i.logger.clone(t)),["store","services","language"].forEach(d=>{i[d]=this[d]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},a){const d=Object.keys(this.store.data).reduce((h,f)=>(h[f]={...this.store.data[f]},h[f]=Object.keys(h[f]).reduce((g,m)=>(g[m]={...h[f][m]},g),h[f]),h),{});i.store=new h1(d,s),i.services.resourceStore=i.store}if(t.interpolation){const h={...$g().interpolation,...this.options.interpolation,...t.interpolation},f={...s,interpolation:h};i.services.interpolator=new b1(f)}return i.translator=new xh(i.services,s),i.translator.on("*",(d,...h)=>{i.emit(d,...h)}),i.init(s,n),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const $t=bu.createInstance();$t.createInstance;$t.dir;$t.init;$t.loadResources;$t.reloadResources;$t.use;$t.changeLanguage;$t.getFixedT;$t.t;$t.exists;$t.setDefaultNamespace;$t.hasLoadedNamespace;$t.loadNamespaces;$t.loadLanguages;var d5=function(t){return{type:"backend",init:function(a,s,i){},read:function(a,s,i){if(typeof t=="function"){if(t.length<3){try{var c=t(a,s);c&&typeof c.then=="function"?c.then(function(d){return i(null,d&&d.default||d)}).catch(i):i(null,c)}catch(d){i(d)}return}t(a,s,i);return}i(null,t&&t[a]&&t[a][s])}}};const f5=(e,t,n,a)=>{var i,c,d,h;const s=[n,{code:t,...a||{}}];if((c=(i=e==null?void 0:e.services)==null?void 0:i.logger)!=null&&c.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);bi(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(h=(d=e==null?void 0:e.services)==null?void 0:d.logger)!=null&&h.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},S1={},wC=(e,t,n,a)=>{bi(n)&&S1[n]||(bi(n)&&(S1[n]=new Date),f5(e,t,n,a))},SC=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},Qy=(e,t,n)=>{e.loadNamespaces(t,SC(e,n))},E1=(e,t,n,a)=>{if(bi(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return Qy(e,n,a);n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,SC(e,a))},h5=(e,t,n={})=>!t.languages||!t.languages.length?(wC(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(a,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!s(a.isLanguageChangingTo,e))return!1}}),bi=e=>typeof e=="string",m5=e=>typeof e=="object"&&e!==null,p5=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,g5={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},y5=e=>g5[e],v5=e=>e.replace(p5,y5);let Zy={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:v5,transDefaultProps:void 0};const b5=(e={})=>{Zy={...Zy,...e}},x5=()=>Zy;let EC;const w5=e=>{EC=e},S5=()=>EC,E5={type:"3rdParty",init(e){b5(e.options.react),w5(e)}},R5=y.createContext();class T5{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Kg={exports:{}},Gg={};/**
63
+ * @license React
64
+ * use-sync-external-store-shim.production.js
65
+ *
66
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
67
+ *
68
+ * This source code is licensed under the MIT license found in the
69
+ * LICENSE file in the root directory of this source tree.
70
+ */var R1;function C5(){if(R1)return Gg;R1=1;var e=Xu();function t(m,b){return m===b&&(m!==0||1/m===1/b)||m!==m&&b!==b}var n=typeof Object.is=="function"?Object.is:t,a=e.useState,s=e.useEffect,i=e.useLayoutEffect,c=e.useDebugValue;function d(m,b){var x=b(),w=a({inst:{value:x,getSnapshot:b}}),S=w[0].inst,R=w[1];return i(function(){S.value=x,S.getSnapshot=b,h(S)&&R({inst:S})},[m,x,b]),s(function(){return h(S)&&R({inst:S}),m(function(){h(S)&&R({inst:S})})},[m]),c(x),x}function h(m){var b=m.getSnapshot;m=m.value;try{var x=b();return!n(m,x)}catch{return!0}}function f(m,b){return b()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:d;return Gg.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Gg}var T1;function RC(){return T1||(T1=1,Kg.exports=C5()),Kg.exports}var cb=RC();const O5=(e,t)=>bi(t)?t:m5(t)&&bi(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,M5={t:O5,ready:!1},N5=()=>()=>{},yr=(e,t={})=>{var B,W,K;const{i18n:n}=t,{i18n:a,defaultNS:s}=y.useContext(R5)||{},i=n||a||S5();i&&!i.reportNamespaces&&(i.reportNamespaces=new T5),i||wC(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const c=y.useMemo(()=>{var I;return{...x5(),...(I=i==null?void 0:i.options)==null?void 0:I.react,...t}},[i,t]),{useSuspense:d,keyPrefix:h}=c,f=s||((B=i==null?void 0:i.options)==null?void 0:B.defaultNS),g=bi(f)?[f]:f||["translation"],m=y.useMemo(()=>g,g);(K=(W=i==null?void 0:i.reportNamespaces)==null?void 0:W.addUsedNamespaces)==null||K.call(W,m);const b=y.useRef(0),x=y.useCallback(I=>{if(!i)return N5;const{bindI18n:H,bindI18nStore:F}=c,q=()=>{b.current+=1,I()};return H&&i.on(H,q),F&&i.store.on(F,q),()=>{H&&H.split(" ").forEach(_=>i.off(_,q)),F&&F.split(" ").forEach(_=>i.store.off(_,q))}},[i,c]),w=y.useRef(),S=y.useCallback(()=>{if(!i)return M5;const I=!!(i.isInitialized||i.initializedStoreOnce)&&m.every(P=>h5(P,i,c)),H=t.lng||i.language,F=b.current,q=w.current;if(q&&q.ready===I&&q.lng===H&&q.keyPrefix===h&&q.revision===F)return q;const L={t:i.getFixedT(H,c.nsMode==="fallback"?m:m[0],h),ready:I,lng:H,keyPrefix:h,revision:F};return w.current=L,L},[i,m,h,c,t.lng]),[R,T]=y.useState(0),{t:C,ready:M}=cb.useSyncExternalStore(x,S,S);y.useEffect(()=>{if(i&&!M&&!d){const I=()=>T(H=>H+1);t.lng?E1(i,t.lng,m,I):Qy(i,m,I)}},[i,t.lng,m,M,d,R]);const O=i||{},D=y.useRef(null),k=y.useRef(),A=I=>{const H=Object.getOwnPropertyDescriptors(I);H.__original&&delete H.__original;const F=Object.create(Object.getPrototypeOf(I),H);if(!Object.prototype.hasOwnProperty.call(F,"__original"))try{Object.defineProperty(F,"__original",{value:I,writable:!1,enumerable:!1,configurable:!1})}catch{}return F},j=y.useMemo(()=>{const I=O,H=I==null?void 0:I.language;let F=I;I&&(D.current&&D.current.__original===I?k.current!==H?(F=A(I),D.current=F,k.current=H):F=D.current:(F=A(I),D.current=F,k.current=H));const q=[C,F,M];return q.t=C,q.i18n=F,q.ready=M,q},[C,O,M,O.resolvedLanguage,O.language,O.languages]);if(i&&d&&!M)throw new Promise(I=>{const H=()=>I();t.lng?E1(i,t.lng,m,H):Qy(i,m,H)});return j},A5=Object.assign({"../../../../packages/shared/src/i18n/locales/en_US.json":()=>Ro(()=>import("./en_US-CjVU4anP.js"),[]),"../../../../packages/shared/src/i18n/locales/ja_JP.json":()=>Ro(()=>import("./ja_JP-Bq-BwOH_.js"),[]),"../../../../packages/shared/src/i18n/locales/zh_CN.json":()=>Ro(()=>import("./zh_CN-BuxyXhCT.js"),[])});function D5(e){const t=Object.entries(A5).find(([n])=>n.endsWith(`/${e}.json`));return t==null?void 0:t[1]}function k5(){const e=navigator.language;return e.startsWith("zh")?"zh_CN":e.startsWith("ja")?"ja_JP":Gv}const j5=$t.use(d5(async(e,t)=>{const n=D5(e);return n?(await n()).default[t]??{}:{}})).use(E5).init({lng:k5(),fallbackLng:Gv,ns:["translation"],defaultNS:"translation",interpolation:{escapeValue:!1},returnNull:!1,react:{useSuspense:!1}}),_5={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"},L5={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 I5(e){const t=e==="light"?_5:L5;return`fg=${t.foreground},bg=${t.background}`}let lh=null;function C1(e){lh=e}function P5(e,t){lh==null||lh(e,t)}let Eo=null;function O1(e){Eo=e}function IY(){Eo!=null&&Eo.isMobile&&Eo.setOpenMobile(!0)}function z5(){Eo!=null&&Eo.isMobile&&Eo.setOpenMobile(!1)}const U5=/^\/devices\/([^/]+)\/windows\/([^/]+)\/panes\/([^/]+)$/;function H5(e){try{const t=new URL(e,window.location.origin);return t.pathname+t.search+t.hash}catch{return e}}function wh(e){const t=H5(e),n=U5.exec(t);if(n){const[,a,s,i]=n;window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:a,windowId:s,paneId:decodeURIComponent(i)}}))}P5(t,{replace:!0}),z5()}const B5=`${typeof window<"u"&&window.location.protocol==="https:"?"wss:":"ws:"}//${typeof window<"u"?window.location.host:""}/ws`,F5={clientImpl:"tmex-fe",clientVersion:"0.1.0",maxFrameBytes:1048576,reconnectDelayMs:1e3,maxReconnectAttempts:5,heartbeatIntervalMs:5e3};class V5{constructor(t={}){We(this,"ws",null);We(this,"options");We(this,"state","IDLE");We(this,"seq",0);We(this,"chunkReassembler",new N_);We(this,"reconnectAttempts",0);We(this,"reconnectTimer",null);We(this,"heartbeatTimer",null);We(this,"pongTimeoutTimer",null);We(this,"lastPingSentAt",0);We(this,"messageHandlers",new Set);We(this,"stateChangeHandlers",new Set);We(this,"errorHandlers",new Set);We(this,"latencyHandlers",new Set);We(this,"visibilityHandler",null);We(this,"lastVisibilityReconnectAt",0);We(this,"pendingMessages",[]);We(this,"maxPendingMessages",100);We(this,"hasConnectedOnce",!1);We(this,"latencyMs",null);this.options={...F5,...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(a){console.error("[borsh-client] State change handler error:",a)}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)}onLatency(t){return this.latencyHandlers.add(t),()=>this.latencyHandlers.delete(t)}connect(){var t,n;if(this.setupVisibilityListener(),!(((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(B5),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{this.sendHello()},this.ws.onmessage=a=>{this.handleMessage(a.data)},this.ws.onclose=()=>{this.handleClose()},this.ws.onerror=()=>{this.handleError(new Error("WebSocket error"))}}catch(a){this.handleError(a instanceof Error?a:new Error(String(a)))}}}disconnect(){this.setState("CLOSED"),this.clearTimers(),this.latencyMs=null,this.ws&&(this.ws.close(),this.ws=null),this.visibilityHandler&&(document.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null)}handleMessage(t){if(typeof t=="string")return;const n=new Uint8Array(t);if(!O_(n)){console.warn("[borsh-client] Received message without magic, ignoring");return}try{const a=R_(n);if(a.kind===qk){const s=C_(a.payload),i=this.chunkReassembler.addChunk(s);i&&this.dispatchMessage({kind:i.kind,seq:i.seq,payload:i.payload});return}if(a.kind===ik){this.handleHelloS2C(a.payload);return}if(a.kind===ck){if(this.clearPongTimeout(),this.lastPingSentAt>0){const s=Date.now()-this.lastPingSentAt;this.latencyMs=s;for(const i of this.latencyHandlers)try{i(s)}catch{}}return}this.dispatchMessage({kind:a.kind,seq:a.seq,payload:a.payload})}catch(a){console.error("[borsh-client] Failed to decode message:",a)}}dispatchMessage(t){for(const n of this.messageHandlers)try{n(t)}catch(a){console.error("[borsh-client] Message handler error:",a)}}handleHelloS2C(t){try{const n=Da(Tj,t);console.log("[borsh-client] HELLO_S2C received:",n),this.setState("READY"),this.hasConnectedOnce=!0,this.startHeartbeat(),this.sendPing(),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(a){console.error("[borsh-client] Error handler error:",a)}}sendHello(){const t={clientImpl:this.options.clientImpl,clientVersion:this.options.clientVersion,maxFrameBytes:this.options.maxFrameBytes,supportsCompression:!1,supportsDiffSnapshot:!1},n=pn(Rj,t),a=this.nextSeq(),s=ah(sk,n,a);this.sendRaw(s),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 a=this.nextSeq(),s=A_(n,t,a,{maxFrameBytes:this.options.maxFrameBytes,chunkStreamId:D_()});if(s.totalChunks===0){const i=ah(t,n,a);this.sendRaw(i)}else for(const i of s.chunks){const c=T_(i,this.nextSeq());this.sendRaw(c)}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=pn(Cj,t),a=this.nextSeq(),s=ah(lk,n,a);this.sendRaw(s),this.lastPingSentAt=Date.now(),this.clearPongTimeout(),this.pongTimeoutTimer=setTimeout(()=>{var i;this.pongTimeoutTimer=null,(i=this.ws)==null||i.close()},1e4)}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(),this.clearPongTimeout()}clearPongTimeout(){this.pongTimeoutTimer&&(clearTimeout(this.pongTimeoutTimer),this.pongTimeoutTimer=null)}setupVisibilityListener(){if(this.visibilityHandler||typeof document>"u")return;const t=()=>{if(document.visibilityState==="visible")if(this.clearPongTimeout(),this.state==="CLOSED"){const n=Date.now();if(n-this.lastVisibilityReconnectAt<5e3)return;this.lastVisibilityReconnectAt=n,this.reconnectAttempts=0,this.connect()}else this.state==="RECONNECT_BACKOFF"?(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectAttempts=0,this.connect()):this.state==="READY"&&this.sendPing()};document.addEventListener("visibilitychange",t),this.visibilityHandler=t}reconnect(){this.clearTimers(),this.latencyMs=null,this.ws&&(this.ws.onclose=null,this.ws.onerror=null,this.ws.close(),this.ws=null),this.reconnectAttempts=0,this.setState("IDLE"),this.connect()}nextSeq(){return this.seq=(this.seq+1)%4294967295,this.seq}}let Xg=null;function nn(){return Xg||(Xg=new V5),Xg}class Y5{constructor(t={}){We(this,"transactions",new Map);We(this,"outputGates",new Map);We(this,"deferredResets",new Map);We(this,"deferredHistories",new Map);We(this,"deferredFlushes",new Map);We(this,"deferredOutputs",new Map);We(this,"callbacks");We(this,"ackTimeoutMs",1500);We(this,"liveResumeTimeoutMs",2e3);We(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.keys())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:a,paneId:s,selectToken:i,wantHistory:c}=t;this.cancelTransaction(n),this.clearDeferred(n);const d={state:"SELECTING",deviceId:n,windowId:a,paneId:s,selectToken:new Uint8Array(i),wantHistory:c,startedAt:Date.now()};this.transactions.set(n,d),this.startOutputBuffering(n),this.setTimer(n,()=>{this.handleTimeout(n,"ack")},this.ackTimeoutMs)}handleSwitchAck(t){const{deviceId:n,selectToken:a}=t,s=this.transactions.get(n);!s||!this.validateToken(s.selectToken,a)||s.state==="SELECTING"&&(this.clearTimer(n),s.state="ACKED",this.callbacks.onResetTerminal?this.callbacks.onResetTerminal(n,s.paneId):this.deferredResets.set(n,s.paneId),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleHistory(t){const{deviceId:n,selectToken:a,data:s}=t,i=this.transactions.get(n);!i||!this.validateToken(i.selectToken,a)||i.state==="ACKED"&&(i.state="HISTORY_APPLIED",this.callbacks.onApplyHistory?this.callbacks.onApplyHistory(n,i.paneId,s,t.alternateScreen):this.deferredHistories.set(n,{paneId:i.paneId,data:s,alternateScreen:t.alternateScreen}),this.setTimer(n,()=>{this.handleTimeout(n,"live")},this.liveResumeTimeoutMs))}handleLiveResume(t){const{deviceId:n,selectToken:a}=t,s=this.transactions.get(n);if(!s||!this.validateToken(s.selectToken,a)||s.state!=="ACKED"&&s.state!=="HISTORY_APPLIED")return;this.clearTimer(n),s.state="LIVE";const i=this.stopOutputBuffering(n),c=s.paneId;this.completeTransaction(n),this.callbacks.onFlushBuffer?this.callbacks.onFlushBuffer(n,c,i):i.length>0&&this.deferredFlushes.set(n,{paneId:c,buffer:i}),this.replayDeferred(n)}handleOutput(t){const{deviceId:n,paneId:a,data:s}=t,i=this.transactions.get(n);if(i&&i.paneId!==a){this.emitOutput(n,a,s);return}if(this.isBuffering(n)){this.bufferOutput(n,s);return}this.emitOutput(n,a,s)}emitOutput(t,n,a){if(this.callbacks.onOutput){this.callbacks.onOutput(t,n,a);return}const s=this.deferredOutputs.get(t)??[];s.push({paneId:n,data:new Uint8Array(a)}),this.deferredOutputs.set(t,s)}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 a,s;const n=this.transactions.get(t);n&&(n.state="SELECT_FAILED",this.stopOutputBuffering(t),(s=(a=this.callbacks).onSelectFailed)==null||s.call(a,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 a=[...n.buffer];return this.outputGates.delete(t),a}bufferOutput(t,n){const a=this.outputGates.get(t);a&&(a.buffer.length>=1e3&&a.buffer.shift(),a.buffer.push(new Uint8Array(n)))}validateToken(t,n){if(t.length!==n.length)return!1;for(let a=0;a<t.length;a++)if(t[a]!==n[a])return!1;return!0}replayDeferred(t){const n=this.deferredResets.get(t);n!==void 0&&this.callbacks.onResetTerminal&&(this.deferredResets.delete(t),this.callbacks.onResetTerminal(t,n));const a=this.deferredHistories.get(t);a!==void 0&&this.callbacks.onApplyHistory&&(this.callbacks.onApplyHistory(t,a.paneId,a.data,a.alternateScreen),this.deferredHistories.delete(t));const s=this.deferredFlushes.get(t);s&&this.callbacks.onFlushBuffer&&(this.callbacks.onFlushBuffer(t,s.paneId,s.buffer),this.deferredFlushes.delete(t));const i=this.deferredOutputs.get(t);if(i&&this.callbacks.onOutput){for(const c of i)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,a){this.clearTimer(t);const s=setTimeout(n,a);this.timers.set(t,s)}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 ou=null;function bl(e){return ou?(e&&ou.setCallbacks(e),ou):(ou=new Y5(e),ou)}function M1(){return crypto.getRandomValues(new Uint8Array(16))}function TC(e){const t=pn(Oj,{deviceId:e});return{kind:dk,payload:t}}function q5(e){const t=pn(Nj,{deviceId:e});return{kind:hk,payload:t}}function $5(e){const t=pn(kj,{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:gk,payload:t}}function K5(e,t){const n=pn(jj,{deviceId:e,windowId:t});return{kind:yk,payload:n}}function G5(e,t,n){const a=pn(_j,{deviceId:e,name:t??null,cwd:n??null});return{kind:vk,payload:a}}function X5(e,t){const n=pn(Lj,{deviceId:e,windowId:t});return{kind:bk,payload:n}}function W5(e,t){const n=pn(Ij,{deviceId:e,paneId:t});return{kind:xk,payload:n}}function Q5(e,t,n){const a=pn(Pj,{deviceId:e,windowId:t,name:n});return{kind:wk,payload:a}}function Z5(e,t){const n=pn(zj,{deviceId:e,style:t});return{kind:Rk,payload:n}}function J5(e,t){const n=pn(Uj,{deviceId:e,windowIds:t});return{kind:Tk,payload:n}}function ez(e,t,n){const a=pn(Hj,{deviceId:e,windowId:t,paneIds:n});return{kind:Ck,payload:a}}function tz(e,t,n,a=!1){const s=new TextEncoder,i=pn(Qj,{deviceId:e,paneId:t,encoding:2,data:s.encode(n),isComposing:a});return{kind:Ik,payload:i}}function nz(e,t,n){const a=new TextEncoder,s=pn(Zj,{deviceId:e,paneId:t,encoding:2,data:a.encode(n),isComposing:!1});return{kind:Pk,payload:s}}function rz(e,t,n,a){const s=pn(zT,{deviceId:e,paneId:t,cols:n,rows:a});return{kind:zk,payload:s}}function az(e,t,n,a){const s=pn(Jj,{deviceId:e,paneId:t,cols:n,rows:a});return{kind:Uk,payload:s}}function oz(e,t){const n=pn(Fj,{deviceId:e,paneIds:t});return{kind:Ok,payload:n}}function sz(e,t,n){const a=pn(Vj,{deviceId:e,paneId:t,requestToken:n});return{kind:Mk,payload:a}}function iz(e,t,n){const a=pn(Yj,{deviceId:e,paneId:t,cols:n.cols??null,rows:n.rows??null});return{kind:Nk,payload:a}}function lz(e,t,n,a){const s=pn(qj,{deviceId:e,windowId:t,cols:n,rows:a});return{kind:Ak,payload:s}}function cz(e,t,n,a){const s=pn($j,{deviceId:e,paneId:t,direction:n==="down"?2:1,cwd:a??null});return{kind:Dk,payload:s}}function uz(e,t,n){const a=pn(Kj,{deviceId:e,windowId:t,paneId:n});return{kind:kk,payload:a}}function dz(e,t,n){const a=pn(Gj,{deviceId:e,paneId:t,name:n});return{kind:jk,payload:a}}const fz={left:1,right:2,top:3,bottom:4};function hz(e,t){const n=pn(Wj,{deviceId:e,paneId:t});return{kind:Lk,payload:n}}function mz(e,t,n,a){const s=pn(Xj,{deviceId:e,srcPaneId:t,dstPaneId:n,position:fz[a]});return{kind:_k,payload:s}}function pz(e){const t=pn(c_,{sessionId:e});return{kind:$k,payload:t}}function gz(e){const t=pn(u_,{sessionId:e});return{kind:Kk,payload:t}}const N1=1e3,yz=3e3,xl=new Map,Vl=new Map,xi=new Map;function Jl(e,t){return`${e}:${t}`}function vz(e,t){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 ub(e){let t=Vl.get(e);return t||(t={outputs:[],reset:!1,history:null},Vl.set(e,t)),t}function PY(e,t,n){const a=Jl(e,t);xl.set(a,n);const s=Vl.get(a);if(s){Vl.delete(a),s.reset&&n.onReset(),s.history&&n.onApplyHistory(s.history.data,s.history.alternateScreen);for(const i of s.outputs)n.onOutput(i)}return()=>{xl.get(a)===n&&xl.delete(a)}}function CC(e,t){const n=Jl(e,t),a=xl.get(n);if(a){a.onReset();return}const s=ub(n);s.reset=!0,s.outputs=[],s.history=null}function OC(e,t,n,a){const s=Jl(e,t),i=xl.get(s);if(i){i.onApplyHistory(n,a);return}ub(s).history={data:n,alternateScreen:a}}function Sh(e,t,n){const a=Jl(e,t),s=xi.get(a);if(s){s.buffer.length>=N1&&s.buffer.shift(),s.buffer.push(new Uint8Array(n));return}const i=xl.get(a);if(i){i.onOutput(n);return}const c=ub(a);c.outputs.length>=N1&&c.outputs.shift(),c.outputs.push(new Uint8Array(n))}function bz(e,t,n){const a=Jl(e,t);Jy(a,{flush:!0});const s=setTimeout(()=>{console.warn(`[pane-sink] history gate timeout on ${a}, releasing buffered output`),Jy(a,{flush:!0})},yz);xi.set(a,{token:new Uint8Array(n),buffer:[],timer:s})}function xz(e,t,n,a,s){const i=Jl(e,t),c=xi.get(i);if(!c||!vz(c.token,n))return!1;clearTimeout(c.timer),xi.delete(i),CC(e,t),OC(e,t,a,s);for(const d of c.buffer)Sh(e,t,d);return!0}function Jy(e,t){const n=xi.get(e);if(n&&(clearTimeout(n.timer),xi.delete(e),t.flush)){const[a,s]=wz(e);for(const i of n.buffer)Sh(a,s,i)}}function wz(e){const t=e.lastIndexOf(":");return[e.slice(0,t),e.slice(t+1)]}function Sz(e){const t=`${e}:`;for(const n of Vl.keys())n.startsWith(t)&&Vl.delete(n);for(const n of xi.keys())n.startsWith(t)&&Jy(n,{flush:!1})}const A1=e=>{let t;const n=new Set,a=(f,g)=>{const m=typeof f=="function"?f(t):f;if(!Object.is(m,t)){const b=t;t=g??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(x=>x(t,b))}},s=()=>t,d={setState:a,getState:s,getInitialState:()=>h,subscribe:f=>(n.add(f),()=>n.delete(f))},h=t=e(a,s,d);return d},Ez=(e=>e?A1(e):A1),Rz=e=>e;function Tz(e,t=Rz){const n=Pe.useSyncExternalStore(e.subscribe,Pe.useCallback(()=>t(e.getState()),[e,t]),Pe.useCallback(()=>t(e.getInitialState()),[e,t]));return Pe.useDebugValue(n),n}const D1=e=>{const t=Ez(e),n=a=>Tz(t,a);return Object.assign(n,t),n},Kh=(e=>e?D1(e):D1),Wg={siteName:"tmex",siteUrl:typeof window<"u"?window.location.origin:"http://localhost:9663",bellThrottleSeconds:6,notificationThrottleSeconds:3,enableBrowserBellToast:!0,enableBrowserNotificationToast:!0,enableTelegramBellPush:!0,enableTelegramNotificationPush:!0,enableWeixinBellPush:!1,enableWeixinNotificationPush:!1,sshReconnectMaxRetries:2,sshReconnectDelaySeconds:10,language:Gv,updatedAt:new Date(0).toISOString()};async function k1(){const e=await fetch("/api/settings/site");if(!e.ok)throw new Error("Failed to load site settings");return(await e.json()).settings}const wi=Kh((e,t)=>({settings:null,loading:!1,fetchSettings:async()=>{const n=t().settings;if(n)return n;e({loading:!0});try{const a=await k1();return e({settings:a,loading:!1}),$t.changeLanguage(a.language),a}catch(a){return console.error("[site] failed to fetch settings:",a),e({settings:Wg,loading:!1}),$t.changeLanguage(Wg.language),Wg}},refreshSettings:async()=>{e({loading:!0});try{const n=await k1();return e({settings:n,loading:!1}),$t.changeLanguage(n.language),n}catch(n){throw console.error("[site] failed to refresh settings:",n),e({loading:!1}),n}}}));function Cz(e){return typeof e.paneTitle=="string"&&e.paneTitle?e.paneTitle:typeof e.paneCurrentCommand=="string"&&e.paneCurrentCommand?e.paneCurrentCommand:typeof e.paneIndex=="number"?$t.t("terminal.paneTitle",{index:e.paneIndex}):typeof e.paneId=="string"&&e.paneId?$t.t("terminal.paneTitle",{index:e.paneId}):""}function MC(e){const t=typeof e.windowIndex=="number"?String(e.windowIndex):typeof e.windowId=="string"&&e.windowId?e.windowId:"",n=Cz(e);return t&&n?$t.t("terminal.bellDescriptionWithTitle",{window:t,paneLabel:n}):t?`${$t.t("notification.window")} ${t}`:n||""}function Oz(e){const t=typeof e.title=="string"&&e.title?e.title:$t.t("terminal.notificationFallbackTitle"),n=MC(e),a=typeof e.body=="string"&&e.body?e.body:typeof e.source=="string"&&e.source?$t.t("terminal.notificationSourceLabel",{source:e.source}):$t.t("terminal.notificationFallbackDetail");return{title:t,description:n?`${n}
71
+ ${a}`:a}}const Qg=[{id:"geist-mono",displayName:"Geist Mono",cssFamily:"GeistMonoTmex",bundled:!0,isDefault:!0,files:{regular:"/fonts/GeistMonoNerdFontMono-Regular.woff2",bold:"/fonts/GeistMonoNerdFontMono-Bold.woff2"}},{id:"jetbrains-mono",displayName:"JetBrains Mono",cssFamily:"JetBrainsMonoTmex",bundled:!0,files:{regular:"/fonts/generated/jetbrains-mono/jetbrains-mono-regular.woff2",bold:"/fonts/generated/jetbrains-mono/jetbrains-mono-bold.woff2"}},{id:"fira-code",displayName:"Fira Code",cssFamily:"FiraCodeTmex",bundled:!0,files:{regular:"/fonts/generated/fira-code/fira-code-regular.woff2",bold:"/fonts/generated/fira-code/fira-code-bold.woff2"}},{id:"blex-mono",displayName:"Blex Mono (IBM Plex Mono)",cssFamily:"BlexMonoTmex",bundled:!0,files:{regular:"/fonts/generated/blex-mono/blex-mono-regular.woff2",bold:"/fonts/generated/blex-mono/blex-mono-bold.woff2"}},{id:"noto-sans-mono",displayName:"Noto Sans Mono",cssFamily:"NotoSansMTmex",bundled:!0,files:{regular:"/fonts/generated/noto-sans-mono/noto-sans-mono-regular.woff2",bold:"/fonts/generated/noto-sans-mono/noto-sans-mono-bold.woff2"}},{id:"zed-mono",displayName:"Zed Mono",cssFamily:"ZedMonoTmex",bundled:!0,files:{regular:"/fonts/generated/zed-mono/zed-mono-regular.woff2",bold:"/fonts/generated/zed-mono/zed-mono-bold.woff2"}},{id:"victor-mono",displayName:"Victor Mono",cssFamily:"VictorMonoTmex",bundled:!0,files:{regular:"/fonts/generated/victor-mono/victor-mono-regular.woff2",bold:"/fonts/generated/victor-mono/victor-mono-bold.woff2"}}],NC="geist-mono";function Mz(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var i;const c=h=>h===null?null:JSON.parse(h,void 0),d=(i=n.getItem(s))!=null?i:null;return d instanceof Promise?d.then(c):c(d)},setItem:(s,i)=>n.setItem(s,JSON.stringify(i,void 0)),removeItem:s=>n.removeItem(s)}}const ev=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(a){return ev(a)(n)},catch(a){return this}}}catch(n){return{then(a){return this},catch(a){return ev(a)(n)}}}},Nz=(e,t)=>(n,a,s)=>{let i={storage:Mz(()=>window.localStorage),partialize:R=>R,version:0,merge:(R,T)=>({...T,...R}),...t},c=!1,d=0;const h=new Set,f=new Set;let g=i.storage;if(!g)return e((...R)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...R)},a,s);const m=()=>{const R=i.partialize({...a()});return g.setItem(i.name,{state:R,version:i.version})},b=s.setState;s.setState=(R,T)=>(b(R,T),m());const x=e((...R)=>(n(...R),m()),a,s);s.getInitialState=()=>x;let w;const S=()=>{var R,T;if(!g)return;const C=++d;c=!1,h.forEach(O=>{var D;return O((D=a())!=null?D:x)});const M=((T=i.onRehydrateStorage)==null?void 0:T.call(i,(R=a())!=null?R:x))||void 0;return ev(g.getItem.bind(g))(i.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==i.version){if(i.migrate){const D=i.migrate(O.state,O.version);return D instanceof Promise?D.then(k=>[!0,k]):[!0,D]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var D;if(C!==d)return;const[k,A]=O;if(w=i.merge(A,(D=a())!=null?D:x),n(w,!0),k)return m()}).then(()=>{C===d&&(M==null||M(w,void 0),w=a(),c=!0,f.forEach(O=>O(w)))}).catch(O=>{C===d&&(M==null||M(void 0,O))})};return s.persist={setOptions:R=>{i={...i,...R},R.storage&&(g=R.storage)},clearStorage:()=>{g==null||g.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>S(),hasHydrated:()=>c,onHydrate:R=>(h.add(R),()=>{h.delete(R)}),onFinishHydration:R=>(f.add(R),()=>{f.delete(R)})},i.skipHydration||S(),w||x},AC=Nz,Az=13,Dz=1.2,Vr=Kh()(AC(e=>({sidebarCollapsed:!1,sidebarTab:"panes",inputMode:"direct",editorSendWithEnter:!0,theme:"dark",keyboardBehaviorMode:"follow",editorHistory:[],editorDrafts:{},terminalFontSize:Az,terminalLineHeight:Dz,terminalFontId:NC,setSidebarCollapsed:t=>e({sidebarCollapsed:t}),setSidebarTab:t=>e({sidebarTab:t}),setInputMode:t=>e({inputMode:t}),setKeyboardBehaviorMode:t=>e({keyboardBehaviorMode:t}),setEditorSendWithEnter:t=>e({editorSendWithEnter:t}),setTheme:t=>e({theme:t}),setTerminalFontSize:t=>e({terminalFontSize:t}),setTerminalLineHeight:t=>e({terminalLineHeight:t}),setTerminalFontId:t=>e({terminalFontId:t}),addEditorHistory:t=>e(n=>({editorHistory:[t,...n.editorHistory.slice(0,49)]})),setEditorDraft:(t,n)=>e(a=>({editorDrafts:{...a.editorDrafts,[t]:n}})),removeEditorDraft:t=>e(n=>{if(!(t in n.editorDrafts))return n;const a={...n.editorDrafts};return delete a[t],{editorDrafts:a}})}),{name:"tmex-ui",partialize:e=>({sidebarCollapsed:e.sidebarCollapsed,inputMode:e.inputMode,editorSendWithEnter:e.editorSendWithEnter,theme:e.theme,keyboardBehaviorMode:e.keyboardBehaviorMode,editorHistory:e.editorHistory,editorDrafts:e.editorDrafts,terminalFontSize:e.terminalFontSize,terminalLineHeight:e.terminalLineHeight,terminalFontId:e.terminalFontId}),merge:(e,t)=>{const{sidebarTab:n,...a}=e??{};return{...t,...a}}})),kz=500,j1=new Map,Zg=new Map;function DC(e){const t=Date.now(),n=j1.get(e);return n!==void 0&&t-n<kz?!0:(j1.set(e,t),!1)}let _1=!1;function Jg(e){const t=I5(Vr.getState().theme),n=Z5(e,t);nn().send(n.kind,n.payload)}function Lf(e,t){if(typeof e!="number"||typeof t!="number")return null;const n=Math.max(2,Math.floor(e)),a=Math.max(2,Math.floor(t));return{cols:n,rows:a}}function jz(e,t){if(_1)return;_1=!0;const n=nn();bl({onResetTerminal:(i,c)=>{CC(i,c)},onApplyHistory:(i,c,d,h)=>{OC(i,c,d,h)},onFlushBuffer:(i,c,d)=>{for(const h of d)Sh(i,c,h)},onOutput:(i,c,d)=>{Sh(i,c,d)}});const a=i=>{const c=t().selectedPanes[i];!c||bl().getTransaction(i)||t().selectPane(i,c.windowId,c.paneId)};n.onStateChange(i=>{e(c=>({connectionState:i,hasConnectedOnce:i==="READY"?!0:c.hasConnectedOnce,wsLatencyMs:i==="READY"?c.wsLatencyMs:null}))}),n.onMessage(i=>{const c=bl();switch(i.kind){case fk:{const d=Da(Mj,i.payload);e(h=>({deviceConnected:{...h.deviceConnected,[d.deviceId]:!0},deviceErrors:{...h.deviceErrors,[d.deviceId]:void 0},deviceReconnecting:{...h.deviceReconnecting,[d.deviceId]:void 0}})),Jg(d.deviceId),a(d.deviceId);return}case mk:{const d=Da(Aj,i.payload);c.cleanup(d.deviceId),Sz(d.deviceId),e(h=>({deviceConnected:{...h.deviceConnected,[d.deviceId]:!1}}));return}case pk:{const d=j_(i.payload);_z(e,d),d.type==="reconnected"&&(Jg(d.deviceId),a(d.deviceId));return}case Ek:{const d=I_(i.payload);e(h=>({snapshots:{...h.snapshots,[d.deviceId]:d}}));return}case Sk:{const d=__(i.payload);Lz(e,d);return}case Vk:{const d=Da(r_,i.payload);c.dispatch({type:"SWITCH_ACK",deviceId:d.deviceId,selectToken:d.selectToken});return}case Bk:{const d=Da(t_,i.payload),h=new TextDecoder().decode(d.data);if(xz(d.deviceId,d.paneId,d.selectToken,h,d.alternateScreen))return;c.dispatch({type:"HISTORY",deviceId:d.deviceId,selectToken:d.selectToken,data:h,alternateScreen:d.alternateScreen});return}case Yk:{const d=Da(a_,i.payload);c.dispatch({type:"LIVE_RESUME",deviceId:d.deviceId,selectToken:d.selectToken});return}case Hk:{const d=Da(e_,i.payload);c.dispatch({type:"OUTPUT",deviceId:d.deviceId,paneId:d.paneId,data:d.data});return}case Fk:{const d=Da(n_,i.payload);if(document.visibilityState!=="visible")return;const h=t().selectedPanes[d.deviceId];if(!h||h.paneId!==d.paneId)return;navigator.clipboard.writeText(d.text).then(()=>{dn.success($t.t("terminal.copied"))},f=>{console.warn("[tmux] clipboard write failed:",f)});return}case uk:return}}),n.onError(i=>{console.error("[tmux] borsh ws error:",i)}),n.onLatency(i=>{e({wsLatencyMs:i})}),n.onStateChange(i=>{if(i!=="READY")return;const c=t().connectedDevices;for(const d of c){if(DC(d))continue;const h=TC(d);n.send(h.kind,h.payload)}});let s=Vr.getState().theme;Vr.subscribe(i=>{if(i.theme===s)return;s=i.theme;const c=t();for(const d of c.connectedDevices)c.deviceConnected[d]&&Jg(d)})}function _z(e,t){if(t.type==="error"){const n=t.message??"Device Error",a=t.errorType??"unknown";if(a==="reconnecting"){e(s=>({deviceReconnecting:{...s.deviceReconnecting,[t.deviceId]:{message:n,at:Date.now()}}}));return}e(s=>{const i=s.deviceErrors[t.deviceId];return(!i||i.type!==a)&&dn.error(n),{deviceErrors:{...s.deviceErrors,[t.deviceId]:{message:n,type:a,rawMessage:t.rawMessage,at:Date.now()}},deviceReconnecting:{...s.deviceReconnecting,[t.deviceId]:void 0}}});return}if(t.type==="disconnected"){bl().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 Lz(e,t){if(t.type==="bell"){console.log("[tmex] bell",t.data);const n=wi.getState().settings;if((n==null?void 0:n.enableBrowserBellToast)===!1)return;const a=t.data??{},s=$t.t("terminal.bellNotification"),i=MC(a),c=typeof a.paneUrl=="string"?a.paneUrl:void 0;dn(s,{description:i||$t.t("terminal.bellFallback"),action:c?{label:"Open",onClick:()=>{wh(c)}}:void 0})}if(t.type==="notification"){console.log("[tmex] notification",t.data);const n=wi.getState().settings;if((n==null?void 0:n.enableBrowserNotificationToast)===!1)return;const a=t.data??{},{title:s,description:i}=Oz(a),c=typeof a.paneUrl=="string"?a.paneUrl:void 0;dn(s,{description:i,action:c?{label:"Open",onClick:()=>{wh(c)}}:void 0})}if(t.type==="pane-active"){const n=t.data;n!=null&&n.windowId&&(n!=null&&n.paneId)&&e(a=>({activePaneFromEvent:{...a.activePaneFromEvent,[t.deviceId]:{windowId:n.windowId,paneId:n.paneId}}}))}}const rn=Kh((e,t)=>({connectionState:"IDLE",hasConnectedOnce:!1,wsLatencyMs:null,snapshots:{},connectedDevices:new Set,deviceConnected:{},deviceErrors:{},deviceReconnecting:{},selectedPanes:{},activePaneFromEvent:{},pendingCreateWindowAt:{},ensureSocketConnected(){jz(e,t),nn().connect()},connectDevice(n){if(!n||(e(s=>{const i=new Set(s.connectedDevices);return i.add(n),{connectedDevices:i}}),t().ensureSocketConnected(),DC(n)))return;const a=TC(n);nn().send(a.kind,a.payload)},disconnectDevice(n){if(!n)return;e(s=>{const i=new Set(s.connectedDevices);return i.delete(n),{connectedDevices:i}}),bl().cleanup(n);const a=q5(n);nn().send(a.kind,a.payload)},clearDeviceError(n){e(a=>({deviceErrors:{...a.deviceErrors,[n]:void 0},deviceReconnecting:{...a.deviceReconnecting,[n]:void 0}}))},hydrateDeviceErrors(n){e(a=>{const s={...a.deviceErrors};for(const i of n)s[i.deviceId]||!i.lastError||!i.lastErrorType||(s[i.deviceId]={message:i.lastError,type:i.lastErrorType,at:0});return{deviceErrors:s}})},selectPane(n,a,s,i){if(!n||!a||!s)return;e(g=>({selectedPanes:{...g.selectedPanes,[n]:{windowId:a,paneId:s}}}));const c=M1(),d=!0;bl().dispatch({type:"SELECT_START",deviceId:n,windowId:a,paneId:s,selectToken:c,wantHistory:d});const h=Lf(i==null?void 0:i.cols,i==null?void 0:i.rows)??Zg.get(n)??null,f=$5({deviceId:n,windowId:a,paneId:s,selectToken:c,wantHistory:d,cols:h==null?void 0:h.cols,rows:h==null?void 0:h.rows});nn().send(f.kind,f.payload)},selectWindow(n,a){if(!n||!a)return;const s=K5(n,a);nn().send(s.kind,s.payload)},sendInput(n,a,s,i=!1){if(!n||!a)return;const c=tz(n,a,s,i);nn().send(c.kind,c.payload)},resizePane(n,a,s,i){if(!n||!a)return;const c=Lf(s,i);c&&Zg.set(n,{...c,at:Date.now()});const d=rz(n,a,s,i);nn().send(d.kind,d.payload)},syncPaneSize(n,a,s,i){if(!n||!a)return;const c=Lf(s,i);c&&Zg.set(n,{...c,at:Date.now()});const d=az(n,a,s,i);nn().send(d.kind,d.payload)},paste(n,a,s){if(!n||!a)return;const i=nz(n,a,s);nn().send(i.kind,i.payload)},createWindow(n,a,s){if(!n)return;const i=G5(n,a,s);nn().send(i.kind,i.payload),e(c=>({pendingCreateWindowAt:{...c.pendingCreateWindowAt,[n]:Date.now()}}))},clearPendingCreateWindow(n){n&&e(a=>{if(a.pendingCreateWindowAt[n]===void 0)return a;const s={...a.pendingCreateWindowAt};return delete s[n],{pendingCreateWindowAt:s}})},closeWindow(n,a){if(!n||!a)return;const s=X5(n,a);nn().send(s.kind,s.payload)},closePane(n,a){if(!n||!a)return;const s=W5(n,a);nn().send(s.kind,s.payload)},renameWindow(n,a,s){if(!n||!a)return;const i=Q5(n,a,s);nn().send(i.kind,i.payload)},reorderWindows(n,a){if(!n||a.length===0)return;e(i=>{const c=i.snapshots[n],d=c==null?void 0:c.session;if(!d)return{};const h=new Map(d.windows.map(m=>[m.id,m])),f=a.map(m=>h.get(m)).filter(m=>m!==void 0),g=d.windows.filter(m=>!a.includes(m.id));return{snapshots:{...i.snapshots,[n]:{...c,session:{...d,windows:[...f,...g]}}}}});const s=J5(n,a);nn().send(s.kind,s.payload)},subscribePanes(n,a){if(!n)return;const s=oz(n,a);nn().send(s.kind,s.payload)},fetchPaneHistory(n,a){if(!n||!a)return;const s=M1();bz(n,a,s);const i=sz(n,a,s);nn().send(i.kind,i.payload)},focusPane(n,a,s){if(!n||!a||!s)return;e(c=>({selectedPanes:{...c.selectedPanes,[n]:{windowId:a,paneId:s}}}));const i=uz(n,a,s);nn().send(i.kind,i.payload)},splitPane(n,a,s,i){if(!n||!a)return;const c=cz(n,a,s,i);nn().send(c.kind,c.payload)},renamePane(n,a,s){if(!n||!a)return;const i=dz(n,a,s);nn().send(i.kind,i.payload)},movePane(n,a,s,i){if(!n||!a||!s||a===s)return;const c=mz(n,a,s,i);nn().send(c.kind,c.payload)},breakPane(n,a){if(!n||!a)return;const s=hz(n,a);nn().send(s.kind,s.payload)},resizePaneInWindow(n,a,s){if(!n||!a||s.cols===void 0&&s.rows===void 0)return;const i=iz(n,a,s);nn().send(i.kind,i.payload)},applyStackedLayout(n,a,s,i){if(!n||!a)return;const c=Lf(s,i);if(!c)return;const d=lz(n,a,c.cols,c.rows);nn().send(d.kind,d.payload)},reorderPanes(n,a,s){if(!n||!a||s.length===0)return;e(c=>{const d=c.snapshots[n],h=d==null?void 0:d.session;if(!h)return{};const f=h.windows.map(g=>{if(g.id!==a)return g;const m=new Map(g.panes.map(w=>[w.id,w])),b=s.map(w=>m.get(w)).filter(w=>w!==void 0),x=g.panes.filter(w=>!s.includes(w.id));return{...g,panes:[...b,...x]}});return{snapshots:{...c.snapshots,[n]:{...d,session:{...h,windows:f}}}}});const i=ez(n,a,s);nn().send(i.kind,i.payload)}}));/**
72
+ * @license lucide-react v0.564.0 - ISC
73
+ *
74
+ * This source code is licensed under the ISC license.
75
+ * See the LICENSE file in the root directory of this source tree.
76
+ */const kC=(...e)=>e.filter((t,n,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===n).join(" ").trim();/**
77
+ * @license lucide-react v0.564.0 - ISC
78
+ *
79
+ * This source code is licensed under the ISC license.
80
+ * See the LICENSE file in the root directory of this source tree.
81
+ */const Iz=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
82
+ * @license lucide-react v0.564.0 - ISC
83
+ *
84
+ * This source code is licensed under the ISC license.
85
+ * See the LICENSE file in the root directory of this source tree.
86
+ */const Pz=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,a)=>a?a.toUpperCase():n.toLowerCase());/**
87
+ * @license lucide-react v0.564.0 - ISC
88
+ *
89
+ * This source code is licensed under the ISC license.
90
+ * See the LICENSE file in the root directory of this source tree.
91
+ */const L1=e=>{const t=Pz(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
92
+ * @license lucide-react v0.564.0 - ISC
93
+ *
94
+ * This source code is licensed under the ISC license.
95
+ * See the LICENSE file in the root directory of this source tree.
96
+ */var zz={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"};/**
97
+ * @license lucide-react v0.564.0 - ISC
98
+ *
99
+ * This source code is licensed under the ISC license.
100
+ * See the LICENSE file in the root directory of this source tree.
101
+ */const Uz=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
102
+ * @license lucide-react v0.564.0 - ISC
103
+ *
104
+ * This source code is licensed under the ISC license.
105
+ * See the LICENSE file in the root directory of this source tree.
106
+ */const Hz=y.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:a,className:s="",children:i,iconNode:c,...d},h)=>y.createElement("svg",{ref:h,...zz,width:t,height:t,stroke:e,strokeWidth:a?Number(n)*24/Number(t):n,className:kC("lucide",s),...!i&&!Uz(d)&&{"aria-hidden":"true"},...d},[...c.map(([f,g])=>y.createElement(f,g)),...Array.isArray(i)?i:[i]]));/**
107
+ * @license lucide-react v0.564.0 - ISC
108
+ *
109
+ * This source code is licensed under the ISC license.
110
+ * See the LICENSE file in the root directory of this source tree.
111
+ */const Jt=(e,t)=>{const n=y.forwardRef(({className:a,...s},i)=>y.createElement(Hz,{ref:i,iconNode:t,className:kC(`lucide-${Iz(L1(e))}`,`lucide-${e}`,a),...s}));return n.displayName=L1(e),n};/**
112
+ * @license lucide-react v0.564.0 - ISC
113
+ *
114
+ * This source code is licensed under the ISC license.
115
+ * See the LICENSE file in the root directory of this source tree.
116
+ */const Bz=[["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"}]],Fz=Jt("activity",Bz);/**
117
+ * @license lucide-react v0.564.0 - ISC
118
+ *
119
+ * This source code is licensed under the ISC license.
120
+ * See the LICENSE file in the root directory of this source tree.
121
+ */const Vz=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Yz=Jt("arrow-left",Vz);/**
122
+ * @license lucide-react v0.564.0 - ISC
123
+ *
124
+ * This source code is licensed under the ISC license.
125
+ * See the LICENSE file in the root directory of this source tree.
126
+ */const qz=[["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"}]],$z=Jt("bell",qz);/**
127
+ * @license lucide-react v0.564.0 - ISC
128
+ *
129
+ * This source code is licensed under the ISC license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */const Kz=[["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"}]],db=Jt("bot",Kz);/**
132
+ * @license lucide-react v0.564.0 - ISC
133
+ *
134
+ * This source code is licensed under the ISC license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Gz=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Xz=Jt("check",Gz);/**
137
+ * @license lucide-react v0.564.0 - ISC
138
+ *
139
+ * This source code is licensed under the ISC license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const Wz=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],jC=Jt("chevron-down",Wz);/**
142
+ * @license lucide-react v0.564.0 - ISC
143
+ *
144
+ * This source code is licensed under the ISC license.
145
+ * See the LICENSE file in the root directory of this source tree.
146
+ */const Qz=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],_C=Jt("chevron-right",Qz);/**
147
+ * @license lucide-react v0.564.0 - ISC
148
+ *
149
+ * This source code is licensed under the ISC license.
150
+ * See the LICENSE file in the root directory of this source tree.
151
+ */const Zz=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Jz=Jt("chevron-up",Zz);/**
152
+ * @license lucide-react v0.564.0 - ISC
153
+ *
154
+ * This source code is licensed under the ISC license.
155
+ * See the LICENSE file in the root directory of this source tree.
156
+ */const e3=[["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"}]],t3=Jt("circle-alert",e3);/**
157
+ * @license lucide-react v0.564.0 - ISC
158
+ *
159
+ * This source code is licensed under the ISC license.
160
+ * See the LICENSE file in the root directory of this source tree.
161
+ */const n3=[["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"}]],LC=Jt("ellipsis-vertical",n3);/**
162
+ * @license lucide-react v0.564.0 - ISC
163
+ *
164
+ * This source code is licensed under the ISC license.
165
+ * See the LICENSE file in the root directory of this source tree.
166
+ */const r3=[["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"}]],a3=Jt("ellipsis",r3);/**
167
+ * @license lucide-react v0.564.0 - ISC
168
+ *
169
+ * This source code is licensed under the ISC license.
170
+ * See the LICENSE file in the root directory of this source tree.
171
+ */const o3=[["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"}]],s3=Jt("folder-closed",o3);/**
172
+ * @license lucide-react v0.564.0 - ISC
173
+ *
174
+ * This source code is licensed under the ISC license.
175
+ * See the LICENSE file in the root directory of this source tree.
176
+ */const i3=[["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"}]],IC=Jt("folder-open",i3);/**
177
+ * @license lucide-react v0.564.0 - ISC
178
+ *
179
+ * This source code is licensed under the ISC license.
180
+ * See the LICENSE file in the root directory of this source tree.
181
+ */const l3=[["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"}]],c3=Jt("globe",l3);/**
182
+ * @license lucide-react v0.564.0 - ISC
183
+ *
184
+ * This source code is licensed under the ISC license.
185
+ * See the LICENSE file in the root directory of this source tree.
186
+ */const u3=[["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"}]],fb=Jt("grip-vertical",u3);/**
187
+ * @license lucide-react v0.564.0 - ISC
188
+ *
189
+ * This source code is licensed under the ISC license.
190
+ * See the LICENSE file in the root directory of this source tree.
191
+ */const d3=[["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"}]],f3=Jt("history",d3);/**
192
+ * @license lucide-react v0.564.0 - ISC
193
+ *
194
+ * This source code is licensed under the ISC license.
195
+ * See the LICENSE file in the root directory of this source tree.
196
+ */const h3=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Yl=Jt("loader-circle",h3);/**
197
+ * @license lucide-react v0.564.0 - ISC
198
+ *
199
+ * This source code is licensed under the ISC license.
200
+ * See the LICENSE file in the root directory of this source tree.
201
+ */const m3=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],p3=Jt("menu",m3);/**
202
+ * @license lucide-react v0.564.0 - ISC
203
+ *
204
+ * This source code is licensed under the ISC license.
205
+ * See the LICENSE file in the root directory of this source tree.
206
+ */const g3=[["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"}]],PC=Jt("monitor",g3);/**
207
+ * @license lucide-react v0.564.0 - ISC
208
+ *
209
+ * This source code is licensed under the ISC license.
210
+ * See the LICENSE file in the root directory of this source tree.
211
+ */const y3=[["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"}]],v3=Jt("moon",y3);/**
212
+ * @license lucide-react v0.564.0 - ISC
213
+ *
214
+ * This source code is licensed under the ISC license.
215
+ * See the LICENSE file in the root directory of this source tree.
216
+ */const b3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],x3=Jt("panel-left",b3);/**
217
+ * @license lucide-react v0.564.0 - ISC
218
+ *
219
+ * This source code is licensed under the ISC license.
220
+ * See the LICENSE file in the root directory of this source tree.
221
+ */const w3=[["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"}]],S3=Jt("panels-top-left",w3);/**
222
+ * @license lucide-react v0.564.0 - ISC
223
+ *
224
+ * This source code is licensed under the ISC license.
225
+ * See the LICENSE file in the root directory of this source tree.
226
+ */const E3=[["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"}]],Gh=Jt("pencil",E3);/**
227
+ * @license lucide-react v0.564.0 - ISC
228
+ *
229
+ * This source code is licensed under the ISC license.
230
+ * See the LICENSE file in the root directory of this source tree.
231
+ */const R3=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xh=Jt("plus",R3);/**
232
+ * @license lucide-react v0.564.0 - ISC
233
+ *
234
+ * This source code is licensed under the ISC license.
235
+ * See the LICENSE file in the root directory of this source tree.
236
+ */const T3=[["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"}]],C3=Jt("power-off",T3);/**
237
+ * @license lucide-react v0.564.0 - ISC
238
+ *
239
+ * This source code is licensed under the ISC license.
240
+ * See the LICENSE file in the root directory of this source tree.
241
+ */const O3=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],M3=Jt("power",O3);/**
242
+ * @license lucide-react v0.564.0 - ISC
243
+ *
244
+ * This source code is licensed under the ISC license.
245
+ * See the LICENSE file in the root directory of this source tree.
246
+ */const N3=[["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"}]],zC=Jt("radar",N3);/**
247
+ * @license lucide-react v0.564.0 - ISC
248
+ *
249
+ * This source code is licensed under the ISC license.
250
+ * See the LICENSE file in the root directory of this source tree.
251
+ */const A3=[["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"}]],UC=Jt("refresh-ccw",A3);/**
252
+ * @license lucide-react v0.564.0 - ISC
253
+ *
254
+ * This source code is licensed under the ISC license.
255
+ * See the LICENSE file in the root directory of this source tree.
256
+ */const D3=[["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"}]],k3=Jt("settings",D3);/**
257
+ * @license lucide-react v0.564.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */const j3=[["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"}]],_3=Jt("sparkles",j3);/**
262
+ * @license lucide-react v0.564.0 - ISC
263
+ *
264
+ * This source code is licensed under the ISC license.
265
+ * See the LICENSE file in the root directory of this source tree.
266
+ */const L3=[["path",{d:"M8 19H5c-1 0-2-1-2-2V7c0-1 1-2 2-2h3",key:"lubmu8"}],["path",{d:"M16 5h3c1 0 2 1 2 2v10c0 1-1 2-2 2h-3",key:"1ag34g"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]],HC=Jt("square-split-horizontal",L3);/**
267
+ * @license lucide-react v0.564.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */const I3=[["path",{d:"M5 8V5c0-1 1-2 2-2h10c1 0 2 1 2 2v3",key:"1pi83i"}],["path",{d:"M19 16v3c0 1-1 2-2 2H7c-1 0-2-1-2-2v-3",key:"ido5k7"}],["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}]],BC=Jt("square-split-vertical",I3);/**
272
+ * @license lucide-react v0.564.0 - ISC
273
+ *
274
+ * This source code is licensed under the ISC license.
275
+ * See the LICENSE file in the root directory of this source tree.
276
+ */const P3=[["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"}]],z3=Jt("sun",P3);/**
277
+ * @license lucide-react v0.564.0 - ISC
278
+ *
279
+ * This source code is licensed under the ISC license.
280
+ * See the LICENSE file in the root directory of this source tree.
281
+ */const U3=[["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"}]],FC=Jt("trash-2",U3);/**
282
+ * @license lucide-react v0.564.0 - ISC
283
+ *
284
+ * This source code is licensed under the ISC license.
285
+ * See the LICENSE file in the root directory of this source tree.
286
+ */const H3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Si=Jt("x",H3);function B3(e){return e==="WS_CONNECTING"||e==="HELLO_NEGOTIATING"||e==="RECONNECT_BACKOFF"||e==="CLOSED"}function F3(){const{t:e}=yr(),t=rn(m=>m.connectionState),n=rn(m=>m.hasConnectedOnce),[a,s]=y.useState("hidden"),i=y.useRef(a);i.current=a;const c=B3(t);y.useEffect(()=>{c&&(i.current==="hidden"||i.current==="exiting")?(s("entering"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{s("visible")})})):!c&&i.current==="visible"&&s("exiting")},[c]);const d=()=>{i.current==="exiting"&&s("hidden")};if(a==="hidden")return null;const h=t==="CLOSED",f=!n&&!h,g={bottom:"calc(1rem + env(safe-area-inset-bottom, 0px))",transition:a==="exiting"?"transform 300ms ease-in, opacity 300ms ease-in":"transform 300ms ease-out, opacity 300ms ease-out",transform:a==="visible"?"translateY(0)":a==="exiting"?"translateY(20px) scale(0.8)":"translateY(20px)",opacity:a==="visible"?1:0};return h?E.jsxs("div",{className:"fixed z-50 right-4 flex items-center rounded-full bg-background border border-border shadow-lg px-3 py-2 gap-2 text-sm text-destructive cursor-pointer",style:g,onTransitionEnd:d,onClick:()=>nn().reconnect(),children:[E.jsx(UC,{className:"size-4"}),E.jsx("span",{children:e("websocket.reconnect")})]}):f?E.jsx("div",{className:"fixed z-50 right-4 flex items-center rounded-full bg-background border border-border shadow-lg p-2.5 text-sm text-muted-foreground",style:g,onTransitionEnd:d,children:E.jsx(Yl,{className:"size-4 animate-spin"})}):E.jsxs("div",{className:"fixed z-50 right-4 flex items-center rounded-full bg-background border border-border shadow-lg px-3 py-2 gap-2 text-sm text-muted-foreground",style:g,onTransitionEnd:d,children:[E.jsx(Yl,{className:"size-4 animate-spin"}),E.jsx("span",{children:e("websocket.reconnecting")})]})}function tv(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const xu={};function ca(e,t,n,a,s){let i={...nv(e,xu)};return t&&(i=mu(i,t)),n&&(i=mu(i,n)),a&&(i=mu(i,a)),s&&(i=mu(i,s)),i}function V3(e){if(e.length===0)return xu;if(e.length===1)return nv(e[0],xu);let t={...nv(e[0],xu)};for(let n=1;n<e.length;n+=1)t=mu(t,e[n]);return t}function mu(e,t){return VC(t)?t(e):Y3(e,t)}function Y3(e,t){if(!t)return e;for(const n in t){const a=t[n];switch(n){case"style":{e[n]=tv(e.style,a);break}case"className":{e[n]=YC(e.className,a);break}default:q3(n,a)?e[n]=$3(e[n],a):e[n]=a}}return e}function q3(e,t){const n=e.charCodeAt(0),a=e.charCodeAt(1),s=e.charCodeAt(2);return n===111&&a===110&&s>=65&&s<=90&&(typeof t=="function"||typeof t>"u")}function VC(e){return typeof e=="function"}function nv(e,t){return VC(e)?e(t):e??xu}function $3(e,t){return t?e?n=>{if(K3(n)){const s=n;rv(s);const i=t(s);return s.baseUIHandlerPrevented||e==null||e(s),i}const a=t(n);return e==null||e(n),a}:t:e}function rv(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function YC(e,t){return t?e?t+" "+e:t:e}function K3(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function yn(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(a=>n.searchParams.append("args[]",a)),`Base UI error #${e}; visit ${n} for the full message.`}const I1={};function Kn(e,t){const n=y.useRef(I1);return n.current===I1&&(n.current=e(t)),n}function wa(e,t,n,a){const s=Kn(qC).current;return X3(s,e,t,n,a)&&$C(s,[e,t,n,a]),s.callback}function G3(e){const t=Kn(qC).current;return W3(t,e)&&$C(t,e),t.callback}function qC(){return{callback:null,cleanup:null,refs:[]}}function X3(e,t,n,a,s){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==a||e.refs[3]!==s}function W3(e,t){return e.refs.length!==t.length||e.refs.some((n,a)=>n!==t[a])}function $C(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 a=Array(t.length).fill(null);for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const c=i(n);typeof c=="function"&&(a[s]=c);break}case"object":{i.current=n;break}}}e.cleanup=()=>{for(let s=0;s<t.length;s+=1){const i=t[s];if(i!=null)switch(typeof i){case"function":{const c=a[s];typeof c=="function"?c():i(null);break}case"object":{i.current=null;break}}}}}}}const Q3=parseInt(y.version,10);function hb(e){return Q3>=e}function P1(e){if(!y.isValidElement(e))return null;const t=e,n=t.props;return(hb(19)?n==null?void 0:n.ref:t.ref)??null}function Z3(e,t){const n={};for(const a in e){const s=e[a];if(t!=null&&t.hasOwnProperty(a)){const i=t[a](s);i!=null&&Object.assign(n,i);continue}s===!0?n[`data-${a.toLowerCase()}`]="":s&&(n[`data-${a.toLowerCase()}`]=s.toString())}return n}function J3(e,t){return typeof e=="function"?e(t):e}function e4(e,t){return typeof e=="function"?e(t):e}function Mr(){}const Es=Object.freeze([]),Tn=Object.freeze({}),t4=500,n4=500,r4={style:{transition:"none"}},a4="data-base-ui-click-trigger",KC={fallbackAxisSide:"none"},GC={fallbackAxisSide:"end"},o4={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Nt(e,t,n={}){const a=t.render,s=s4(t,n);if(n.enabled===!1)return null;const i=n.state??Tn;return l4(e,a,s,i)}function s4(e,t={}){const{className:n,style:a,render:s}=e,{state:i=Tn,ref:c,props:d,stateAttributesMapping:h,enabled:f=!0}=t,g=f?J3(n,i):void 0,m=f?e4(a,i):void 0,b=f?Z3(i,h):Tn,x=f?tv(b,Array.isArray(d)?V3(d):d)??Tn:Tn;return typeof document<"u"&&(f?Array.isArray(c)?x.ref=G3([x.ref,P1(s),...c]):x.ref=wa(x.ref,P1(s),c):wa(null,null)),f?(g!==void 0&&(x.className=YC(x.className,g)),m!==void 0&&(x.style=tv(x.style,m)),x):Tn}const i4=Symbol.for("react.lazy");function l4(e,t,n,a){if(t){if(typeof t=="function")return t(n,a);const s=ca(n,t.props);s.ref=n.ref;let i=t;return(i==null?void 0:i.$$typeof)===i4&&(i=y.Children.toArray(t)[0]),y.cloneElement(i,s)}if(e&&typeof e=="string")return c4(e,n);throw new Error(yn(8))}function c4(e,t){return e==="button"?y.createElement("button",{type:"button",...t,key:t.key}):e==="img"?y.createElement("img",{alt:"",...t,key:t.key}):y.createElement(e,t)}function Wh(e){return Nt(e.defaultTagName??"div",e,e)}function XC(e){var t,n,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=XC(e[t]))&&(a&&(a+=" "),a+=n)}else for(n in e)e[n]&&(a&&(a+=" "),a+=n);return a}function WC(){for(var e,t,n=0,a="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=XC(e))&&(a&&(a+=" "),a+=t);return a}const z1=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,U1=WC,Qh=(e,t)=>n=>{var a;if((t==null?void 0:t.variants)==null)return U1(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=t,c=Object.keys(s).map(f=>{const g=n==null?void 0:n[f],m=i==null?void 0:i[f];if(g===null)return null;const b=z1(g)||z1(m);return s[f][b]}),d=n&&Object.entries(n).reduce((f,g)=>{let[m,b]=g;return b===void 0||(f[m]=b),f},{}),h=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((f,g)=>{let{class:m,className:b,...x}=g;return Object.entries(x).every(w=>{let[S,R]=w;return Array.isArray(R)?R.includes({...i,...d}[S]):{...i,...d}[S]===R})?[...f,m,b]:f},[]);return U1(e,c,h,n==null?void 0:n.class,n==null?void 0:n.className)},ey=768;function u4(){const[e,t]=y.useState(void 0);return y.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ey-1}px)`),a=()=>{t(window.innerWidth<ey)};return n.addEventListener("change",a),t(window.innerWidth<ey),()=>n.removeEventListener("change",a)},[]),!!e}const d4=(e,t)=>{const n=new Array(e.length+t.length);for(let a=0;a<e.length;a++)n[a]=e[a];for(let a=0;a<t.length;a++)n[e.length+a]=t[a];return n},f4=(e,t)=>({classGroupId:e,validator:t}),QC=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Eh="-",H1=[],h4="arbitrary..",m4=e=>{const t=g4(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:a}=e;return{getClassGroupId:c=>{if(c.startsWith("[")&&c.endsWith("]"))return p4(c);const d=c.split(Eh),h=d[0]===""&&d.length>1?1:0;return ZC(d,h,t)},getConflictingClassGroupIds:(c,d)=>{if(d){const h=a[c],f=n[c];return h?f?d4(f,h):h:f||H1}return n[c]||H1}}},ZC=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const s=e[t],i=n.nextPart.get(s);if(i){const f=ZC(e,t+1,i);if(f)return f}const c=n.validators;if(c===null)return;const d=t===0?e.join(Eh):e.slice(t).join(Eh),h=c.length;for(let f=0;f<h;f++){const g=c[f];if(g.validator(d))return g.classGroupId}},p4=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),a=t.slice(0,n);return a?h4+a:void 0})(),g4=e=>{const{theme:t,classGroups:n}=e;return y4(n,t)},y4=(e,t)=>{const n=QC();for(const a in e){const s=e[a];mb(s,n,a,t)}return n},mb=(e,t,n,a)=>{const s=e.length;for(let i=0;i<s;i++){const c=e[i];v4(c,t,n,a)}},v4=(e,t,n,a)=>{if(typeof e=="string"){b4(e,t,n);return}if(typeof e=="function"){x4(e,t,n,a);return}w4(e,t,n,a)},b4=(e,t,n)=>{const a=e===""?t:JC(t,e);a.classGroupId=n},x4=(e,t,n,a)=>{if(S4(e)){mb(e(a),t,n,a);return}t.validators===null&&(t.validators=[]),t.validators.push(f4(n,e))},w4=(e,t,n,a)=>{const s=Object.entries(e),i=s.length;for(let c=0;c<i;c++){const[d,h]=s[c];mb(h,JC(t,d),n,a)}},JC=(e,t)=>{let n=e;const a=t.split(Eh),s=a.length;for(let i=0;i<s;i++){const c=a[i];let d=n.nextPart.get(c);d||(d=QC(),n.nextPart.set(c,d)),n=d}return n},S4=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,E4=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),a=Object.create(null);const s=(i,c)=>{n[i]=c,t++,t>e&&(t=0,a=n,n=Object.create(null))};return{get(i){let c=n[i];if(c!==void 0)return c;if((c=a[i])!==void 0)return s(i,c),c},set(i,c){i in n?n[i]=c:s(i,c)}}},av="!",B1=":",R4=[],F1=(e,t,n,a,s)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:a,isExternal:s}),T4=e=>{const{prefix:t,experimentalParseClassName:n}=e;let a=s=>{const i=[];let c=0,d=0,h=0,f;const g=s.length;for(let S=0;S<g;S++){const R=s[S];if(c===0&&d===0){if(R===B1){i.push(s.slice(h,S)),h=S+1;continue}if(R==="/"){f=S;continue}}R==="["?c++:R==="]"?c--:R==="("?d++:R===")"&&d--}const m=i.length===0?s:s.slice(h);let b=m,x=!1;m.endsWith(av)?(b=m.slice(0,-1),x=!0):m.startsWith(av)&&(b=m.slice(1),x=!0);const w=f&&f>h?f-h:void 0;return F1(i,x,b,w)};if(t){const s=t+B1,i=a;a=c=>c.startsWith(s)?i(c.slice(s.length)):F1(R4,!1,c,void 0,!0)}if(n){const s=a;a=i=>n({className:i,parseClassName:s})}return a},C4=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,a)=>{t.set(n,1e6+a)}),n=>{const a=[];let s=[];for(let i=0;i<n.length;i++){const c=n[i],d=c[0]==="[",h=t.has(c);d||h?(s.length>0&&(s.sort(),a.push(...s),s=[]),a.push(c)):s.push(c)}return s.length>0&&(s.sort(),a.push(...s)),a}},O4=e=>({cache:E4(e.cacheSize),parseClassName:T4(e),sortModifiers:C4(e),...m4(e)}),M4=/\s+/,N4=(e,t)=>{const{parseClassName:n,getClassGroupId:a,getConflictingClassGroupIds:s,sortModifiers:i}=t,c=[],d=e.trim().split(M4);let h="";for(let f=d.length-1;f>=0;f-=1){const g=d[f],{isExternal:m,modifiers:b,hasImportantModifier:x,baseClassName:w,maybePostfixModifierPosition:S}=n(g);if(m){h=g+(h.length>0?" "+h:h);continue}let R=!!S,T=a(R?w.substring(0,S):w);if(!T){if(!R){h=g+(h.length>0?" "+h:h);continue}if(T=a(w),!T){h=g+(h.length>0?" "+h:h);continue}R=!1}const C=b.length===0?"":b.length===1?b[0]:i(b).join(":"),M=x?C+av:C,O=M+T;if(c.indexOf(O)>-1)continue;c.push(O);const D=s(T,R);for(let k=0;k<D.length;++k){const A=D[k];c.push(M+A)}h=g+(h.length>0?" "+h:h)}return h},A4=(...e)=>{let t=0,n,a,s="";for(;t<e.length;)(n=e[t++])&&(a=eO(n))&&(s&&(s+=" "),s+=a);return s},eO=e=>{if(typeof e=="string")return e;let t,n="";for(let a=0;a<e.length;a++)e[a]&&(t=eO(e[a]))&&(n&&(n+=" "),n+=t);return n},D4=(e,...t)=>{let n,a,s,i;const c=h=>{const f=t.reduce((g,m)=>m(g),e());return n=O4(f),a=n.cache.get,s=n.cache.set,i=d,d(h)},d=h=>{const f=a(h);if(f)return f;const g=N4(h,n);return s(h,g),g};return i=c,(...h)=>i(A4(...h))},k4=[],Yn=e=>{const t=n=>n[e]||k4;return t.isThemeGetter=!0,t},tO=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,nO=/^\((?:(\w[\w-]*):)?(.+)\)$/i,j4=/^\d+\/\d+$/,_4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,L4=/\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$/,I4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,P4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,z4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dl=e=>j4.test(e),zt=e=>!!e&&!Number.isNaN(Number(e)),es=e=>!!e&&Number.isInteger(Number(e)),ty=e=>e.endsWith("%")&&zt(e.slice(0,-1)),mo=e=>_4.test(e),U4=()=>!0,H4=e=>L4.test(e)&&!I4.test(e),rO=()=>!1,B4=e=>P4.test(e),F4=e=>z4.test(e),V4=e=>!at(e)&&!ot(e),Y4=e=>ec(e,sO,rO),at=e=>tO.test(e),Zs=e=>ec(e,iO,H4),ny=e=>ec(e,X4,zt),V1=e=>ec(e,aO,rO),q4=e=>ec(e,oO,F4),If=e=>ec(e,lO,B4),ot=e=>nO.test(e),su=e=>tc(e,iO),$4=e=>tc(e,W4),Y1=e=>tc(e,aO),K4=e=>tc(e,sO),G4=e=>tc(e,oO),Pf=e=>tc(e,lO,!0),ec=(e,t,n)=>{const a=tO.exec(e);return a?a[1]?t(a[1]):n(a[2]):!1},tc=(e,t,n=!1)=>{const a=nO.exec(e);return a?a[1]?t(a[1]):n:!1},aO=e=>e==="position"||e==="percentage",oO=e=>e==="image"||e==="url",sO=e=>e==="length"||e==="size"||e==="bg-size",iO=e=>e==="length",X4=e=>e==="number",W4=e=>e==="family-name",lO=e=>e==="shadow",Q4=()=>{const e=Yn("color"),t=Yn("font"),n=Yn("text"),a=Yn("font-weight"),s=Yn("tracking"),i=Yn("leading"),c=Yn("breakpoint"),d=Yn("container"),h=Yn("spacing"),f=Yn("radius"),g=Yn("shadow"),m=Yn("inset-shadow"),b=Yn("text-shadow"),x=Yn("drop-shadow"),w=Yn("blur"),S=Yn("perspective"),R=Yn("aspect"),T=Yn("ease"),C=Yn("animate"),M=()=>["auto","avoid","all","avoid-page","page","left","right","column"],O=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],D=()=>[...O(),ot,at],k=()=>["auto","hidden","clip","visible","scroll"],A=()=>["auto","contain","none"],j=()=>[ot,at,h],B=()=>[dl,"full","auto",...j()],W=()=>[es,"none","subgrid",ot,at],K=()=>["auto",{span:["full",es,ot,at]},es,ot,at],I=()=>[es,"auto",ot,at],H=()=>["auto","min","max","fr",ot,at],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...j()],L=()=>[dl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],P=()=>[e,ot,at],V=()=>[...O(),Y1,V1,{position:[ot,at]}],Q=()=>["no-repeat",{repeat:["","x","y","space","round"]}],z=()=>["auto","cover","contain",K4,Y4,{size:[ot,at]}],Y=()=>[ty,su,Zs],X=()=>["","none","full",f,ot,at],G=()=>["",zt,su,Zs],ce=()=>["solid","dashed","dotted","double"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],de=()=>[zt,ty,Y1,V1],ve=()=>["","none",w,ot,at],xe=()=>["none",zt,ot,at],Ne=()=>["none",zt,ot,at],_e=()=>[zt,ot,at],ee=()=>[dl,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[mo],breakpoint:[mo],color:[U4],container:[mo],"drop-shadow":[mo],ease:["in","out","in-out"],font:[V4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[mo],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[mo],shadow:[mo],spacing:["px",zt],text:[mo],"text-shadow":[mo],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dl,at,ot,R]}],container:["container"],columns:[{columns:[zt,at,ot,d]}],"break-after":[{"break-after":M()}],"break-before":[{"break-before":M()}],"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:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:A()}],"overscroll-x":[{"overscroll-x":A()}],"overscroll-y":[{"overscroll-y":A()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{start:B()}],end:[{end:B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[es,"auto",ot,at]}],basis:[{basis:[dl,"full","auto",d,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[zt,dl,"auto","initial","none",at]}],grow:[{grow:["",zt,ot,at]}],shrink:[{shrink:["",zt,ot,at]}],order:[{order:[es,"first","last","none",ot,at]}],"grid-cols":[{"grid-cols":W()}],"col-start-end":[{col:K()}],"col-start":[{"col-start":I()}],"col-end":[{"col-end":I()}],"grid-rows":[{"grid-rows":W()}],"row-start-end":[{row:K()}],"row-start":[{"row-start":I()}],"row-end":[{"row-end":I()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":H()}],"auto-rows":[{"auto-rows":H()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:L()}],w:[{w:[d,"screen",...L()]}],"min-w":[{"min-w":[d,"screen","none",...L()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[c]},...L()]}],h:[{h:["screen","lh",...L()]}],"min-h":[{"min-h":["screen","lh","none",...L()]}],"max-h":[{"max-h":["screen","lh",...L()]}],"font-size":[{text:["base",n,su,Zs]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[a,ot,ny]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ty,at]}],"font-family":[{font:[$4,at,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:[s,ot,at]}],"line-clamp":[{"line-clamp":[zt,"none",ot,ny]}],leading:[{leading:[i,...j()]}],"list-image":[{"list-image":["none",ot,at]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",ot,at]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[zt,"from-font","auto",ot,Zs]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[zt,"auto",ot,at]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",ot,at]}],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",ot,at]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:V()}],"bg-repeat":[{bg:Q()}],"bg-size":[{bg:z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},es,ot,at],radial:["",ot,at],conic:[es,ot,at]},G4,q4]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:Y()}],"gradient-via-pos":[{via:Y()}],"gradient-to-pos":[{to:Y()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:X()}],"rounded-s":[{"rounded-s":X()}],"rounded-e":[{"rounded-e":X()}],"rounded-t":[{"rounded-t":X()}],"rounded-r":[{"rounded-r":X()}],"rounded-b":[{"rounded-b":X()}],"rounded-l":[{"rounded-l":X()}],"rounded-ss":[{"rounded-ss":X()}],"rounded-se":[{"rounded-se":X()}],"rounded-ee":[{"rounded-ee":X()}],"rounded-es":[{"rounded-es":X()}],"rounded-tl":[{"rounded-tl":X()}],"rounded-tr":[{"rounded-tr":X()}],"rounded-br":[{"rounded-br":X()}],"rounded-bl":[{"rounded-bl":X()}],"border-w":[{border:G()}],"border-w-x":[{"border-x":G()}],"border-w-y":[{"border-y":G()}],"border-w-s":[{"border-s":G()}],"border-w-e":[{"border-e":G()}],"border-w-t":[{"border-t":G()}],"border-w-r":[{"border-r":G()}],"border-w-b":[{"border-b":G()}],"border-w-l":[{"border-l":G()}],"divide-x":[{"divide-x":G()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":G()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[zt,ot,at]}],"outline-w":[{outline:["",zt,su,Zs]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",g,Pf,If]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",m,Pf,If]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:G()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[zt,Zs]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":G()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",b,Pf,If]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[zt,ot,at]}],"mix-blend":[{"mix-blend":[...oe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":oe()}],"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":[zt]}],"mask-image-linear-from-pos":[{"mask-linear-from":de()}],"mask-image-linear-to-pos":[{"mask-linear-to":de()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":de()}],"mask-image-t-to-pos":[{"mask-t-to":de()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":de()}],"mask-image-r-to-pos":[{"mask-r-to":de()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":de()}],"mask-image-b-to-pos":[{"mask-b-to":de()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":de()}],"mask-image-l-to-pos":[{"mask-l-to":de()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":de()}],"mask-image-x-to-pos":[{"mask-x-to":de()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":de()}],"mask-image-y-to-pos":[{"mask-y-to":de()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[ot,at]}],"mask-image-radial-from-pos":[{"mask-radial-from":de()}],"mask-image-radial-to-pos":[{"mask-radial-to":de()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"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":O()}],"mask-image-conic-pos":[{"mask-conic":[zt]}],"mask-image-conic-from-pos":[{"mask-conic-from":de()}],"mask-image-conic-to-pos":[{"mask-conic-to":de()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:V()}],"mask-repeat":[{mask:Q()}],"mask-size":[{mask:z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",ot,at]}],filter:[{filter:["","none",ot,at]}],blur:[{blur:ve()}],brightness:[{brightness:[zt,ot,at]}],contrast:[{contrast:[zt,ot,at]}],"drop-shadow":[{"drop-shadow":["","none",x,Pf,If]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",zt,ot,at]}],"hue-rotate":[{"hue-rotate":[zt,ot,at]}],invert:[{invert:["",zt,ot,at]}],saturate:[{saturate:[zt,ot,at]}],sepia:[{sepia:["",zt,ot,at]}],"backdrop-filter":[{"backdrop-filter":["","none",ot,at]}],"backdrop-blur":[{"backdrop-blur":ve()}],"backdrop-brightness":[{"backdrop-brightness":[zt,ot,at]}],"backdrop-contrast":[{"backdrop-contrast":[zt,ot,at]}],"backdrop-grayscale":[{"backdrop-grayscale":["",zt,ot,at]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[zt,ot,at]}],"backdrop-invert":[{"backdrop-invert":["",zt,ot,at]}],"backdrop-opacity":[{"backdrop-opacity":[zt,ot,at]}],"backdrop-saturate":[{"backdrop-saturate":[zt,ot,at]}],"backdrop-sepia":[{"backdrop-sepia":["",zt,ot,at]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",ot,at]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[zt,"initial",ot,at]}],ease:[{ease:["linear","initial",T,ot,at]}],delay:[{delay:[zt,ot,at]}],animate:[{animate:["none",C,ot,at]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[S,ot,at]}],"perspective-origin":[{"perspective-origin":D()}],rotate:[{rotate:xe()}],"rotate-x":[{"rotate-x":xe()}],"rotate-y":[{"rotate-y":xe()}],"rotate-z":[{"rotate-z":xe()}],scale:[{scale:Ne()}],"scale-x":[{"scale-x":Ne()}],"scale-y":[{"scale-y":Ne()}],"scale-z":[{"scale-z":Ne()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[ot,at,"","none","gpu","cpu"]}],"transform-origin":[{origin:D()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ee()}],"translate-x":[{"translate-x":ee()}],"translate-y":[{"translate-y":ee()}],"translate-z":[{"translate-z":ee()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"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",ot,at]}],"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":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"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",ot,at]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[zt,su,Zs,ny]}],stroke:[{stroke:["none",...P()]}],"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"]}},Z4=D4(Q4);function Oe(...e){return Z4(WC(e))}function Zh(){return typeof window<"u"}function Ts(e){return pb(e)?(e.nodeName||"").toLowerCase():"#document"}function _n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function $a(e){var t;return(t=(pb(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function pb(e){return Zh()?e instanceof Node||e instanceof _n(e).Node:!1}function an(e){return Zh()?e instanceof Element||e instanceof _n(e).Element:!1}function wn(e){return Zh()?e instanceof HTMLElement||e instanceof _n(e).HTMLElement:!1}function ov(e){return!Zh()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _n(e).ShadowRoot}const J4=new Set(["inline","contents"]);function Cs(e){const{overflow:t,overflowX:n,overflowY:a,display:s}=Yr(e);return/auto|scroll|overlay|hidden|clip/.test(t+a+n)&&!J4.has(s)}const eU=new Set(["table","td","th"]);function tU(e){return eU.has(Ts(e))}const nU=[":popover-open",":modal"];function Jh(e){return nU.some(t=>{try{return e.matches(t)}catch{return!1}})}const rU=["transform","translate","scale","rotate","perspective"],aU=["transform","translate","scale","rotate","perspective","filter"],oU=["paint","layout","strict","content"];function gb(e){const t=em(),n=an(e)?Yr(e):e;return rU.some(a=>n[a]?n[a]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||aU.some(a=>(n.willChange||"").includes(a))||oU.some(a=>(n.contain||"").includes(a))}function sU(e){let t=Fa(e);for(;wn(t)&&!za(t);){if(gb(t))return t;if(Jh(t))return null;t=Fa(t)}return null}function em(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const iU=new Set(["html","body","#document"]);function za(e){return iU.has(Ts(e))}function Yr(e){return _n(e).getComputedStyle(e)}function tm(e){return an(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fa(e){if(Ts(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ov(e)&&e.host||$a(e);return ov(t)?t.host:t}function cO(e){const t=Fa(e);return za(t)?e.ownerDocument?e.ownerDocument.body:e.body:wn(t)&&Cs(t)?t:cO(t)}function bs(e,t,n){var a;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=cO(e),i=s===((a=e.ownerDocument)==null?void 0:a.body),c=_n(s);if(i){const d=sv(c);return t.concat(c,c.visualViewport||[],Cs(s)?s:[],d&&n?bs(d):[])}return t.concat(s,bs(s,[],n))}function sv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const ry=Kv[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],lU=ry&&ry!==y.useLayoutEffect?ry:e=>e();function Be(e){const t=Kn(cU).current;return t.next=e,lU(t.effect),t.trampoline}function cU(){const e={next:void 0,callback:uU,trampoline:(...t)=>{var n;return(n=e.callback)==null?void 0:n.call(e,...t)},effect:()=>{e.callback=e.next}};return e}function uU(){}const dU={...Kv},fU=()=>{},Ue=typeof document<"u"?y.useLayoutEffect:fU,uO=y.createContext(void 0);function yb(e=!1){const t=y.useContext(uO);if(t===void 0&&!e)throw new Error(yn(16));return t}function hU(e){const{focusableWhenDisabled:t,disabled:n,composite:a=!1,tabIndex:s=0,isNativeButton:i}=e,c=a&&t!==!1,d=a&&t===!1;return{props:y.useMemo(()=>{const f={onKeyDown(g){n&&t&&g.key!=="Tab"&&g.preventDefault()}};return a||(f.tabIndex=s,!i&&n&&(f.tabIndex=t?s:-1)),(i&&(t||c)||!i&&n)&&(f["aria-disabled"]=n),i&&(!t||d)&&(f.disabled=n),f},[a,n,t,c,d,i,s])}}function Oo(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:a=0,native:s=!0}=e,i=y.useRef(null),c=yb(!0)!==void 0,d=Be(()=>{const b=i.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:h}=hU({focusableWhenDisabled:n,disabled:t,composite:c,tabIndex:a,isNativeButton:s}),f=y.useCallback(()=>{const b=i.current;mU(b)&&c&&t&&h.disabled===void 0&&b.disabled&&(b.disabled=!1)},[t,h.disabled,c]);Ue(f,[f]);const g=y.useCallback((b={})=>{const{onClick:x,onMouseDown:w,onKeyUp:S,onKeyDown:R,onPointerDown:T,...C}=b;return ca({type:s?"button":void 0,onClick(O){if(t){O.preventDefault();return}x==null||x(O)},onMouseDown(O){t||w==null||w(O)},onKeyDown(O){if(t||(rv(O),R==null||R(O)),O.baseUIHandlerPrevented)return;const D=O.target===O.currentTarget&&!s&&!d()&&!t,k=O.key==="Enter",A=O.key===" ";D&&((A||k)&&O.preventDefault(),k&&(x==null||x(O)))},onKeyUp(O){t||(rv(O),S==null||S(O)),!O.baseUIHandlerPrevented&&O.target===O.currentTarget&&!s&&!t&&O.key===" "&&(x==null||x(O))},onPointerDown(O){if(t){O.preventDefault();return}T==null||T(O)}},s?void 0:{role:"button"},h,C)},[t,h,s,d]),m=Be(b=>{i.current=b,f()});return{getButtonProps:g,buttonRef:m}}function mU(e){return wn(e)&&e.tagName==="BUTTON"}const pU=y.forwardRef(function(t,n){const{render:a,className:s,disabled:i=!1,focusableWhenDisabled:c=!1,nativeButton:d=!0,...h}=t,{getButtonProps:f,buttonRef:g}=Oo({disabled:i,focusableWhenDisabled:c,native:d});return Nt("button",t,{state:{disabled:i},ref:[n,g],props:[h,f]})}),gU=Qh("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 Cn({className:e,variant:t="default",size:n="default",...a}){return E.jsx(pU,{"data-slot":"button",className:Oe(gU({variant:t,size:n,className:e})),...a})}let q1=(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 yU={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},vb={valid(e){return e===null?null:e?{[q1.valid]:""}:{[q1.invalid]:""}}},vU=y.createContext({invalid:void 0,name:void 0,validityData:{state:yU,errors:[],error:"",value:"",initialValue:null},setValidityData:Mr,disabled:void 0,touched:!1,setTouched:Mr,dirty:!1,setDirty:Mr,filled:!1,setFilled:Mr,focused:!1,setFocused:Mr,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=Tn)=>e,getInputValidationProps:(e=Tn)=>e,inputRef:{current:null},commit:async()=>{}}});function nc(e=!0){const t=y.useContext(vU);if(t.setValidityData===Mr&&!e)throw new Error(yn(28));return t}const bU=y.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Mr,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function bb(){return y.useContext(bU)}let $1=0;function xU(e,t="mui"){const[n,a]=y.useState(e),s=e||n;return y.useEffect(()=>{n==null&&($1+=1,a(`${t}-${$1}`))},[n,t]),s}const K1=dU.useId;function Ai(e,t){if(K1!==void 0){const n=K1();return e??(t?`${t}-${n}`:n)}return xU(e,t)}function Ta(e){return Ai(e,"base-ui")}const wU=y.createContext({controlId:void 0,registerControlId:Mr,labelId:void 0,setLabelId:Mr,messageIds:[],setMessageIds:Mr,getDescriptionProps:e=>e});function nm(){return y.useContext(wU)}const SU=[];function rm(e){y.useEffect(e,SU)}const iu=0;class Va{constructor(){We(this,"currentId",iu);We(this,"clear",()=>{this.currentId!==iu&&(clearTimeout(this.currentId),this.currentId=iu)});We(this,"disposeEffect",()=>this.clear)}static create(){return new Va}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=iu,n()},t)}isStarted(){return this.currentId!==iu}}function jn(){const e=Kn(Va.create).current;return rm(e.disposeEffect),e}function EU(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}function qt(e){return(e==null?void 0:e.ownerDocument)||document}const rc=typeof navigator<"u",ay=TU(),dO=OU(),fO=CU(),am=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),hO=ay.platform==="MacIntel"&&ay.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(ay.platform),mO=rc&&/apple/i.test(navigator.vendor),iv=rc&&/android/i.test(dO)||/android/i.test(fO),RU=rc&&dO.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,pO=fO.includes("jsdom/");function TU(){if(!rc)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 CU(){if(!rc)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function OU(){if(!rc)return"";const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform??""}const lv="data-base-ui-focusable",gO="active",yO="selected",vO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",xs="ArrowLeft",ws="ArrowRight",xb="ArrowUp",nd="ArrowDown";function Br(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 Mt(e,t){var a;if(!e||!t)return!1;const n=(a=t.getRootNode)==null?void 0:a.call(t);if(e.contains(t))return!0;if(n&&ov(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Rh(e,t){if(!an(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,a]of t.entries())if(Mt(a,n))return!a.hasAttribute("data-trigger-disabled");return!1}function gr(e){return"composedPath"in e?e.composedPath()[0]:e.target}function ya(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 MU(e){return e.matches("html,body")}function om(e){return wn(e)&&e.matches(vO)}function cv(e){return e?e.getAttribute("role")==="combobox"&&om(e):!1}function NU(e){if(!e||pO)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function Iu(e){return e?e.hasAttribute(lv)?e:e.querySelector(`[${lv}]`)||e:null}function pi(e,t,n=!0){return e.filter(s=>{var i;return s.parentId===t&&(!n||((i=s.context)==null?void 0:i.open))}).flatMap(s=>[s,...pi(e,s.id,n)])}function G1(e,t){var s;let n=[],a=(s=e.find(i=>i.id===t))==null?void 0:s.parentId;for(;a;){const i=e.find(c=>c.id===a);a=i==null?void 0:i.parentId,i&&(n=n.concat(i))}return n}function cr(e){e.preventDefault(),e.stopPropagation()}function AU(e){return"nativeEvent"in e}function bO(e){return e.pointerType===""&&e.isTrusted?!0:iv&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function xO(e){return pO?!1:!iv&&e.width===0&&e.height===0||iv&&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 Ei(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function wO(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const DU=["top","right","bottom","left"],ql=Math.min,Fr=Math.max,Th=Math.round,yl=Math.floor,Ua=e=>({x:e,y:e}),kU={left:"right",right:"left",bottom:"top",top:"bottom"},jU={start:"end",end:"start"};function uv(e,t,n){return Fr(e,ql(t,n))}function Co(e,t){return typeof e=="function"?e(t):e}function Nr(e){return e.split("-")[0]}function Os(e){return e.split("-")[1]}function wb(e){return e==="x"?"y":"x"}function Sb(e){return e==="y"?"height":"width"}const _U=new Set(["top","bottom"]);function sa(e){return _U.has(Nr(e))?"y":"x"}function Eb(e){return wb(sa(e))}function LU(e,t,n){n===void 0&&(n=!1);const a=Os(e),s=Eb(e),i=Sb(s);let c=s==="x"?a===(n?"end":"start")?"right":"left":a==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(c=Ch(c)),[c,Ch(c)]}function IU(e){const t=Ch(e);return[dv(e),t,dv(t)]}function dv(e){return e.replace(/start|end/g,t=>jU[t])}const X1=["left","right"],W1=["right","left"],PU=["top","bottom"],zU=["bottom","top"];function UU(e,t,n){switch(e){case"top":case"bottom":return n?t?W1:X1:t?X1:W1;case"left":case"right":return t?PU:zU;default:return[]}}function HU(e,t,n,a){const s=Os(e);let i=UU(Nr(e),n==="start",a);return s&&(i=i.map(c=>c+"-"+s),t&&(i=i.concat(i.map(dv)))),i}function Ch(e){return e.replace(/left|right|bottom|top/g,t=>kU[t])}function BU(e){return{top:0,right:0,bottom:0,left:0,...e}}function SO(e){return typeof e!="number"?BU(e):{top:e,right:e,bottom:e,left:e}}function Oh(e){const{x:t,y:n,width:a,height:s}=e;return{width:a,height:s,top:n,left:t,right:t+a,bottom:n+s,x:t,y:n}}function zf(e,t,n){return Math.floor(e/t)!==n}function wl(e,t){return t<0||t>=e.current.length}function ch(e,t){return ar(e,{disabledIndices:t})}function fv(e,t){return ar(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ar(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:a,amount:s=1}={}){let i=t;do i+=n?-s:s;while(i>=0&&i<=e.current.length-1&&Ss(e,i,a));return i}function EO(e,{event:t,orientation:n,loopFocus:a,rtl:s,cols:i,disabledIndices:c,minIndex:d,maxIndex:h,prevIndex:f,stopEvent:g=!1}){let m=f;const b=[],x={};let w=!1;{let T=null,C=-1;e.current.forEach((M,O)=>{if(M==null)return;const D=M.closest('[role="row"]');D&&(w=!0),(D!==T||C===-1)&&(T=D,C+=1,b[C]=[]),b[C].push(O),x[O]=C})}const S=w&&b.length>0&&b.some(T=>T.length!==i);function R(T){if(!S||f===-1)return;const C=x[f];if(C==null)return;const M=b[C].indexOf(f);let O=T==="up"?C-1:C+1;a&&(O<0?O=b.length-1:O>=b.length&&(O=0));const D=new Set;for(;O>=0&&O<b.length&&!D.has(O);){D.add(O);const k=b[O];if(k.length===0){O=T==="up"?O-1:O+1;continue}const A=Math.min(M,k.length-1);for(let j=A;j>=0;j-=1){const B=k[j];if(!Ss(e,B,c))return B}O=T==="up"?O-1:O+1,a&&(O<0?O=b.length-1:O>=b.length&&(O=0))}}if(t.key===xb){const T=R("up");if(T!==void 0)g&&cr(t),m=T;else{if(g&&cr(t),f===-1)m=h;else if(m=ar(e,{startingIndex:m,amount:i,decrement:!0,disabledIndices:c}),a&&(f-i<d||m<0)){const C=f%i,M=h%i,O=h-(M-C);M===C?m=h:m=M>C?O:O-i}wl(e,m)&&(m=f)}}if(t.key===nd){const T=R("down");T!==void 0?(g&&cr(t),m=T):(g&&cr(t),f===-1?m=d:(m=ar(e,{startingIndex:f,amount:i,disabledIndices:c}),a&&f+i>h&&(m=ar(e,{startingIndex:f%i-i,amount:i,disabledIndices:c}))),wl(e,m)&&(m=f))}if(n==="both"){const T=yl(f/i);t.key===(s?xs:ws)&&(g&&cr(t),f%i!==i-1?(m=ar(e,{startingIndex:f,disabledIndices:c}),a&&zf(m,i,T)&&(m=ar(e,{startingIndex:f-f%i-1,disabledIndices:c}))):a&&(m=ar(e,{startingIndex:f-f%i-1,disabledIndices:c})),zf(m,i,T)&&(m=f)),t.key===(s?ws:xs)&&(g&&cr(t),f%i!==0?(m=ar(e,{startingIndex:f,decrement:!0,disabledIndices:c}),a&&zf(m,i,T)&&(m=ar(e,{startingIndex:f+(i-f%i),decrement:!0,disabledIndices:c}))):a&&(m=ar(e,{startingIndex:f+(i-f%i),decrement:!0,disabledIndices:c})),zf(m,i,T)&&(m=f));const C=yl(h/i)===T;wl(e,m)&&(a&&C?m=t.key===(s?ws:xs)?h:ar(e,{startingIndex:f-f%i-1,disabledIndices:c}):m=f)}return m}function RO(e,t,n){const a=[];let s=0;return e.forEach(({width:i,height:c},d)=>{let h=!1;for(n&&(s=0);!h;){const f=[];for(let g=0;g<i;g+=1)for(let m=0;m<c;m+=1)f.push(s+g+m*t);s%t+i<=t&&f.every(g=>a[g]==null)?(f.forEach(g=>{a[g]=d}),h=!0):s+=1}}),[...a]}function TO(e,t,n,a,s){if(e===-1)return-1;const i=n.indexOf(e),c=t[e];switch(s){case"tl":return i;case"tr":return c?i+c.width-1:i;case"bl":return c?i+(c.height-1)*a:i;case"br":return n.lastIndexOf(e);default:return-1}}function CO(e,t){return t.flatMap((n,a)=>e.includes(n)?[a]:[])}function Ss(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const a=e.current[t];return a?a.hasAttribute("disabled")||a.getAttribute("aria-disabled")==="true":!1}/*!
287
+ * tabbable 6.4.0
288
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
289
+ */var FU=["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] *)"],Mh=FU.join(","),OO=typeof Element>"u",$l=OO?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Nh=!OO&&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},Ah=function(t,n){var a;n===void 0&&(n=!0);var s=t==null||(a=t.getAttribute)===null||a===void 0?void 0:a.call(t,"inert"),i=s===""||s==="true",c=i||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):Ah(t.parentNode));return c},VU=function(t){var n,a=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return a===""||a==="true"},MO=function(t,n,a){if(Ah(t))return[];var s=Array.prototype.slice.apply(t.querySelectorAll(Mh));return n&&$l.call(t,Mh)&&s.unshift(t),s=s.filter(a),s},Dh=function(t,n,a){for(var s=[],i=Array.from(t);i.length;){var c=i.shift();if(!Ah(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,f=Dh(h,!0,a);a.flatten?s.push.apply(s,f):s.push({scopeParent:c,candidates:f})}else{var g=$l.call(c,Mh);g&&a.filter(c)&&(n||!t.includes(c))&&s.push(c);var m=c.shadowRoot||typeof a.getShadowRoot=="function"&&a.getShadowRoot(c),b=!Ah(m,!1)&&(!a.shadowRootFilter||a.shadowRootFilter(c));if(m&&b){var x=Dh(m===!0?c.children:m.children,!0,a);a.flatten?s.push.apply(s,x):s.push({scopeParent:c,candidates:x})}else i.unshift.apply(i,c.children)}}return s},NO=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},AO=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||VU(t))&&!NO(t)?0:t.tabIndex},YU=function(t,n){var a=AO(t);return a<0&&n&&!NO(t)?0:a},qU=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},DO=function(t){return t.tagName==="INPUT"},$U=function(t){return DO(t)&&t.type==="hidden"},KU=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(a){return a.tagName==="SUMMARY"});return n},GU=function(t,n){for(var a=0;a<t.length;a++)if(t[a].checked&&t[a].form===n)return t[a]},XU=function(t){if(!t.name)return!0;var n=t.form||Nh(t),a=function(d){return n.querySelectorAll('input[type="radio"][name="'+d+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=a(window.CSS.escape(t.name));else try{s=a(t.name)}catch(c){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",c.message),!1}var i=GU(s,t.form);return!i||i===t},WU=function(t){return DO(t)&&t.type==="radio"},QU=function(t){return WU(t)&&!XU(t)},ZU=function(t){var n,a=t&&Nh(t),s=(n=a)===null||n===void 0?void 0:n.host,i=!1;if(a&&a!==t){var c,d,h;for(i=!!((c=s)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(s)||t!=null&&(h=t.ownerDocument)!==null&&h!==void 0&&h.contains(t));!i&&s;){var f,g,m;a=Nh(s),s=(f=a)===null||f===void 0?void 0:f.host,i=!!((g=s)!==null&&g!==void 0&&(m=g.ownerDocument)!==null&&m!==void 0&&m.contains(s))}}return i},Q1=function(t){var n=t.getBoundingClientRect(),a=n.width,s=n.height;return a===0&&s===0},JU=function(t,n){var a=n.displayCheck,s=n.getShadowRoot;if(a==="full-native"&&"checkVisibility"in t){var i=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(t).visibility==="hidden")return!0;var c=$l.call(t,"details>summary:first-of-type"),d=c?t.parentElement:t;if($l.call(d,"details:not([open]) *"))return!0;if(!a||a==="full"||a==="full-native"||a==="legacy-full"){if(typeof s=="function"){for(var h=t;t;){var f=t.parentElement,g=Nh(t);if(f&&!f.shadowRoot&&s(f)===!0)return Q1(t);t.assignedSlot?t=t.assignedSlot:!f&&g!==t.ownerDocument?t=g.host:t=f}t=h}if(ZU(t))return!t.getClientRects().length;if(a!=="legacy-full")return!0}else if(a==="non-zero-area")return Q1(t);return!1},eH=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var a=0;a<n.children.length;a++){var s=n.children.item(a);if(s.tagName==="LEGEND")return $l.call(n,"fieldset[disabled] *")?!0:!s.contains(t)}return!0}n=n.parentElement}return!1},hv=function(t,n){return!(n.disabled||$U(n)||JU(n,t)||KU(n)||eH(n))},mv=function(t,n){return!(QU(n)||AO(n)<0||!hv(t,n))},tH=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},kO=function(t){var n=[],a=[];return t.forEach(function(s,i){var c=!!s.scopeParent,d=c?s.scopeParent:s,h=YU(d,c),f=c?kO(s.candidates):d;h===0?c?n.push.apply(n,f):n.push(d):a.push({documentOrder:i,tabIndex:h,item:s,isScope:c,content:f})}),a.sort(qU).reduce(function(s,i){return i.isScope?s.push.apply(s,i.content):s.push(i.content),s},[]).concat(n)},rd=function(t,n){n=n||{};var a;return n.getShadowRoot?a=Dh([t],n.includeContainer,{filter:mv.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:tH}):a=MO(t,n.includeContainer,mv.bind(null,n)),kO(a)},nH=function(t,n){n=n||{};var a;return n.getShadowRoot?a=Dh([t],n.includeContainer,{filter:hv.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):a=MO(t,n.includeContainer,hv.bind(null,n)),a},jO=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return $l.call(t,Mh)===!1?!1:mv(n,t)};const ac=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function _O(e,t){const n=rd(e,ac()),a=n.length;if(a===0)return;const s=Br(qt(e)),i=n.indexOf(s),c=i===-1?t===1?0:a-1:i+t;return n[c]}function Rb(e){return _O(qt(e).body,1)||e}function LO(e){return _O(qt(e).body,-1)||e}function IO(e,t){if(!e)return null;const n=rd(qt(e).body,ac()),a=n.length;if(a===0)return null;const s=n.indexOf(e);if(s===-1)return null;const i=(s+t+a)%a;return n[i]}function rH(e){return IO(e,1)}function aH(e){return IO(e,-1)}function Sl(e,t){const n=t||e.currentTarget,a=e.relatedTarget;return!a||!Mt(n,a)}function oH(e){rd(e,ac()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Z1(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const a=n.dataset.tabindex;delete n.dataset.tabindex,a?n.setAttribute("tabindex",a):n.removeAttribute("tabindex")})}const Uf=null;class sH{constructor(){We(this,"callbacks",[]);We(this,"callbacksCount",0);We(this,"nextId",1);We(this,"startId",1);We(this,"isScheduled",!1);We(this,"tick",t=>{var s;this.isScheduled=!1;const n=this.callbacks,a=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,a>0)for(let i=0;i<n.length;i+=1)(s=n[i])==null||s.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 Hf=new sH;class kn{constructor(){We(this,"currentId",Uf);We(this,"cancel",()=>{this.currentId!==Uf&&(Hf.cancel(this.currentId),this.currentId=Uf)});We(this,"disposeEffect",()=>this.cancel)}static create(){return new kn}static request(t){return Hf.request(t)}static cancel(t){return Hf.cancel(t)}request(t){this.cancel(),this.currentId=Hf.request(()=>{this.currentId=Uf,t()})}}function ad(){const e=Kn(kn.create).current;return rm(e.disposeEffect),e}function yo(e){return e==null?e:"current"in e?e.current:e}let Ri=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const iH={[Ri.startingStyle]:""},lH={[Ri.endingStyle]:""},Mo={transitionStatus(e){return e==="starting"?iH:e==="ending"?lH:null}};function PO(e,t=!1,n=!0){const a=ad();return Be((s,i=null)=>{a.cancel();function c(){or.flushSync(s)}const d=yo(e);if(d==null)return;const h=d;if(typeof h.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)s();else{let f=function(){const m=Ri.startingStyle;if(!h.hasAttribute(m)){a.request(g);return}const b=new MutationObserver(()=>{h.hasAttribute(m)||(b.disconnect(),g())});b.observe(h,{attributes:!0,attributeFilter:[m]}),i==null||i.addEventListener("abort",()=>b.disconnect(),{once:!0})},g=function(){Promise.all(h.getAnimations().map(m=>m.finished)).then(()=>{i!=null&&i.aborted||c()}).catch(()=>{const m=h.getAnimations();if(n){if(i!=null&&i.aborted)return;c()}else m.length>0&&m.some(b=>b.pending||b.playState!=="finished")&&g()})};if(t){f();return}a.request(g)}})}function No(e){const{enabled:t=!0,open:n,ref:a,onComplete:s}=e,i=Be(s),c=PO(a,n,!1);y.useEffect(()=>{if(!t)return;const d=new AbortController;return c(i,d.signal),()=>{d.abort()}},[t,n,i,c])}function od(e,t=!1,n=!1){const[a,s]=y.useState(e&&t?"idle":void 0),[i,c]=y.useState(e);return e&&!i&&(c(!0),s("starting")),!e&&i&&a!=="ending"&&!n&&s("ending"),!e&&!i&&a==="ending"&&s(void 0),Ue(()=>{if(!e&&i&&a!=="ending"&&n){const d=kn.request(()=>{s("ending")});return()=>{kn.cancel(d)}}},[e,i,a,n]),Ue(()=>{if(!e||t)return;const d=kn.request(()=>{s(void 0)});return()=>{kn.cancel(d)}},[t,e]),Ue(()=>{if(!e||!t)return;e&&i&&a!=="idle"&&s("starting");const d=kn.request(()=>{s("idle")});return()=>{kn.cancel(d)}},[t,e,i,s,a]),y.useMemo(()=>({mounted:i,setMounted:c,transitionStatus:a}),[i,a])}function Kl({controlled:e,default:t,name:n,state:a="value"}){const{current:s}=y.useRef(e!==void 0),[i,c]=y.useState(t),d=s?e:i,h=y.useCallback(f=>{s||c(f)},[]);return[d,h]}function sm(e={}){const{id:t,implicit:n=!1,controlRef:a}=e,{controlId:s,registerControlId:i}=nm(),c=Ta(t),d=n?s:void 0,h=Kn(()=>Symbol("labelable-control")),f=y.useRef(!1),g=y.useRef(t!=null),m=Be(()=>{!f.current||i===Mr||(f.current=!1,i(h.current,void 0))});return Ue(()=>{if(i===Mr)return;let b;if(n){const x=a==null?void 0:a.current;an(x)&&x.closest("label")!=null?b=t??null:b=d??c}else if(t!=null)g.current=!0,b=t;else if(g.current)b=c;else{m();return}if(b===void 0){m();return}f.current=!0,i(h.current,b)},[t,a,d,i,n,c,h,m]),y.useEffect(()=>m,[m]),s??c}function Tb(e){const{enabled:t=!0,value:n,id:a,name:s,controlRef:i,commit:c}=e,{formRef:d}=bb(),{invalid:h,markedDirtyRef:f,validityData:g,setValidityData:m}=nc(),b=Be(e.getValue);Ue(()=>{if(!t)return;let x=n;x===void 0&&(x=b()),g.initialValue===null&&x!==null&&m(w=>({...w,initialValue:x}))},[t,m,n,g.initialValue,b]),Ue(()=>{!t||!a||d.current.fields.set(a,{getValue:b,name:s,controlRef:i,validityData:EU(g,h),validate(x=!0){let w=n;w===void 0&&(w=b()),f.current=!0,x?or.flushSync(()=>c(w)):c(w)}})},[c,i,t,d,b,a,h,f,s,g,n]),Ue(()=>{const x=d.current.fields;return()=>{a&&x.delete(a)}},[d,a])}const Sa="none",Ti="trigger-press",dr="trigger-hover",El="trigger-focus",im="outside-press",wu="item-press",cH="close-press",Ci="focus-out",lm="escape-key",uh="list-navigation",zO="cancel-open",dh="sibling-open",uH="disabled",Cb="imperative-action",dH="window-resize";function yt(e,t,n,a){let s=!1,i=!1;const c=a??Tn;return{reason:e,event:t??new Event("base-ui"),cancel(){s=!0},allowPropagation(){i=!0},get isCanceled(){return s},get isPropagationAllowed(){return i},trigger:n,...c}}const fH=y.forwardRef(function(t,n){const{render:a,className:s,id:i,name:c,value:d,disabled:h=!1,onValueChange:f,defaultValue:g,autoFocus:m=!1,...b}=t,{state:x,name:w,disabled:S,setTouched:R,setDirty:T,validityData:C,setFocused:M,setFilled:O,validationMode:D,validation:k}=nc(),A=S||h,j=w??c,B={...x,disabled:A},{labelId:W}=nm(),K=sm({id:i});Ue(()=>{var P;const L=d!=null;(P=k.inputRef.current)!=null&&P.value||L&&d!==""?O(!0):L&&d===""&&O(!1)},[k.inputRef,O,d]);const I=y.useRef(null);Ue(()=>{m&&I.current===Br(qt(I.current))&&M(!0)},[m,M]);const[H]=Kl({controlled:d,default:g,name:"FieldControl",state:"value"}),F=d!==void 0,q=F?H:void 0;return Tb({id:K,name:j,commit:k.commit,value:q,getValue:()=>{var L;return(L=k.inputRef.current)==null?void 0:L.value},controlRef:k.inputRef}),Nt("input",t,{ref:[n,I],state:B,props:[{id:K,disabled:A,name:j,ref:k.inputRef,"aria-labelledby":W,autoFocus:m,...F?{value:q}:{defaultValue:g},onChange(L){const P=L.currentTarget.value;f==null||f(P,yt(Sa,L.nativeEvent)),T(P!==C.initialValue),O(P!=="")},onFocus(){M(!0)},onBlur(L){R(!0),M(!1),D==="onBlur"&&k.commit(L.currentTarget.value)},onKeyDown(L){L.currentTarget.tagName==="INPUT"&&L.key==="Enter"&&(R(!0),k.commit(L.currentTarget.value))}},k.getInputValidationProps(),b],stateAttributesMapping:vb})}),hH=y.forwardRef(function(t,n){return E.jsx(fH,{ref:n,...t})});function va({className:e,type:t,...n}){return E.jsx(hH,{type:t,"data-slot":"input",className:Oe("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 UO=y.forwardRef(function(t,n){const{className:a,render:s,orientation:i="horizontal",...c}=t;return Nt("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},c]})});function mH({className:e,orientation:t="horizontal",...n}){return E.jsx(UO,{"data-slot":"separator",orientation:t,className:Oe("bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch",e),...n})}const Ob=y.createContext(void 0);function Ms(e){const t=y.useContext(Ob);if(e===!1&&t===void 0)throw new Error(yn(27));return t}let ai=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ri.startingStyle]="startingStyle",e[e.endingStyle=Ri.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),kh=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const pH={[kh.popupOpen]:""},gH={[kh.popupOpen]:"",[kh.pressed]:""},yH={[ai.open]:""},vH={[ai.closed]:""},bH={[ai.anchorHidden]:""},HO={open(e){return e?pH:null}},pv={open(e){return e?gH:null}},Ka={open(e){return e?yH:vH},anchorHidden(e){return e?bH:null}},xH={...Ka,...Mo},Mb=y.forwardRef(function(t,n){const{render:a,className:s,forceRender:i=!1,...c}=t,{store:d}=Ms(),h=d.useState("open"),f=d.useState("nested"),g=d.useState("mounted"),m=d.useState("transitionStatus");return Nt("div",t,{state:{open:h,transitionStatus:m},ref:[d.context.backdropRef,n],stateAttributesMapping:xH,props:[{role:"presentation",hidden:!g,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:i||!f})}),cm=y.forwardRef(function(t,n){const{render:a,className:s,disabled:i=!1,nativeButton:c=!0,...d}=t,{store:h}=Ms(),f=h.useState("open");function g(w){f&&h.setOpen(!1,yt(cH,w.nativeEvent))}const{getButtonProps:m,buttonRef:b}=Oo({disabled:i,native:c});return Nt("button",t,{state:{disabled:i},ref:[n,b],props:[{onClick:g},d,m]})}),Nb=y.forwardRef(function(t,n){const{render:a,className:s,id:i,...c}=t,{store:d}=Ms(),h=Ta(i);return d.useSyncedValueWithCleanup("descriptionElementId",h),Nt("p",t,{ref:n,props:[{id:h},c]})});function Zn(e){const t=Kn(wH,e).current;return t.next=e,Ue(t.effect),t}function wH(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function BO(){const e=new Map;return{emit(t,n){var a;(a=e.get(t))==null||a.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var a;(a=e.get(t))==null||a.delete(n)}}}class Ab{constructor(){We(this,"nodesRef",{current:[]});We(this,"events",BO())}addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(a=>a===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const FO=y.createContext(null),VO=y.createContext(null),Ao=()=>{var e;return((e=y.useContext(FO))==null?void 0:e.id)||null},Ns=e=>{const t=y.useContext(VO);return e??t};function YO(e){const t=Ai(),n=Ns(e),a=Ao();return Ue(()=>{if(!t)return;const s={id:t,parentId:a};return n==null||n.addNode(s),()=>{n==null||n.removeNode(s)}},[n,t,a]),t}function SH(e){const{children:t,id:n}=e,a=Ao();return E.jsx(FO.Provider,{value:y.useMemo(()=>({id:n,parentId:a}),[n,a]),children:t})}function EH(e){const{children:t,externalTree:n}=e,a=Kn(()=>n??new Ab).current;return E.jsx(VO.Provider,{value:a,children:t})}function Gl(e){return`data-base-ui-${e}`}function fh(e,t,n){if(n&&!Ei(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const a=e();return typeof a=="number"?a:a==null?void 0:a[t]}return e==null?void 0:e[t]}const RH=y.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Va,currentIdRef:{current:null},currentContextRef:{current:null}});function TH(e,t={open:!1}){const n="rootStore"in e?e.rootStore:e,a=n.useState("floatingId"),{open:s}=t,i=y.useContext(RH),{currentIdRef:c,delayRef:d,timeoutMs:h,initialDelayRef:f,currentContextRef:g,hasProvider:m,timeout:b}=i,[x,w]=y.useState(!1);return Ue(()=>{function S(){var R;w(!1),(R=g.current)==null||R.setIsInstantPhase(!1),c.current=null,g.current=null,d.current=f.current}if(c.current&&!s&&c.current===a){if(w(!1),h){const R=a;return b.start(h,()=>{n.select("open")||c.current&&c.current!==R||S()}),()=>{b.clear()}}S()}},[s,a,c,d,h,f,g,b,n]),Ue(()=>{if(!s)return;const S=g.current,R=c.current;b.clear(),g.current={onOpenChange:n.setOpen,setIsInstantPhase:w},c.current=a,d.current={open:0,close:fh(f.current,"close")},R!==null&&R!==a?(w(!0),S==null||S.setIsInstantPhase(!0),S==null||S.onOpenChange(!1,yt(Sa))):(w(!1),S==null||S.setIsInstantPhase(!1))},[s,a,n,c,d,h,f,g,b]),Ue(()=>()=>{g.current=null},[g]),y.useMemo(()=>({hasProvider:m,delayRef:d,isInstantPhase:x}),[m,d,x])}const qO={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},um={...qO,position:"fixed",top:0,left:0},$O={...qO,position:"absolute"},Xl=y.forwardRef(function(t,n){const[a,s]=y.useState();Ue(()=>{mO&&s("button")},[]);const i={tabIndex:0,role:a};return E.jsx("span",{...t,ref:n,style:um,"aria-hidden":a?void 0:!0,...i,"data-base-ui-focus-guard":""})});let J1=0;function Su(e,t={}){const{preventScroll:n=!1,cancelPrevious:a=!0,sync:s=!1}=t;a&&cancelAnimationFrame(J1);const i=()=>e==null?void 0:e.focus({preventScroll:n});s?i():J1=requestAnimationFrame(i)}const Rl={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function eR(e){return e==="inert"?Rl.inert:e==="aria-hidden"?Rl["aria-hidden"]:Rl.none}let Bf=new WeakSet,Ff={},oy=0;const KO=e=>e&&(e.host||KO(e.parentNode)),CH=(e,t)=>t.map(n=>{if(e.contains(n))return n;const a=KO(n);return e.contains(a)?a:null}).filter(n=>n!=null);function OH(e,t,n,a){const s="data-base-ui-inert",i=a?"inert":n?"aria-hidden":null,c=CH(t,e),d=new Set,h=new Set(c),f=[];Ff[s]||(Ff[s]=new WeakMap);const g=Ff[s];c.forEach(m),b(t),d.clear();function m(x){!x||d.has(x)||(d.add(x),x.parentNode&&m(x.parentNode))}function b(x){!x||h.has(x)||[].forEach.call(x.children,w=>{if(Ts(w)!=="script")if(d.has(w))b(w);else{const S=i?w.getAttribute(i):null,R=S!==null&&S!=="false",T=eR(i),C=(T.get(w)||0)+1,M=(g.get(w)||0)+1;T.set(w,C),g.set(w,M),f.push(w),C===1&&R&&Bf.add(w),M===1&&w.setAttribute(s,""),!R&&i&&w.setAttribute(i,i==="inert"?"":"true")}})}return oy+=1,()=>{f.forEach(x=>{const w=eR(i),R=(w.get(x)||0)-1,T=(g.get(x)||0)-1;w.set(x,R),g.set(x,T),R||(!Bf.has(x)&&i&&x.removeAttribute(i),Bf.delete(x)),T||x.removeAttribute(s)}),oy-=1,oy||(Rl.inert=new WeakMap,Rl["aria-hidden"]=new WeakMap,Rl.none=new WeakMap,Bf=new WeakSet,Ff={})}}function MH(e,t=!1,n=!1){const a=qt(e[0]).body;return OH(e.concat(Array.from(a.querySelectorAll("[aria-live]"))),a,t,n)}const GO=y.createContext(null),XO=()=>y.useContext(GO),NH=Gl("portal");function WO(e={}){const{ref:t,container:n,componentProps:a=Tn,elementProps:s}=e,i=Ai(),c=XO(),d=c==null?void 0:c.portalNode,[h,f]=y.useState(null),[g,m]=y.useState(null),b=Be(R=>{R!==null&&m(R)}),x=y.useRef(null);Ue(()=>{if(n===null){x.current&&(x.current=null,m(null),f(null));return}if(i==null)return;const R=(n&&(pb(n)?n:n.current))??d??document.body;if(R==null){x.current&&(x.current=null,m(null),f(null));return}x.current!==R&&(x.current=R,m(null),f(R))},[n,d,i]);const w=Nt("div",a,{ref:[t,b],props:[{id:i,[NH]:""},s]});return{portalNode:g,portalSubtree:h&&w?or.createPortal(w,h):null}}const Db=y.forwardRef(function(t,n){const{children:a,container:s,className:i,render:c,renderGuards:d,...h}=t,{portalNode:f,portalSubtree:g}=WO({container:s,ref:n,componentProps:t,elementProps:h}),m=y.useRef(null),b=y.useRef(null),x=y.useRef(null),w=y.useRef(null),[S,R]=y.useState(null),T=S==null?void 0:S.modal,C=S==null?void 0:S.open,M=typeof d=="boolean"?d:!!S&&!S.modal&&S.open&&!!f;y.useEffect(()=>{if(!f||T)return;function D(k){f&&k.relatedTarget&&Sl(k)&&(k.type==="focusin"?Z1:oH)(f)}return f.addEventListener("focusin",D,!0),f.addEventListener("focusout",D,!0),()=>{f.removeEventListener("focusin",D,!0),f.removeEventListener("focusout",D,!0)}},[f,T]),y.useEffect(()=>{!f||C||Z1(f)},[C,f]);const O=y.useMemo(()=>({beforeOutsideRef:m,afterOutsideRef:b,beforeInsideRef:x,afterInsideRef:w,portalNode:f,setFocusManagerState:R}),[f]);return E.jsxs(y.Fragment,{children:[g,E.jsxs(GO.Provider,{value:O,children:[M&&f&&E.jsx(Xl,{"data-type":"outside",ref:m,onFocus:D=>{var k;if(Sl(D,f))(k=x.current)==null||k.focus();else{const A=S?S.domReference:null,j=LO(A);j==null||j.focus()}}}),M&&f&&E.jsx("span",{"aria-owns":f.id,style:o4}),f&&or.createPortal(a,f),M&&f&&E.jsx(Xl,{"data-type":"outside",ref:b,onFocus:D=>{var k;if(Sl(D,f))(k=w.current)==null||k.focus();else{const A=S?S.domReference:null,j=Rb(A);j==null||j.focus(),S!=null&&S.closeOnFocusOut&&(S==null||S.onOpenChange(!1,yt(Ci,D.nativeEvent)))}}})]})]})});function AH(e,t){const n=_n(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 tR=20;let gs=[];function kb(){gs=gs.filter(e=>{var t;return(t=e.deref())==null?void 0:t.isConnected})}function DH(e){kb(),e&&Ts(e)!=="body"&&(gs.push(new WeakRef(e)),gs.length>tR&&(gs=gs.slice(-tR)))}function sy(){var e;return kb(),(e=gs[gs.length-1])==null?void 0:e.deref()}function kH(e){if(!e)return null;const t=ac();return jO(e,t)?e:rd(e,t)[0]||e}function jH(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():Yr(e).display!=="none"}function nR(e,t){var c;if(!t.current.includes("floating")&&!((c=e.getAttribute("role"))!=null&&c.includes("dialog")))return;const n=ac(),s=nH(e,n).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return jO(d,n)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),i=e.getAttribute("tabindex");t.current.includes("floating")||s.length===0?i!=="0"&&e.setAttribute("tabindex","0"):(i!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function jb(e){const{context:t,children:n,disabled:a=!1,initialFocus:s=!0,returnFocus:i=!0,restoreFocus:c=!1,modal:d=!0,closeOnFocusOut:h=!0,openInteractionType:f="",nextFocusableElement:g,previousFocusableElement:m,beforeContentFocusGuardRef:b,externalTree:x}=e,w="rootStore"in t?t.rootStore:t,S=w.useState("open"),R=w.useState("domReferenceElement"),T=w.useState("floatingElement"),{events:C,dataRef:M}=w.context,O=Be(()=>{var ue;return(ue=M.current.floatingContext)==null?void 0:ue.nodeId}),D=s===!1,k=cv(R)&&D,A=y.useRef(["content"]),j=Zn(s),B=Zn(i),W=Zn(f),K=Ns(x),I=XO(),H=y.useRef(null),F=y.useRef(null),q=y.useRef(!1),_=y.useRef(!1),L=y.useRef(!1),P=y.useRef(-1),V=y.useRef(""),Q=y.useRef(""),z=y.useRef(null),Y=y.useRef(null),X=wa(z,b,I==null?void 0:I.beforeInsideRef),G=wa(Y,I==null?void 0:I.afterInsideRef),ce=jn(),oe=jn(),de=ad(),ve=I!=null,xe=Iu(T),Ne=Be((ue=xe)=>ue?rd(ue,ac()):[]),_e=Be(ue=>{const pe=Ne(ue);return A.current.map(()=>pe).filter(Boolean).flat()});y.useEffect(()=>{if(a||!d)return;function ue(ke){ke.key==="Tab"&&Mt(xe,Br(qt(xe)))&&Ne().length===0&&!k&&cr(ke)}const pe=qt(xe);return pe.addEventListener("keydown",ue),()=>{pe.removeEventListener("keydown",ue)}},[a,R,xe,d,A,k,Ne,_e]),y.useEffect(()=>{if(a||!S)return;const ue=qt(xe);function pe(){L.current=!1}function ke(be){const we=gr(be),Z=Mt(T,we)||Mt(R,we)||Mt(I==null?void 0:I.portalNode,we);L.current=!Z,Q.current=be.pointerType||"keyboard",we!=null&&we.closest(`[${a4}]`)&&(_.current=!0)}function Te(){Q.current="keyboard"}return ue.addEventListener("pointerdown",ke,!0),ue.addEventListener("pointerup",pe,!0),ue.addEventListener("pointercancel",pe,!0),ue.addEventListener("keydown",Te,!0),()=>{ue.removeEventListener("pointerdown",ke,!0),ue.removeEventListener("pointerup",pe,!0),ue.removeEventListener("pointercancel",pe,!0),ue.removeEventListener("keydown",Te,!0)}},[a,T,R,xe,S,I]),y.useEffect(()=>{if(a||!h)return;const ue=qt(xe);function pe(){_.current=!0,oe.start(0,()=>{_.current=!1})}function ke(Se){const ge=gr(Se),He=Ne().indexOf(ge);He!==-1&&(P.current=He)}function Te(Se){const ge=Se.relatedTarget,ze=Se.currentTarget,He=gr(Se);queueMicrotask(()=>{const De=O(),st=w.context.triggerElements,xt=(ge==null?void 0:ge.hasAttribute(Gl("focus-guard")))&&[z.current,Y.current,I==null?void 0:I.beforeInsideRef.current,I==null?void 0:I.afterInsideRef.current,I==null?void 0:I.beforeOutsideRef.current,I==null?void 0:I.afterOutsideRef.current,yo(m),yo(g)].includes(ge),vt=!(Mt(R,ge)||Mt(T,ge)||Mt(ge,T)||Mt(I==null?void 0:I.portalNode,ge)||ge!=null&&st.hasElement(ge)||st.hasMatchingElement(Je=>Mt(Je,ge))||xt||K&&(pi(K.nodesRef.current,De).find(Je=>{var Qe,ft;return Mt((Qe=Je.context)==null?void 0:Qe.elements.floating,ge)||Mt((ft=Je.context)==null?void 0:ft.elements.domReference,ge)})||G1(K.nodesRef.current,De).find(Je=>{var Qe,ft,se;return[(Qe=Je.context)==null?void 0:Qe.elements.floating,Iu((ft=Je.context)==null?void 0:ft.elements.floating)].includes(ge)||((se=Je.context)==null?void 0:se.elements.domReference)===ge})));if(ze===R&&xe&&nR(xe,A),c&&ze!==R&&!jH(He)&&Br(ue)===ue.body){if(wn(xe)&&(xe.focus(),c==="popup")){de.request(()=>{xe.focus()});return}const Je=P.current,Qe=Ne(),ft=Qe[Je]||Qe[Qe.length-1]||xe;wn(ft)&&ft.focus()}if(M.current.insideReactTree){M.current.insideReactTree=!1;return}(k||!d)&&ge&&vt&&!_.current&&(k||ge!==sy())&&(q.current=!0,w.setOpen(!1,yt(Ci,Se)))})}function be(){L.current||(M.current.insideReactTree=!0,ce.start(0,()=>{M.current.insideReactTree=!1}))}const we=wn(R)?R:null,Z=[];if(!(!T&&!we))return we&&(we.addEventListener("focusout",Te),we.addEventListener("pointerdown",pe),Z.push(()=>{we.removeEventListener("focusout",Te),we.removeEventListener("pointerdown",pe)})),T&&(T.addEventListener("focusin",ke),T.addEventListener("focusout",Te),I&&(T.addEventListener("focusout",be,!0),Z.push(()=>{T.removeEventListener("focusout",be,!0)})),Z.push(()=>{T.removeEventListener("focusin",ke),T.removeEventListener("focusout",Te)})),()=>{Z.forEach(Se=>{Se()})}},[a,R,T,xe,d,K,I,w,h,c,Ne,k,O,A,M,ce,oe,de,g,m]),y.useEffect(()=>{var be,we,Z;if(a||!T||!S)return;const ue=Array.from(((be=I==null?void 0:I.portalNode)==null?void 0:be.querySelectorAll(`[${Gl("portal")}]`))||[]),ke=(Z=(we=(K?G1(K.nodesRef.current,O()):[]).find(Se=>{var ge;return cv(((ge=Se.context)==null?void 0:ge.elements.domReference)||null)}))==null?void 0:we.context)==null?void 0:Z.elements.domReference,Te=[T,ke,...ue,H.current,F.current,z.current,Y.current,I==null?void 0:I.beforeOutsideRef.current,I==null?void 0:I.afterOutsideRef.current,yo(m),yo(g),k?R:null].filter(Se=>Se!=null);return MH(Te,d||k)},[S,a,R,T,d,A,I,k,K,O,g,m]),Ue(()=>{if(!S||a||!wn(xe))return;const ue=qt(xe),pe=Br(ue);queueMicrotask(()=>{const ke=_e(xe),Te=j.current,be=typeof Te=="function"?Te(W.current||""):Te;if(be===void 0||be===!1)return;let we;be===!0||be===null?we=ke[0]||xe:we=yo(be),we=we||ke[0]||xe,!Mt(xe,pe)&&Su(we,{preventScroll:we===xe})})},[a,S,xe,D,_e,j,W]),Ue(()=>{if(a||!xe)return;const ue=qt(xe),pe=Br(ue);DH(pe);function ke(we){if(we.open||(V.current=AH(we.nativeEvent,Q.current)),we.reason===dr&&we.nativeEvent.type==="mouseleave"&&(q.current=!0),we.reason===im)if(we.nested)q.current=!1;else if(bO(we.nativeEvent)||xO(we.nativeEvent))q.current=!1;else{let Z=!1;document.createElement("div").focus({get preventScroll(){return Z=!0,!1}}),Z?q.current=!1:q.current=!0}}C.on("openchange",ke);const Te=ue.createElement("span");Te.setAttribute("tabindex","-1"),Te.setAttribute("aria-hidden","true"),Object.assign(Te.style,um),ve&&R&&R.insertAdjacentElement("afterend",Te);function be(){const we=B.current;let Z=typeof we=="function"?we(V.current):we;if(Z===void 0||Z===!1)return null;if(Z===null&&(Z=!0),typeof Z=="boolean"){const ge=R||sy();return ge&&ge.isConnected?ge:Te}const Se=R||sy()||Te;return yo(Z)||Se}return()=>{C.off("openchange",ke);const we=Br(ue),Z=Mt(T,we)||K&&pi(K.nodesRef.current,O(),!1).some(ge=>{var ze;return Mt((ze=ge.context)==null?void 0:ze.elements.floating,we)}),Se=be();queueMicrotask(()=>{const ge=kH(Se),ze=typeof B.current!="boolean";B.current&&!q.current&&wn(ge)&&(!(!ze&&ge!==we&&we!==ue.body)||Z)&&ge.focus({preventScroll:!0}),Te.remove(),q.current=!1})}},[a,T,xe,B,M,C,K,ve,R,O]),Ue(()=>{if(!am||S||!T)return;const ue=Br(qt(T));!wn(ue)||!om(ue)||Mt(T,ue)&&ue.blur()},[S,T]),Ue(()=>{if(!(a||!I))return I.setFocusManagerState({modal:d,closeOnFocusOut:h,open:S,onOpenChange:w.setOpen,domReference:R}),()=>{I.setFocusManagerState(null)}},[a,I,d,S,w,h,R]),Ue(()=>{if(!(a||!xe))return nR(xe,A),()=>{queueMicrotask(kb)}},[a,xe,A]);const ee=!a&&(d?!k:!0)&&(ve||d);return E.jsxs(y.Fragment,{children:[ee&&E.jsx(Xl,{"data-type":"inside",ref:X,onFocus:ue=>{var pe;if(d){const ke=_e();Su(ke[ke.length-1])}else if(I!=null&&I.portalNode)if(q.current=!1,Sl(ue,I.portalNode)){const ke=Rb(R);ke==null||ke.focus()}else(pe=yo(m??I.beforeOutsideRef))==null||pe.focus()}}),n,ee&&E.jsx(Xl,{"data-type":"inside",ref:G,onFocus:ue=>{var pe;if(d)Su(_e()[0]);else if(I!=null&&I.portalNode)if(h&&(q.current=!0),Sl(ue,I.portalNode)){const ke=LO(R);ke==null||ke.focus()}else(pe=yo(g??I.afterOutsideRef))==null||pe.focus()}})]})}function QO(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.context.dataRef,{enabled:s=!0,event:i="click",toggle:c=!0,ignoreMouse:d=!1,stickIfOpen:h=!0,touchOpenDelay:f=0,reason:g=Ti}=t,m=y.useRef(void 0),b=ad(),x=jn(),w=y.useMemo(()=>({onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const R=m.current,T=S.nativeEvent,C=n.select("open");if(S.button!==0||i==="click"||Ei(R,!0)&&d)return;const M=a.current.openEvent,O=M==null?void 0:M.type,D=n.select("domReferenceElement")!==S.currentTarget,k=C&&D||!(C&&c&&(!(M&&h)||O==="click"||O==="mousedown"));if(om(T.target)){const j=yt(g,T,T.target);k&&R==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,j)}):n.setOpen(k,j);return}const A=S.currentTarget;b.request(()=>{const j=yt(g,T,A);k&&R==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,j)}):n.setOpen(k,j)})},onClick(S){if(i==="mousedown-only")return;const R=m.current;if(i==="mousedown"&&R){m.current=void 0;return}if(Ei(R,!0)&&d)return;const T=n.select("open"),C=a.current.openEvent,M=n.select("domReferenceElement")!==S.currentTarget,O=T&&M||!(T&&c&&(!(C&&h)||wO(C))),D=yt(g,S.nativeEvent,S.currentTarget);O&&R==="touch"&&f>0?x.start(f,()=>{n.setOpen(!0,D)}):n.setOpen(O,D)},onKeyDown(){m.current=void 0}}),[a,i,d,n,h,c,b,x,f,g]);return y.useMemo(()=>s?{reference:w}:Tn,[s,w])}function _H(e,t){let n=null,a=null,s=!1;return{contextElement:e||void 0,getBoundingClientRect(){var x;const i=(e==null?void 0:e.getBoundingClientRect())||{width:0,height:0,x:0,y:0},c=t.axis==="x"||t.axis==="both",d=t.axis==="y"||t.axis==="both",h=["mouseenter","mousemove"].includes(((x=t.dataRef.current.openEvent)==null?void 0:x.type)||"")&&t.pointerType!=="touch";let f=i.width,g=i.height,m=i.x,b=i.y;return n==null&&t.x&&c&&(n=i.x-t.x),a==null&&t.y&&d&&(a=i.y-t.y),m-=n||0,b-=a||0,f=0,g=0,!s||h?(f=t.axis==="y"?i.width:0,g=t.axis==="x"?i.height:0,m=c&&t.x!=null?t.x:m,b=d&&t.y!=null?t.y:b):s&&!h&&(g=t.axis==="x"?i.height:g,f=t.axis==="y"?i.width:f),s=!0,{width:f,height:g,x:m,y:b,top:b,right:m+f,bottom:b+g,left:m}}}}function rR(e){return e!=null&&e.clientX!=null}function LH(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),s=n.useState("floatingElement"),i=n.useState("domReferenceElement"),c=n.context.dataRef,{enabled:d=!0,axis:h="both"}=t,f=y.useRef(!1),g=y.useRef(null),[m,b]=y.useState(),[x,w]=y.useState([]),S=Be((O,D,k)=>{f.current||c.current.openEvent&&!rR(c.current.openEvent)||n.set("positionReference",_H(k??i,{x:O,y:D,axis:h,dataRef:c,pointerType:m}))}),R=Be(O=>{a?g.current||w([]):S(O.clientX,O.clientY,O.currentTarget)}),T=Ei(m)?s:a,C=y.useCallback(()=>{if(!T||!d)return;const O=_n(s);function D(k){const A=gr(k);Mt(s,A)?(O.removeEventListener("mousemove",D),g.current=null):S(k.clientX,k.clientY)}if(!c.current.openEvent||rR(c.current.openEvent)){O.addEventListener("mousemove",D);const k=()=>{O.removeEventListener("mousemove",D),g.current=null};return g.current=k,k}n.set("positionReference",i)},[T,d,s,c,i,n,S]);y.useEffect(()=>C(),[C,x]),y.useEffect(()=>{d&&!s&&(f.current=!1)},[d,s]),y.useEffect(()=>{!d&&a&&(f.current=!0)},[d,a]);const M=y.useMemo(()=>{function O(D){b(D.pointerType)}return{onPointerDown:O,onPointerEnter:O,onMouseMove:R,onMouseEnter:R}},[R]);return y.useMemo(()=>d?{reference:M,trigger:M}:{},[d,M])}function aR(e,t,n){let{reference:a,floating:s}=e;const i=sa(t),c=Eb(t),d=Sb(c),h=Nr(t),f=i==="y",g=a.x+a.width/2-s.width/2,m=a.y+a.height/2-s.height/2,b=a[d]/2-s[d]/2;let x;switch(h){case"top":x={x:g,y:a.y-s.height};break;case"bottom":x={x:g,y:a.y+a.height};break;case"right":x={x:a.x+a.width,y:m};break;case"left":x={x:a.x-s.width,y:m};break;default:x={x:a.x,y:a.y}}switch(Os(t)){case"start":x[c]-=b*(n&&f?-1:1);break;case"end":x[c]+=b*(n&&f?-1:1);break}return x}async function IH(e,t){var n;t===void 0&&(t={});const{x:a,y:s,platform:i,rects:c,elements:d,strategy:h}=e,{boundary:f="clippingAncestors",rootBoundary:g="viewport",elementContext:m="floating",altBoundary:b=!1,padding:x=0}=Co(t,e),w=SO(x),R=d[b?m==="floating"?"reference":"floating":m],T=Oh(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(R)))==null||n?R:R.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(d.floating)),boundary:f,rootBoundary:g,strategy:h})),C=m==="floating"?{x:a,y:s,width:c.floating.width,height:c.floating.height}:c.reference,M=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d.floating)),O=await(i.isElement==null?void 0:i.isElement(M))?await(i.getScale==null?void 0:i.getScale(M))||{x:1,y:1}:{x:1,y:1},D=Oh(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:C,offsetParent:M,strategy:h}):C);return{top:(T.top-D.top+w.top)/O.y,bottom:(D.bottom-T.bottom+w.bottom)/O.y,left:(T.left-D.left+w.left)/O.x,right:(D.right-T.right+w.right)/O.x}}const PH=async(e,t,n)=>{const{placement:a="bottom",strategy:s="absolute",middleware:i=[],platform:c}=n,d=i.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let f=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y:m}=aR(f,a,h),b=a,x={},w=0;for(let R=0;R<d.length;R++){var S;const{name:T,fn:C}=d[R],{x:M,y:O,data:D,reset:k}=await C({x:g,y:m,initialPlacement:a,placement:b,strategy:s,middlewareData:x,rects:f,platform:{...c,detectOverflow:(S=c.detectOverflow)!=null?S:IH},elements:{reference:e,floating:t}});g=M??g,m=O??m,x={...x,[T]:{...x[T],...D}},k&&w<=50&&(w++,typeof k=="object"&&(k.placement&&(b=k.placement),k.rects&&(f=k.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:s}):k.rects),{x:g,y:m}=aR(f,b,h)),R=-1)}return{x:g,y:m,placement:b,strategy:s,middlewareData:x}},zH=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,a;const{placement:s,middlewareData:i,rects:c,initialPlacement:d,platform:h,elements:f}=t,{mainAxis:g=!0,crossAxis:m=!0,fallbackPlacements:b,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:S=!0,...R}=Co(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const T=Nr(s),C=sa(d),M=Nr(d)===d,O=await(h.isRTL==null?void 0:h.isRTL(f.floating)),D=b||(M||!S?[Ch(d)]:IU(d)),k=w!=="none";!b&&k&&D.push(...HU(d,S,w,O));const A=[d,...D],j=await h.detectOverflow(t,R),B=[];let W=((a=i.flip)==null?void 0:a.overflows)||[];if(g&&B.push(j[T]),m){const F=LU(s,c,O);B.push(j[F[0]],j[F[1]])}if(W=[...W,{placement:s,overflows:B}],!B.every(F=>F<=0)){var K,I;const F=(((K=i.flip)==null?void 0:K.index)||0)+1,q=A[F];if(q&&(!(m==="alignment"?C!==sa(q):!1)||W.every(P=>sa(P.placement)===C?P.overflows[0]>0:!0)))return{data:{index:F,overflows:W},reset:{placement:q}};let _=(I=W.filter(L=>L.overflows[0]<=0).sort((L,P)=>L.overflows[1]-P.overflows[1])[0])==null?void 0:I.placement;if(!_)switch(x){case"bestFit":{var H;const L=(H=W.filter(P=>{if(k){const V=sa(P.placement);return V===C||V==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(V=>V>0).reduce((V,Q)=>V+Q,0)]).sort((P,V)=>P[1]-V[1])[0])==null?void 0:H[0];L&&(_=L);break}case"initialPlacement":_=d;break}if(s!==_)return{reset:{placement:_}}}return{}}}};function oR(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function sR(e){return DU.some(t=>e[t]>=0)}const UH=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:a}=t,{strategy:s="referenceHidden",...i}=Co(e,t);switch(s){case"referenceHidden":{const c=await a.detectOverflow(t,{...i,elementContext:"reference"}),d=oR(c,n.reference);return{data:{referenceHiddenOffsets:d,referenceHidden:sR(d)}}}case"escaped":{const c=await a.detectOverflow(t,{...i,altBoundary:!0}),d=oR(c,n.floating);return{data:{escapedOffsets:d,escaped:sR(d)}}}default:return{}}}}},ZO=new Set(["left","top"]);async function HH(e,t){const{placement:n,platform:a,elements:s}=e,i=await(a.isRTL==null?void 0:a.isRTL(s.floating)),c=Nr(n),d=Os(n),h=sa(n)==="y",f=ZO.has(c)?-1:1,g=i&&h?-1:1,m=Co(t,e);let{mainAxis:b,crossAxis:x,alignmentAxis:w}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return d&&typeof w=="number"&&(x=d==="end"?w*-1:w),h?{x:x*g,y:b*f}:{x:b*f,y:x*g}}const BH=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,a;const{x:s,y:i,placement:c,middlewareData:d}=t,h=await HH(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(a=d.arrow)!=null&&a.alignmentOffset?{}:{x:s+h.x,y:i+h.y,data:{...h,placement:c}}}}},FH=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:a,placement:s,platform:i}=t,{mainAxis:c=!0,crossAxis:d=!1,limiter:h={fn:T=>{let{x:C,y:M}=T;return{x:C,y:M}}},...f}=Co(e,t),g={x:n,y:a},m=await i.detectOverflow(t,f),b=sa(Nr(s)),x=wb(b);let w=g[x],S=g[b];if(c){const T=x==="y"?"top":"left",C=x==="y"?"bottom":"right",M=w+m[T],O=w-m[C];w=uv(M,w,O)}if(d){const T=b==="y"?"top":"left",C=b==="y"?"bottom":"right",M=S+m[T],O=S-m[C];S=uv(M,S,O)}const R=h.fn({...t,[x]:w,[b]:S});return{...R,data:{x:R.x-n,y:R.y-a,enabled:{[x]:c,[b]:d}}}}}},VH=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:a,placement:s,rects:i,middlewareData:c}=t,{offset:d=0,mainAxis:h=!0,crossAxis:f=!0}=Co(e,t),g={x:n,y:a},m=sa(s),b=wb(m);let x=g[b],w=g[m];const S=Co(d,t),R=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const M=b==="y"?"height":"width",O=i.reference[b]-i.floating[M]+R.mainAxis,D=i.reference[b]+i.reference[M]-R.mainAxis;x<O?x=O:x>D&&(x=D)}if(f){var T,C;const M=b==="y"?"width":"height",O=ZO.has(Nr(s)),D=i.reference[m]-i.floating[M]+(O&&((T=c.offset)==null?void 0:T[m])||0)+(O?0:R.crossAxis),k=i.reference[m]+i.reference[M]+(O?0:((C=c.offset)==null?void 0:C[m])||0)-(O?R.crossAxis:0);w<D?w=D:w>k&&(w=k)}return{[b]:x,[m]:w}}}},YH=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,a;const{placement:s,rects:i,platform:c,elements:d}=t,{apply:h=()=>{},...f}=Co(e,t),g=await c.detectOverflow(t,f),m=Nr(s),b=Os(s),x=sa(s)==="y",{width:w,height:S}=i.floating;let R,T;m==="top"||m==="bottom"?(R=m,T=b===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(T=m,R=b==="end"?"top":"bottom");const C=S-g.top-g.bottom,M=w-g.left-g.right,O=ql(S-g[R],C),D=ql(w-g[T],M),k=!t.middlewareData.shift;let A=O,j=D;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=M),(a=t.middlewareData.shift)!=null&&a.enabled.y&&(A=C),k&&!b){const W=Fr(g.left,0),K=Fr(g.right,0),I=Fr(g.top,0),H=Fr(g.bottom,0);x?j=w-2*(W!==0||K!==0?W+K:Fr(g.left,g.right)):A=S-2*(I!==0||H!==0?I+H:Fr(g.top,g.bottom))}await h({...t,availableWidth:j,availableHeight:A});const B=await c.getDimensions(d.floating);return w!==B.width||S!==B.height?{reset:{rects:!0}}:{}}}};function JO(e){const t=Yr(e);let n=parseFloat(t.width)||0,a=parseFloat(t.height)||0;const s=wn(e),i=s?e.offsetWidth:n,c=s?e.offsetHeight:a,d=Th(n)!==i||Th(a)!==c;return d&&(n=i,a=c),{width:n,height:a,$:d}}function _b(e){return an(e)?e:e.contextElement}function Tl(e){const t=_b(e);if(!wn(t))return Ua(1);const n=t.getBoundingClientRect(),{width:a,height:s,$:i}=JO(t);let c=(i?Th(n.width):n.width)/a,d=(i?Th(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const qH=Ua(0);function eM(e){const t=_n(e);return!em()||!t.visualViewport?qH:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function $H(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_n(e)?!1:t}function Oi(e,t,n,a){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),i=_b(e);let c=Ua(1);t&&(a?an(a)&&(c=Tl(a)):c=Tl(e));const d=$H(i,n,a)?eM(i):Ua(0);let h=(s.left+d.x)/c.x,f=(s.top+d.y)/c.y,g=s.width/c.x,m=s.height/c.y;if(i){const b=_n(i),x=a&&an(a)?_n(a):a;let w=b,S=sv(w);for(;S&&a&&x!==w;){const R=Tl(S),T=S.getBoundingClientRect(),C=Yr(S),M=T.left+(S.clientLeft+parseFloat(C.paddingLeft))*R.x,O=T.top+(S.clientTop+parseFloat(C.paddingTop))*R.y;h*=R.x,f*=R.y,g*=R.x,m*=R.y,h+=M,f+=O,w=_n(S),S=sv(w)}}return Oh({width:g,height:m,x:h,y:f})}function dm(e,t){const n=tm(e).scrollLeft;return t?t.left+n:Oi($a(e)).left+n}function tM(e,t){const n=e.getBoundingClientRect(),a=n.left+t.scrollLeft-dm(e,n),s=n.top+t.scrollTop;return{x:a,y:s}}function KH(e){let{elements:t,rect:n,offsetParent:a,strategy:s}=e;const i=s==="fixed",c=$a(a),d=t?Jh(t.floating):!1;if(a===c||d&&i)return n;let h={scrollLeft:0,scrollTop:0},f=Ua(1);const g=Ua(0),m=wn(a);if((m||!m&&!i)&&((Ts(a)!=="body"||Cs(c))&&(h=tm(a)),wn(a))){const x=Oi(a);f=Tl(a),g.x=x.x+a.clientLeft,g.y=x.y+a.clientTop}const b=c&&!m&&!i?tM(c,h):Ua(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+g.x+b.x,y:n.y*f.y-h.scrollTop*f.y+g.y+b.y}}function GH(e){return Array.from(e.getClientRects())}function XH(e){const t=$a(e),n=tm(e),a=e.ownerDocument.body,s=Fr(t.scrollWidth,t.clientWidth,a.scrollWidth,a.clientWidth),i=Fr(t.scrollHeight,t.clientHeight,a.scrollHeight,a.clientHeight);let c=-n.scrollLeft+dm(e);const d=-n.scrollTop;return Yr(a).direction==="rtl"&&(c+=Fr(t.clientWidth,a.clientWidth)-s),{width:s,height:i,x:c,y:d}}const iR=25;function WH(e,t){const n=_n(e),a=$a(e),s=n.visualViewport;let i=a.clientWidth,c=a.clientHeight,d=0,h=0;if(s){i=s.width,c=s.height;const g=em();(!g||g&&t==="fixed")&&(d=s.offsetLeft,h=s.offsetTop)}const f=dm(a);if(f<=0){const g=a.ownerDocument,m=g.body,b=getComputedStyle(m),x=g.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,w=Math.abs(a.clientWidth-m.clientWidth-x);w<=iR&&(i-=w)}else f<=iR&&(i+=f);return{width:i,height:c,x:d,y:h}}const QH=new Set(["absolute","fixed"]);function ZH(e,t){const n=Oi(e,!0,t==="fixed"),a=n.top+e.clientTop,s=n.left+e.clientLeft,i=wn(e)?Tl(e):Ua(1),c=e.clientWidth*i.x,d=e.clientHeight*i.y,h=s*i.x,f=a*i.y;return{width:c,height:d,x:h,y:f}}function lR(e,t,n){let a;if(t==="viewport")a=WH(e,n);else if(t==="document")a=XH($a(e));else if(an(t))a=ZH(t,n);else{const s=eM(e);a={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Oh(a)}function nM(e,t){const n=Fa(e);return n===t||!an(n)||za(n)?!1:Yr(n).position==="fixed"||nM(n,t)}function JH(e,t){const n=t.get(e);if(n)return n;let a=bs(e,[],!1).filter(d=>an(d)&&Ts(d)!=="body"),s=null;const i=Yr(e).position==="fixed";let c=i?Fa(e):e;for(;an(c)&&!za(c);){const d=Yr(c),h=gb(c);!h&&d.position==="fixed"&&(s=null),(i?!h&&!s:!h&&d.position==="static"&&!!s&&QH.has(s.position)||Cs(c)&&!h&&nM(e,c))?a=a.filter(g=>g!==c):s=d,c=Fa(c)}return t.set(e,a),a}function e6(e){let{element:t,boundary:n,rootBoundary:a,strategy:s}=e;const c=[...n==="clippingAncestors"?Jh(t)?[]:JH(t,this._c):[].concat(n),a],d=c[0],h=c.reduce((f,g)=>{const m=lR(t,g,s);return f.top=Fr(m.top,f.top),f.right=ql(m.right,f.right),f.bottom=ql(m.bottom,f.bottom),f.left=Fr(m.left,f.left),f},lR(t,d,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function t6(e){const{width:t,height:n}=JO(e);return{width:t,height:n}}function n6(e,t,n){const a=wn(t),s=$a(t),i=n==="fixed",c=Oi(e,!0,i,t);let d={scrollLeft:0,scrollTop:0};const h=Ua(0);function f(){h.x=dm(s)}if(a||!a&&!i)if((Ts(t)!=="body"||Cs(s))&&(d=tm(t)),a){const x=Oi(t,!0,i,t);h.x=x.x+t.clientLeft,h.y=x.y+t.clientTop}else s&&f();i&&!a&&s&&f();const g=s&&!a&&!i?tM(s,d):Ua(0),m=c.left+d.scrollLeft-h.x-g.x,b=c.top+d.scrollTop-h.y-g.y;return{x:m,y:b,width:c.width,height:c.height}}function iy(e){return Yr(e).position==="static"}function cR(e,t){if(!wn(e)||Yr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return $a(e)===n&&(n=n.ownerDocument.body),n}function rM(e,t){const n=_n(e);if(Jh(e))return n;if(!wn(e)){let s=Fa(e);for(;s&&!za(s);){if(an(s)&&!iy(s))return s;s=Fa(s)}return n}let a=cR(e,t);for(;a&&tU(a)&&iy(a);)a=cR(a,t);return a&&za(a)&&iy(a)&&!gb(a)?n:a||sU(e)||n}const r6=async function(e){const t=this.getOffsetParent||rM,n=this.getDimensions,a=await n(e.floating);return{reference:n6(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:a.width,height:a.height}}};function a6(e){return Yr(e).direction==="rtl"}const o6={convertOffsetParentRelativeRectToViewportRelativeRect:KH,getDocumentElement:$a,getClippingRect:e6,getOffsetParent:rM,getElementRects:r6,getClientRects:GH,getDimensions:t6,getScale:Tl,isElement:an,isRTL:a6};function aM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function s6(e,t){let n=null,a;const s=$a(e);function i(){var d;clearTimeout(a),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),i();const f=e.getBoundingClientRect(),{left:g,top:m,width:b,height:x}=f;if(d||t(),!b||!x)return;const w=yl(m),S=yl(s.clientWidth-(g+b)),R=yl(s.clientHeight-(m+x)),T=yl(g),M={rootMargin:-w+"px "+-S+"px "+-R+"px "+-T+"px",threshold:Fr(0,ql(1,h))||1};let O=!0;function D(k){const A=k[0].intersectionRatio;if(A!==h){if(!O)return c();A?c(!1,A):a=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!aM(f,e.getBoundingClientRect())&&c(),O=!1}try{n=new IntersectionObserver(D,{...M,root:s.ownerDocument})}catch{n=new IntersectionObserver(D,M)}n.observe(e)}return c(!0),i}function uR(e,t,n,a){a===void 0&&(a={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=a,f=_b(e),g=s||i?[...f?bs(f):[],...bs(t)]:[];g.forEach(T=>{s&&T.addEventListener("scroll",n,{passive:!0}),i&&T.addEventListener("resize",n)});const m=f&&d?s6(f,n):null;let b=-1,x=null;c&&(x=new ResizeObserver(T=>{let[C]=T;C&&C.target===f&&x&&(x.unobserve(t),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var M;(M=x)==null||M.observe(t)})),n()}),f&&!h&&x.observe(f),x.observe(t));let w,S=h?Oi(e):null;h&&R();function R(){const T=Oi(e);S&&!aM(S,T)&&n(),S=T,w=requestAnimationFrame(R)}return n(),()=>{var T;g.forEach(C=>{s&&C.removeEventListener("scroll",n),i&&C.removeEventListener("resize",n)}),m==null||m(),(T=x)==null||T.disconnect(),x=null,h&&cancelAnimationFrame(w)}}const i6=BH,l6=FH,c6=zH,u6=YH,d6=UH,f6=VH,h6=(e,t,n)=>{const a=new Map,s={platform:o6,...n},i={...s.platform,_c:a};return PH(e,t,{...s,platform:i})};var m6=typeof document<"u",p6=function(){},hh=m6?y.useLayoutEffect:p6;function jh(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,a,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(a=n;a--!==0;)if(!jh(e[a],t[a]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(a=n;a--!==0;)if(!{}.hasOwnProperty.call(t,s[a]))return!1;for(a=n;a--!==0;){const i=s[a];if(!(i==="_owner"&&e.$$typeof)&&!jh(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function oM(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function dR(e,t){const n=oM(e);return Math.round(t*n)/n}function ly(e){const t=y.useRef(e);return hh(()=>{t.current=e}),t}function g6(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:a=[],platform:s,elements:{reference:i,floating:c}={},transform:d=!0,whileElementsMounted:h,open:f}=e,[g,m]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[b,x]=y.useState(a);jh(b,a)||x(a);const[w,S]=y.useState(null),[R,T]=y.useState(null),C=y.useCallback(P=>{P!==k.current&&(k.current=P,S(P))},[]),M=y.useCallback(P=>{P!==A.current&&(A.current=P,T(P))},[]),O=i||w,D=c||R,k=y.useRef(null),A=y.useRef(null),j=y.useRef(g),B=h!=null,W=ly(h),K=ly(s),I=ly(f),H=y.useCallback(()=>{if(!k.current||!A.current)return;const P={placement:t,strategy:n,middleware:b};K.current&&(P.platform=K.current),h6(k.current,A.current,P).then(V=>{const Q={...V,isPositioned:I.current!==!1};F.current&&!jh(j.current,Q)&&(j.current=Q,or.flushSync(()=>{m(Q)}))})},[b,t,n,K,I]);hh(()=>{f===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(P=>({...P,isPositioned:!1})))},[f]);const F=y.useRef(!1);hh(()=>(F.current=!0,()=>{F.current=!1}),[]),hh(()=>{if(O&&(k.current=O),D&&(A.current=D),O&&D){if(W.current)return W.current(O,D,H);H()}},[O,D,H,W,B]);const q=y.useMemo(()=>({reference:k,floating:A,setReference:C,setFloating:M}),[C,M]),_=y.useMemo(()=>({reference:O,floating:D}),[O,D]),L=y.useMemo(()=>{const P={position:n,left:0,top:0};if(!_.floating)return P;const V=dR(_.floating,g.x),Q=dR(_.floating,g.y);return d?{...P,transform:"translate("+V+"px, "+Q+"px)",...oM(_.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:Q}},[n,d,_.floating,g.x,g.y]);return y.useMemo(()=>({...g,update:H,refs:q,elements:_,floatingStyles:L}),[g,H,q,_,L])}const y6=(e,t)=>({...i6(e),options:[e,t]}),v6=(e,t)=>({...l6(e),options:[e,t]}),b6=(e,t)=>({...f6(e),options:[e,t]}),x6=(e,t)=>({...c6(e),options:[e,t]}),w6=(e,t)=>({...u6(e),options:[e,t]}),S6=(e,t)=>({...d6(e),options:[e,t]}),E6={intentional:"onClick",sloppy:"onPointerDown"};function R6(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 fm(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),s=n.useState("floatingElement"),i=n.useState("referenceElement"),c=n.useState("domReferenceElement"),{onOpenChange:d,dataRef:h}=n.context,{enabled:f=!0,escapeKey:g=!0,outsidePress:m=!0,outsidePressEvent:b="sloppy",referencePress:x=!1,referencePressEvent:w="sloppy",ancestorScroll:S=!1,bubbles:R,externalTree:T}=t,C=Ns(T),M=Be(typeof m=="function"?m:()=>!1),O=typeof m=="function"?M:m,D=y.useRef(!1),{escapeKey:k,outsidePress:A}=R6(R),j=y.useRef(null),B=jn(),W=jn(),K=Be(()=>{W.clear(),h.current.insideReactTree=!1}),I=y.useRef(!1),H=y.useRef(""),F=Be(ee=>{H.current=ee.pointerType}),q=Be(()=>{const ee=H.current,ue=ee==="pen"||!ee?"mouse":ee,pe=typeof b=="function"?b():b;return typeof pe=="string"?pe:pe[ue]}),_=Be(ee=>{var be;if(!a||!f||!g||ee.key!=="Escape"||I.current)return;const ue=(be=h.current.floatingContext)==null?void 0:be.nodeId,pe=C?pi(C.nodesRef.current,ue):[];if(!k&&pe.length>0){let we=!0;if(pe.forEach(Z=>{var Se;(Se=Z.context)!=null&&Se.open&&!Z.context.dataRef.current.__escapeKeyBubbles&&(we=!1)}),!we)return}const ke=AU(ee)?ee.nativeEvent:ee,Te=yt(lm,ke);n.setOpen(!1,Te),!k&&!Te.isPropagationAllowed&&ee.stopPropagation()}),L=Be(ee=>{const ue=q();return ue==="intentional"&&ee.type!=="click"||ue==="sloppy"&&ee.type==="click"}),P=Be(()=>{h.current.insideReactTree=!0,W.start(0,K)}),V=Be((ee,ue=!1)=>{var ze;if(L(ee)){K();return}if(h.current.insideReactTree){K();return}if(q()==="intentional"&&ue||typeof O=="function"&&!O(ee))return;const pe=gr(ee),ke=`[${Gl("inert")}]`,Te=qt(n.select("floatingElement")).querySelectorAll(ke),be=n.context.triggerElements;if(pe&&(be.hasElement(pe)||be.hasMatchingElement(He=>Mt(He,pe))))return;let we=an(pe)?pe:null;for(;we&&!za(we);){const He=Fa(we);if(za(He)||!an(He))break;we=He}if(Te.length&&an(pe)&&!MU(pe)&&!Mt(pe,n.select("floatingElement"))&&Array.from(Te).every(He=>!Mt(we,He)))return;if(wn(pe)&&!("touches"in ee)){const He=za(pe),De=Yr(pe),st=/auto|scroll/,xt=He||st.test(De.overflowX),vt=He||st.test(De.overflowY),Je=xt&&pe.clientWidth>0&&pe.scrollWidth>pe.clientWidth,Qe=vt&&pe.clientHeight>0&&pe.scrollHeight>pe.clientHeight,ft=De.direction==="rtl",se=Qe&&(ft?ee.offsetX<=pe.offsetWidth-pe.clientWidth:ee.offsetX>pe.clientWidth),je=Je&&ee.offsetY>pe.clientHeight;if(se||je)return}const Z=(ze=h.current.floatingContext)==null?void 0:ze.nodeId,Se=C&&pi(C.nodesRef.current,Z).some(He=>{var De;return ya(ee,(De=He.context)==null?void 0:De.elements.floating)});if(ya(ee,n.select("floatingElement"))||ya(ee,n.select("domReferenceElement"))||Se)return;const ge=C?pi(C.nodesRef.current,Z):[];if(ge.length>0){let He=!0;if(ge.forEach(De=>{var st;(st=De.context)!=null&&st.open&&!De.context.dataRef.current.__outsidePressBubbles&&(He=!1)}),!He)return}n.setOpen(!1,yt(im,ee)),K()}),Q=Be(ee=>{q()!=="sloppy"||ee.pointerType==="touch"||!n.select("open")||!f||ya(ee,n.select("floatingElement"))||ya(ee,n.select("domReferenceElement"))||V(ee)}),z=Be(ee=>{if(q()!=="sloppy"||!n.select("open")||!f||ya(ee,n.select("floatingElement"))||ya(ee,n.select("domReferenceElement")))return;const ue=ee.touches[0];ue&&(j.current={startTime:Date.now(),startX:ue.clientX,startY:ue.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}),Y=Be(ee=>{const ue=gr(ee);function pe(){z(ee),ue==null||ue.removeEventListener(ee.type,pe)}ue==null||ue.addEventListener(ee.type,pe)}),X=Be(ee=>{const ue=D.current;if(D.current=!1,B.clear(),ee.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)return;const pe=gr(ee);function ke(){ee.type==="pointerdown"?Q(ee):V(ee,ue),pe==null||pe.removeEventListener(ee.type,ke)}pe==null||pe.addEventListener(ee.type,ke)}),G=Be(ee=>{if(q()!=="sloppy"||!j.current||ya(ee,n.select("floatingElement"))||ya(ee,n.select("domReferenceElement")))return;const ue=ee.touches[0];if(!ue)return;const pe=Math.abs(ue.clientX-j.current.startX),ke=Math.abs(ue.clientY-j.current.startY),Te=Math.sqrt(pe*pe+ke*ke);Te>5&&(j.current.dismissOnTouchEnd=!0),Te>10&&(V(ee),B.clear(),j.current=null)}),ce=Be(ee=>{const ue=gr(ee);function pe(){G(ee),ue==null||ue.removeEventListener(ee.type,pe)}ue==null||ue.addEventListener(ee.type,pe)}),oe=Be(ee=>{q()!=="sloppy"||!j.current||ya(ee,n.select("floatingElement"))||ya(ee,n.select("domReferenceElement"))||(j.current.dismissOnTouchEnd&&V(ee),B.clear(),j.current=null)}),de=Be(ee=>{const ue=gr(ee);function pe(){oe(ee),ue==null||ue.removeEventListener(ee.type,pe)}ue==null||ue.addEventListener(ee.type,pe)});y.useEffect(()=>{if(!a||!f)return;h.current.__escapeKeyBubbles=k,h.current.__outsidePressBubbles=A;const ee=new Va;function ue(we){n.setOpen(!1,yt(Sa,we))}function pe(){ee.clear(),I.current=!0}function ke(){ee.start(em()?5:0,()=>{I.current=!1})}const Te=qt(s);Te.addEventListener("pointerdown",F,!0),g&&(Te.addEventListener("keydown",_),Te.addEventListener("compositionstart",pe),Te.addEventListener("compositionend",ke)),O&&(Te.addEventListener("click",X,!0),Te.addEventListener("pointerdown",X,!0),Te.addEventListener("touchstart",Y,!0),Te.addEventListener("touchmove",ce,!0),Te.addEventListener("touchend",de,!0),Te.addEventListener("mousedown",X,!0));let be=[];return S&&(an(c)&&(be=bs(c)),an(s)&&(be=be.concat(bs(s))),!an(i)&&i&&i.contextElement&&(be=be.concat(bs(i.contextElement)))),be=be.filter(we=>{var Z;return we!==((Z=Te.defaultView)==null?void 0:Z.visualViewport)}),be.forEach(we=>{we.addEventListener("scroll",ue,{passive:!0})}),()=>{Te.removeEventListener("pointerdown",F,!0),g&&(Te.removeEventListener("keydown",_),Te.removeEventListener("compositionstart",pe),Te.removeEventListener("compositionend",ke)),O&&(Te.removeEventListener("click",X,!0),Te.removeEventListener("pointerdown",X,!0),Te.removeEventListener("touchstart",Y,!0),Te.removeEventListener("touchmove",ce,!0),Te.removeEventListener("touchend",de,!0),Te.removeEventListener("mousedown",X,!0)),be.forEach(we=>{we.removeEventListener("scroll",ue)}),ee.clear(),D.current=!1}},[h,s,i,c,g,O,a,d,S,f,k,A,_,V,X,Q,Y,ce,de,F,n]),y.useEffect(K,[O,K]);const ve=y.useMemo(()=>({onKeyDown:_,...x&&{[E6[w]]:ee=>{n.setOpen(!1,yt(Ti,ee.nativeEvent))},...w!=="intentional"&&{onClick(ee){n.setOpen(!1,yt(Ti,ee.nativeEvent))}}}}),[_,n,x,w]),xe=Be(ee=>{const ue=gr(ee.nativeEvent);!Mt(n.select("floatingElement"),ue)||ee.button!==0||(D.current=!0)}),Ne=Be(ee=>{!a||!f||ee.button!==0||(D.current=!0)}),_e=y.useMemo(()=>({onKeyDown:_,onPointerDown:xe,onMouseDown:xe,onMouseUp:xe,onClickCapture:P,onMouseDownCapture(ee){P(),Ne(ee)},onPointerDownCapture(ee){P(),Ne(ee)},onMouseUpCapture:P,onTouchEndCapture:P,onTouchMoveCapture:P}),[_,xe,P,Ne]);return y.useMemo(()=>f?{reference:ve,floating:_e,trigger:ve}:{},[f,ve,_e])}var _h=Symbol("NOT_FOUND");function T6(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function C6(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function O6(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(a=>typeof a=="function"?`function ${a.name||"unnamed"}()`:typeof a).join(", ");throw new TypeError(`${t}[${n}]`)}}var fR=e=>Array.isArray(e)?e:[e];function M6(e){const t=Array.isArray(e[0])?e[0]:e;return O6(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function N6(e,t){const n=[],{length:a}=e;for(let s=0;s<a;s++)n.push(e[s].apply(null,t));return n}function A6(e){let t;return{get(n){return t&&e(t.key,n)?t.value:_h},put(n,a){t={key:n,value:a}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function D6(e,t){let n=[];function a(d){const h=n.findIndex(f=>t(d,f.key));if(h>-1){const f=n[h];return h>0&&(n.splice(h,1),n.unshift(f)),f.value}return _h}function s(d,h){a(d)===_h&&(n.unshift({key:d,value:h}),n.length>e&&n.pop())}function i(){return n}function c(){n=[]}return{get:a,put:s,getEntries:i,clear:c}}var k6=(e,t)=>e===t;function j6(e){return function(n,a){if(n===null||a===null||n.length!==a.length)return!1;const{length:s}=n;for(let i=0;i<s;i++)if(!e(n[i],a[i]))return!1;return!0}}function _6(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:a=k6,maxSize:s=1,resultEqualityCheck:i}=n,c=j6(a);let d=0;const h=s<=1?A6(c):D6(s,c);function f(){let g=h.get(arguments);if(g===_h){if(g=e.apply(null,arguments),d++,i){const b=h.getEntries().find(x=>i(x.value,g));b&&(g=b.value,d!==0&&d--)}h.put(arguments,g)}return g}return f.clearCache=()=>{h.clear(),f.resetResultsCount()},f.resultsCount=()=>d,f.resetResultsCount=()=>{d=0},f}var L6=class{constructor(e){this.value=e}deref(){return this.value}},I6=typeof WeakRef<"u"?WeakRef:L6,P6=0,hR=1;function Vf(){return{s:P6,v:void 0,o:null,p:null}}function sM(e,t={}){let n=Vf();const{resultEqualityCheck:a}=t;let s,i=0;function c(){var m;let d=n;const{length:h}=arguments;for(let b=0,x=h;b<x;b++){const w=arguments[b];if(typeof w=="function"||typeof w=="object"&&w!==null){let S=d.o;S===null&&(d.o=S=new WeakMap);const R=S.get(w);R===void 0?(d=Vf(),S.set(w,d)):d=R}else{let S=d.p;S===null&&(d.p=S=new Map);const R=S.get(w);R===void 0?(d=Vf(),S.set(w,d)):d=R}}const f=d;let g;if(d.s===hR)g=d.v;else if(g=e.apply(null,arguments),i++,a){const b=((m=s==null?void 0:s.deref)==null?void 0:m.call(s))??s;b!=null&&a(b,g)&&(g=b,i!==0&&i--),s=typeof g=="object"&&g!==null||typeof g=="function"?new I6(g):g}return f.s=hR,f.v=g,g}return c.clearCache=()=>{n=Vf(),c.resetResultsCount()},c.resultsCount=()=>i,c.resetResultsCount=()=>{i=0},c}function iM(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,a=(...s)=>{let i=0,c=0,d,h={},f=s.pop();typeof f=="object"&&(h=f,f=s.pop()),T6(f,`createSelector expects an output function after the inputs, but received: [${typeof f}]`);const g={...n,...h},{memoize:m,memoizeOptions:b=[],argsMemoize:x=sM,argsMemoizeOptions:w=[]}=g,S=fR(b),R=fR(w),T=M6(s),C=m(function(){return i++,f.apply(null,arguments)},...S),M=x(function(){c++;const D=N6(T,arguments);return d=C.apply(null,D),d},...R);return Object.assign(M,{resultFunc:f,memoizedResultFunc:C,dependencies:T,dependencyRecomputations:()=>c,resetDependencyRecomputations:()=>{c=0},lastResult:()=>d,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:m,argsMemoize:x})};return Object.assign(a,{withTypes:()=>a}),a}var z6=iM(sM),U6=Object.assign((e,t=z6)=>{C6(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),a=n.map(i=>e[i]);return t(a,(...i)=>i.reduce((c,d,h)=>(c[n[h]]=d,c),{}))},{withTypes:()=>U6});iM({memoize:_6,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const qe=(e,t,n,a,s,i,...c)=>{if(c.length>0)throw new Error(yn(1));let d;if(e)d=e;else throw new Error("Missing arguments");return d};var cy={exports:{}},uy={};/**
290
+ * @license React
291
+ * use-sync-external-store-shim/with-selector.production.js
292
+ *
293
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
294
+ *
295
+ * This source code is licensed under the MIT license found in the
296
+ * LICENSE file in the root directory of this source tree.
297
+ */var mR;function H6(){if(mR)return uy;mR=1;var e=Xu(),t=RC();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var a=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,i=e.useRef,c=e.useEffect,d=e.useMemo,h=e.useDebugValue;return uy.useSyncExternalStoreWithSelector=function(f,g,m,b,x){var w=i(null);if(w.current===null){var S={hasValue:!1,value:null};w.current=S}else S=w.current;w=d(function(){function T(k){if(!C){if(C=!0,M=k,k=b(k),x!==void 0&&S.hasValue){var A=S.value;if(x(A,k))return O=A}return O=k}if(A=O,a(M,k))return A;var j=b(k);return x!==void 0&&x(A,j)?(M=k,A):(M=k,O=j)}var C=!1,M,O,D=m===void 0?null:m;return[function(){return T(g())},D===null?void 0:function(){return T(D())}]},[g,m,b,x]);var R=s(f,w[0],w[1]);return c(function(){S.hasValue=!0,S.value=R},[R]),h(R),R},uy}var pR;function B6(){return pR||(pR=1,cy.exports=H6()),cy.exports}var F6=B6();const gv=[];let yv;function V6(){return yv}function Y6(e){gv.push(e)}function Lb(e){const t=(n,a)=>{const s=Kn(q6).current;let i;try{yv=s;for(const c of gv)c.before(s);i=e(n,a);for(const c of gv)c.after(s);s.didInitialize=!0}finally{yv=void 0}return i};return t.displayName=e.displayName||e.name,t}function lM(e){return y.forwardRef(Lb(e))}function q6(){return{didInitialize:!1}}const $6=hb(19),K6=$6?X6:W6;function Et(e,t,n,a,s){return K6(e,t,n,a,s)}function G6(e,t,n,a,s){const i=y.useCallback(()=>t(e.getSnapshot(),n,a,s),[e,t,n,a,s]);return cb.useSyncExternalStore(e.subscribe,i,i)}Y6({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 a=e.syncHooks[n],s=a.selector(a.store.state,a.a1,a.a2,a.a3);(a.didChange||!Object.is(a.value,s))&&(t=!0,a.value=s,a.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 s of e.syncHooks)n.add(s.store);const a=[];for(const s of n)a.push(s.subscribe(t));return()=>{for(const s of a)s()}}),cb.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function X6(e,t,n,a,s){const i=V6();if(!i)return G6(e,t,n,a,s);const c=i.syncIndex;i.syncIndex+=1;let d;return i.didInitialize?(d=i.syncHooks[c],(d.store!==e||d.selector!==t||!Object.is(d.a1,n)||!Object.is(d.a2,a)||!Object.is(d.a3,s))&&(d.store!==e&&(i.didChangeStore=!0),d.store=e,d.selector=t,d.a1=n,d.a2=a,d.a3=s,d.didChange=!0)):(d={store:e,selector:t,a1:n,a2:a,a3:s,value:t(e.getSnapshot(),n,a,s),didChange:!1},i.syncHooks.push(d)),d.value}function W6(e,t,n,a,s){return F6.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,i=>t(i,n,a,s))}class cM{constructor(t){We(this,"subscribe",t=>(this.listeners.add(t),()=>{this.listeners.delete(t)}));We(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 a of this.listeners){if(n!==this.updateTick)return;a(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,a,s){return Et(this,t,n,a,s)}}class hm extends cM{constructor(t,n={},a){super(t),this.context=n,this.selectors=a}useSyncedValue(t,n){y.useDebugValue(t),Ue(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const a=this;Ue(()=>(a.state[t]!==n&&a.set(t,n),()=>{a.set(t,void 0)}),[a,t,n])}useSyncedValues(t){const n=this,a=Object.values(t);Ue(()=>{n.update(t)},[n,...a])}useControlledProp(t,n){y.useDebugValue(t);const a=n!==void 0;Ue(()=>{a&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,a])}select(t,n,a,s){const i=this.selectors[t];return i(this.state,n,a,s)}useState(t,n,a,s){return y.useDebugValue(t),Et(this,this.selectors[t],n,a,s)}useContextCallback(t,n){y.useDebugValue(t);const a=Be(n??Mr);this.context[t]=a}useStateSetter(t){const n=y.useRef(void 0);return n.current===void 0&&(n.current=a=>{this.set(t,a)}),n.current}observe(t,n){let a;typeof t=="function"?a=t:a=this.selectors[t];let s=a(this.state);return n(s,s,this),this.subscribe(i=>{const c=a(i);if(!Object.is(s,c)){const d=s;s=c,n(c,d,this)}})}}const Q6={open:qe(e=>e.open),domReferenceElement:qe(e=>e.domReferenceElement),referenceElement:qe(e=>e.positionReference??e.referenceElement),floatingElement:qe(e=>e.floatingElement),floatingId:qe(e=>e.floatingId)};class Ib extends hm{constructor(n){const{nested:a,noEmit:s,onOpenChange:i,triggerElements:c,...d}=n;super({...d,positionReference:d.referenceElement,domReferenceElement:d.referenceElement},{onOpenChange:i,dataRef:{current:{}},events:BO(),nested:a,noEmit:s,triggerElements:c},Q6);We(this,"setOpen",(n,a)=>{var s,i;if((!n||!this.state.open||wO(a.event))&&(this.context.dataRef.current.openEvent=n?a.event:void 0),!this.context.noEmit){const c={open:n,reason:a.reason,nativeEvent:a.event,nested:this.context.nested,triggerElement:a.trigger};this.context.events.emit("openchange",c)}(i=(s=this.context).onOpenChange)==null||i.call(s,n,a)})}}function Z6(e,t){const n=y.useRef(null),a=y.useRef(null);return y.useCallback(s=>{if(e!==void 0){if(n.current!==null){const i=n.current,c=a.current,d=t.context.triggerElements.getById(i);c&&d===c&&t.context.triggerElements.delete(i),n.current=null,a.current=null}s!==null&&(n.current=e,a.current=s,t.context.triggerElements.add(e,s))}},[t,e])}function uM(e,t,n,a){const s=n.useState("isMountedByTrigger",e),i=Z6(e,n),c=Be(d=>{if(i(d),!d||!n.select("open"))return;const h=n.select("activeTriggerId");if(h===e){n.update({activeTriggerElement:d,...a});return}h==null&&n.update({activeTriggerId:e,activeTriggerElement:d,...a})});return Ue(()=>{s&&n.update({activeTriggerElement:t.current,...a})},[s,n,t,...Object.values(a)]),{registerTrigger:c,isMountedByThisTrigger:s}}function Pb(e){const t=e.useState("open");Ue(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[a,s]=n.value;e.update({activeTriggerId:a,activeTriggerElement:s})}}},[t,e])}function zb(e,t,n){const{mounted:a,setMounted:s,transitionStatus:i}=od(e);t.useSyncedValues({mounted:a,transitionStatus:i});const c=Be(()=>{var h,f;s(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n==null||n(),(f=(h=t.context).onOpenChangeComplete)==null||f.call(h,!1)}),d=t.useState("preventUnmountingOnClose");return No({enabled:!d,open:e,ref:t.context.popupRef,onComplete(){e||c()}}),{forceUnmount:c,transitionStatus:i}}class sd{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const a=this.idMap.get(t);a!==n&&(a!==void 0&&this.elementsSet.delete(a),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 J6(){return new Ib({open:!1,floatingElement:null,referenceElement:null,triggerElements:new sd,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Ub(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:J6(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Tn,inactiveTriggerProps:Tn,popupProps:Tn}}const Yf=qe(e=>e.triggerIdProp??e.activeTriggerId),Hb={open:qe(e=>e.openProp??e.open),mounted:qe(e=>e.mounted),transitionStatus:qe(e=>e.transitionStatus),floatingRootContext:qe(e=>e.floatingRootContext),preventUnmountingOnClose:qe(e=>e.preventUnmountingOnClose),payload:qe(e=>e.payload),activeTriggerId:Yf,activeTriggerElement:qe(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:qe((e,t)=>t!==void 0&&Yf(e)===t),isOpenedByTrigger:qe((e,t)=>t!==void 0&&Yf(e)===t&&e.open),isMountedByTrigger:qe((e,t)=>t!==void 0&&Yf(e)===t&&e.mounted),triggerProps:qe((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:qe(e=>e.popupProps),popupElement:qe(e=>e.popupElement),positionerElement:qe(e=>e.positionerElement)};function dM(e){const{open:t=!1,onOpenChange:n,elements:a={}}=e,s=Ai(),i=Ao()!=null,c=Kn(()=>new Ib({open:t,onOpenChange:n,referenceElement:a.reference??null,floatingElement:a.floating??null,triggerElements:new sd,floatingId:s,nested:i,noEmit:!1})).current;return Ue(()=>{const d={open:t,floatingId:s};a.reference!==void 0&&(d.referenceElement=a.reference,d.domReferenceElement=an(a.reference)?a.reference:null),a.floating!==void 0&&(d.floatingElement=a.floating),c.update(d)},[t,s,a.reference,a.floating,c]),c.context.onOpenChange=n,c.context.nested=i,c.context.noEmit=!1,c}function eB(e={}){const{nodeId:t,externalTree:n}=e,a=dM(e),s=e.rootContext||a,i={reference:s.useState("referenceElement"),floating:s.useState("floatingElement"),domReference:s.useState("domReferenceElement")},[c,d]=y.useState(null),h=y.useRef(null),f=Ns(n);Ue(()=>{i.domReference&&(h.current=i.domReference)},[i.domReference]);const g=g6({...e,elements:{...i,...c&&{reference:c}}}),m=y.useCallback(A=>{const j=an(A)?{getBoundingClientRect:()=>A.getBoundingClientRect(),getClientRects:()=>A.getClientRects(),contextElement:A}:A;d(j),g.refs.setReference(j)},[g.refs]),[b,x]=y.useState(null),[w,S]=y.useState(null);s.useSyncedValue("referenceElement",b),s.useSyncedValue("domReferenceElement",an(b)?b:null),s.useSyncedValue("floatingElement",w);const R=y.useCallback(A=>{(an(A)||A===null)&&(h.current=A,x(A)),(an(g.refs.reference.current)||g.refs.reference.current===null||A!==null&&!an(A))&&g.refs.setReference(A)},[g.refs,x]),T=y.useCallback(A=>{S(A),g.refs.setFloating(A)},[g.refs]),C=y.useMemo(()=>({...g.refs,setReference:R,setFloating:T,setPositionReference:m,domReference:h}),[g.refs,R,T,m]),M=y.useMemo(()=>({...g.elements,domReference:i.domReference}),[g.elements,i.domReference]),O=s.useState("open"),D=s.useState("floatingId"),k=y.useMemo(()=>({...g,dataRef:s.context.dataRef,open:O,onOpenChange:s.setOpen,events:s.context.events,floatingId:D,refs:C,elements:M,nodeId:t,rootStore:s}),[g,C,M,t,s,O,D]);return Ue(()=>{s.context.dataRef.current.floatingContext=k;const A=f==null?void 0:f.nodesRef.current.find(j=>j.id===t);A&&(A.context=k)}),y.useMemo(()=>({...g,context:k,refs:C,elements:M,rootStore:s}),[g,C,M,k,s])}function Bb(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:a=!1,onOpenChange:s}=e,i=Ai(),c=Ao()!=null,d=t.useState("open"),h=t.useState("activeTriggerElement"),f=t.useState(a?"popupElement":"positionerElement"),g=t.context.triggerElements,m=Kn(()=>new Ib({open:d,referenceElement:h,floatingElement:f,triggerElements:g,onOpenChange:s,floatingId:i,nested:c,noEmit:n})).current;return Ue(()=>{const b={open:d,floatingId:i,referenceElement:h,floatingElement:f};an(h)&&(b.domReferenceElement=h),m.state.positionReference===m.state.referenceElement&&(b.positionReference=h),m.update(b)},[d,i,h,f,m]),m.context.onOpenChange=s,m.context.nested=c,m.context.noEmit=n,m}const dy=RU&&mO;function fM(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:a,dataRef:s}=n.context,{enabled:i=!0,delay:c}=t,d=y.useRef(!1),h=y.useRef(null),f=jn(),g=y.useRef(!0);y.useEffect(()=>{const b=n.select("domReferenceElement");if(!i)return;const x=_n(b);function w(){const T=n.select("domReferenceElement");!n.select("open")&&wn(T)&&T===Br(qt(T))&&(d.current=!0)}function S(){g.current=!0}function R(){g.current=!1}return x.addEventListener("blur",w),dy&&(x.addEventListener("keydown",S,!0),x.addEventListener("pointerdown",R,!0)),()=>{x.removeEventListener("blur",w),dy&&(x.removeEventListener("keydown",S,!0),x.removeEventListener("pointerdown",R,!0))}},[n,i]),y.useEffect(()=>{if(!i)return;function b(x){if(x.reason===Ti||x.reason===lm){const w=n.select("domReferenceElement");an(w)&&(h.current=w,d.current=!0)}}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,i,n]);const m=y.useMemo(()=>({onMouseLeave(){d.current=!1,h.current=null},onFocus(b){const x=b.currentTarget;if(d.current){if(h.current===x)return;d.current=!1,h.current=null}const w=gr(b.nativeEvent);if(an(w)){if(dy&&!b.relatedTarget){if(!g.current&&!om(w))return}else if(!NU(w))return}const S=Rh(b.relatedTarget,n.context.triggerElements),{nativeEvent:R,currentTarget:T}=b,C=typeof c=="function"?c():c;if(n.select("open")&&S||C===0||C===void 0){n.setOpen(!0,yt(El,R,T));return}f.start(C,()=>{d.current||n.setOpen(!0,yt(El,R,T))})},onBlur(b){d.current=!1,h.current=null;const x=b.relatedTarget,w=b.nativeEvent,S=an(x)&&x.hasAttribute(Gl("focus-guard"))&&x.getAttribute("data-type")==="outside";f.start(0,()=>{var M;const R=n.select("domReferenceElement"),T=Br(R?R.ownerDocument:document);!x&&T===R||Mt((M=s.current.floatingContext)==null?void 0:M.refs.floating.current,T)||Mt(R,T)||S||Rh(x??T,n.context.triggerElements)||n.setOpen(!1,yt(El,w))})}}),[s,n,f,c]);return y.useMemo(()=>i?{reference:m,trigger:m}:{},[i,m])}const vv=Gl("safe-polygon"),tB=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${vO}`;function nB(e){return e?!!e.closest(tB):!1}class Fb{constructor(){We(this,"dispose",()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()});We(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 Va,this.restTimeout=new Va,this.handleCloseOptions=void 0}static create(){return new Fb}}function hM(e){const t=Kn(Fb.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),rm(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const rB=new Set(["click","mousedown"]);function mM(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),s=n.useState("floatingElement"),i=n.useState("domReferenceElement"),{dataRef:c}=n.context,{enabled:d=!0,closeDelay:h=0}=t,f=hM(n),g=Ns(),m=Ao(),b=Be(()=>f.interactedInside?!0:c.current.openEvent?rB.has(c.current.openEvent.type):!1),x=Be(()=>{var O;const M=(O=c.current.openEvent)==null?void 0:O.type;return(M==null?void 0:M.includes("mouse"))&&M!=="mousedown"}),w=Be(M=>Rh(M,n.context.triggerElements)),S=y.useCallback((M,O=!0)=>{const D=aB(h,f.pointerType);D&&!f.handler?f.openChangeTimeout.start(D,()=>n.setOpen(!1,yt(dr,M))):O&&(f.openChangeTimeout.clear(),n.setOpen(!1,yt(dr,M)))},[h,n,f]),R=Be(()=>{f.unbindMouseMove(),f.handler=void 0}),T=Be(()=>{if(f.performedPointerEventsMutation){const M=qt(s).body;M.style.pointerEvents="",M.removeAttribute(vv),f.performedPointerEventsMutation=!1}}),C=Be(M=>{const O=gr(M);if(!nB(O)){f.interactedInside=!1;return}f.interactedInside=!0});Ue(()=>{a||(f.pointerType=void 0,f.restTimeoutPending=!1,f.interactedInside=!1,R(),T())},[a,f,R,T]),y.useEffect(()=>()=>{R()},[R]),y.useEffect(()=>T,[T]),Ue(()=>{var M,O,D;if(d&&a&&(M=f.handleCloseOptions)!=null&&M.blockPointerEvents&&x()&&an(i)&&s){f.performedPointerEventsMutation=!0;const k=qt(s).body;k.setAttribute(vv,"");const A=i,j=s,B=(D=(O=g==null?void 0:g.nodesRef.current.find(W=>W.id===m))==null?void 0:O.context)==null?void 0:D.elements.floating;return B&&(B.style.pointerEvents=""),k.style.pointerEvents="none",A.style.pointerEvents="auto",j.style.pointerEvents="auto",()=>{k.style.pointerEvents="",A.style.pointerEvents="",j.style.pointerEvents=""}}},[d,a,i,s,f,x,g,m]),y.useEffect(()=>{if(!d)return;function M(A){b()||!c.current.floatingContext||!n.select("open")||w(A.relatedTarget)||(T(),R(),b()||S(A))}function O(A){var j;f.openChangeTimeout.clear(),T(),(j=f.handler)==null||j.call(f,A),R()}function D(A){b()||S(A,!1)}const k=s;return k&&(k.addEventListener("mouseleave",M),k.addEventListener("mouseenter",O),k.addEventListener("mouseleave",D),k.addEventListener("pointerdown",C,!0)),()=>{k&&(k.removeEventListener("mouseleave",M),k.removeEventListener("mouseenter",O),k.removeEventListener("mouseleave",D),k.removeEventListener("pointerdown",C,!0))}},[d,s,n,c,b,w,S,T,R,C,f])}function aB(e,t){return t&&!Ei(t)?0:typeof e=="function"?e():e}function fy(e){return typeof e=="function"?e():e}const oB={current:null};function pM(e,t={}){var W;const n="rootStore"in e?e.rootStore:e,{dataRef:a,events:s}=n.context,{enabled:i=!0,delay:c=0,handleClose:d=null,mouseOnly:h=!1,restMs:f=0,move:g=!0,triggerElementRef:m=oB,externalTree:b,isActiveTrigger:x=!0}=t,w=Ns(b),S=hM(n),R=Zn(d),T=Zn(c),C=Zn(f),M=Zn(i);x&&(S.handleCloseOptions=(W=R.current)==null?void 0:W.__options);const O=Be(()=>S.interactedInside?!0:a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1),D=Be(K=>Rh(K,n.context.triggerElements)),k=y.useCallback((K,I=!0)=>{const H=fh(T.current,"close",S.pointerType);H&&!S.handler?S.openChangeTimeout.start(H,()=>n.setOpen(!1,yt(dr,K))):I&&(S.openChangeTimeout.clear(),n.setOpen(!1,yt(dr,K)))},[T,n,S]),A=Be(()=>{S.unbindMouseMove(),S.handler=void 0}),j=Be(()=>{if(S.performedPointerEventsMutation){const K=qt(n.select("domReferenceElement")).body;K.style.pointerEvents="",K.removeAttribute(vv),S.performedPointerEventsMutation=!1}});y.useEffect(()=>{if(!i)return;function K(I){I.open||(S.openChangeTimeout.clear(),S.restTimeout.clear(),S.blockMouseMove=!0,S.restTimeoutPending=!1)}return s.on("openchange",K),()=>{s.off("openchange",K)}},[i,s,S]);const B=Be(K=>{var H;if(O()||!a.current.floatingContext||D(K.relatedTarget))return;const I=m.current;(H=R.current)==null||H.call(R,{...a.current.floatingContext,tree:w,x:K.clientX,y:K.clientY,onClose(){j(),A(),!O()&&I===n.select("domReferenceElement")&&k(K)}})(K)});return y.useEffect(()=>{if(!i)return;const K=m.current??(x?n.select("domReferenceElement"):null);if(!an(K))return;function I(q){if(S.openChangeTimeout.clear(),S.blockMouseMove=!1,h&&!Ei(S.pointerType)||fy(C.current)>0&&!fh(T.current,"open"))return;const _=fh(T.current,"open",S.pointerType),L=n.select("domReferenceElement"),P=n.context.triggerElements,V=(P.hasElement(q.target)||P.hasMatchingElement(X=>Mt(X,q.target)))&&(!L||!Mt(L,q.target)),Q=q.currentTarget??null,z=n.select("open"),Y=!z||V;V&&z?n.setOpen(!0,yt(dr,q,Q)):_?S.openChangeTimeout.start(_,()=>{Y&&n.setOpen(!0,yt(dr,q,Q))}):Y&&n.setOpen(!0,yt(dr,q,Q))}function H(q){if(O()){j();return}S.unbindMouseMove();const _=n.select("domReferenceElement"),L=qt(_);if(S.restTimeout.clear(),S.restTimeoutPending=!1,D(q.relatedTarget))return;if(R.current&&a.current.floatingContext){n.select("open")||S.openChangeTimeout.clear();const V=m.current;S.handler=R.current({...a.current.floatingContext,tree:w,x:q.clientX,y:q.clientY,onClose(){j(),A(),M.current&&!O()&&V===n.select("domReferenceElement")&&k(q,!0)}});const Q=S.handler;Q(q),L.addEventListener("mousemove",Q),S.unbindMouseMove=()=>{L.removeEventListener("mousemove",Q)};return}(S.pointerType==="touch"?!Mt(n.select("floatingElement"),q.relatedTarget):!0)&&k(q)}function F(q){B(q)}return n.select("open")&&K.addEventListener("mouseleave",F),g&&K.addEventListener("mousemove",I,{once:!0}),K.addEventListener("mouseenter",I),K.addEventListener("mouseleave",H),()=>{K.removeEventListener("mouseleave",F),g&&K.removeEventListener("mousemove",I),K.removeEventListener("mouseenter",I),K.removeEventListener("mouseleave",H)}},[A,j,a,T,k,n,i,R,B,S,x,O,D,h,g,C,m,w,M]),y.useMemo(()=>{if(!i)return;function K(I){S.pointerType=I.pointerType}return{onPointerDown:K,onPointerEnter:K,onMouseMove(I){const{nativeEvent:H}=I,F=I.currentTarget,q=n.select("domReferenceElement"),_=n.context.triggerElements,L=n.select("open"),P=(_.hasElement(I.target)||_.hasMatchingElement(Q=>Mt(Q,I.target)))&&(!q||!Mt(q,I.target));if(h&&!Ei(S.pointerType)||L&&!P||fy(C.current)===0||!P&&S.restTimeoutPending&&I.movementX**2+I.movementY**2<2)return;S.restTimeout.clear();function V(){if(S.restTimeoutPending=!1,O())return;const Q=n.select("open");!S.blockMouseMove&&(!Q||P)&&n.setOpen(!0,yt(dr,H,F))}S.pointerType==="touch"?or.flushSync(()=>{V()}):P&&L?V():(S.restTimeoutPending=!0,S.restTimeout.start(fy(C.current),V))}}},[i,S,O,h,n,C])}function id(e=[]){const t=e.map(f=>f==null?void 0:f.reference),n=e.map(f=>f==null?void 0:f.floating),a=e.map(f=>f==null?void 0:f.item),s=e.map(f=>f==null?void 0:f.trigger),i=y.useCallback(f=>qf(f,e,"reference"),t),c=y.useCallback(f=>qf(f,e,"floating"),n),d=y.useCallback(f=>qf(f,e,"item"),a),h=y.useCallback(f=>qf(f,e,"trigger"),s);return y.useMemo(()=>({getReferenceProps:i,getFloatingProps:c,getItemProps:d,getTriggerProps:h}),[i,c,d,h])}function qf(e,t,n){var c;const a=new Map,s=n==="item",i={};n==="floating"&&(i.tabIndex=-1,i[lv]="");for(const d in e)s&&e&&(d===gO||d===yO)||(i[d]=e[d]);for(let d=0;d<t.length;d+=1){let h;const f=(c=t[d])==null?void 0:c[n];typeof f=="function"?h=e?f(e):null:h=f,h&&gR(i,h,s,a)}return gR(i,e,s,a),i}function gR(e,t,n,a){var s;for(const i in t){const c=t[i];n&&(i===gO||i===yO)||(i.startsWith("on")?(a.has(i)||a.set(i,[]),typeof c=="function"&&((s=a.get(i))==null||s.push(c),e[i]=(...d)=>{var h;return(h=a.get(i))==null?void 0:h.map(f=>f(...d)).find(f=>f!==void 0)})):e[i]=c)}}const sB="Escape";function mm(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function $f(e,t){return mm(t,e===xb||e===nd,e===xs||e===ws)}function hy(e,t,n){return mm(t,e===nd,n?e===xs:e===ws)||e==="Enter"||e===" "||e===""}function iB(e,t,n){return mm(t,n?e===xs:e===ws,e===nd)}function lB(e,t,n,a){const s=n?e===ws:e===xs,i=e===xb;return t==="both"||t==="horizontal"&&a&&a>1?e===sB:mm(t,s,i)}function gM(e,t){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),s=n.useState("floatingElement"),i=n.useState("domReferenceElement"),c=n.context.dataRef,{listRef:d,activeIndex:h,onNavigate:f=()=>{},enabled:g=!0,selectedIndex:m=null,allowEscape:b=!1,loopFocus:x=!1,nested:w=!1,rtl:S=!1,virtual:R=!1,focusItemOnOpen:T="auto",focusItemOnHover:C=!0,openOnArrowKeyDown:M=!0,disabledIndices:O=void 0,orientation:D="vertical",parentOrientation:k,cols:A=1,id:j,resetOnPointerLeave:B=!0,externalTree:W}=t,K=Iu(s),I=Zn(K),H=Ao(),F=Ns(W);Ue(()=>{c.current.orientation=D},[c,D]);const q=cv(i),_=y.useRef(T),L=y.useRef(m??-1),P=y.useRef(null),V=y.useRef(!0),Q=Be(Z=>{f(L.current===-1?null:L.current,Z)}),z=y.useRef(Q),Y=y.useRef(!!s),X=y.useRef(a),G=y.useRef(!1),ce=y.useRef(!1),oe=Zn(O),de=Zn(a),ve=Zn(m),xe=Zn(B),Ne=Be(()=>{function Z(He){R?F==null||F.events.emit("virtualfocus",He):Su(He,{sync:G.current,preventScroll:!0})}const Se=d.current[L.current],ge=ce.current;Se&&Z(Se),(G.current?He=>He():requestAnimationFrame)(()=>{var st;const He=d.current[L.current]||Se;if(!He)return;Se||Z(He),ee&&(ge||!V.current)&&((st=He.scrollIntoView)==null||st.call(He,{block:"nearest",inline:"nearest"}))})});Ue(()=>{g&&(a&&s?(L.current=m??-1,_.current&&m!=null&&(ce.current=!0,Q())):Y.current&&(L.current=-1,z.current()))},[g,a,s,m,Q]),Ue(()=>{if(g){if(!a){G.current=!1;return}if(s)if(h==null){if(G.current=!1,ve.current!=null)return;if(Y.current&&(L.current=-1,Ne()),(!X.current||!Y.current)&&_.current&&(P.current!=null||_.current===!0&&P.current==null)){let Z=0;const Se=()=>{d.current[0]==null?(Z<2&&(Z?requestAnimationFrame:queueMicrotask)(Se),Z+=1):(L.current=P.current==null||hy(P.current,D,S)||w?ch(d):fv(d),P.current=null,Q())};Se()}}else wl(d,h)||(L.current=h,Ne(),ce.current=!1)}},[g,a,s,h,ve,w,d,D,S,Q,Ne,oe]),Ue(()=>{var He,De;if(!g||s||!F||R||!Y.current)return;const Z=F.nodesRef.current,Se=(De=(He=Z.find(st=>st.id===H))==null?void 0:He.context)==null?void 0:De.elements.floating,ge=Br(qt(s)),ze=Z.some(st=>st.context&&Mt(st.context.elements.floating,ge));Se&&!ze&&V.current&&Se.focus({preventScroll:!0})},[g,s,F,H,R]),Ue(()=>{z.current=Q,X.current=a,Y.current=!!s}),Ue(()=>{a||(P.current=null,_.current=T)},[a,T]);const _e=h!=null,ee=y.useMemo(()=>{function Z(ge){if(!de.current)return;const ze=d.current.indexOf(ge.currentTarget);ze!==-1&&L.current!==ze&&(L.current=ze,Q(ge))}return{onFocus(ge){G.current=!0,Z(ge)},onClick:({currentTarget:ge})=>ge.focus({preventScroll:!0}),onMouseMove(ge){G.current=!0,ce.current=!1,C&&Z(ge)},onPointerLeave(ge){var He;if(!de.current||!V.current||ge.pointerType==="touch")return;G.current=!0;const ze=ge.relatedTarget;!C||d.current.includes(ze)||xe.current&&(Su(null,{sync:!0}),L.current=-1,Q(ge),R||(He=I.current)==null||He.focus({preventScroll:!0}))}}},[de,I,C,d,Q,xe,R]),ue=y.useCallback(()=>{var Z,Se,ge;return k??((ge=(Se=(Z=F==null?void 0:F.nodesRef.current.find(ze=>ze.id===H))==null?void 0:Z.context)==null?void 0:Se.dataRef)==null?void 0:ge.current.orientation)},[H,F,k]),pe=Be(Z=>{if(V.current=!1,G.current=!0,Z.which===229||!de.current&&Z.currentTarget===I.current)return;if(w&&lB(Z.key,D,S,A)){$f(Z.key,ue())||cr(Z),n.setOpen(!1,yt(uh,Z.nativeEvent)),wn(i)&&(R?F==null||F.events.emit("virtualfocus",i):i.focus());return}const Se=L.current,ge=ch(d,O),ze=fv(d,O);if(q||(Z.key==="Home"&&(cr(Z),L.current=ge,Q(Z)),Z.key==="End"&&(cr(Z),L.current=ze,Q(Z))),A>1){const He=Array.from({length:d.current.length},()=>({width:1,height:1})),De=RO(He,A,!1),st=De.findIndex(Je=>Je!=null&&!Ss(d,Je,O)),xt=De.reduce((Je,Qe,ft)=>Qe!=null&&!Ss(d,Qe,O)?ft:Je,-1),vt=De[EO({current:De.map(Je=>Je!=null?d.current[Je]:null)},{event:Z,orientation:D,loopFocus:x,rtl:S,cols:A,disabledIndices:CO([...(typeof O!="function"?O:null)||d.current.map((Je,Qe)=>Ss(d,Qe,O)?Qe:void 0),void 0],De),minIndex:st,maxIndex:xt,prevIndex:TO(L.current>ze?ge:L.current,He,De,A,Z.key===nd?"bl":Z.key===(S?xs:ws)?"tr":"tl"),stopEvent:!0})];if(vt!=null&&(L.current=vt,Q(Z)),D==="both")return}if($f(Z.key,D)){if(cr(Z),a&&!R&&Br(Z.currentTarget.ownerDocument)===Z.currentTarget){L.current=hy(Z.key,D,S)?ge:ze,Q(Z);return}hy(Z.key,D,S)?x?Se>=ze?b&&Se!==d.current.length?L.current=-1:(G.current=!1,L.current=ge):L.current=ar(d,{startingIndex:Se,disabledIndices:O}):L.current=Math.min(ze,ar(d,{startingIndex:Se,disabledIndices:O})):x?Se<=ge?b&&Se!==-1?L.current=d.current.length:(G.current=!1,L.current=ze):L.current=ar(d,{startingIndex:Se,decrement:!0,disabledIndices:O}):L.current=Math.max(ge,ar(d,{startingIndex:Se,decrement:!0,disabledIndices:O})),wl(d,L.current)&&(L.current=-1),Q(Z)}}),ke=y.useMemo(()=>R&&a&&_e&&{"aria-activedescendant":`${j}-${h}`},[R,a,_e,j,h]),Te=y.useMemo(()=>({"aria-orientation":D==="both"?void 0:D,...q?{}:ke,onKeyDown(Z){if(Z.key==="Tab"&&Z.shiftKey&&a&&!R){const Se=gr(Z.nativeEvent);if(Se&&!Mt(I.current,Se))return;cr(Z),n.setOpen(!1,yt(Ci,Z.nativeEvent)),wn(i)&&i.focus();return}pe(Z)},onPointerMove(){V.current=!0}}),[ke,pe,I,D,q,n,a,R,i]),be=y.useMemo(()=>{function Z(ge){T==="auto"&&bO(ge.nativeEvent)&&(_.current=!R)}function Se(ge){_.current=T,T==="auto"&&xO(ge.nativeEvent)&&(_.current=!0)}return{onKeyDown(ge){const ze=n.select("open");V.current=!1;const He=ge.key.startsWith("Arrow"),De=iB(ge.key,ue(),S),st=$f(ge.key,D),xt=(w?De:st)||ge.key==="Enter"||ge.key.trim()==="";if(R&&ze)return pe(ge);if(!(!ze&&!M&&He)){if(xt){const vt=$f(ge.key,ue());P.current=w&&vt?null:ge.key}if(w){De&&(cr(ge),ze?(L.current=ch(d,oe.current),Q(ge)):n.setOpen(!0,yt(uh,ge.nativeEvent,ge.currentTarget)));return}st&&(ve.current!=null&&(L.current=ve.current),cr(ge),!ze&&M?n.setOpen(!0,yt(uh,ge.nativeEvent,ge.currentTarget)):pe(ge),ze&&Q(ge))}},onFocus(ge){n.select("open")&&!R&&(L.current=-1,Q(ge))},onPointerDown:Se,onPointerEnter:Se,onMouseDown:Z,onClick:Z}},[pe,oe,T,d,w,Q,n,M,D,ue,S,ve,R]),we=y.useMemo(()=>({...ke,...be}),[ke,be]);return y.useMemo(()=>g?{reference:we,floating:Te,item:ee,trigger:be}:{},[g,we,Te,be,ee])}const cB=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function yM(e,t={}){const n="rootStore"in e?e.rootStore:e,a=n.useState("open"),s=n.useState("floatingId"),i=n.useState("domReferenceElement"),c=n.useState("floatingElement"),{role:d="dialog"}=t,h=Ai(),f=(i==null?void 0:i.id)||h,g=y.useMemo(()=>{var C;return((C=Iu(c))==null?void 0:C.id)||s},[c,s]),m=cB.get(d)??d,x=Ao()!=null,w=y.useMemo(()=>m==="tooltip"||d==="label"?Tn:{"aria-haspopup":m==="alertdialog"?"dialog":m,"aria-expanded":"false",...m==="listbox"&&{role:"combobox"},...m==="menu"&&x&&{role:"menuitem"},...d==="select"&&{"aria-autocomplete":"none"},...d==="combobox"&&{"aria-autocomplete":"list"}},[m,x,d]),S=y.useMemo(()=>m==="tooltip"||d==="label"?{[`aria-${d==="label"?"labelledby":"describedby"}`]:a?g:void 0}:{...w,"aria-expanded":a?"true":"false","aria-controls":a?g:void 0,...m==="menu"&&{id:f}},[m,g,a,f,d,w]),R=y.useMemo(()=>{const C={id:g,...m&&{role:m}};return m==="tooltip"||d==="label"?C:{...C,...m==="menu"&&{"aria-labelledby":f}}},[m,g,f,d]),T=y.useCallback(({active:C,selected:M})=>{const O={role:"option",...C&&{id:`${g}-fui-option`}};switch(d){case"select":case"combobox":return{...O,"aria-selected":M}}return{}},[g,d]);return y.useMemo(()=>({reference:S,floating:R,item:T,trigger:w}),[S,R,w,T])}function vM(e,t){const n="rootStore"in e?e.rootStore:e,a=n.context.dataRef,s=n.useState("open"),{listRef:i,activeIndex:c,onMatch:d,onTypingChange:h,enabled:f=!0,resetMs:g=750,selectedIndex:m=null}=t,b=jn(),x=y.useRef(""),w=y.useRef(m??c??-1),S=y.useRef(null);Ue(()=>{!s&&m!==null||(b.clear(),S.current=null,x.current!==""&&(x.current=""))},[s,m,b]),Ue(()=>{s&&x.current===""&&(w.current=m??c??-1)},[s,m,c]);const R=Be(D=>{D?a.current.typing||(a.current.typing=D,h==null||h(D)):a.current.typing&&(a.current.typing=D,h==null||h(D))}),T=Be(D=>{function k(I,H,F){const q=H.find(_=>(_==null?void 0:_.toLocaleLowerCase().indexOf(F.toLocaleLowerCase()))===0);return q?I.indexOf(q):-1}const A=i.current;if(x.current.length>0&&x.current[0]!==" "&&(k(A,A,x.current)===-1?R(!1):D.key===" "&&cr(D)),A==null||D.key.length!==1||D.ctrlKey||D.metaKey||D.altKey)return;s&&D.key!==" "&&(cr(D),R(!0));const j=x.current==="";j&&(w.current=m??c??-1),A.every(I=>{var H,F;return I?((H=I[0])==null?void 0:H.toLocaleLowerCase())!==((F=I[1])==null?void 0:F.toLocaleLowerCase()):!0})&&x.current===D.key&&(x.current="",w.current=S.current),x.current+=D.key,b.start(g,()=>{x.current="",w.current=S.current,R(!1)});const W=j?m??c??-1:w.current,K=k(A,[...A.slice((W||0)+1),...A.slice(0,(W||0)+1)],x.current);K!==-1?(d==null||d(K),S.current=K):D.key!==" "&&(x.current="",R(!1))}),C=Be(D=>{const k=D.relatedTarget,A=n.select("domReferenceElement"),j=n.select("floatingElement"),B=Mt(A,k),W=Mt(j,k);B||W||(b.clear(),x.current="",w.current=S.current,R(!1))}),M=y.useMemo(()=>({onKeyDown:T,onBlur:C}),[T,C]),O=y.useMemo(()=>({onKeyDown:T,onKeyUp(D){D.key===" "&&R(!1)},onBlur:C}),[T,C,R]);return y.useMemo(()=>f?{reference:M,floating:O}:{},[f,M,O])}function yR(e,t){const[n,a]=e;let s=!1;const i=t.length;for(let c=0,d=i-1;c<i;d=c++){const[h,f]=t[c]||[0,0],[g,m]=t[d]||[0,0];f>=a!=m>=a&&n<=(g-h)*(a-f)/(m-f)+h&&(s=!s)}return s}function uB(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function bM(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:a=!0}=e,s=new Va;let i=!1,c=null,d=null,h=typeof performance<"u"?performance.now():0;function f(m,b){const x=performance.now(),w=x-h;if(c===null||d===null||w===0)return c=m,d=b,h=x,null;const S=m-c,R=b-d,C=Math.sqrt(S*S+R*R)/w;return c=m,d=b,h=x,C}const g=({x:m,y:b,placement:x,elements:w,onClose:S,nodeId:R,tree:T})=>function(M){function O(){s.clear(),S()}if(s.clear(),!w.domReference||!w.floating||x==null||m==null||b==null)return;const{clientX:D,clientY:k}=M,A=[D,k],j=gr(M),B=M.type==="mouseleave",W=Mt(w.floating,j),K=Mt(w.domReference,j),I=w.domReference.getBoundingClientRect(),H=w.floating.getBoundingClientRect(),F=x.split("-")[0],q=m>H.right-H.width/2,_=b>H.bottom-H.height/2,L=uB(A,I),P=H.width>I.width,V=H.height>I.height,Q=(P?I:H).left,z=(P?I:H).right,Y=(V?I:H).top,X=(V?I:H).bottom;if(W&&(i=!0,!B))return;if(K&&(i=!1),K&&!B){i=!0;return}if(B&&an(M.relatedTarget)&&Mt(w.floating,M.relatedTarget)||T&&pi(T.nodesRef.current,R).some(({context:oe})=>oe==null?void 0:oe.open))return;if(F==="top"&&b>=I.bottom-1||F==="bottom"&&b<=I.top+1||F==="left"&&m>=I.right-1||F==="right"&&m<=I.left+1)return O();let G=[];switch(F){case"top":G=[[Q,I.top+1],[Q,H.bottom-1],[z,H.bottom-1],[z,I.top+1]];break;case"bottom":G=[[Q,H.top+1],[Q,I.bottom-1],[z,I.bottom-1],[z,H.top+1]];break;case"left":G=[[H.right-1,X],[H.right-1,Y],[I.left+1,Y],[I.left+1,X]];break;case"right":G=[[I.right-1,X],[I.right-1,Y],[H.left+1,Y],[H.left+1,X]];break}function ce([oe,de]){switch(F){case"top":{const ve=[P?oe+t/2:q?oe+t*4:oe-t*4,de+t+1],xe=[P?oe-t/2:q?oe+t*4:oe-t*4,de+t+1],Ne=[[H.left,q||P?H.bottom-t:H.top],[H.right,q?P?H.bottom-t:H.top:H.bottom-t]];return[ve,xe,...Ne]}case"bottom":{const ve=[P?oe+t/2:q?oe+t*4:oe-t*4,de-t],xe=[P?oe-t/2:q?oe+t*4:oe-t*4,de-t],Ne=[[H.left,q||P?H.top+t:H.bottom],[H.right,q?P?H.top+t:H.bottom:H.top+t]];return[ve,xe,...Ne]}case"left":{const ve=[oe+t+1,V?de+t/2:_?de+t*4:de-t*4],xe=[oe+t+1,V?de-t/2:_?de+t*4:de-t*4];return[...[[_||V?H.right-t:H.left,H.top],[_?V?H.right-t:H.left:H.right-t,H.bottom]],ve,xe]}case"right":{const ve=[oe-t,V?de+t/2:_?de+t*4:de-t*4],xe=[oe-t,V?de-t/2:_?de+t*4:de-t*4],Ne=[[_||V?H.left+t:H.right,H.top],[_?V?H.left+t:H.right:H.left+t,H.bottom]];return[ve,xe,...Ne]}default:return[]}}if(!yR([D,k],G)){if(i&&!L)return O();if(!B&&a){const oe=f(M.clientX,M.clientY);if(oe!==null&&oe<.1)return O()}yR([D,k],ce([m,b]))?!i&&a&&s.start(40,O):O()}};return g.__options={blockPointerEvents:n},g}let dB=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),fB=(function(e){return e[e.open=ai.open]="open",e[e.closed=ai.closed]="closed",e[e.startingStyle=ai.startingStyle]="startingStyle",e[e.endingStyle=ai.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const xM=y.createContext(void 0);function hB(){const e=y.useContext(xM);if(e===void 0)throw new Error(yn(26));return e}const Cl="ArrowUp",oi="ArrowDown",Pu="ArrowLeft",Ol="ArrowRight",ld="Home",cd="End",wM=new Set([Pu,Ol]),mB=new Set([Pu,Ol,ld,cd]),SM=new Set([Cl,oi]),pB=new Set([Cl,oi,ld,cd]),EM=new Set([...wM,...SM]),gB=new Set([...EM,ld,cd]),Vb=new Set([Cl,oi,Pu,Ol,ld,cd]),yB="Shift",vB="Control",bB="Alt",xB="Meta",wB=new Set([yB,vB,bB,xB]);function SB(e){return wn(e)&&e.tagName==="INPUT"}function vR(e){return!!(SB(e)&&e.selectionStart!=null||wn(e)&&e.tagName==="TEXTAREA")}function bR(e,t,n,a){if(!e||!t||!t.scrollTo)return;let s=e.scrollLeft,i=e.scrollTop;const c=e.clientWidth<e.scrollWidth,d=e.clientHeight<e.scrollHeight;if(c&&a!=="vertical"){const h=xR(e,t,"left"),f=Kf(e),g=Kf(t);n==="ltr"&&(h+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight?s=h+t.offsetWidth+g.scrollMarginRight-e.clientWidth+f.scrollPaddingRight:h-g.scrollMarginLeft<e.scrollLeft+f.scrollPaddingLeft&&(s=h-g.scrollMarginLeft-f.scrollPaddingLeft)),n==="rtl"&&(h-g.scrollMarginRight<e.scrollLeft+f.scrollPaddingLeft?s=h-g.scrollMarginLeft-f.scrollPaddingLeft:h+t.offsetWidth+g.scrollMarginRight>e.scrollLeft+e.clientWidth-f.scrollPaddingRight&&(s=h+t.offsetWidth+g.scrollMarginRight-e.clientWidth+f.scrollPaddingRight))}if(d&&a!=="horizontal"){const h=xR(e,t,"top"),f=Kf(e),g=Kf(t);h-g.scrollMarginTop<e.scrollTop+f.scrollPaddingTop?i=h-g.scrollMarginTop-f.scrollPaddingTop:h+t.offsetHeight+g.scrollMarginBottom>e.scrollTop+e.clientHeight-f.scrollPaddingBottom&&(i=h+t.offsetHeight+g.scrollMarginBottom-e.clientHeight+f.scrollPaddingBottom)}e.scrollTo({left:s,top:i,behavior:"auto"})}function xR(e,t,n){const a=n==="left"?"offsetLeft":"offsetTop";let s=0;for(;t.offsetParent&&(s+=t[a],t.offsetParent!==e);)t=t.offsetParent;return s}function Kf(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 EB={...Ka,...Mo,nestedDialogOpen(e){return e?{[fB.nestedDialogOpen]:""}:null}},Yb=y.forwardRef(function(t,n){const{className:a,finalFocus:s,initialFocus:i,render:c,...d}=t,{store:h}=Ms(),f=h.useState("descriptionElementId"),g=h.useState("disablePointerDismissal"),m=h.useState("floatingRootContext"),b=h.useState("popupProps"),x=h.useState("modal"),w=h.useState("mounted"),S=h.useState("nested"),R=h.useState("nestedOpenDialogCount"),T=h.useState("open"),C=h.useState("openMethod"),M=h.useState("titleElementId"),O=h.useState("transitionStatus"),D=h.useState("role");hB(),No({open:T,ref:h.context.popupRef,onComplete(){var K,I;T&&((I=(K=h.context).onOpenChangeComplete)==null||I.call(K,!0))}});function k(K){return K==="touch"?h.context.popupRef.current:!0}const A=i===void 0?k:i,j=R>0,W=Nt("div",t,{state:{open:T,nested:S,transitionStatus:O,nestedDialogOpen:j},props:[b,{"aria-labelledby":M??void 0,"aria-describedby":f??void 0,role:D,tabIndex:-1,hidden:!w,onKeyDown(K){Vb.has(K.key)&&K.stopPropagation()},style:{[dB.nestedDialogs]:R}},d],ref:[n,h.context.popupRef,h.useStateSetter("popupElement")],stateAttributesMapping:EB});return E.jsx(jb,{context:m,openInteractionType:C,disabled:!w,closeOnFocusOut:!g,initialFocus:A,returnFocus:s,modal:x!==!1,restoreFocus:"popup",children:W})});function qb(e){return hb(19)?e:e?"true":void 0}const $b=y.forwardRef(function(t,n){const{cutout:a,...s}=t;let i;if(a){const c=a==null?void 0:a.getBoundingClientRect();i=`polygon(
298
+ 0% 0%,
299
+ 100% 0%,
300
+ 100% 100%,
301
+ 0% 100%,
302
+ 0% 0%,
303
+ ${c.left}px ${c.top}px,
304
+ ${c.left}px ${c.bottom}px,
305
+ ${c.right}px ${c.bottom}px,
306
+ ${c.right}px ${c.top}px,
307
+ ${c.left}px ${c.top}px
308
+ )`}return E.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...s,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})}),Kb=y.forwardRef(function(t,n){const{keepMounted:a=!1,...s}=t,{store:i}=Ms(),c=i.useState("mounted"),d=i.useState("modal"),h=i.useState("open");return c||a?E.jsx(xM.Provider,{value:a,children:E.jsxs(Db,{ref:n,...s,children:[c&&d===!0&&E.jsx($b,{ref:i.context.internalBackdropRef,inert:qb(!h)}),t.children]})}):null});function pm(e){const t=y.useRef(!0);t.current&&(t.current=!1,e())}let wR={},SR={},ER="";function RB(e){if(typeof document>"u")return!1;const t=qt(e);return _n(t).innerWidth-t.documentElement.clientWidth>0}function TB(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=qt(e),a=n.documentElement,s=n.body,i=Cs(a)?a:s,c=i.style.overflowY,d=a.style.scrollbarGutter;a.style.scrollbarGutter="stable",i.style.overflowY="scroll";const h=i.offsetWidth;i.style.overflowY="hidden";const f=i.offsetWidth;return i.style.overflowY=c,a.style.scrollbarGutter=d,h===f}function CB(e){const t=qt(e),n=t.documentElement,a=t.body,s=Cs(n)?n:a,i={overflowY:s.style.overflowY,overflowX:s.style.overflowX};return Object.assign(s.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(s.style,i)}}function OB(e){var b;const t=qt(e),n=t.documentElement,a=t.body,s=_n(n);let i=0,c=0,d=!1;const h=kn.create();if(am&&(((b=s.visualViewport)==null?void 0:b.scale)??1)!==1)return()=>{};function f(){const x=s.getComputedStyle(n),w=s.getComputedStyle(a),T=(x.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";i=n.scrollTop,c=n.scrollLeft,wR={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ER=n.style.scrollBehavior,SR={position:a.style.position,height:a.style.height,width:a.style.width,boxSizing:a.style.boxSizing,overflowY:a.style.overflowY,overflowX:a.style.overflowX,scrollBehavior:a.style.scrollBehavior};const C=n.scrollHeight>n.clientHeight,M=n.scrollWidth>n.clientWidth,O=x.overflowY==="scroll"||w.overflowY==="scroll",D=x.overflowX==="scroll"||w.overflowX==="scroll",k=Math.max(0,s.innerWidth-a.clientWidth),A=Math.max(0,s.innerHeight-a.clientHeight),j=parseFloat(w.marginTop)+parseFloat(w.marginBottom),B=parseFloat(w.marginLeft)+parseFloat(w.marginRight),W=Cs(n)?n:a;if(d=TB(e),d){n.style.scrollbarGutter=T,W.style.overflowY="hidden",W.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(C||O)&&(n.style.overflowY="scroll"),(M||D)&&(n.style.overflowX="scroll"),Object.assign(a.style,{position:"relative",height:j||A?`calc(100dvh - ${j+A}px)`:"100dvh",width:B||k?`calc(100vw - ${B+k}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),a.scrollTop=i,a.scrollLeft=c,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function g(){Object.assign(n.style,wR),Object.assign(a.style,SR),d||(n.scrollTop=i,n.scrollLeft=c,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ER)}function m(){g(),h.request(f)}return f(),s.addEventListener("resize",m),()=>{h.cancel(),g(),typeof s.removeEventListener=="function"&&s.removeEventListener("resize",m)}}class MB{constructor(){We(this,"lockCount",0);We(this,"restore",null);We(this,"timeoutLock",Va.create());We(this,"timeoutUnlock",Va.create());We(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});We(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 a=qt(t).documentElement,s=_n(a).getComputedStyle(a).overflowY;if(s==="hidden"||s==="clip"){this.restore=Mr;return}const i=hO||!RB(t);this.restore=i?CB(t):OB(t)}}const NB=new MB;function Gb(e=!0,t=null){Ue(()=>{if(e)return NB.acquire(t)},[e,t])}function AB(e){const t=y.useRef(""),n=y.useCallback(s=>{s.defaultPrevented||(t.current=s.pointerType,e(s,s.pointerType))},[e]);return{onClick:y.useCallback(s=>{if(s.detail===0){e(s,"keyboard");return}"pointerType"in s?e(s,s.pointerType):e(s,t.current),t.current=""},[e]),onPointerDown:n}}function Xb(e){const[t,n]=y.useState(null),a=Be((d,h)=>{e||n(h||(hO?"touch":""))}),s=y.useCallback(()=>{n(null)},[]),{onClick:i,onPointerDown:c}=AB(a);return y.useMemo(()=>({openMethod:t,reset:s,triggerProps:{onClick:i,onPointerDown:c}}),[t,s,i,c])}function RM(e){const{store:t,parentContext:n,actionsRef:a}=e,s=t.useState("open"),i=t.useState("disablePointerDismissal"),c=t.useState("modal"),d=t.useState("popupElement"),{openMethod:h,triggerProps:f,reset:g}=Xb(s);Pb(t);const{forceUnmount:m}=zb(s,t,()=>{g()}),b=Be(W=>{const K=yt(W);return K.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},K}),x=y.useCallback(()=>{t.setOpen(!1,b(Cb))},[t,b]);y.useImperativeHandle(a,()=>({unmount:m,close:x}),[m,x]);const w=Bb({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[S,R]=y.useState(0),T=S===0,C=yM(w),M=fm(w,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:c==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(W){if(!t.context.outsidePressEnabledRef.current||"button"in W&&W.button!==0||"touches"in W&&W.touches.length!==1)return!1;const K=gr(W);if(T&&!i){const I=K;return c&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===I||t.context.backdropRef.current===I||Mt(I,d)&&!(I!=null&&I.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:T});Gb(s&&c===!0,d);const{getReferenceProps:O,getFloatingProps:D,getTriggerProps:k}=id([C,M]);t.useContextCallback("onNestedDialogOpen",W=>{R(W+1)}),t.useContextCallback("onNestedDialogClose",()=>{R(0)}),y.useEffect(()=>(n!=null&&n.onNestedDialogOpen&&s&&n.onNestedDialogOpen(S),n!=null&&n.onNestedDialogClose&&!s&&n.onNestedDialogClose(),()=>{n!=null&&n.onNestedDialogClose&&s&&n.onNestedDialogClose()}),[s,n,S]);const A=y.useMemo(()=>O(f),[O,f]),j=y.useMemo(()=>k(f),[k,f]),B=y.useMemo(()=>D(),[D]);t.useSyncedValues({openMethod:h,activeTriggerProps:A,inactiveTriggerProps:j,popupProps:B,floatingRootContext:w,nestedOpenDialogCount:S})}const DB={...Hb,modal:qe(e=>e.modal),nested:qe(e=>e.nested),nestedOpenDialogCount:qe(e=>e.nestedOpenDialogCount),disablePointerDismissal:qe(e=>e.disablePointerDismissal),openMethod:qe(e=>e.openMethod),descriptionElementId:qe(e=>e.descriptionElementId),titleElementId:qe(e=>e.titleElementId),viewportElement:qe(e=>e.viewportElement),role:qe(e=>e.role)};class TM extends hm{constructor(n){super(kB(n),{popupRef:y.createRef(),backdropRef:y.createRef(),internalBackdropRef:y.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new sd,onOpenChange:void 0,onOpenChangeComplete:void 0},DB);We(this,"setOpen",(n,a)=>{var d,h,f,g;if(a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!n&&a.trigger==null&&this.state.activeTriggerId!=null&&(a.trigger=this.state.activeTriggerElement??void 0),(h=(d=this.context).onOpenChange)==null||h.call(d,n,a),a.isCanceled)return;const s={open:n,nativeEvent:a.event,reason:a.reason,nested:this.state.nested};(f=this.state.floatingRootContext.context.events)==null||f.emit("openchange",s);const i={open:n},c=((g=a.trigger)==null?void 0:g.id)??null;(c||n)&&(i.activeTriggerId=c,i.activeTriggerElement=a.trigger??null),this.update(i)})}}function kB(e={}){return{...Ub(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function CM(e){const{children:t,open:n,defaultOpen:a=!1,onOpenChange:s,onOpenChangeComplete:i,disablePointerDismissal:c=!1,modal:d=!0,actionsRef:h,handle:f,triggerId:g,defaultTriggerId:m=null}=e,b=Ms(!0),x=!!b,w=Kn(()=>(f==null?void 0:f.store)??new TM({open:a,openProp:n,activeTriggerId:m,triggerIdProp:g,modal:d,disablePointerDismissal:c,nested:x})).current;pm(()=>{n===void 0&&w.state.open===!1&&a===!0&&w.update({open:!0,activeTriggerId:m})}),w.useControlledProp("openProp",n),w.useControlledProp("triggerIdProp",g),w.useSyncedValues({disablePointerDismissal:c,nested:x,modal:d}),w.useContextCallback("onOpenChange",s),w.useContextCallback("onOpenChangeComplete",i);const S=w.useState("payload");RM({store:w,actionsRef:h,parentContext:b==null?void 0:b.store.context});const R=y.useMemo(()=>({store:w}),[w]);return E.jsx(Ob.Provider,{value:R,children:typeof t=="function"?t({payload:S}):t})}const Wb=y.forwardRef(function(t,n){const{render:a,className:s,id:i,...c}=t,{store:d}=Ms(),h=Ta(i);return d.useSyncedValueWithCleanup("titleElementId",h),Nt("h2",t,{ref:n,props:[{id:h},c]})});function jB({...e}){return E.jsx(CM,{"data-slot":"sheet",...e})}function _B({...e}){return E.jsx(Kb,{"data-slot":"sheet-portal",...e})}function LB({className:e,...t}){return E.jsx(Mb,{"data-slot":"sheet-overlay",className:Oe("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 IB="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 PB({className:e,children:t,side:n="right",showCloseButton:a=!0,animation:s="slide",...i}){return E.jsxs(_B,{children:[E.jsx(LB,{}),E.jsxs(Yb,{"data-slot":"sheet-content","data-side":n,className:Oe("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",s==="slide"&&IB,s==="bottom-up"&&"data-open:slide-in-from-bottom-16 data-closed:slide-out-to-bottom-16",s==="top-down"&&"data-open:slide-in-from-top-16 data-closed:slide-out-to-top-16",e),...i,children:[t,a&&E.jsxs(cm,{"data-slot":"sheet-close",render:E.jsx(Cn,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[E.jsx(Si,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function zB({className:e,...t}){return E.jsx("div",{"data-slot":"sheet-header",className:Oe("gap-0.5 p-4 flex flex-col",e),...t})}function UB({className:e,...t}){return E.jsx(Wb,{"data-slot":"sheet-title",className:Oe("text-foreground text-base font-medium",e),...t})}function HB({className:e,...t}){return E.jsx(Nb,{"data-slot":"sheet-description",className:Oe("text-muted-foreground text-sm",e),...t})}const OM=y.createContext(void 0);function ud(e){const t=y.useContext(OM);if(t===void 0&&!e)throw new Error(yn(72));return t}const BB={...Hb,disabled:qe(e=>e.disabled),instantType:qe(e=>e.instantType),isInstantPhase:qe(e=>e.isInstantPhase),trackCursorAxis:qe(e=>e.trackCursorAxis),disableHoverablePopup:qe(e=>e.disableHoverablePopup),lastOpenChangeReason:qe(e=>e.openChangeReason),closeDelay:qe(e=>e.closeDelay),hasViewport:qe(e=>e.hasViewport)};class Qb extends hm{constructor(n){super({...FB(),...n},{popupRef:y.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:new sd},BB);We(this,"setOpen",(n,a)=>{var f,g;const s=a.reason,i=s===dr,c=n&&s===El,d=!n&&(s===Ti||s===lm);if(a.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},(g=(f=this.context).onOpenChange)==null||g.call(f,n,a),a.isCanceled)return;const h=()=>{var x;const m={open:n,openChangeReason:s};c?m.instantType="focus":d?m.instantType="dismiss":s===dr&&(m.instantType=void 0);const b=((x=a.trigger)==null?void 0:x.id)??null;(b||n)&&(m.activeTriggerId=b,m.activeTriggerElement=a.trigger??null),this.update(m)};i?or.flushSync(h):h()})}static useStore(n,a){const s=Kn(()=>new Qb(a)).current,i=n??s,c=Bb({popupStore:i,onOpenChange:i.setOpen});return i.state.floatingRootContext=c,i}}function FB(){return{...Ub(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeDelay:0,hasViewport:!1}}const VB=Lb(function(t){const{disabled:n=!1,defaultOpen:a=!1,open:s,disableHoverablePopup:i=!1,trackCursorAxis:c="none",actionsRef:d,onOpenChange:h,onOpenChangeComplete:f,handle:g,triggerId:m,defaultTriggerId:b=null,children:x}=t,w=Qb.useStore(g==null?void 0:g.store,{open:a,openProp:s,activeTriggerId:b,triggerIdProp:m});pm(()=>{s===void 0&&w.state.open===!1&&a===!0&&w.update({open:!0,activeTriggerId:b})}),w.useControlledProp("openProp",s),w.useControlledProp("triggerIdProp",m),w.useContextCallback("onOpenChange",h),w.useContextCallback("onOpenChangeComplete",f);const S=w.useState("open"),R=!n&&S,T=w.useState("activeTriggerId"),C=w.useState("payload");w.useSyncedValues({trackCursorAxis:c,disableHoverablePopup:i}),Ue(()=>{S&&n&&w.setOpen(!1,yt(uH))},[S,n,w]),w.useSyncedValue("disabled",n),Pb(w);const{forceUnmount:M,transitionStatus:O}=zb(R,w),D=w.useState("isInstantPhase"),k=w.useState("instantType"),A=w.useState("lastOpenChangeReason"),j=y.useRef(null);Ue(()=>{O==="ending"&&A===Sa||O!=="ending"&&D?(k!=="delay"&&(j.current=k),w.set("instantType","delay")):j.current!==null&&(w.set("instantType",j.current),j.current=null)},[O,D,A,k,w]),Ue(()=>{R&&T==null&&w.set("payload",void 0)},[w,T,R]);const B=y.useCallback(()=>{w.setOpen(!1,YB(w,Cb))},[w]);y.useImperativeHandle(d,()=>({unmount:M,close:B}),[M,B]);const W=w.useState("floatingRootContext"),K=fm(W,{enabled:!n,referencePress:!0}),I=LH(W,{enabled:!n&&c!=="none",axis:c==="none"?void 0:c}),{getReferenceProps:H,getFloatingProps:F,getTriggerProps:q}=id([K,I]),_=y.useMemo(()=>H(),[H]),L=y.useMemo(()=>q(),[q]),P=y.useMemo(()=>F(),[F]);return w.useSyncedValues({activeTriggerProps:_,inactiveTriggerProps:L,popupProps:P}),E.jsx(OM.Provider,{value:w,children:typeof x=="function"?x({payload:C}):x})});function YB(e,t){const n=yt(t);return n.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},n}const qB=y.createContext(void 0);function $B(){return y.useContext(qB)}let KB=(function(e){return e[e.popupOpen=kh.popupOpen]="popupOpen",e.triggerDisabled="data-trigger-disabled",e})({});const GB=600,XB=lM(function(t,n){const{className:a,render:s,handle:i,payload:c,disabled:d,delay:h,closeDelay:f,id:g,...m}=t,b=ud(!0),x=(i==null?void 0:i.store)??b;if(!x)throw new Error(yn(82));const w=Ta(g),S=x.useState("isTriggerActive",w),R=x.useState("isOpenedByTrigger",w),T=x.useState("floatingRootContext"),C=y.useRef(null),M=h??GB,O=f??0,{registerTrigger:D,isMountedByThisTrigger:k}=uM(w,C,x,{payload:c,closeDelay:O}),A=$B(),{delayRef:j,isInstantPhase:B,hasProvider:W}=TH(T,{open:R});x.useSyncedValue("isInstantPhase",B);const K=x.useState("disabled"),I=d??K,H=x.useState("trackCursorAxis"),F=x.useState("disableHoverablePopup"),q=pM(T,{enabled:!I,mouseOnly:!0,move:!1,handleClose:!F&&H!=="both"?bM():null,restMs(){const Q=A==null?void 0:A.delay,z=typeof j.current=="object"?j.current.open:void 0;let Y=M;return W&&(z!==0?Y=h??Q??M:Y=0),Y},delay(){const Q=typeof j.current=="object"?j.current.close:void 0;let z=O;return f==null&&W&&(z=Q),{close:z}},triggerElementRef:C,isActiveTrigger:S}),_=fM(T,{enabled:!I}).reference,L={open:R},P=x.useState("triggerProps",k);return Nt("button",t,{state:L,ref:[n,D,C],props:[q,_,P,{id:w,[KB.triggerDisabled]:I?"":void 0},m],stateAttributesMapping:HO})}),MM=y.createContext(void 0);function WB(){const e=y.useContext(MM);if(e===void 0)throw new Error(yn(70));return e}const QB=y.forwardRef(function(t,n){const{children:a,container:s,className:i,render:c,...d}=t,{portalNode:h,portalSubtree:f}=WO({container:s,ref:n,componentProps:t,elementProps:d});return!f&&!h?null:E.jsxs(y.Fragment,{children:[f,h&&or.createPortal(a,h)]})}),ZB=y.forwardRef(function(t,n){const{keepMounted:a=!1,...s}=t;return ud().useState("mounted")||a?E.jsx(MM.Provider,{value:a,children:E.jsx(QB,{ref:n,...s})}):null}),NM=y.createContext(void 0);function AM(){const e=y.useContext(NM);if(e===void 0)throw new Error(yn(71));return e}const JB=y.createContext(void 0);function oc(){const e=y.useContext(JB);return(e==null?void 0:e.direction)??"ltr"}const e8=e=>({name:"arrow",options:e,async fn(t){var V,Q;const{x:n,y:a,placement:s,rects:i,platform:c,elements:d,middlewareData:h}=t,{element:f,padding:g=0,offsetParent:m="real"}=Co(e,t)||{};if(f==null)return{};const b=SO(g),x={x:n,y:a},w=Eb(s),S=Sb(w),R=await c.getDimensions(f),T=w==="y",C=T?"top":"left",M=T?"bottom":"right",O=T?"clientHeight":"clientWidth",D=i.reference[S]+i.reference[w]-x[w]-i.floating[S],k=x[w]-i.reference[w],A=m==="real"?await((V=c.getOffsetParent)==null?void 0:V.call(c,f)):d.floating;let j=d.floating[O]||i.floating[S];(!j||!await((Q=c.isElement)==null?void 0:Q.call(c,A)))&&(j=d.floating[O]||i.floating[S]);const B=D/2-k/2,W=j/2-R[S]/2-1,K=Math.min(b[C],W),I=Math.min(b[M],W),H=K,F=j-R[S]-I,q=j/2-R[S]/2+B,_=uv(H,q,F),L=!h.arrow&&Os(s)!=null&&q!==_&&i.reference[S]/2-(q<H?K:I)-R[S]/2<0,P=L?q<H?q-H:q-F:0;return{[w]:x[w]+P,data:{[w]:_,centerOffset:q-_-P,...L&&{alignmentOffset:P}},reset:L}}}),t8=(e,t)=>({...e8(e),options:[e,t]}),n8={name:"hide",async fn(e){var d;const{width:t,height:n,x:a,y:s}=e.rects.reference,i=t===0&&n===0&&a===0&&s===0;return{data:{referenceHidden:((d=(await S6().fn(e)).data)==null?void 0:d.referenceHidden)||i}}}},mh={sideX:"left",sideY:"top"},r8={name:"adaptiveOrigin",async fn(e){var C,M;const{x:t,y:n,rects:{floating:a},elements:{floating:s},platform:i,strategy:c,placement:d}=e,h=_n(s),f=h.getComputedStyle(s);if(!(f.transitionDuration!=="0s"&&f.transitionDuration!==""))return{x:t,y:n,data:mh};const m=await((C=i.getOffsetParent)==null?void 0:C.call(i,s));let b={width:0,height:0};if(c==="fixed"&&(h!=null&&h.visualViewport))b={width:h.visualViewport.width,height:h.visualViewport.height};else if(m===h){const O=qt(s);b={width:O.documentElement.clientWidth,height:O.documentElement.clientHeight}}else await((M=i.isElement)==null?void 0:M.call(i,m))&&(b=await i.getDimensions(m));const x=Nr(d);let w=t,S=n;x==="left"&&(w=b.width-(t+a.width)),x==="top"&&(S=b.height-(n+a.height));const R=x==="left"?"right":mh.sideX,T=x==="top"?"bottom":mh.sideY;return{x:w,y:S,data:{sideX:R,sideY:T}}}};function DM(e,t,n){const a=e==="inline-start"||e==="inline-end";return{top:"top",right:a?n?"inline-start":"inline-end":"right",bottom:"bottom",left:a?n?"inline-end":"inline-start":"left"}[t]}function RR(e,t,n){const{rects:a,placement:s}=e;return{side:DM(t,Nr(s),n),align:Os(s)||"center",anchor:{width:a.reference.width,height:a.reference.height},positioner:{width:a.floating.width,height:a.floating.height}}}function Zb(e){var ht,Lt;const{anchor:t,positionMethod:n="absolute",side:a="bottom",sideOffset:s=0,align:i="center",alignOffset:c=0,collisionBoundary:d,collisionPadding:h=5,sticky:f=!1,arrowPadding:g=5,disableAnchorTracking:m=!1,keepMounted:b=!1,floatingRootContext:x,mounted:w,collisionAvoidance:S,shiftCrossAxis:R=!1,nodeId:T,adaptiveOrigin:C,lazyFlip:M=!1,externalTree:O}=e,[D,k]=y.useState(null);!w&&D!==null&&k(null);const A=S.side||"flip",j=S.align||"flip",B=S.fallbackAxisSide||"end",W=typeof t=="function"?t:void 0,K=Be(W),I=W?K:t,H=Zn(t),q=oc()==="rtl",_=D||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":q?"left":"right","inline-start":q?"right":"left"}[a],L=i==="center"?_:`${_}-${i}`;let P=h;const V=1,Q=a==="bottom"?V:0,z=a==="top"?V:0,Y=a==="right"?V:0,X=a==="left"?V:0;typeof P=="number"?P={top:P+Q,right:P+X,bottom:P+z,left:P+Y}:P&&(P={top:(P.top||0)+Q,right:(P.right||0)+X,bottom:(P.bottom||0)+z,left:(P.left||0)+Y});const G={boundary:d==="clipping-ancestors"?"clippingAncestors":d,padding:P},ce=y.useRef(null),oe=Zn(s),de=Zn(c),Ne=[y6(ct=>{const pt=RR(ct,a,q),tt=typeof oe.current=="function"?oe.current(pt):oe.current,lt=typeof de.current=="function"?de.current(pt):de.current;return{mainAxis:tt,crossAxis:lt,alignmentAxis:lt}},[typeof s!="function"?s:0,typeof c!="function"?c:0,q,a])],_e=j==="none"&&A!=="shift",ee=!_e&&(f||R||A==="shift"),ue=A==="none"?null:x6({...G,padding:{top:P.top+V,right:P.right+V,bottom:P.bottom+V,left:P.left+V},mainAxis:!R&&A==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),pe=_e?null:v6(ct=>{const pt=qt(ct.elements.floating).documentElement;return{...G,rootBoundary:R?{x:0,y:0,width:pt.clientWidth,height:pt.clientHeight}:void 0,mainAxis:j!=="none",crossAxis:ee,limiter:f||R?void 0:b6(tt=>{if(!ce.current)return{};const{width:lt,height:gt}=ce.current.getBoundingClientRect(),Ye=sa(Nr(tt.placement)),Tt=Ye==="y"?lt:gt,kt=Ye==="y"?P.left+P.right:P.top+P.bottom;return{offset:Tt/2+kt/2}})}},[G,f,R,P,j]);A==="shift"||j==="shift"||i==="center"?Ne.push(pe,ue):Ne.push(ue,pe),Ne.push(w6({...G,apply({elements:{floating:ct},rects:{reference:pt},availableWidth:tt,availableHeight:lt}){const gt=ct.style;gt.setProperty("--available-width",`${tt}px`),gt.setProperty("--available-height",`${lt}px`),gt.setProperty("--anchor-width",`${pt.width}px`),gt.setProperty("--anchor-height",`${pt.height}px`)}}),t8(()=>({element:ce.current||document.createElement("div"),padding:g,offsetParent:"floating"}),[g]),{name:"transformOrigin",fn(ct){var $e,nt,St;const{elements:pt,middlewareData:tt,placement:lt,rects:gt,y:Ye}=ct,Tt=Nr(lt),kt=sa(Tt),Rt=ce.current,on=(($e=tt.arrow)==null?void 0:$e.x)||0,Pt=((nt=tt.arrow)==null?void 0:nt.y)||0,Xe=(Rt==null?void 0:Rt.clientWidth)||0,Ct=(Rt==null?void 0:Rt.clientHeight)||0,$=on+Xe/2,re=Pt+Ct/2,le=Math.abs(((St=tt.shift)==null?void 0:St.y)||0),Ee=gt.reference.height/2,Le=typeof s=="function"?s(RR(ct,a,q)):s,et=le>Le,Ze={top:`${$}px calc(100% + ${Le}px)`,bottom:`${$}px ${-Le}px`,left:`calc(100% + ${Le}px) ${re}px`,right:`${-Le}px ${re}px`}[Tt],Ve=`${$}px ${gt.reference.y+Ee-Ye}px`;return pt.floating.style.setProperty("--transform-origin",ee&&kt==="y"&&et?Ve:Ze),{}}},n8,C),Ue(()=>{!w&&x&&x.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[w,x]);const ke=y.useMemo(()=>({elementResize:!m&&typeof ResizeObserver<"u",layoutShift:!m&&typeof IntersectionObserver<"u"}),[m]),{refs:Te,elements:be,x:we,y:Z,middlewareData:Se,update:ge,placement:ze,context:He,isPositioned:De,floatingStyles:st}=eB({rootContext:x,placement:L,middleware:Ne,strategy:n,whileElementsMounted:b?void 0:(...ct)=>uR(...ct,ke),nodeId:T,externalTree:O}),{sideX:xt,sideY:vt}=Se.adaptiveOrigin||mh,Je=De?n:"fixed",Qe=y.useMemo(()=>{const ct=C?{position:Je,[xt]:we,[vt]:Z}:{position:Je,...st};return De||(ct.opacity=0),ct},[C,Je,xt,we,vt,Z,st,De]),ft=y.useRef(null);Ue(()=>{if(!w)return;const ct=H.current,pt=typeof ct=="function"?ct():ct,lt=(TR(pt)?pt.current:pt)||null||null;lt!==ft.current&&(Te.setPositionReference(lt),ft.current=lt)},[w,Te,I,H]),y.useEffect(()=>{if(!w)return;const ct=H.current;typeof ct!="function"&&TR(ct)&&ct.current!==ft.current&&(Te.setPositionReference(ct.current),ft.current=ct.current)},[w,Te,I,H]),y.useEffect(()=>{if(b&&w&&be.domReference&&be.floating)return uR(be.domReference,be.floating,ge,ke)},[b,w,be,ge,ke]);const se=Nr(ze),je=DM(a,se,q),Ke=Os(ze)||"center",Me=!!((ht=Se.hide)!=null&&ht.referenceHidden);Ue(()=>{M&&w&&De&&k(se)},[M,w,De,se]);const Ie=y.useMemo(()=>{var ct,pt;return{position:"absolute",top:(ct=Se.arrow)==null?void 0:ct.y,left:(pt=Se.arrow)==null?void 0:pt.x}},[Se.arrow]),Fe=((Lt=Se.arrow)==null?void 0:Lt.centerOffset)!==0;return y.useMemo(()=>({positionerStyles:Qe,arrowStyles:Ie,arrowRef:ce,arrowUncentered:Fe,side:je,align:Ke,physicalSide:se,anchorHidden:Me,refs:Te,context:He,isPositioned:De,update:ge}),[Qe,Ie,ce,Fe,je,Ke,se,Me,Te,He,De,ge])}function TR(e){return e!=null&&"current"in e}function sc(e){return e==="starting"?r4:Tn}const a8=y.forwardRef(function(t,n){const{render:a,className:s,anchor:i,positionMethod:c="absolute",side:d="top",align:h="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:S=!1,collisionAvoidance:R=GC,...T}=t,C=ud(),M=WB(),O=C.useState("open"),D=C.useState("mounted"),k=C.useState("trackCursorAxis"),A=C.useState("disableHoverablePopup"),j=C.useState("floatingRootContext"),B=C.useState("instantType"),W=C.useState("transitionStatus"),K=C.useState("hasViewport"),I=Zb({anchor:i,positionMethod:c,floatingRootContext:j,mounted:D,side:d,sideOffset:f,align:h,alignOffset:g,collisionBoundary:m,collisionPadding:b,sticky:w,arrowPadding:x,disableAnchorTracking:S,keepMounted:M,collisionAvoidance:R,adaptiveOrigin:K?r8:void 0}),H=y.useMemo(()=>{const L={};return(!O||k==="both"||A)&&(L.pointerEvents="none"),{role:"presentation",hidden:!D,style:{...I.positionerStyles,...L}}},[O,k,A,D,I.positionerStyles]),F=y.useMemo(()=>({open:O,side:I.side,align:I.align,anchorHidden:I.anchorHidden,instant:k!=="none"?"tracking-cursor":B}),[O,I.side,I.align,I.anchorHidden,k,B]),q=y.useMemo(()=>({...F,arrowRef:I.arrowRef,arrowStyles:I.arrowStyles,arrowUncentered:I.arrowUncentered}),[F,I.arrowRef,I.arrowStyles,I.arrowUncentered]),_=Nt("div",t,{state:F,props:[H,sc(W),T],ref:[n,C.useStateSetter("positionerElement")],stateAttributesMapping:Ka});return E.jsx(NM.Provider,{value:q,children:_})}),o8={...Ka,...Mo},s8=y.forwardRef(function(t,n){const{className:a,render:s,...i}=t,c=ud(),{side:d,align:h}=AM(),f=c.useState("open"),g=c.useState("instantType"),m=c.useState("transitionStatus"),b=c.useState("popupProps"),x=c.useState("floatingRootContext");No({open:f,ref:c.context.popupRef,onComplete(){var C,M;f&&((M=(C=c.context).onOpenChangeComplete)==null||M.call(C,!0))}});const w=c.useState("disabled"),S=c.useState("closeDelay");return mM(x,{enabled:!w,closeDelay:S}),Nt("div",t,{state:{open:f,side:d,align:h,instant:g,transitionStatus:m},ref:[n,c.context.popupRef,c.useStateSetter("popupElement")],props:[b,sc(m),i],stateAttributesMapping:o8})}),i8=y.forwardRef(function(t,n){const{className:a,render:s,...i}=t,d=ud().useState("instantType"),{open:h,arrowRef:f,side:g,align:m,arrowUncentered:b,arrowStyles:x}=AM();return Nt("div",t,{state:{open:h,side:g,align:m,uncentered:b,instant:d},ref:[n,f],props:[{style:x,"aria-hidden":!0},i],stateAttributesMapping:Ka})});function l8({...e}){return E.jsx(VB,{"data-slot":"tooltip",...e})}function c8({...e}){return E.jsx(XB,{"data-slot":"tooltip-trigger",...e})}function u8({className:e,side:t="top",sideOffset:n=4,align:a="center",alignOffset:s=0,children:i,...c}){return E.jsx(ZB,{children:E.jsx(a8,{align:a,alignOffset:s,side:t,sideOffset:n,className:"isolate z-50",children:E.jsxs(s8,{"data-slot":"tooltip-content",className:Oe("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),...c,children:[i,E.jsx(i8,{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 d8="sidebar_state",f8=3600*24*7,my="100vw",h8="3rem",m8="b",lu=320,Lh=320,p8=450,py="tmex_sidebar_width";function g8(){const e=typeof window>"u"?Number.POSITIVE_INFINITY:window.innerWidth;return Math.max(Lh,e-p8)}function Gf(e){return Math.min(g8(),Math.max(Lh,Math.round(e)))}const kM=y.createContext(null);function qr(){const e=y.useContext(kM);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}function y8({defaultOpen:e=!0,open:t,onOpenChange:n,className:a,style:s,children:i,...c}){const d=u4(),[h,f]=y.useState(!1),g=y.useRef(lu),[m,b]=y.useState(()=>{if(typeof window>"u")return lu;const j=Number(window.localStorage.getItem(py)),B=Number.isFinite(j)&&j>0?Math.max(Lh,Math.round(j)):lu;return g.current=B,Gf(B)}),[x,w]=y.useState(!1),S=y.useCallback(j=>{const B=Math.max(Lh,Math.round(j));g.current=B,b(Gf(j)),window.localStorage.setItem(py,String(B))},[]),R=y.useCallback(()=>{g.current=lu,b(Gf(lu)),window.localStorage.removeItem(py)},[]);y.useEffect(()=>{const j=()=>{b(Gf(g.current))};return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]);const[T,C]=y.useState(e),M=t??T,O=y.useCallback(j=>{const B=typeof j=="function"?j(M):j;n?n(B):C(B),document.cookie=`${d8}=${B}; path=/; max-age=${f8}`},[n,M]),D=y.useCallback(()=>d?f(j=>!j):O(j=>!j),[d,O,f]);y.useEffect(()=>{const j=B=>{B.defaultPrevented||B.target instanceof HTMLElement&&B.target.closest(".xterm")||B.key===m8&&(B.metaKey||B.ctrlKey)&&(B.preventDefault(),D())};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[D]);const k=M?"expanded":"collapsed",A=y.useMemo(()=>({state:k,open:M,setOpen:O,isMobile:d,openMobile:h,setOpenMobile:f,toggleSidebar:D,width:m,setWidth:S,resetWidth:R,isResizing:x,setIsResizing:w}),[k,M,O,d,h,f,D,m,S,R,x]);return E.jsx(kM.Provider,{value:A,children:E.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":`${m}px`,"--sidebar-width-icon":h8,...s},className:Oe("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",a),...c,children:i})})}function v8({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:a,children:s,dir:i,...c}){const{isMobile:d,state:h,openMobile:f,setOpenMobile:g,isResizing:m}=qr();return n==="none"?E.jsx("div",{"data-slot":"sidebar",className:Oe("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",a),...c,children:s}):d?E.jsx(jB,{open:f,onOpenChange:g,...c,children:E.jsxs(PB,{dir:i,"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":my,width:my,maxWidth:my},side:e,animation:"top-down",children:[E.jsxs(zB,{className:"sr-only",children:[E.jsx(UB,{children:"Sidebar"}),E.jsx(HB,{children:"Displays the mobile sidebar."})]}),E.jsx("div",{className:"flex h-full w-full flex-col","data-testid":"sidebar",style:{paddingBottom:"var(--tmex-safe-area-bottom)"},children:s})]})}):E.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":h,"data-collapsible":h==="collapsed"?n:"","data-variant":t,"data-side":e,"data-slot":"sidebar",children:[E.jsx("div",{"data-slot":"sidebar-gap",className:Oe(!m&&"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)")}),E.jsxs("div",{"data-slot":"sidebar-container","data-side":e,className:Oe(!m&&"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",a),...c,children:[E.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:s}),h==="expanded"&&E.jsx(b8,{side:e})]})]})}function b8({side:e}){const{width:t,setWidth:n,resetWidth:a,setIsResizing:s}=qr(),i=y.useRef(null);return E.jsx("div",{"data-slot":"sidebar-resizer","data-testid":"sidebar-resizer","aria-hidden":"true",className:Oe("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:c=>{c.preventDefault(),i.current={pointerId:c.pointerId,startX:c.clientX,startWidth:t},c.currentTarget.setPointerCapture(c.pointerId),s(!0)},onPointerMove:c=>{const d=i.current;if(!d||d.pointerId!==c.pointerId)return;const h=c.clientX-d.startX;n(d.startWidth+(e==="left"?h:-h))},onPointerUp:c=>{var d;((d=i.current)==null?void 0:d.pointerId)===c.pointerId&&(i.current=null,s(!1))},onPointerCancel:c=>{var d;((d=i.current)==null?void 0:d.pointerId)===c.pointerId&&(i.current=null,s(!1))},onDoubleClick:a})}function x8({className:e,onClick:t,...n}){const{toggleSidebar:a,isMobile:s}=qr();return E.jsxs(Cn,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:Oe(e),onClick:i=>{t==null||t(i),a()},...n,children:[s?E.jsx(p3,{}):E.jsx(x3,{}),E.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function w8({className:e,...t}){return E.jsx("main",{"data-slot":"sidebar-inset",className:Oe("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 S8({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Oe("gap-2 p-2 flex flex-col",e),...t})}function E8({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Oe("gap-2 p-2 flex flex-col",e),...t})}function R8({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Oe("no-scrollbar gap-0 flex min-h-0 flex-1 flex-col overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t})}function jM({className:e,...t}){return E.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Oe("p-2 relative flex w-full min-w-0 flex-col",e),...t})}function T8({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Oe("gap-0 flex w-full min-w-0 flex-col",e),...t})}function C8({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Oe("group/menu-item relative",e),...t})}const O8=Qh("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 M8({render:e,isActive:t=!1,variant:n="default",size:a="default",tooltip:s,className:i,...c}){const{isMobile:d,state:h}=qr(),f=Wh({defaultTagName:"button",props:ca({className:Oe(O8({variant:n,size:a}),i)},c),render:s?c8:e,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:t}});return s?(typeof s=="string"&&(s={children:s}),E.jsxs(l8,{children:[f,E.jsx(u8,{side:"right",align:"center",hidden:h!=="collapsed"||d,...s})]})):f}function N8({className:e,render:t,showOnHover:n=!1,...a}){return Wh({defaultTagName:"button",props:ca({className:Oe("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)},a),render:t,state:{slot:"sidebar-menu-action",sidebar:"menu-action"}})}function A8({className:e,...t}){return E.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Oe("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 D8({className:e,...t}){return E.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Oe("group/menu-sub-item relative",e),...t})}function k8({render:e,size:t="md",isActive:n=!1,className:a,...s}){return Wh({defaultTagName:"a",props:ca({className:Oe("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",a)},s),render:e,state:{slot:"sidebar-menu-sub-button",sidebar:"menu-sub-button",size:t,active:n}})}function j8(){const e=rb(),{isMobile:t,setOpenMobile:n}=qr();return y.useEffect(()=>(C1((a,s)=>e(a,s??{})),()=>C1(null)),[e]),y.useEffect(()=>(O1({isMobile:t,setOpenMobile:n}),()=>O1(null)),[t,n]),null}const CR="tmex:connectedDevices",_M=y.createContext(null);function _8(){const e=y.useContext(_M);if(!e)throw new Error("useGlobalDevice must be used within GlobalDeviceProvider");return e}function L8({children:e}){const t=qa(),[n,a]=y.useState(()=>{try{const m=localStorage.getItem(CR);if(m){const b=JSON.parse(m);return new Set(b)}}catch{}return new Set}),s=rn(m=>m.connectDevice),i=rn(m=>m.disconnectDevice),c=rn(m=>m.connectedDevices);y.useEffect(()=>{try{localStorage.setItem(CR,JSON.stringify([...n]))}catch{}},[n]),y.useEffect(()=>{const m=t.pathname.match(/^\/devices\/([^/]+)/),b=m==null?void 0:m[1];b&&!c.has(b)&&s(b)},[t.pathname,c,s]);const d=y.useCallback(m=>{a(b=>{const x=new Set(b);return x.add(m),x}),c.has(m)||s(m)},[c,s]),h=y.useCallback(m=>{a(b=>{const x=new Set(b);return x.delete(m),x}),c.has(m)&&i(m)},[c,i]),f=y.useCallback((m,b)=>{b?h(m):d(m)},[d,h]),g=y.useMemo(()=>({persistedDevices:n,connectDevice:d,disconnectDevice:h,toggleDevice:f}),[n,d,h,f]);return E.jsx(_M.Provider,{value:g,children:e})}const LM=y.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function I8(){return y.useContext(LM)}function gm(e){const{children:t,elementsRef:n,labelsRef:a,onMapChange:s}=e,i=Be(s),c=y.useRef(0),d=Kn(z8).current,h=Kn(P8).current,[f,g]=y.useState(0),m=y.useRef(f),b=Be((T,C)=>{h.set(T,C??null),m.current+=1,g(m.current)}),x=Be(T=>{h.delete(T),m.current+=1,g(m.current)}),w=y.useMemo(()=>{const T=new Map;return Array.from(h.keys()).filter(M=>M.isConnected).sort(U8).forEach((M,O)=>{const D=h.get(M)??{};T.set(M,{...D,index:O})}),T},[h,f]);Ue(()=>{if(typeof MutationObserver!="function"||w.size===0)return;const T=new MutationObserver(C=>{const M=new Set,O=D=>M.has(D)?M.delete(D):M.add(D);C.forEach(D=>{D.removedNodes.forEach(O),D.addedNodes.forEach(O)}),M.size===0&&(m.current+=1,g(m.current))});return w.forEach((C,M)=>{M.parentElement&&T.observe(M.parentElement,{childList:!0})}),()=>{T.disconnect()}},[w]),Ue(()=>{m.current===f&&(n.current.length!==w.size&&(n.current.length=w.size),a&&a.current.length!==w.size&&(a.current.length=w.size),c.current=w.size),i(w)},[i,w,n,a,f]),Ue(()=>()=>{n.current=[]},[n]),Ue(()=>()=>{a&&(a.current=[])},[a]);const S=Be(T=>(d.add(T),()=>{d.delete(T)}));Ue(()=>{d.forEach(T=>T(w))},[d,w]);const R=y.useMemo(()=>({register:b,unregister:x,subscribeMapChange:S,elementsRef:n,labelsRef:a,nextIndexRef:c}),[b,x,S,n,a,c]);return E.jsx(LM.Provider,{value:R,children:t})}function P8(){return new Map}function z8(){return new Set}function U8(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 IM=y.createContext(void 0);function PM(){const e=y.useContext(IM);if(e===void 0)throw new Error(yn(64));return e}let H8=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const zM={tabActivationDirection:e=>({[H8.activationDirection]:e})},B8=y.forwardRef(function(t,n){const{className:a,defaultValue:s=0,onValueChange:i,orientation:c="horizontal",render:d,value:h,...f}=t,g=oc(),m=Object.hasOwn(t,"defaultValue"),b=y.useRef([]),[x,w]=y.useState(()=>new Map),[S,R]=Kl({controlled:h,default:s,name:"Tabs",state:"value"}),T=h!==void 0,[C,M]=y.useState(()=>new Map),[O,D]=y.useState("none"),k=Be((L,P)=>{i==null||i(L,P),!P.isCanceled&&(R(L),D(P.activationDirection))}),A=Be((L,P)=>{w(V=>{if(V.get(L)===P)return V;const Q=new Map(V);return Q.set(L,P),Q})}),j=Be((L,P)=>{w(V=>{if(!V.has(L)||V.get(L)!==P)return V;const Q=new Map(V);return Q.delete(L),Q})}),B=y.useCallback(L=>x.get(L),[x]),W=y.useCallback(L=>{for(const P of C.values())if(L===(P==null?void 0:P.value))return P==null?void 0:P.id},[C]),K=y.useCallback(L=>{if(L===void 0)return null;for(const[P,V]of C.entries())if(V!=null&&L===(V.value??V.index))return P;return null},[C]),I=y.useMemo(()=>({direction:g,getTabElementBySelectedValue:K,getTabIdByPanelValue:W,getTabPanelIdByValue:B,onValueChange:k,orientation:c,registerMountedTabPanel:A,setTabMap:M,unregisterMountedTabPanel:j,tabActivationDirection:O,value:S}),[g,K,W,B,k,c,A,M,j,O,S]),H=y.useMemo(()=>{for(const L of C.values())if(L!=null&&L.value===S)return L},[C,S]),F=y.useMemo(()=>{for(const L of C.values())if(L!=null&&!L.disabled)return L.value},[C]);Ue(()=>{if(T||C.size===0)return;const L=H==null?void 0:H.disabled,P=H==null&&S!==null;if(m&&L&&S===s||!L&&!P)return;const Q=F??null;S!==Q&&(R(Q),D("none"))},[s,F,m,T,H,D,R,C,S]);const _=Nt("div",t,{state:{orientation:c,tabActivationDirection:O},ref:n,props:f,stateAttributesMapping:zM});return E.jsx(IM.Provider,{value:I,children:E.jsx(gm,{elementsRef:b,children:_})})}),UM="data-composite-item-active";let HM=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Jb(e={}){const{label:t,metadata:n,textRef:a,indexGuessBehavior:s,index:i}=e,{register:c,unregister:d,subscribeMapChange:h,elementsRef:f,labelsRef:g,nextIndexRef:m}=I8(),b=y.useRef(-1),[x,w]=y.useState(i??(s===HM.GuessFromOrder?()=>{if(b.current===-1){const T=m.current;m.current+=1,b.current=T}return b.current}:-1)),S=y.useRef(null),R=y.useCallback(T=>{var C;if(S.current=T,x!==-1&&T!==null&&(f.current[x]=T,g)){const M=t!==void 0;g.current[x]=M?t:((C=a==null?void 0:a.current)==null?void 0:C.textContent)??T.textContent}},[x,f,g,t,a]);return Ue(()=>{if(i!=null)return;const T=S.current;if(T)return c(T,n),()=>{d(T)}},[i,c,d,n]),Ue(()=>{if(i==null)return h(T=>{var M;const C=S.current?(M=T.get(S.current))==null?void 0:M.index:null;C!=null&&w(C)})},[i,h,w]),y.useMemo(()=>({ref:R,index:x}),[x,R])}function BM(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:a}=yb(),{ref:s,index:i}=Jb(e),c=n===i,d=y.useRef(null),h=wa(s,d);return{compositeProps:y.useMemo(()=>({tabIndex:c?0:-1,onFocus(){a(i)},onMouseMove(){const g=d.current;if(!t||!g)return;const m=g.hasAttribute("disabled")||g.ariaDisabled==="true";!c&&!m&&g.focus()}}),[c,a,i,t]),compositeRef:h,index:i}}const FM=y.createContext(void 0);function F8(){const e=y.useContext(FM);if(e===void 0)throw new Error(yn(65));return e}const V8=y.forwardRef(function(t,n){const{className:a,disabled:s=!1,render:i,value:c,id:d,nativeButton:h=!0,...f}=t,{value:g,getTabPanelIdByValue:m,orientation:b}=PM(),{activateOnFocus:x,highlightedTabIndex:w,onTabActivation:S,setHighlightedTabIndex:R,tabsListElement:T}=F8(),C=Ta(d),M=y.useMemo(()=>({disabled:s,id:C,value:c}),[s,C,c]),{compositeProps:O,compositeRef:D,index:k}=BM({metadata:M}),A=c===g,j=y.useRef(!1);Ue(()=>{if(j.current){j.current=!1;return}if(!(A&&k>-1&&w!==k))return;const V=T;if(V!=null){const Q=Br(qt(V));if(Q&&Mt(V,Q))return}s||R(k)},[A,k,w,R,s,T]);const{getButtonProps:B,buttonRef:W}=Oo({disabled:s,native:h,focusableWhenDisabled:!0}),K=m(c),I=y.useRef(!1),H=y.useRef(!1);function F(V){A||s||S(c,yt(Sa,V.nativeEvent,void 0,{activationDirection:"none"}))}function q(V){A||(k>-1&&!s&&R(k),!s&&x&&(!I.current||I.current&&H.current)&&S(c,yt(Sa,V.nativeEvent,void 0,{activationDirection:"none"})))}function _(V){if(A||s)return;I.current=!0;function Q(){I.current=!1,H.current=!1}(!V.button||V.button===0)&&(H.current=!0,qt(V.currentTarget).addEventListener("pointerup",Q,{once:!0}))}return Nt("button",t,{state:{disabled:s,active:A,orientation:b},ref:[n,W,D],props:[O,{role:"tab","aria-controls":K,"aria-selected":A,id:C,onClick:F,onFocus:q,onPointerDown:_,[UM]:A?"":void 0,onKeyDownCapture(){j.current=!0}},f,B]})}),Y8=y.createContext(void 0),q8={disableStyleElements:!1};function VM(){return y.useContext(Y8)??q8}function $8(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const K8=[];function G8(e){const{itemSizes:t,cols:n=1,loopFocus:a=!0,dense:s=!1,orientation:i="both",direction:c,highlightedIndex:d,onHighlightedIndexChange:h,rootRef:f,enableHomeAndEndKeys:g=!1,stopEventPropagation:m=!1,disabledIndices:b,modifierKeys:x=K8}=e,[w,S]=y.useState(0),R=n>1,T=y.useRef(null),C=wa(T,f),M=y.useRef([]),O=y.useRef(!1),D=d??w,k=Be((B,W=!1)=>{if((h??S)(B),W){const K=M.current[B];bR(T.current,K,c,i)}}),A=Be(B=>{if(B.size===0||O.current)return;O.current=!0;const W=Array.from(B.keys()),K=W.find(H=>H==null?void 0:H.hasAttribute(UM))??null,I=K?W.indexOf(K):-1;I!==-1&&k(I),bR(T.current,K,c,i)}),j=y.useMemo(()=>({"aria-orientation":i==="both"?void 0:i,ref:C,onFocus(B){!T.current||!vR(B.target)||B.target.setSelectionRange(0,B.target.value.length??0)},onKeyDown(B){const W=g?gB:EM;if(!W.has(B.key)||X8(B,x)||!T.current)return;const I=c==="rtl",H=I?Pu:Ol,F={horizontal:H,vertical:oi,both:H}[i],q=I?Ol:Pu,_={horizontal:q,vertical:Cl,both:q}[i];if(vR(B.target)&&!$8(B.target)){const X=B.target.selectionStart,G=B.target.selectionEnd,ce=B.target.value??"";if(X==null||B.shiftKey||X!==G||B.key!==_&&X<ce.length||B.key!==F&&X>0)return}let L=D;const P=ch(M,b),V=fv(M,b);if(R){const X=t||Array.from({length:M.current.length},()=>({width:1,height:1})),G=RO(X,n,s),ce=G.findIndex(de=>de!=null&&!Ss(M,de,b)),oe=G.reduce((de,ve,xe)=>ve!=null&&!Ss(M,ve,b)?xe:de,-1);L=G[EO({current:G.map(de=>de?M.current[de]:null)},{event:B,orientation:i,loopFocus:a,cols:n,disabledIndices:CO([...b||M.current.map((de,ve)=>Ss(M,ve)?ve:void 0),void 0],G),minIndex:ce,maxIndex:oe,prevIndex:TO(D>V?P:D,X,G,n,B.key===oi?"bl":B.key===Ol?"tr":"tl"),rtl:I})]}const Q={horizontal:[H],vertical:[oi],both:[H,oi]}[i],z={horizontal:[q],vertical:[Cl],both:[q,Cl]}[i],Y=R?W:{horizontal:g?mB:wM,vertical:g?pB:SM,both:W}[i];g&&(B.key===ld?L=P:B.key===cd&&(L=V)),L===D&&(Q.includes(B.key)||z.includes(B.key))&&(a&&L===V&&Q.includes(B.key)?L=P:a&&L===P&&z.includes(B.key)?L=V:L=ar(M,{startingIndex:L,decrement:z.includes(B.key),disabledIndices:b})),L!==D&&!wl(M,L)&&(m&&B.stopPropagation(),Y.has(B.key)&&B.preventDefault(),k(L,!0),queueMicrotask(()=>{var X;(X=M.current[L])==null||X.focus()}))}}),[n,s,c,b,M,g,D,R,t,a,C,x,k,i,m]);return y.useMemo(()=>({props:j,highlightedIndex:D,onHighlightedIndexChange:k,elementsRef:M,disabledIndices:b,onMapChange:A,relayKeyboardEvent:j.onKeyDown}),[j,D,k,M,b,A])}function X8(e,t){for(const n of wB.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function W8(e){const{render:t,className:n,refs:a=Es,props:s=Es,state:i=Tn,stateAttributesMapping:c,highlightedIndex:d,onHighlightedIndexChange:h,orientation:f,dense:g,itemSizes:m,loopFocus:b,cols:x,enableHomeAndEndKeys:w,onMapChange:S,stopEventPropagation:R=!0,rootRef:T,disabledIndices:C,modifierKeys:M,highlightItemOnHover:O=!1,tag:D="div",...k}=e,A=oc(),{props:j,highlightedIndex:B,onHighlightedIndexChange:W,elementsRef:K,onMapChange:I,relayKeyboardEvent:H}=G8({itemSizes:m,cols:x,loopFocus:b,dense:g,orientation:f,highlightedIndex:d,onHighlightedIndexChange:h,rootRef:T,stopEventPropagation:R,enableHomeAndEndKeys:w,direction:A,disabledIndices:C,modifierKeys:M}),F=Nt(D,e,{state:i,ref:a,props:[j,...s,k],stateAttributesMapping:c}),q=y.useMemo(()=>({highlightedIndex:B,onHighlightedIndexChange:W,highlightItemOnHover:O,relayKeyboardEvent:H}),[B,W,O,H]);return E.jsx(uO.Provider,{value:q,children:E.jsx(gm,{elementsRef:K,onMapChange:_=>{S==null||S(_),I(_)},children:F})})}const Q8=y.forwardRef(function(t,n){const{activateOnFocus:a=!1,className:s,loopFocus:i=!0,render:c,...d}=t,{getTabElementBySelectedValue:h,onValueChange:f,orientation:g,value:m,setTabMap:b,tabActivationDirection:x}=PM(),[w,S]=y.useState(0),[R,T]=y.useState(null),C=Z8(m,g,R,h),M=Be((A,j)=>{if(A!==m){const B=C(A);j.activationDirection=B,f(A,j)}}),O={orientation:g,tabActivationDirection:x},D={"aria-orientation":g==="vertical"?"vertical":void 0,role:"tablist"},k=y.useMemo(()=>({activateOnFocus:a,highlightedTabIndex:w,onTabActivation:M,setHighlightedTabIndex:S,tabsListElement:R,value:m}),[a,w,M,S,R,m]);return E.jsx(FM.Provider,{value:k,children:E.jsx(W8,{render:c,className:s,state:O,refs:[n,T],props:[D,d],stateAttributesMapping:zM,highlightedIndex:w,enableHomeAndEndKeys:!0,loopFocus:i,orientation:g,onHighlightedIndexChange:S,onMapChange:b,disabledIndices:Es})})});function OR(e,t){const{left:n,top:a}=e.getBoundingClientRect(),{left:s,top:i}=t.getBoundingClientRect(),c=n-s,d=a-i;return{left:c,top:d}}function Z8(e,t,n,a){const[s,i]=y.useState(null);return Ue(()=>{if(e==null||n==null){i(null);return}const c=a(e);if(c==null){i(null);return}const{left:d,top:h}=OR(c,n);i(t==="horizontal"?d:h)},[t,a,n,e]),y.useCallback(c=>{if(c===e)return"none";if(c==null)return i(null),"none";if(c!=null&&n!=null){const d=a(c);if(d!=null){const{left:h,top:f}=OR(d,n);if(s==null)return i(t==="horizontal"?h:f),"none";if(t==="horizontal"){if(h<s)return i(h),"left";if(h>s)return i(h),"right"}else{if(f<s)return i(f),"up";if(f>s)return i(f),"down"}}}return"none"},[a,t,s,n,e])}function J8({className:e,orientation:t="horizontal",...n}){return E.jsx(B8,{"data-slot":"tabs","data-orientation":t,className:Oe("gap-2 group/tabs flex data-horizontal:flex-col",e),...n})}const eF=Qh("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 tF({className:e,variant:t="default",...n}){return E.jsx(Q8,{"data-slot":"tabs-list","data-variant":t,className:Oe(eF({variant:t}),e),...n})}function gy({className:e,...t}){return E.jsx(V8,{"data-slot":"tabs-trigger",className:Oe("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 nF(e){const{open:t,defaultOpen:n,onOpenChange:a,disabled:s}=e,i=t!==void 0,[c,d]=Kl({controlled:t,default:n,name:"Collapsible",state:"open"}),{mounted:h,setMounted:f,transitionStatus:g}=od(c,!0,!0),[m,b]=y.useState(c),[{height:x,width:w},S]=y.useState({height:void 0,width:void 0}),R=Ta(),[T,C]=y.useState(),M=T??R,[O,D]=y.useState(!1),[k,A]=y.useState(!1),j=y.useRef(null),B=y.useRef(null),W=y.useRef(null),K=y.useRef(null),I=PO(K,!1),H=Be(F=>{const q=!c,_=yt(Ti,F.nativeEvent);if(a(q,_),_.isCanceled)return;const L=K.current;B.current==="css-animation"&&L!=null&&L.style.removeProperty("animation-name"),!O&&!k&&(B.current!=null&&B.current!=="css-animation"&&!h&&q&&f(!0),B.current==="css-animation"&&(!m&&q&&b(!0),!h&&q&&f(!0))),d(q),B.current==="none"&&h&&!q&&f(!1)});return Ue(()=>{i&&B.current==="none"&&!k&&!c&&f(!1)},[i,k,c,t,f]),y.useMemo(()=>({abortControllerRef:j,animationTypeRef:B,disabled:s,handleTrigger:H,height:x,mounted:h,open:c,panelId:M,panelRef:K,runOnceAnimationsFinish:I,setDimensions:S,setHiddenUntilFound:D,setKeepMounted:A,setMounted:f,setOpen:d,setPanelIdState:C,setVisible:b,transitionDimensionRef:W,transitionStatus:g,visible:m,width:w}),[j,B,s,H,x,h,c,M,K,I,S,D,A,f,d,b,W,g,m,w])}const YM=y.createContext(void 0);function qM(){const e=y.useContext(YM);if(e===void 0)throw new Error(yn(15));return e}let Eu=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Ri.startingStyle]="startingStyle",e[e.endingStyle=Ri.endingStyle]="endingStyle",e})({}),rF=(function(e){return e.panelOpen="data-panel-open",e})({});const aF={[Eu.open]:""},oF={[Eu.closed]:""},sF={open(e){return e?{[rF.panelOpen]:""}:null}},iF={open(e){return e?aF:oF}},$M={...iF,...Mo},lF=y.forwardRef(function(t,n){const{render:a,className:s,defaultOpen:i=!1,disabled:c=!1,onOpenChange:d,open:h,...f}=t,g=Be(d),m=nF({open:h,defaultOpen:i,onOpenChange:g,disabled:c}),b=y.useMemo(()=>({open:m.open,disabled:m.disabled,transitionStatus:m.transitionStatus}),[m.open,m.disabled,m.transitionStatus]),x=y.useMemo(()=>({...m,onOpenChange:g,state:b}),[m,g,b]),w=Nt("div",t,{state:b,ref:n,props:f,stateAttributesMapping:$M});return E.jsx(YM.Provider,{value:x,children:w})}),cF={...sF,...Mo},uF=y.forwardRef(function(t,n){const{panelId:a,open:s,handleTrigger:i,state:c,disabled:d}=qM(),{className:h,disabled:f=d,id:g,render:m,nativeButton:b=!0,...x}=t,{getButtonProps:w,buttonRef:S}=Oo({disabled:f,focusableWhenDisabled:!0,native:b}),R=y.useMemo(()=>({"aria-controls":s?a:void 0,"aria-expanded":s,onClick:i}),[a,s,i]);return Nt("button",t,{state:c,ref:[n,S],props:[R,x,w],stateAttributesMapping:cF})});let dF=(function(e){return e.disabled="data-disabled",e.orientation="data-orientation",e})({});function fF(e){const{abortControllerRef:t,animationTypeRef:n,externalRef:a,height:s,hiddenUntilFound:i,keepMounted:c,id:d,mounted:h,onOpenChange:f,open:g,panelRef:m,runOnceAnimationsFinish:b,setDimensions:x,setMounted:w,setOpen:S,setVisible:R,transitionDimensionRef:T,visible:C,width:M}=e,O=y.useRef(!1),D=y.useRef(null),k=y.useRef(g),A=y.useRef(g),j=ad(),B=y.useMemo(()=>n.current==="css-animation"?!C:!g&&!h,[g,h,C,n]),W=Be(I=>{if(!I)return;if(n.current==null||T.current==null){const q=getComputedStyle(I),_=q.animationName!=="none"&&q.animationName!=="",L=q.transitionDuration!=="0s"&&q.transitionDuration!=="";_&&L||(q.animationName==="none"&&q.transitionDuration!=="0s"?n.current="css-transition":q.animationName!=="none"&&q.transitionDuration==="0s"?n.current="css-animation":n.current="none"),I.getAttribute(dF.orientation)==="horizontal"||q.transitionProperty.indexOf("width")>-1?T.current="width":T.current="height"}if(n.current!=="css-transition")return;(s===void 0||M===void 0)&&(x({height:I.scrollHeight,width:I.scrollWidth}),A.current&&I.style.setProperty("transition-duration","0s"));let H=-1,F=-1;return H=kn.request(()=>{A.current=!1,F=kn.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})}),()=>{kn.cancel(H),kn.cancel(F)}}),K=wa(a,m,W);return Ue(()=>{if(n.current!=="css-transition")return;const I=m.current;if(!I)return;let H=-1;if(t.current!=null&&(t.current.abort(),t.current=null),g){const F={"justify-content":I.style.justifyContent,"align-items":I.style.alignItems,"align-content":I.style.alignContent,"justify-items":I.style.justifyItems};Object.keys(F).forEach(q=>{I.style.setProperty(q,"initial","important")}),!A.current&&!c&&I.setAttribute(Eu.startingStyle,""),x({height:I.scrollHeight,width:I.scrollWidth}),H=kn.request(()=>{Object.entries(F).forEach(([q,_])=>{_===""?I.style.removeProperty(q):I.style.setProperty(q,_)})})}else{if(I.scrollHeight===0&&I.scrollWidth===0)return;x({height:I.scrollHeight,width:I.scrollWidth});const F=new AbortController;t.current=F;const q=F.signal;let _=null;const L=Eu.endingStyle;return _=new MutationObserver(P=>{P.some(Q=>Q.type==="attributes"&&Q.attributeName===L)&&(_==null||_.disconnect(),_=null,b(()=>{x({height:0,width:0}),I.style.removeProperty("content-visibility"),w(!1),t.current===F&&(t.current=null)},q))}),_.observe(I,{attributes:!0,attributeFilter:[L]}),()=>{_==null||_.disconnect(),j.cancel(),t.current===F&&(F.abort(),t.current=null)}}return()=>{kn.cancel(H)}},[t,n,j,i,c,h,g,m,b,x,w]),Ue(()=>{if(n.current!=="css-animation")return;const I=m.current;I&&(D.current=I.style.animationName||D.current,I.style.setProperty("animation-name","none"),x({height:I.scrollHeight,width:I.scrollWidth}),!k.current&&!O.current&&I.style.removeProperty("animation-name"),g?(t.current!=null&&(t.current.abort(),t.current=null),w(!0),R(!0)):(t.current=new AbortController,b(()=>{w(!1),R(!1),t.current=null},t.current.signal)))},[t,n,g,m,b,x,w,R,C]),rm(()=>{const I=kn.request(()=>{k.current=!1});return()=>kn.cancel(I)}),Ue(()=>{if(!i)return;const I=m.current;if(!I)return;let H=-1,F=-1;return g&&O.current&&(I.style.transitionDuration="0s",x({height:I.scrollHeight,width:I.scrollWidth}),H=kn.request(()=>{O.current=!1,F=kn.request(()=>{setTimeout(()=>{I.style.removeProperty("transition-duration")})})})),()=>{kn.cancel(H),kn.cancel(F)}},[i,g,m,x]),Ue(()=>{const I=m.current;I&&i&&B&&(I.setAttribute("hidden","until-found"),n.current==="css-transition"&&I.setAttribute(Eu.startingStyle,""))},[i,B,n,m]),y.useEffect(function(){const H=m.current;if(!H)return;function F(q){O.current=!0,S(!0),f(!0,yt(Sa,q))}return H.addEventListener("beforematch",F),()=>{H.removeEventListener("beforematch",F)}},[f,m,S]),y.useMemo(()=>({props:{hidden:B,id:d,ref:K}}),[B,d,K])}let MR=(function(e){return e.collapsiblePanelHeight="--collapsible-panel-height",e.collapsiblePanelWidth="--collapsible-panel-width",e})({});const hF=y.forwardRef(function(t,n){const{className:a,hiddenUntilFound:s,keepMounted:i,render:c,id:d,...h}=t,{abortControllerRef:f,animationTypeRef:g,height:m,mounted:b,onOpenChange:x,open:w,panelId:S,panelRef:R,runOnceAnimationsFinish:T,setDimensions:C,setHiddenUntilFound:M,setKeepMounted:O,setMounted:D,setPanelIdState:k,setOpen:A,setVisible:j,state:B,transitionDimensionRef:W,visible:K,width:I,transitionStatus:H}=qM(),F=s??!1,q=i??!1;Ue(()=>{if(d)return k(d),()=>{k(void 0)}},[d,k]),Ue(()=>{M(F)},[M,F]),Ue(()=>{O(q)},[O,q]);const{props:_}=fF({abortControllerRef:f,animationTypeRef:g,externalRef:n,height:m,hiddenUntilFound:F,id:S,keepMounted:q,mounted:b,onOpenChange:x,open:w,panelRef:R,runOnceAnimationsFinish:T,setDimensions:C,setMounted:D,setOpen:A,setVisible:j,transitionDimensionRef:W,visible:K,width:I});No({open:w&&H==="idle",ref:R,onComplete(){w&&C({height:void 0,width:void 0})}});const L=y.useMemo(()=>({...B,transitionStatus:H}),[B,H]),P=Nt("div",t,{state:L,ref:[n,R],props:[_,{style:{[MR.collapsiblePanelHeight]:m===void 0?"auto":`${m}px`,[MR.collapsiblePanelWidth]:I===void 0?"auto":`${I}px`}},h],stateAttributesMapping:$M});return q||F||!q&&b?P:null});function KM({...e}){return E.jsx(lF,{"data-slot":"collapsible",...e})}function GM({...e}){return E.jsx(uF,{"data-slot":"collapsible-trigger",...e})}function XM({...e}){return E.jsx(hF,{"data-slot":"collapsible-content",...e})}function Ih({children:e,onClick:t,...n}){const{isMobile:a,setOpenMobile:s}=qr(),i=c=>{a&&s(!1),t==null||t(c)};return E.jsx(lb,{...n,onClick:i,children:e})}function mF({items:e}){const{t}=yr();return E.jsx(jM,{children:E.jsx(T8,{children:e.map(n=>{var a,s;return E.jsxs(KM,{defaultOpen:n.isActive,render:E.jsx(C8,{}),children:[E.jsx(Ih,{to:n.url,children:E.jsxs(M8,{tooltip:t(n.title),children:[E.jsx(n.icon,{}),E.jsx("span",{children:t(n.title)})]})}),(a=n.items)!=null&&a.length?E.jsxs(E.Fragment,{children:[E.jsxs(GM,{render:E.jsx(N8,{className:"data-[state=open]:rotate-90"}),children:[E.jsx(_C,{}),E.jsx("span",{className:"sr-only",children:"Toggle"})]}),E.jsx(XM,{children:E.jsx(A8,{children:(s=n.items)==null?void 0:s.map(i=>E.jsx(D8,{children:E.jsx(Ih,{to:i.url,children:E.jsx(k8,{children:E.jsx("span",{children:t(i.title)})})})},i.title))})})]}):null]},n.title)})})})}const pF=Qh("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 zu({className:e,variant:t="default",render:n,...a}){return Wh({defaultTagName:"span",props:ca({className:Oe(pF({className:e,variant:t}))},a),render:n,state:{slot:"badge",variant:t}})}const gF={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 yF({deviceId:e,className:t}){const{t:n}=yr(),a=rn(i=>i.deviceReconnecting[e]),s=rn(i=>i.deviceErrors[e]);if(a)return E.jsxs(zu,{variant:"outline",title:a.message,className:Oe("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:[E.jsx(UC,{className:"h-3 w-3 animate-spin"}),E.jsx("span",{className:"truncate max-w-[120px]",children:a.message})]});if(s){const i=gF[s.type]??"unknown",c=n(`deviceStatus.errorBadge.${i}`),d=[c,s.message,s.rawMessage].filter(Boolean).join(`
309
+ `);return E.jsxs(zu,{variant:"outline",title:d,className:Oe("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:[E.jsx(t3,{className:"h-3 w-3"}),E.jsx("span",{className:"truncate max-w-[120px]",children:c})]})}return null}function vF(e){const{children:t,open:n,defaultOpen:a=!1,onOpenChange:s,onOpenChangeComplete:i,actionsRef:c,handle:d,triggerId:h,defaultTriggerId:f=null}=e,g=Ms(),m=!!g,b=Kn(()=>(d==null?void 0:d.store)??new TM({open:a,openProp:n,activeTriggerId:f,triggerIdProp:h,modal:!0,disablePointerDismissal:!0,nested:m,role:"alertdialog"})).current;b.useControlledProp("openProp",n),b.useControlledProp("triggerIdProp",h),b.useSyncedValue("nested",m),b.useContextCallback("onOpenChange",s),b.useContextCallback("onOpenChangeComplete",i);const x=b.useState("payload");RM({store:b,actionsRef:c,parentContext:g==null?void 0:g.store.context});const w=y.useMemo(()=>({store:b}),[b]);return E.jsx(Ob.Provider,{value:w,children:typeof t=="function"?t({payload:x}):t})}function bv({...e}){return E.jsx(vF,{"data-slot":"alert-dialog",...e})}function bF({...e}){return E.jsx(Kb,{"data-slot":"alert-dialog-portal",...e})}function xF({className:e,...t}){return E.jsx(Mb,{"data-slot":"alert-dialog-overlay",className:Oe("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 xv({className:e,size:t="default",...n}){return E.jsxs(bF,{children:[E.jsx(xF,{}),E.jsx(Yb,{"data-slot":"alert-dialog-content","data-size":t,className:Oe("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 wv({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-header",className:Oe("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 Sv({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-footer",className:Oe("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 NR({className:e,...t}){return E.jsx("div",{"data-slot":"alert-dialog-media",className:Oe("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 Ev({className:e,...t}){return E.jsx(Wb,{"data-slot":"alert-dialog-title",className:Oe("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 Rv({className:e,...t}){return E.jsx(Nb,{"data-slot":"alert-dialog-description",className:Oe("text-muted-foreground *:[a]:hover:text-foreground text-sm text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3",e),...t})}function Tv({className:e,...t}){return E.jsx(Cn,{"data-slot":"alert-dialog-action",className:Oe(e),...t})}function Cv({className:e,variant:t="outline",size:n="default",...a}){return E.jsx(cm,{"data-slot":"alert-dialog-cancel",className:Oe(e),render:E.jsx(Cn,{variant:t,size:n}),...a})}function Ov({...e}){return E.jsx(CM,{"data-slot":"dialog",...e})}function wF({...e}){return E.jsx(Kb,{"data-slot":"dialog-portal",...e})}function SF({className:e,...t}){return E.jsx(Mb,{"data-slot":"dialog-overlay",className:Oe("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 Mv({className:e,children:t,showCloseButton:n=!0,...a}){return E.jsxs(wF,{children:[E.jsx(SF,{}),E.jsxs(Yb,{"data-slot":"dialog-content",className:Oe("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),...a,children:[t,n&&E.jsxs(cm,{"data-slot":"dialog-close",render:E.jsx(Cn,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[E.jsx(Si,{}),E.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Nv({className:e,...t}){return E.jsx("div",{"data-slot":"dialog-header",className:Oe("gap-2 flex flex-col",e),...t})}function AR({className:e,showCloseButton:t=!1,children:n,...a}){return E.jsxs("div",{"data-slot":"dialog-footer",className:Oe("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),...a,children:[n,t&&E.jsx(cm,{render:E.jsx(Cn,{variant:"outline"}),children:"Close"})]})}function Av({className:e,...t}){return E.jsx(Wb,{"data-slot":"dialog-title",className:Oe("text-base leading-none font-medium",e),...t})}function WM({className:e,...t}){return E.jsx(Nb,{"data-slot":"dialog-description",className:Oe("text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3",e),...t})}const QM=y.createContext(void 0);function ZM(e){const t=y.useContext(QM);if(t===void 0&&!e)throw new Error(yn(33));return t}const JM=y.createContext(void 0);function As(e){const t=y.useContext(JM);if(t===void 0&&!e)throw new Error(yn(36));return t}const EF=y.createContext(void 0);function dd(e=!0){const t=y.useContext(EF);if(t===void 0&&!e)throw new Error(yn(25));return t}const RF={...Ka,...Mo},TF=y.forwardRef(function(t,n){const{className:a,render:s,...i}=t,{store:c}=As(),d=c.useState("open"),h=c.useState("mounted"),f=c.useState("transitionStatus"),g=c.useState("lastOpenChangeReason"),m=dd(),b={open:d,transitionStatus:f};return Nt("div",t,{ref:m!=null&&m.backdropRef?[n,m.backdropRef]:n,state:b,stateAttributesMapping:RF,props:[{role:"presentation",hidden:!h,style:{pointerEvents:g===dr?"none":void 0,userSelect:"none",WebkitUserSelect:"none"}},i]})});function CF(e){const{closeOnClick:t,highlighted:n,id:a,nodeId:s,store:i,itemRef:c,itemMetadata:d}=e,{events:h}=i.useState("floatingTreeRoot"),f=dd(!0),g=f!==void 0;return y.useMemo(()=>({id:a,role:"menuitem",tabIndex:n?0:-1,onMouseMove(m){s&&h.emit("itemhover",{nodeId:s,target:m.currentTarget})},onClick(m){t&&h.emit("close",{domEvent:m,reason:wu})},onMouseUp(m){if(f){const b=f.initialCursorPointRef.current;if(f.initialCursorPointRef.current=null,g&&b&&Math.abs(m.clientX-b.x)<=1&&Math.abs(m.clientY-b.y)<=1)return}c.current&&i.context.allowMouseUpTriggerRef.current&&(!g||m.button===2)&&(!d||d.type==="regular-item")&&c.current.click()}}),[t,n,a,h,s,i,c,f,g,d])}const OF={type:"regular-item"};function MF(e){const{closeOnClick:t,disabled:n=!1,highlighted:a,id:s,store:i,nativeButton:c,itemMetadata:d,nodeId:h}=e,f=y.useRef(null),{getButtonProps:g,buttonRef:m}=Oo({disabled:n,focusableWhenDisabled:!0,native:c}),b=CF({closeOnClick:t,highlighted:a,id:s,nodeId:h,store:i,itemRef:f,itemMetadata:d}),x=y.useCallback(S=>ca(b,{onMouseEnter(){d.type==="submenu-trigger"&&d.setActive()},onKeyUp(R){R.key===" "&&i.context.typingRef.current&&R.preventBaseUIHandler()}},S,g),[b,g,i,d]),w=wa(f,m);return y.useMemo(()=>({getItemProps:x,itemRef:w}),[x,w])}const NF=y.forwardRef(function(t,n){const{render:a,className:s,id:i,label:c,nativeButton:d=!1,disabled:h=!1,closeOnClick:f=!0,...g}=t,m=Jb({label:c}),b=ZM(!0),x=Ta(i),{store:w}=As(),S=w.useState("isActive",m.index),R=w.useState("itemProps"),{getItemProps:T,itemRef:C}=MF({closeOnClick:f,disabled:h,highlighted:S,id:x,store:w,nativeButton:d,nodeId:b==null?void 0:b.nodeId,itemMetadata:OF});return Nt("div",t,{state:{disabled:h,highlighted:S},props:[R,g,T],ref:[C,n,m.ref]})}),AF=y.createContext(void 0);function e2(e){return y.useContext(AF)}const DF={...Ka,...Mo},kF=y.forwardRef(function(t,n){const{render:a,className:s,finalFocus:i,...c}=t,{store:d}=As(),{side:h,align:f}=ZM(),g=e2()!=null,m=d.useState("open"),b=d.useState("transitionStatus"),x=d.useState("popupProps"),w=d.useState("mounted"),S=d.useState("instantType"),R=d.useState("activeTriggerElement"),T=d.useState("parent"),C=d.useState("lastOpenChangeReason"),M=d.useState("rootId"),O=d.useState("floatingRootContext"),D=d.useState("floatingTreeRoot"),k=d.useState("closeDelay"),A=d.useState("activeTriggerElement"),j=T.type==="context-menu";No({open:m,ref:d.context.popupRef,onComplete(){var F,q;m&&((q=(F=d.context).onOpenChangeComplete)==null||q.call(F,!0))}}),y.useEffect(()=>{function F(q){d.setOpen(!1,yt(q.reason,q.domEvent))}return D.events.on("close",F),()=>{D.events.off("close",F)}},[D.events,d]);const B=d.useState("hoverEnabled"),W=d.useState("disabled");mM(O,{enabled:B&&!W&&!j&&T.type!=="menubar",closeDelay:k});const K={transitionStatus:b,side:h,align:f,open:m,nested:T.type==="menu",instant:S},I=Nt("div",t,{state:K,ref:[n,d.context.popupRef],stateAttributesMapping:DF,props:[x,{onKeyDown(F){g&&Vb.has(F.key)&&F.stopPropagation()}},sc(b),c,{"data-rootownerid":M}]});let H=T.type===void 0||j;return(R||T.type==="menubar"&&C!==im)&&(H=!0),E.jsx(jb,{context:O,modal:j,disabled:!w,returnFocus:i===void 0?H:i,initialFocus:T.type!=="menu",restoreFocus:!0,externalTree:T.type!=="menubar"?D:void 0,previousFocusableElement:A,nextFocusableElement:T.type===void 0?d.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:T.type===void 0?d.context.beforeContentFocusGuardRef:void 0,children:I})}),t2=y.createContext(void 0);function jF(){const e=y.useContext(t2);if(e===void 0)throw new Error(yn(32));return e}const _F=y.forwardRef(function(t,n){const{keepMounted:a=!1,...s}=t,{store:i}=As();return i.useState("mounted")||a?E.jsx(t2.Provider,{value:a,children:E.jsx(Db,{ref:n,...s})}):null}),LF=y.forwardRef(function(t,n){var _e;const{anchor:a,positionMethod:s="absolute",className:i,render:c,side:d,align:h,sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b=5,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:S=!1,collisionAvoidance:R=KC,...T}=t,{store:C}=As(),M=jF(),O=dd(!0),D=C.useState("parent"),k=C.useState("floatingRootContext"),A=C.useState("floatingTreeRoot"),j=C.useState("mounted"),B=C.useState("open"),W=C.useState("modal"),K=C.useState("activeTriggerElement"),I=C.useState("transitionStatus"),H=C.useState("lastOpenChangeReason"),F=C.useState("floatingNodeId"),q=C.useState("floatingParentNodeId");let _=a,L=f,P=g,V=h,Q=R;D.type==="context-menu"&&(_=a??((_e=D.context)==null?void 0:_e.anchor),V=V??"start",!d&&V!=="center"&&(P=t.alignOffset??2,L=t.sideOffset??-5));let z=d,Y=V;D.type==="menu"?(z=z??"inline-end",Y=Y??"start",Q=t.collisionAvoidance??GC):D.type==="menubar"&&(z=z??"bottom",Y=Y??"start");const X=D.type==="context-menu",G=Zb({anchor:_,floatingRootContext:k,positionMethod:O?"fixed":s,mounted:j,side:z,sideOffset:L,align:Y,alignOffset:P,arrowPadding:X?0:x,collisionBoundary:m,collisionPadding:b,sticky:w,nodeId:F,keepMounted:M,disableAnchorTracking:S,collisionAvoidance:Q,shiftCrossAxis:X&&!("side"in Q&&Q.side==="flip"),externalTree:A}),ce=y.useMemo(()=>{const ee={};return B||(ee.pointerEvents="none"),{role:"presentation",hidden:!j,style:{...G.positionerStyles,...ee}}},[B,j,G.positionerStyles]);y.useEffect(()=>{function ee(ue){ue.open&&(ue.parentNodeId===F&&C.set("hoverEnabled",!1),ue.nodeId!==F&&ue.parentNodeId===C.select("floatingParentNodeId")&&C.setOpen(!1,yt(dh)))}return A.events.on("menuopenchange",ee),()=>{A.events.off("menuopenchange",ee)}},[C,A.events,F]),y.useEffect(()=>{if(C.select("floatingParentNodeId")==null)return;function ee(ue){if(ue.open||ue.nodeId!==C.select("floatingParentNodeId"))return;const pe=ue.reason??dh;C.setOpen(!1,yt(pe))}return A.events.on("menuopenchange",ee),()=>{A.events.off("menuopenchange",ee)}},[A.events,C]),y.useEffect(()=>{function ee(ue){!B||ue.nodeId!==C.select("floatingParentNodeId")||ue.target&&K&&K!==ue.target&&C.setOpen(!1,yt(dh))}return A.events.on("itemhover",ee),()=>{A.events.off("itemhover",ee)}},[A.events,B,K,C]),y.useEffect(()=>{const ee={open:B,nodeId:F,parentNodeId:q,reason:C.select("lastOpenChangeReason")};A.events.emit("menuopenchange",ee)},[A.events,B,C,F,q]);const oe={open:B,side:G.side,align:G.align,anchorHidden:G.anchorHidden,nested:D.type==="menu"},de=y.useMemo(()=>({side:G.side,align:G.align,arrowRef:G.arrowRef,arrowUncentered:G.arrowUncentered,arrowStyles:G.arrowStyles,nodeId:G.context.nodeId}),[G.side,G.align,G.arrowRef,G.arrowUncentered,G.arrowStyles,G.context.nodeId]),ve=Nt("div",t,{state:oe,stateAttributesMapping:Ka,ref:[n,C.useStateSetter("positionerElement")],props:[ce,sc(I),T]}),xe=j&&D.type!=="menu"&&(D.type!=="menubar"&&W&&H!==dr||D.type==="menubar"&&D.context.modal);let Ne=null;return D.type==="menubar"?Ne=D.context.contentElement:D.type===void 0&&(Ne=K),E.jsxs(QM.Provider,{value:de,children:[xe&&E.jsx($b,{ref:D.type==="context-menu"||D.type==="nested-context-menu"?D.context.internalBackdropRef:null,inert:qb(!B),cutout:Ne}),E.jsx(SH,{id:F,children:E.jsx(gm,{elementsRef:C.context.itemDomElements,labelsRef:C.context.itemLabels,children:ve})})]})}),IF=y.createContext(null);function n2(e){return y.useContext(IF)}const PF={...Hb,disabled:qe(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:qe(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:qe(e=>e.allowMouseEnter),stickIfOpen:qe(e=>e.stickIfOpen),parent:qe(e=>e.parent),rootId:qe(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:qe(e=>e.activeIndex),isActive:qe((e,t)=>e.activeIndex===t),hoverEnabled:qe(e=>e.hoverEnabled),instantType:qe(e=>e.instantType),lastOpenChangeReason:qe(e=>e.openChangeReason),floatingTreeRoot:qe(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:qe(e=>e.floatingNodeId),floatingParentNodeId:qe(e=>e.floatingParentNodeId),itemProps:qe(e=>e.itemProps),closeDelay:qe(e=>e.closeDelay),keyboardEventRelay:qe(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class e0 extends hm{constructor(n){super({...zF(),...n},{positionerRef:y.createRef(),popupRef:y.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:y.createRef(),beforeContentFocusGuardRef:y.createRef(),onOpenChangeComplete:void 0,triggerElements:new sd},PF);We(this,"unsubscribeParentListener",null);this.unsubscribeParentListener=this.observe("parent",a=>{var s;if((s=this.unsubscribeParentListener)==null||s.call(this),a.type==="menu"){this.unsubscribeParentListener=a.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=a.store.context.allowMouseUpTriggerRef;return}a.type!==void 0&&(this.context.allowMouseUpTriggerRef=a.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(n,a){this.state.floatingRootContext.context.events.emit("setOpen",{open:n,eventDetails:a})}static useStore(n,a){const s=Kn(()=>new e0(a)).current;return n??s}}function zF(){return{...Ub(),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 Ab,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Tn,keyboardEventRelay:void 0,closeDelay:0}}const UF=y.createContext(void 0);function HF(){return y.useContext(UF)}const BF=Lb(function(t){const{children:n,open:a,onOpenChange:s,onOpenChangeComplete:i,defaultOpen:c=!1,disabled:d=!1,modal:h,loopFocus:f=!0,orientation:g="vertical",actionsRef:m,closeParentOnEsc:b=!1,handle:x,triggerId:w,defaultTriggerId:S=null,highlightItemOnHover:R=!0}=t,T=dd(!0),C=As(!0),M=n2(!0),O=HF(),D=y.useMemo(()=>O&&C?{type:"menu",store:C.store}:M?{type:"menubar",context:M}:T&&!C?{type:"context-menu",context:T}:{type:void 0},[T,C,M,O]),k=e0.useStore(x==null?void 0:x.store,{open:c,openProp:a,activeTriggerId:S,triggerIdProp:w,parent:D});pm(()=>{a===void 0&&k.state.open===!1&&c===!0&&k.update({open:!0,activeTriggerId:S})}),k.useControlledProp("openProp",a),k.useControlledProp("triggerIdProp",w),k.useContextCallback("onOpenChangeComplete",i);const A=k.useState("floatingTreeRoot"),j=YO(A),B=Ao();Ue(()=>{T&&!C?k.update({parent:{type:"context-menu",context:T},floatingNodeId:j,floatingParentNodeId:B}):C&&k.update({floatingNodeId:j,floatingParentNodeId:B})},[T,C,j,B,k]);const W=k.useState("open"),K=k.useState("activeTriggerElement"),I=k.useState("positionerElement"),H=k.useState("hoverEnabled"),F=k.useState("modal"),q=k.useState("disabled"),_=k.useState("lastOpenChangeReason"),L=k.useState("parent"),P=k.useState("activeIndex"),V=k.useState("payload"),Q=k.useState("floatingParentNodeId"),z=y.useRef(null),Y=Q!=null;let X;k.useSyncedValues({disabled:d,modal:L.type===void 0?h:void 0,rootId:Ai()});const{openMethod:G,triggerProps:ce,reset:oe}=Xb(W);Pb(k);const{forceUnmount:de}=zb(W,k,()=>{k.update({allowMouseEnter:!1,stickIfOpen:!0}),oe()}),ve=y.useRef(L.type!=="context-menu"),xe=jn();y.useEffect(()=>{if(W||(z.current=null),L.type==="context-menu"){if(!W){xe.clear(),ve.current=!1;return}xe.start(500,()=>{ve.current=!0})}},[xe,W,L.type]),Gb(W&&F&&_!==dr&&G!=="touch",I),Ue(()=>{!W&&!H&&k.set("hoverEnabled",!0)},[W,H,k]);const Ne=y.useRef(!0),_e=jn(),ee=Be((Me,Ie)=>{var gt;const Fe=Ie.reason;if(W===Me&&Ie.trigger===K&&_===Fe||(Ie.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},!Me&&Ie.trigger==null&&(Ie.trigger=K??void 0),s==null||s(Me,Ie),Ie.isCanceled))return;const ht={open:Me,nativeEvent:Ie.event,reason:Ie.reason,nested:Y};X==null||X.emit("openchange",ht);const Lt=Ie.event;if(Me===!1&&(Lt==null?void 0:Lt.type)==="click"&&Lt.pointerType==="touch"&&!Ne.current)return;if(!Me&&P!==null){const Ye=k.context.itemDomElements.current[P];queueMicrotask(()=>{Ye==null||Ye.setAttribute("tabindex","-1")})}Me&&Fe===El?(Ne.current=!1,_e.start(300,()=>{Ne.current=!0})):(Ne.current=!0,_e.clear());const ct=(Fe===Ti||Fe===wu)&&Lt.detail===0&&(Lt==null?void 0:Lt.isTrusted),pt=!Me&&(Fe===lm||Fe==null),tt={open:Me,openChangeReason:Fe};z.current=Ie.event??null;const lt=((gt=Ie.trigger)==null?void 0:gt.id)??null;(lt||Me)&&(tt.activeTriggerId=lt,tt.activeTriggerElement=Ie.trigger??null),k.update(tt),L.type==="menubar"&&(Fe===El||Fe===Ci||Fe===dr||Fe===uh||Fe===dh)?k.set("instantType","group"):ct||pt?k.set("instantType",ct?"click":"dismiss"):k.set("instantType",void 0)}),ue=y.useCallback(Me=>{const Ie=yt(Me);return Ie.preventUnmountOnClose=()=>{k.set("preventUnmountingOnClose",!0)},Ie},[k]),pe=y.useCallback(()=>{k.setOpen(!1,ue(Cb))},[k,ue]);y.useImperativeHandle(m,()=>({unmount:de,close:pe}),[de,pe]);let ke;L.type==="context-menu"&&(ke=L.context),y.useImperativeHandle(ke==null?void 0:ke.positionerRef,()=>I,[I]),y.useImperativeHandle(ke==null?void 0:ke.actionsRef,()=>({setOpen:ee}),[ee]);const Te=Bb({popupStore:k,onOpenChange:ee});X=Te.context.events,y.useEffect(()=>{const Me=({open:Ie,eventDetails:Fe})=>ee(Ie,Fe);return X.on("setOpen",Me),()=>{X==null||X.off("setOpen",Me)}},[X,ee]);const be=fm(Te,{enabled:!q,bubbles:{escapeKey:b&&L.type==="menu"},outsidePress(){var Me;return L.type!=="context-menu"||((Me=z.current)==null?void 0:Me.type)==="contextmenu"?!0:ve.current},externalTree:Y?A:void 0}),we=yM(Te,{role:"menu"}),Z=oc(),Se=y.useCallback(Me=>{k.select("activeIndex")!==Me&&k.set("activeIndex",Me)},[k]),ge=gM(Te,{enabled:!q,listRef:k.context.itemDomElements,activeIndex:P,nested:L.type!==void 0,loopFocus:f,orientation:g,parentOrientation:L.type==="menubar"?L.context.orientation:void 0,rtl:Z==="rtl",disabledIndices:Es,onNavigate:Se,openOnArrowKeyDown:L.type!=="context-menu",externalTree:Y?A:void 0,focusItemOnHover:R}),ze=y.useCallback(Me=>{k.context.typingRef.current=Me},[k]),He=vM(Te,{listRef:k.context.itemLabels,activeIndex:P,resetMs:t4,onMatch:Me=>{W&&Me!==P&&k.set("activeIndex",Me)},onTypingChange:ze}),{getReferenceProps:De,getFloatingProps:st,getItemProps:xt,getTriggerProps:vt}=id([be,we,ge,He]),Je=y.useMemo(()=>{const Me=ca(De(),{onMouseMove(){k.set("allowMouseEnter",!0)}},ce);return delete Me.role,Me},[De,k,ce]),Qe=y.useMemo(()=>{const Me=vt();if(!Me)return Me;const Ie=ca(Me,ce);return delete Ie.role,delete Ie["aria-controls"],Ie},[vt,ce]),ft=y.useMemo(()=>st({onMouseMove(){k.set("allowMouseEnter",!0),L.type==="menu"&&k.set("hoverEnabled",!1)},onClick(){k.select("hoverEnabled")&&k.set("hoverEnabled",!1)},onKeyDown(Me){const Ie=k.select("keyboardEventRelay");Ie&&!Me.isPropagationStopped()&&Ie(Me)}}),[st,L.type,k]),se=y.useMemo(()=>xt(),[xt]);k.useSyncedValues({floatingRootContext:Te,activeTriggerProps:Je,inactiveTriggerProps:Qe,popupProps:ft,itemProps:se});const je=y.useMemo(()=>({store:k,parent:D}),[k,D]),Ke=E.jsx(JM.Provider,{value:je,children:typeof n=="function"?n({payload:V}):n});return L.type===void 0||L.type==="context-menu"?E.jsx(EH,{externalTree:A,children:Ke}):Ke});function r2(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),a=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||a.content!=="none"))return t;const i=parseFloat(n.width)||0,c=parseFloat(n.height)||0,d=parseFloat(a.width)||0,h=parseFloat(a.height)||0,f=Math.max(t.width,i,d),g=Math.max(t.height,c,h),m=f-t.width,b=g-t.height;return{left:t.left-m/2,right:t.right+m/2,top:t.top-b/2,bottom:t.bottom+b/2}}function FF(e){const{render:t,className:n,state:a=Tn,props:s=Es,refs:i=Es,metadata:c,stateAttributesMapping:d,tag:h="div",...f}=e,{compositeProps:g,compositeRef:m}=BM({metadata:c});return Nt(h,e,{state:a,ref:[...i,m],props:[g,...s,f],stateAttributesMapping:d})}function a2(e){if(wn(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!za(e))return a2(Fa(e))}function VF(e){const{enabled:t=!0,mouseDownAction:n,open:a}=e,s=y.useRef(!1);return y.useMemo(()=>t?{onMouseDown:i=>{(n==="open"&&!a||n==="close"&&a)&&(s.current=!0,qt(i.currentTarget).addEventListener("click",()=>{s.current=!1},{once:!0}))},onClick:i=>{s.current&&(s.current=!1,i.preventBaseUIHandler())}}:Tn,[t,n,a])}const Xf=2,YF=lM(function(t,n){const{render:a,className:s,disabled:i=!1,nativeButton:c=!0,id:d,openOnHover:h,delay:f=100,closeDelay:g=0,handle:m,payload:b,...x}=t,w=As(!0),S=(m==null?void 0:m.store)??(w==null?void 0:w.store);if(!S)throw new Error(yn(85));const R=Ta(d),T=S.useState("isTriggerActive",R),C=S.useState("floatingRootContext"),M=S.useState("isOpenedByTrigger",R),O=y.useRef(null),D=$F(),k=yb(!0),A=Ns(),j=y.useMemo(()=>A??new Ab,[A]),B=YO(j),W=Ao(),{registerTrigger:K,isMountedByThisTrigger:I}=uM(R,O,S,{payload:b,closeDelay:g,parent:D,floatingTreeRoot:j,floatingNodeId:B,floatingParentNodeId:W,keyboardEventRelay:k==null?void 0:k.relayKeyboardEvent}),H=D.type==="menubar",F=S.useState("disabled"),q=i||F||H&&D.context.disabled,{getButtonProps:_,buttonRef:L}=Oo({disabled:q,native:c});y.useEffect(()=>{!M&&D.type===void 0&&(S.context.allowMouseUpTriggerRef.current=!1)},[S,M,D.type]);const P=y.useRef(null),V=jn(),Q=Be(be=>{if(!P.current)return;V.clear(),S.context.allowMouseUpTriggerRef.current=!1;const we=be.target;if(Mt(P.current,we)||Mt(S.select("positionerElement"),we)||we===P.current||we!=null&&a2(we)===S.select("rootId"))return;const Z=r2(P.current);be.clientX>=Z.left-Xf&&be.clientX<=Z.right+Xf&&be.clientY>=Z.top-Xf&&be.clientY<=Z.bottom+Xf||j.events.emit("close",{domEvent:be,reason:zO})});y.useEffect(()=>{M&&S.select("lastOpenChangeReason")===dr&&qt(P.current).addEventListener("mouseup",Q,{once:!0})},[M,Q,S]);const z=H&&D.context.hasSubmenuOpen,X=pM(C,{enabled:(h??z)&&!q&&D.type!=="context-menu"&&(!H||z&&!I),handleClose:bM({blockPointerEvents:!H}),mouseOnly:!0,move:!1,restMs:D.type===void 0?f:void 0,delay:{close:g},triggerElementRef:O,externalTree:j,isActiveTrigger:T}),G=qF(M,S.select("lastOpenChangeReason")),ce=QO(C,{enabled:!q&&D.type!=="context-menu",event:M&&H?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0?G:!1}),oe=fM(C,{enabled:!q&&z}),de=VF({open:M,enabled:H,mouseDownAction:"open"}),ve=id([ce,oe]),xe={disabled:q,open:M},Ne=S.useState("triggerProps",I),_e=[P,n,L,K,O],ee=[ve.getReferenceProps(),X??Tn,Ne,{"aria-haspopup":"menu",id:R,onMouseDown:be=>{if(S.select("open"))return;V.start(200,()=>{S.context.allowMouseUpTriggerRef.current=!0}),qt(be.currentTarget).addEventListener("mouseup",Q,{once:!0})}},H?{role:"menuitem"}:{},de,x,_],ue=y.useRef(null),pe=Be(be=>{or.flushSync(()=>{S.setOpen(!1,yt(Ci,be.nativeEvent,be.currentTarget))});const we=aH(ue.current);we==null||we.focus()}),ke=Be(be=>{var Z;const we=S.select("positionerElement");if(we&&Sl(be,we))(Z=S.context.beforeContentFocusGuardRef.current)==null||Z.focus();else{or.flushSync(()=>{S.setOpen(!1,yt(Ci,be.nativeEvent,be.currentTarget))});let Se=rH(S.context.triggerFocusTargetRef.current||O.current);for(;Se!==null&&Mt(we,Se);){const ge=Se;if(Se=Rb(Se),Se===ge)break}Se==null||Se.focus()}}),Te=Nt("button",t,{enabled:!H,stateAttributesMapping:pv,state:xe,ref:_e,props:ee});return H?E.jsx(FF,{tag:"button",render:a,className:s,state:xe,refs:_e,props:ee,stateAttributesMapping:pv}):M?E.jsxs(y.Fragment,{children:[E.jsx(Xl,{ref:ue,onFocus:pe},`${R}-pre-focus-guard`),E.jsx(y.Fragment,{children:Te},R),E.jsx(Xl,{ref:S.context.triggerFocusTargetRef,onFocus:ke},`${R}-post-focus-guard`)]}):E.jsx(y.Fragment,{children:Te},R)});function qF(e,t){const n=jn(),[a,s]=y.useState(!1);return Ue(()=>{e&&t==="trigger-hover"?(s(!0),n.start(n4,()=>{s(!1)})):e||(n.clear(),s(!1))},[e,t,n]),a}function $F(){const e=dd(!0),t=As(!0),n=n2();return y.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}function t0({...e}){return E.jsx(BF,{"data-slot":"dropdown-menu",...e})}function n0({...e}){return E.jsx(YF,{"data-slot":"dropdown-menu-trigger",...e})}function r0({align:e="start",alignOffset:t=0,side:n="bottom",sideOffset:a=4,backdrop:s=!1,className:i,...c}){return E.jsxs(_F,{children:[s&&E.jsx(TF,{className:"fixed inset-0 z-50"}),E.jsx(LF,{className:"isolate z-50 outline-none",align:e,alignOffset:t,side:n,sideOffset:a,children:E.jsx(kF,{"data-slot":"dropdown-menu-content",className:Oe("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",i),...c})})]})}function ur({className:e,inset:t,variant:n="default",...a}){return E.jsx(NF,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:Oe("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),...a})}function zY({className:e,...t}){return E.jsx(UO,{"data-slot":"dropdown-menu-separator",className:Oe("bg-border -mx-1 my-1 h-px",e),...t})}const o2=y.createContext(void 0);function ym(){const e=y.useContext(o2);if(e===void 0)throw new Error(yn(53));return e}let Ph=(function(e){return e.scrollAreaCornerHeight="--scroll-area-corner-height",e.scrollAreaCornerWidth="--scroll-area-corner-width",e})({});const Wf=500,DR=16;function ia(e,t,n){if(!e)return 0;const a=getComputedStyle(e),s=n==="x"?"Inline":"Block";return n==="x"&&t==="margin"?parseFloat(a[`${t}InlineStart`])*2:parseFloat(a[`${t}${s}Start`])+parseFloat(a[`${t}${s}End`])}let KF=(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})({});const Qf="base-ui-disable-scrollbar",Uu={className:Qf,getElement(e){return E.jsx("style",{nonce:e,href:Qf,precedence:"base-ui:low",children:`.${Qf}{scrollbar-width:none}.${Qf}::-webkit-scrollbar{display:none}`})}};let fl=(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 a0={hasOverflowX:e=>e?{[fl.hasOverflowX]:""}:null,hasOverflowY:e=>e?{[fl.hasOverflowY]:""}:null,overflowXStart:e=>e?{[fl.overflowXStart]:""}:null,overflowXEnd:e=>e?{[fl.overflowXEnd]:""}:null,overflowYStart:e=>e?{[fl.overflowYStart]:""}:null,overflowYEnd:e=>e?{[fl.overflowYEnd]:""}:null,cornerHidden:()=>null},GF={x:0,y:0},kR={width:0,height:0},XF={xStart:!1,xEnd:!1,yStart:!1,yEnd:!1},WF={x:!1,y:!1,corner:!1},QF=y.forwardRef(function(t,n){const{render:a,className:s,overflowEdgeThreshold:i,...c}=t,d=ZF(i),h=Ta(),f=jn(),g=jn(),{nonce:m,disableStyleElements:b}=VM(),[x,w]=y.useState(!1),[S,R]=y.useState(!1),[T,C]=y.useState(!1),[M,O]=y.useState(!1),[D,k]=y.useState(kR),[A,j]=y.useState(kR),[B,W]=y.useState(XF),[K,I]=y.useState(WF),H=y.useRef(null),F=y.useRef(null),q=y.useRef(null),_=y.useRef(null),L=y.useRef(null),P=y.useRef(null),V=y.useRef(null),Q=y.useRef(!1),z=y.useRef(0),Y=y.useRef(0),X=y.useRef(0),G=y.useRef(0),ce=y.useRef("vertical"),oe=y.useRef(GF),de=Be(be=>{const we=be.x-oe.current.x,Z=be.y-oe.current.y;oe.current=be,Z!==0&&(C(!0),f.start(Wf,()=>{C(!1)})),we!==0&&(R(!0),g.start(Wf,()=>{R(!1)}))}),ve=Be(be=>{be.button===0&&(Q.current=!0,z.current=be.clientY,Y.current=be.clientX,ce.current=be.currentTarget.getAttribute(KF.orientation),F.current&&(X.current=F.current.scrollTop,G.current=F.current.scrollLeft),L.current&&ce.current==="vertical"&&L.current.setPointerCapture(be.pointerId),P.current&&ce.current==="horizontal"&&P.current.setPointerCapture(be.pointerId))}),xe=Be(be=>{if(!Q.current)return;const we=be.clientY-z.current,Z=be.clientX-Y.current;if(F.current){const Se=F.current.scrollHeight,ge=F.current.clientHeight,ze=F.current.scrollWidth,He=F.current.clientWidth;if(L.current&&q.current&&ce.current==="vertical"){const De=ia(q.current,"padding","y"),st=ia(L.current,"margin","y"),xt=L.current.offsetHeight,vt=q.current.offsetHeight-xt-De-st,Je=we/vt;F.current.scrollTop=X.current+Je*(Se-ge),be.preventDefault(),C(!0),f.start(Wf,()=>{C(!1)})}if(P.current&&_.current&&ce.current==="horizontal"){const De=ia(_.current,"padding","x"),st=ia(P.current,"margin","x"),xt=P.current.offsetWidth,vt=_.current.offsetWidth-xt-De-st,Je=Z/vt;F.current.scrollLeft=G.current+Je*(ze-He),be.preventDefault(),R(!0),g.start(Wf,()=>{R(!1)})}}}),Ne=Be(be=>{Q.current=!1,L.current&&ce.current==="vertical"&&L.current.releasePointerCapture(be.pointerId),P.current&&ce.current==="horizontal"&&P.current.releasePointerCapture(be.pointerId)});function _e(be){O(be.pointerType==="touch")}function ee(be){if(_e(be),be.pointerType!=="touch"){const we=Mt(H.current,be.target);w(we)}}const ue=y.useMemo(()=>({scrolling:S||T,hasOverflowX:!K.x,hasOverflowY:!K.y,overflowXStart:B.xStart,overflowXEnd:B.xEnd,overflowYStart:B.yStart,overflowYEnd:B.yEnd,cornerHidden:K.corner}),[S,T,K.x,K.y,K.corner,B]),pe={role:"presentation",onPointerEnter:ee,onPointerMove:ee,onPointerDown:_e,onPointerLeave(){w(!1)},style:{position:"relative",[Ph.scrollAreaCornerHeight]:`${D.height}px`,[Ph.scrollAreaCornerWidth]:`${D.width}px`}},ke=Nt("div",t,{state:ue,ref:[n,H],props:[pe,c],stateAttributesMapping:a0}),Te=y.useMemo(()=>({handlePointerDown:ve,handlePointerMove:xe,handlePointerUp:Ne,handleScroll:de,cornerSize:D,setCornerSize:k,thumbSize:A,setThumbSize:j,touchModality:M,cornerRef:V,scrollingX:S,setScrollingX:R,scrollingY:T,setScrollingY:C,hovering:x,setHovering:w,viewportRef:F,rootRef:H,scrollbarYRef:q,scrollbarXRef:_,thumbYRef:L,thumbXRef:P,rootId:h,hiddenState:K,setHiddenState:I,overflowEdges:B,setOverflowEdges:W,viewportState:ue,overflowEdgeThreshold:d}),[ve,xe,Ne,de,D,A,M,S,R,T,C,x,w,h,K,B,ue,d]);return E.jsxs(o2.Provider,{value:Te,children:[!b&&Uu.getElement(m),ke]})});function ZF(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 JF=y.createContext(void 0);function So(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function eV(e,t){if(typeof IntersectionObserver>"u")return()=>{};const n=new IntersectionObserver(a=>{a.forEach(s=>{s.intersectionRatio>0&&(t(),n.disconnect())})});return n.observe(e),()=>{n.disconnect()}}let ys=(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 jR=1;function _R(e,t){if(t<=0)return 0;const n=So(e,0,t),a=n,s=t-n,i=a<=jR,c=s<=jR;return i&&c?a<=s?0:t:i?0:c?t:n}let LR=!1;function tV(){LR||am||(typeof CSS<"u"&&"registerProperty"in CSS&&[ys.scrollAreaOverflowXStart,ys.scrollAreaOverflowXEnd,ys.scrollAreaOverflowYStart,ys.scrollAreaOverflowYEnd].forEach(e=>{try{CSS.registerProperty({name:e,syntax:"<length>",inherits:!1,initialValue:"0px"})}catch{}}),LR=!0)}const nV=y.forwardRef(function(t,n){const{render:a,className:s,...i}=t,{viewportRef:c,scrollbarYRef:d,scrollbarXRef:h,thumbYRef:f,thumbXRef:g,cornerRef:m,cornerSize:b,setCornerSize:x,setThumbSize:w,rootId:S,setHiddenState:R,hiddenState:T,handleScroll:C,setHovering:M,setOverflowEdges:O,overflowEdges:D,overflowEdgeThreshold:k,scrollingX:A,scrollingY:j}=ym(),B=oc(),W=y.useRef(!0),K=jn(),I=jn(),H=Be(()=>{const V=c.current,Q=d.current,z=h.current,Y=f.current,X=g.current,G=m.current;if(!V)return;const ce=V.scrollHeight,oe=V.scrollWidth,de=V.clientHeight,ve=V.clientWidth,xe=V.scrollTop,Ne=V.scrollLeft;if(ce===0||oe===0)return;const _e=de>=ce,ee=ve>=oe,ue=ve/oe,pe=de/ce,ke=Math.max(0,oe-ve),Te=Math.max(0,ce-de);let be=0,we=0;if(!ee){let tt=0;B==="rtl"?tt=So(-Ne,0,ke):tt=So(Ne,0,ke),be=_R(tt,ke),we=ke-be}const Z=_e?0:So(xe,0,Te),Se=_e?0:_R(Z,Te),ge=_e?0:Te-Se,ze=ee?0:ve,He=_e?0:de;let De=0,st=0;!ee&&!_e&&(De=(Q==null?void 0:Q.offsetWidth)||0,st=(z==null?void 0:z.offsetHeight)||0);const xt=b.width===0&&b.height===0,vt=xt?De:0,Je=xt?st:0,Qe=ia(z,"padding","x"),ft=ia(Q,"padding","y"),se=ia(X,"margin","x"),je=ia(Y,"margin","y"),Ke=ze-Qe-se,Me=He-ft-je,Ie=z?Math.min(z.offsetWidth-vt,Ke):Ke,Fe=Q?Math.min(Q.offsetHeight-Je,Me):Me,ht=Math.max(DR,Ie*ue),Lt=Math.max(DR,Fe*pe);if(w(tt=>tt.height===Lt&&tt.width===ht?tt:{width:ht,height:Lt}),Q&&Y){const tt=Q.offsetHeight-Lt-ft-je,lt=ce-de,gt=lt===0?0:xe/lt,Ye=Math.min(tt,Math.max(0,gt*tt));Y.style.transform=`translate3d(0,${Ye}px,0)`}if(z&&X){const tt=z.offsetWidth-ht-Qe-se,lt=oe-ve,gt=lt===0?0:Ne/lt,Ye=B==="rtl"?So(gt*tt,-tt,0):So(gt*tt,0,tt);X.style.transform=`translate3d(${Ye}px,0,0)`}const ct=[[ys.scrollAreaOverflowXStart,be],[ys.scrollAreaOverflowXEnd,we],[ys.scrollAreaOverflowYStart,Se],[ys.scrollAreaOverflowYEnd,ge]];for(const[tt,lt]of ct)V.style.setProperty(tt,`${lt}px`);G&&(ee||_e?x({width:0,height:0}):!ee&&!_e&&x({width:De,height:st})),R(tt=>{const lt=_e||ee;return tt.y===_e&&tt.x===ee&&tt.corner===lt?tt:{y:_e,x:ee,corner:lt}});const pt={xStart:!ee&&be>k.xStart,xEnd:!ee&&we>k.xEnd,yStart:!_e&&Se>k.yStart,yEnd:!_e&&ge>k.yEnd};O(tt=>tt.xStart===pt.xStart&&tt.xEnd===pt.xEnd&&tt.yStart===pt.yStart&&tt.yEnd===pt.yEnd?tt:pt)});Ue(()=>{if(!c.current)return;tV();let V=!1;return eV(c.current,()=>{if(!V){V=!0;return}H()})},[H,c]),Ue(()=>{queueMicrotask(H)},[H,T,B]),Ue(()=>{var V;(V=c.current)!=null&&V.matches(":hover")&&M(!0)},[c,M]),y.useEffect(()=>{const V=c.current;if(typeof ResizeObserver>"u"||!V)return;let Q=!1;const z=new ResizeObserver(()=>{if(!Q){Q=!0;return}H()});return z.observe(V),I.start(0,()=>{const Y=V.getAnimations({subtree:!0});Y.length!==0&&Promise.allSettled(Y.map(X=>X.finished)).then(H).catch(()=>{})}),()=>{z.disconnect(),I.clear()}},[H,c,I]);function F(){W.current=!1}const q={role:"presentation",...S&&{"data-id":`${S}-viewport`},...(!T.x||!T.y)&&{tabIndex:0},className:Uu.className,style:{overflow:"scroll"},onScroll(){c.current&&(H(),W.current||C({x:c.current.scrollLeft,y:c.current.scrollTop}),K.start(100,()=>{W.current=!0}))},onWheel:F,onTouchMove:F,onPointerMove:F,onPointerEnter:F,onKeyDown:F},_=y.useMemo(()=>({scrolling:A||j,hasOverflowX:!T.x,hasOverflowY:!T.y,overflowXStart:D.xStart,overflowXEnd:D.xEnd,overflowYStart:D.yStart,overflowYEnd:D.yEnd,cornerHidden:T.corner}),[A,j,T.x,T.y,T.corner,D]),L=Nt("div",t,{ref:[n,c],state:_,props:[q,i],stateAttributesMapping:a0}),P=y.useMemo(()=>({computeThumbPosition:H}),[H]);return E.jsx(JF.Provider,{value:P,children:L})}),s2=y.createContext(void 0);function rV(){const e=y.useContext(s2);if(e===void 0)throw new Error(yn(54));return e}let zh=(function(e){return e.scrollAreaThumbHeight="--scroll-area-thumb-height",e.scrollAreaThumbWidth="--scroll-area-thumb-width",e})({});const aV=y.forwardRef(function(t,n){const{render:a,className:s,orientation:i="vertical",keepMounted:c=!1,...d}=t,{hovering:h,scrollingX:f,scrollingY:g,hiddenState:m,overflowEdges:b,scrollbarYRef:x,scrollbarXRef:w,viewportRef:S,thumbYRef:R,thumbXRef:T,handlePointerDown:C,handlePointerUp:M,rootId:O,thumbSize:D}=ym(),k={hovering:h,scrolling:{horizontal:f,vertical:g}[i],orientation:i,hasOverflowX:!m.x,hasOverflowY:!m.y,overflowXStart:b.xStart,overflowXEnd:b.xEnd,overflowYStart:b.yStart,overflowYEnd:b.yEnd,cornerHidden:m.corner},A=oc();y.useEffect(()=>{const H=S.current,F=i==="vertical"?x.current:w.current;if(!F)return;function q(_){if(!(!H||!F||_.ctrlKey)){if(_.preventDefault(),i==="vertical"){if(H.scrollTop===0&&_.deltaY<0)return}else if(H.scrollLeft===0&&_.deltaX<0)return;if(i==="vertical"){if(H.scrollTop===H.scrollHeight-H.clientHeight&&_.deltaY>0)return}else if(H.scrollLeft===H.scrollWidth-H.clientWidth&&_.deltaX>0)return;i==="vertical"?H.scrollTop+=_.deltaY:H.scrollLeft+=_.deltaX}}return F.addEventListener("wheel",q,{passive:!1}),()=>{F.removeEventListener("wheel",q)}},[i,w,x,S]);const j={...O&&{"data-id":`${O}-scrollbar`},onPointerDown(H){if(H.button===0&&H.currentTarget===H.target&&S.current){if(R.current&&x.current&&i==="vertical"){const F=ia(R.current,"margin","y"),q=ia(x.current,"padding","y"),_=R.current.offsetHeight,L=x.current.getBoundingClientRect(),P=H.clientY-L.top-_/2-q+F/2,V=S.current.scrollHeight,Q=S.current.clientHeight,z=x.current.offsetHeight-_-q-F,X=P/z*(V-Q);S.current.scrollTop=X}if(T.current&&w.current&&i==="horizontal"){const F=ia(T.current,"margin","x"),q=ia(w.current,"padding","x"),_=T.current.offsetWidth,L=w.current.getBoundingClientRect(),P=H.clientX-L.left-_/2-q+F/2,V=S.current.scrollWidth,Q=S.current.clientWidth,z=w.current.offsetWidth-_-q-F,Y=P/z;let X;A==="rtl"?(X=(1-Y)*(V-Q),S.current.scrollLeft<=0&&(X=-X)):X=Y*(V-Q),S.current.scrollLeft=X}C(H)}},onPointerUp:M,style:{position:"absolute",touchAction:"none",WebkitUserSelect:"none",userSelect:"none",...i==="vertical"&&{top:0,bottom:`var(${Ph.scrollAreaCornerHeight})`,insetInlineEnd:0,[zh.scrollAreaThumbHeight]:`${D.height}px`},...i==="horizontal"&&{insetInlineStart:0,insetInlineEnd:`var(${Ph.scrollAreaCornerWidth})`,bottom:0,[zh.scrollAreaThumbWidth]:`${D.width}px`}}},B=Nt("div",t,{ref:[n,i==="vertical"?x:w],state:k,props:[j,d],stateAttributesMapping:a0}),W=y.useMemo(()=>({orientation:i}),[i]),K=i==="vertical"?m.y:m.x;return c||!K?E.jsx(s2.Provider,{value:W,children:B}):null}),oV=y.forwardRef(function(t,n){const{render:a,className:s,...i}=t,{thumbYRef:c,thumbXRef:d,handlePointerDown:h,handlePointerMove:f,handlePointerUp:g,setScrollingX:m,setScrollingY:b}=ym(),{orientation:x}=rV();return Nt("div",t,{ref:[n,x==="vertical"?c:d],state:{orientation:x},props:[{onPointerDown:h,onPointerMove:f,onPointerUp(R){x==="vertical"&&b(!1),x==="horizontal"&&m(!1),g(R)},style:{...x==="vertical"&&{height:`var(${zh.scrollAreaThumbHeight})`},...x==="horizontal"&&{width:`var(${zh.scrollAreaThumbWidth})`}}},i]})}),sV=y.forwardRef(function(t,n){const{render:a,className:s,...i}=t,{cornerRef:c,cornerSize:d,hiddenState:h}=ym(),f=Nt("div",t,{ref:[n,c],props:[{style:{position:"absolute",bottom:0,insetInlineEnd:0,width:d.width,height:d.height}},i]});return h.corner?null:f});function iV({className:e,children:t,...n}){return E.jsxs(QF,{"data-slot":"scroll-area",className:Oe("relative",e),...n,children:[E.jsx(nV,{"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}),E.jsx(lV,{}),E.jsx(sV,{})]})}function lV({className:e,orientation:t="vertical",...n}){return E.jsx(aV,{"data-slot":"scroll-area-scrollbar","data-orientation":t,orientation:t,className:Oe("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:E.jsx(oV,{"data-slot":"scroll-area-thumb",className:"rounded-full bg-border relative flex-1"})})}const i2=y.createContext(void 0);function cV(){const e=y.useContext(i2);if(e===void 0)throw new Error(yn(63));return e}let IR=(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 l2={...vb,checked(e){return e?{[IR.checked]:""}:{[IR.unchecked]:""}}};function c2(e,t){const n=y.useRef(e),a=Be(t);Ue(()=>{n.current!==e&&a(n.current)},[e,a]),Ue(()=>{n.current=e},[e])}const uV=y.forwardRef(function(t,n){const{checked:a,className:s,defaultChecked:i,id:c,inputRef:d,name:h,nativeButton:f=!1,onCheckedChange:g,readOnly:m=!1,required:b=!1,disabled:x=!1,render:w,uncheckedValue:S,value:R,...T}=t,{clearErrors:C}=bb(),{state:M,setTouched:O,setDirty:D,validityData:k,setFilled:A,setFocused:j,shouldValidateOnChange:B,validationMode:W,disabled:K,name:I,validation:H}=nc(),{labelId:F}=nm(),q=K||x,_=I??h,L=Be(g),P=y.useRef(null),V=wa(P,d,H.inputRef),Q=y.useRef(null),z=Ta(),Y=sm({id:c,implicit:!1,controlRef:Q}),X=f?void 0:Y,[G,ce]=Kl({controlled:a,default:!!i,name:"Switch",state:"checked"});Tb({id:z,commit:H.commit,value:G,controlRef:Q,name:_,getValue:()=>G}),Ue(()=>{P.current&&A(P.current.checked)},[P,A]),c2(G,()=>{C(_),D(G!==k.initialValue),A(G),B()?H.commit(G):H.commit(G,!0)});const{getButtonProps:oe,buttonRef:de}=Oo({disabled:q,native:f}),ve={id:f?Y:z,role:"switch","aria-checked":G,"aria-readonly":m||void 0,"aria-required":b||void 0,"aria-labelledby":F,onFocus(){q||j(!0)},onBlur(){const ee=P.current;!ee||q||(O(!0),j(!1),W==="onBlur"&&H.commit(ee.checked))},onClick(ee){var ue;m||q||(ee.preventDefault(),(ue=P.current)==null||ue.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:ee.shiftKey,ctrlKey:ee.ctrlKey,altKey:ee.altKey,metaKey:ee.metaKey})))}},xe=y.useMemo(()=>ca({checked:G,disabled:q,id:X,name:_,required:b,style:_?$O:um,tabIndex:-1,type:"checkbox","aria-hidden":!0,ref:V,onChange(ee){if(ee.nativeEvent.defaultPrevented)return;const ue=ee.target.checked,pe=yt(Sa,ee.nativeEvent);L==null||L(ue,pe),!pe.isCanceled&&ce(ue)},onFocus(){var ee;(ee=Q.current)==null||ee.focus()}},H.getInputValidationProps,R!==void 0?{value:R}:Tn),[G,q,V,X,_,L,b,ce,H,R]),Ne=y.useMemo(()=>({...M,checked:G,disabled:q,readOnly:m,required:b}),[M,G,q,m,b]),_e=Nt("span",t,{state:Ne,ref:[n,Q,de],props:[ve,H.getValidationProps,T,oe],stateAttributesMapping:l2});return E.jsxs(i2.Provider,{value:Ne,children:[_e,!G&&_&&S!==void 0&&E.jsx("input",{type:"hidden",name:_,value:S}),E.jsx("input",{...xe})]})}),dV=y.forwardRef(function(t,n){const{render:a,className:s,...i}=t,{state:c}=nc(),d=cV(),h={...c,...d};return Nt("span",t,{state:h,ref:n,stateAttributesMapping:l2,props:i})});function Dv({className:e,size:t="default",...n}){return E.jsx(uV,{"data-slot":"switch","data-size":t,className:Oe("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:E.jsx(dV,{"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"})})}const fV=(e,t)=>["watch-rules",e,t],u2=e=>["watch-rule-state",e];async function ic(e,t){try{return(await e.json()).error??t}catch{return t}}async function hV(e,t){const n=new URLSearchParams({deviceId:e,paneId:t}),a=await fetch(`/api/watch/rules?${n}`);if(!a.ok)throw new Error(await ic(a,"Failed to load watch rules"));return(await a.json()).rules}async function mV(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 ic(t,"Failed to create watch rule"));return await t.json()}async function d2(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 ic(n,"Failed to update watch rule"));return await n.json()}async function pV(e){const t=await fetch(`/api/watch/rules/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await ic(t,"Failed to delete watch rule"))}async function f2(e){const t=await fetch(`/api/watch/rules/${e}/state`);if(!t.ok)throw new Error(await ic(t,"Failed to load watch rule state"));return await t.json()}async function gV(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 ic(t,"Failed to generate regex"));return await t.json()}const h2=y.createContext(null),m2=y.createContext(null);function Ga(){const e=y.useContext(h2);if(e===null)throw new Error(yn(60));return e}function p2(){const e=y.useContext(m2);if(e===null)throw new Error(yn(61));return e}const yV=(e,t)=>Object.is(e,t);function Wl(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function vV(e,t,n){return!e||e.length===0?!1:e.some(a=>a===void 0?!1:Wl(t,a,n))}function Ru(e,t,n){return!e||e.length===0?-1:e.findIndex(a=>a===void 0?!1:Wl(a,t,n))}function bV(e,t,n){return e.filter(a=>!Wl(t,a,n))}function kv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function g2(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function xV(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(g2(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 wV(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 kv(e)}function pl(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?kv(e.value):kv(e)}function y2(e,t,n){function a(){return wV(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]??a();if(Array.isArray(t)){const s=g2(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=s.find(c=>c.value===e);return i&&i.label!=null?i.label:a()}if("value"in e){const i=s.find(c=>c&&c.value===e.value);if(i&&i.label!=null)return i.label}}return a()}function SV(e,t,n){return e.reduce((a,s,i)=>(i>0&&a.push(", "),a.push(E.jsx(y.Fragment,{children:y2(s,t,n)},i)),a),[])}const wt={id:qe(e=>e.id),modal:qe(e=>e.modal),multiple:qe(e=>e.multiple),items:qe(e=>e.items),itemToStringLabel:qe(e=>e.itemToStringLabel),itemToStringValue:qe(e=>e.itemToStringValue),isItemEqualToValue:qe(e=>e.isItemEqualToValue),value:qe(e=>e.value),hasSelectedValue:qe(e=>{const{value:t,multiple:n,itemToStringValue:a}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:pl(t,a)!==""}),hasNullItemLabel:qe((e,t)=>t?xV(e.items):!1),open:qe(e=>e.open),mounted:qe(e=>e.mounted),forceMount:qe(e=>e.forceMount),transitionStatus:qe(e=>e.transitionStatus),openMethod:qe(e=>e.openMethod),activeIndex:qe(e=>e.activeIndex),selectedIndex:qe(e=>e.selectedIndex),isActive:qe((e,t)=>e.activeIndex===t),isSelected:qe((e,t,n)=>{const a=e.isItemEqualToValue,s=e.value;return e.multiple?Array.isArray(s)&&s.some(i=>Wl(n,i,a)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Wl(n,s,a)}),isSelectedByFocus:qe((e,t)=>e.selectedIndex===t),popupProps:qe(e=>e.popupProps),triggerProps:qe(e=>e.triggerProps),triggerElement:qe(e=>e.triggerElement),positionerElement:qe(e=>e.positionerElement),listElement:qe(e=>e.listElement),scrollUpArrowVisible:qe(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:qe(e=>e.scrollDownArrowVisible),hasScrollArrows:qe(e=>e.hasScrollArrows)};function EV(e){const{id:t,value:n,defaultValue:a=null,onValueChange:s,open:i,defaultOpen:c=!1,onOpenChange:d,name:h,autoComplete:f,disabled:g=!1,readOnly:m=!1,required:b=!1,modal:x=!0,actionsRef:w,inputRef:S,onOpenChangeComplete:R,items:T,multiple:C=!1,itemToStringLabel:M,itemToStringValue:O,isItemEqualToValue:D=yV,highlightItemOnHover:k=!0,children:A}=e,{clearErrors:j}=bb(),{setDirty:B,setTouched:W,setFocused:K,shouldValidateOnChange:I,validityData:H,setFilled:F,name:q,disabled:_,validation:L,validationMode:P}=nc(),V=sm({id:t}),Q=_||g,z=q??h,[Y,X]=Kl({controlled:n,default:C?a??Es:a,name:"Select",state:"value"}),[G,ce]=Kl({controlled:i,default:c,name:"Select",state:"open"}),oe=y.useRef([]),de=y.useRef([]),ve=y.useRef(null),xe=y.useRef(null),Ne=y.useRef(0),_e=y.useRef(null),ee=y.useRef([]),ue=y.useRef(!1),pe=y.useRef(!1),ke=y.useRef(null),Te=y.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),be=y.useRef(!1),{mounted:we,setMounted:Z,transitionStatus:Se}=od(G),{openMethod:ge,triggerProps:ze,reset:He}=Xb(G),De=Kn(()=>new cM({id:V,modal:x,multiple:C,itemToStringLabel:M,itemToStringValue:O,isItemEqualToValue:D,value:Y,open:G,mounted:we,transitionStatus:Se,items:T,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,st=Et(De,wt.activeIndex),xt=Et(De,wt.selectedIndex),vt=Et(De,wt.triggerElement),Je=Et(De,wt.positionerElement),Qe=y.useMemo(()=>C&&Array.isArray(Y)&&Y.length===0?"":pl(Y,O),[C,Y,O]),ft=y.useMemo(()=>C&&Array.isArray(Y)?Y.map(Xe=>pl(Xe,O)):pl(Y,O),[C,Y,O]),se=Zn(De.state.triggerElement);Tb({id:V,commit:L.commit,value:Y,controlRef:se,name:z,getValue:()=>ft});const je=y.useRef(Y);Ue(()=>{Y!==je.current&&De.set("forceMount",!0)},[De,Y]),Ue(()=>{F(C?Array.isArray(Y)&&Y.length>0:Y!=null)},[C,Y,F]),Ue(function(){if(G)return;const Ct=ee.current;if(C){const re=Array.isArray(Y)?Y:[];if(re.length===0){De.set("selectedIndex",null);return}const le=re[re.length-1],Ee=Ru(Ct,le,D);De.set("selectedIndex",Ee===-1?null:Ee);return}const $=Ru(Ct,Y,D);De.set("selectedIndex",$===-1?null:$)},[C,G,Y,ee,D,De]),c2(Y,()=>{j(z),B(Y!==H.initialValue),I()?L.commit(Y):L.commit(Y,!0)});const Ke=Be((Xe,Ct)=>{if(d==null||d(Xe,Ct),!Ct.isCanceled&&(ce(Xe),!Xe&&(Ct.reason===Ci||Ct.reason===im)&&(W(!0),K(!1),P==="onBlur"&&L.commit(Y)),!Xe&&De.state.activeIndex!==null)){const $=oe.current[De.state.activeIndex];queueMicrotask(()=>{$==null||$.setAttribute("tabindex","-1")})}}),Me=Be(()=>{Z(!1),De.set("activeIndex",null),He(),R==null||R(!1)});No({enabled:!w,open:G,ref:ve,onComplete(){G||Me()}}),y.useImperativeHandle(w,()=>({unmount:Me}),[Me]);const Ie=Be((Xe,Ct)=>{s==null||s(Xe,Ct),!Ct.isCanceled&&X(Xe)}),Fe=Be(()=>{const Xe=De.state.listElement||ve.current;if(!Xe)return;const Ct=Xe.scrollTop,$=Xe.scrollTop+Xe.clientHeight,re=Ct>1,le=$<Xe.scrollHeight-1;De.state.scrollUpArrowVisible!==re&&De.set("scrollUpArrowVisible",re),De.state.scrollDownArrowVisible!==le&&De.set("scrollDownArrowVisible",le)}),ht=dM({open:G,onOpenChange:Ke,elements:{reference:vt,floating:Je}}),Lt=QO(ht,{enabled:!m&&!Q,event:"mousedown"}),ct=fm(ht,{bubbles:!1}),pt=gM(ht,{enabled:!m&&!Q,listRef:oe,activeIndex:st,selectedIndex:xt,disabledIndices:Es,onNavigate(Xe){Xe===null&&!G||De.set("activeIndex",Xe)},focusItemOnHover:!1}),tt=vM(ht,{enabled:!m&&!Q&&(G||!C),listRef:de,activeIndex:st,selectedIndex:xt,onMatch(Xe){G?De.set("activeIndex",Xe):Ie(ee.current[Xe],yt("none"))},onTypingChange(Xe){ue.current=Xe}}),{getReferenceProps:lt,getFloatingProps:gt,getItemProps:Ye}=id([Lt,ct,pt,tt]),Tt=y.useMemo(()=>ca(lt(),ze,V?{id:V}:Tn),[lt,ze,V]);pm(()=>{De.update({popupProps:gt(),triggerProps:Tt})}),Ue(()=>{De.update({id:V,modal:x,multiple:C,value:Y,open:G,mounted:we,transitionStatus:Se,popupProps:gt(),triggerProps:Tt,items:T,itemToStringLabel:M,itemToStringValue:O,isItemEqualToValue:D,openMethod:ge})},[De,V,x,C,Y,G,we,Se,gt,Tt,T,M,O,D,ge]);const kt=y.useMemo(()=>({store:De,name:z,required:b,disabled:Q,readOnly:m,multiple:C,itemToStringLabel:M,itemToStringValue:O,highlightItemOnHover:k,setValue:Ie,setOpen:Ke,listRef:oe,popupRef:ve,scrollHandlerRef:xe,handleScrollArrowVisibility:Fe,scrollArrowsMountedCountRef:Ne,getItemProps:Ye,events:ht.context.events,valueRef:_e,valuesRef:ee,labelsRef:de,typingRef:ue,selectionRef:Te,selectedItemTextRef:ke,validation:L,onOpenChangeComplete:R,keyboardActiveRef:pe,alignItemWithTriggerActiveRef:be,initialValueRef:je}),[De,z,b,Q,m,C,M,O,k,Ie,Ke,Ye,ht.context.events,L,R,Fe]),Rt=wa(S,L.inputRef),on=C&&Array.isArray(Y)&&Y.length>0,Pt=y.useMemo(()=>!C||!Array.isArray(Y)||!z?null:Y.map(Xe=>{const Ct=pl(Xe,O);return E.jsx("input",{type:"hidden",name:z,value:Ct},Ct)}),[C,Y,z,O]);return E.jsx(h2.Provider,{value:kt,children:E.jsxs(m2.Provider,{value:ht,children:[A,E.jsx("input",{...L.getInputValidationProps({onFocus(){var Xe;(Xe=De.state.triggerElement)==null||Xe.focus({focusVisible:!0})},onChange(Xe){if(Xe.nativeEvent.defaultPrevented)return;const Ct=Xe.target.value,$=yt(Sa,Xe.nativeEvent);function re(){if(C)return;const le=ee.current.find(Ee=>pl(Ee,O).toLowerCase()===Ct.toLowerCase());le!=null&&(B(le!==H.initialValue),Ie(le,$),I()&&L.commit(le))}De.set("forceMount",!0),queueMicrotask(re)}}),name:C?void 0:z,autoComplete:f,value:Qe,disabled:Q,required:b&&!on,readOnly:m,ref:Rt,style:z?$O:um,tabIndex:-1,"aria-hidden":!0}),Pt]})})}const Zf=2,RV=400,PR=200,TV={...pv,...vb,value:()=>null},CV=y.forwardRef(function(t,n){const{render:a,className:s,id:i,disabled:c=!1,nativeButton:d=!0,...h}=t,{setTouched:f,setFocused:g,validationMode:m,state:b,disabled:x}=nc(),{labelId:w}=nm(),{store:S,setOpen:R,selectionRef:T,validation:C,readOnly:M,required:O,alignItemWithTriggerActiveRef:D,disabled:k,keyboardActiveRef:A}=Ga(),j=x||k||c,B=Et(S,wt.open),W=Et(S,wt.value),K=Et(S,wt.triggerProps),I=Et(S,wt.positionerElement),H=Et(S,wt.listElement),F=Et(S,wt.id),q=Et(S,wt.hasSelectedValue),_=!q&&B,L=Et(S,wt.hasNullItemLabel,_),P=i??F;sm({id:P});const V=Zn(I),Q=y.useRef(null),{getButtonProps:z,buttonRef:Y}=Oo({disabled:j,native:d}),X=Be(ee=>{S.set("triggerElement",ee)}),G=wa(n,Q,Y,X),ce=jn(),oe=jn(),de=jn(),ve=jn();y.useEffect(()=>{if(B)return!(q||L)?de.start(RV,()=>{T.current.allowUnselectedMouseUp=!0,T.current.allowSelectedMouseUp=!0}):ve.start(PR,()=>{T.current.allowUnselectedMouseUp=!0,de.start(PR,()=>{T.current.allowSelectedMouseUp=!0})}),()=>{de.clear(),ve.clear()};T.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},oe.clear()},[B,q,L,T,oe,de,ve]);const xe=y.useMemo(()=>{var ee;return(H==null?void 0:H.id)??((ee=Iu(I))==null?void 0:ee.id)},[H,I]),Ne=ca(K,{id:P,role:"combobox","aria-expanded":B?"true":"false","aria-haspopup":"listbox","aria-controls":B?xe:void 0,"aria-labelledby":w,"aria-readonly":M||void 0,"aria-required":O||void 0,tabIndex:j?-1:0,ref:G,onFocus(ee){g(!0),B&&D.current&&R(!1,yt(Sa,ee.nativeEvent)),ce.start(0,()=>{S.set("forceMount",!0)})},onBlur(ee){Mt(I,ee.relatedTarget)||(f(!0),g(!1),m==="onBlur"&&C.commit(W))},onPointerMove(){A.current=!1},onKeyDown(){A.current=!0},onMouseDown(ee){if(B)return;const ue=qt(ee.currentTarget);function pe(ke){if(!Q.current)return;const Te=ke.target;if(Mt(Q.current,Te)||Mt(V.current,Te)||Te===Q.current)return;const be=r2(Q.current);ke.clientX>=be.left-Zf&&ke.clientX<=be.right+Zf&&ke.clientY>=be.top-Zf&&ke.clientY<=be.bottom+Zf||R(!1,yt(zO,ke))}oe.start(0,()=>{ue.addEventListener("mouseup",pe,{once:!0})})}},C.getValidationProps,h,z);Ne.role="combobox";const _e={...b,open:B,disabled:j,value:W,readOnly:M,placeholder:!q};return Nt("button",t,{ref:[n,Q],state:_e,stateAttributesMapping:TV,props:Ne})}),OV={value:()=>null},MV=y.forwardRef(function(t,n){const{className:a,render:s,children:i,placeholder:c,...d}=t,{store:h,valueRef:f}=Ga(),g=Et(h,wt.value),m=Et(h,wt.items),b=Et(h,wt.itemToStringLabel),x=Et(h,wt.hasSelectedValue),w=!x&&c!=null&&i==null,S=Et(h,wt.hasNullItemLabel,w),R={value:g,placeholder:!x};let T=null;return typeof i=="function"?T=i(g):i!=null?T=i:!x&&c!=null&&!S?T=c:Array.isArray(g)?T=SV(g,m,b):T=y2(g,m,b),Nt("span",t,{state:R,ref:[n,f],props:[{children:T},d],stateAttributesMapping:OV})}),NV=y.forwardRef(function(t,n){const{className:a,render:s,...i}=t,{store:c}=Ga(),h={open:Et(c,wt.open)};return Nt("span",t,{state:h,ref:n,props:[{"aria-hidden":!0,children:"▼"},i],stateAttributesMapping:HO})}),AV=y.createContext(void 0),DV=y.forwardRef(function(t,n){const{store:a}=Ga(),s=Et(a,wt.mounted),i=Et(a,wt.forceMount);return s||i?E.jsx(AV.Provider,{value:!0,children:E.jsx(Db,{ref:n,...t})}):null}),v2=y.createContext(void 0);function o0(){const e=y.useContext(v2);if(!e)throw new Error(yn(59));return e}function Uh(e,t){e&&Object.assign(e.style,t)}const b2={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},kV={position:"fixed"},jV=y.forwardRef(function(t,n){const{anchor:a,positionMethod:s="absolute",className:i,render:c,side:d="bottom",align:h="center",sideOffset:f=0,alignOffset:g=0,collisionBoundary:m="clipping-ancestors",collisionPadding:b,arrowPadding:x=5,sticky:w=!1,disableAnchorTracking:S,alignItemWithTrigger:R=!0,collisionAvoidance:T=KC,...C}=t,{store:M,listRef:O,labelsRef:D,alignItemWithTriggerActiveRef:k,selectedItemTextRef:A,valuesRef:j,initialValueRef:B,popupRef:W,setValue:K}=Ga(),I=p2(),H=Et(M,wt.open),F=Et(M,wt.mounted),q=Et(M,wt.modal),_=Et(M,wt.value),L=Et(M,wt.openMethod),P=Et(M,wt.positionerElement),V=Et(M,wt.triggerElement),Q=Et(M,wt.isItemEqualToValue),z=Et(M,wt.transitionStatus),Y=y.useRef(null),X=y.useRef(null),[G,ce]=y.useState(R),oe=F&&G&&L!=="touch";!F&&G!==R&&ce(R),Ue(()=>{F||(wt.scrollUpArrowVisible(M.state)&&M.set("scrollUpArrowVisible",!1),wt.scrollDownArrowVisible(M.state)&&M.set("scrollDownArrowVisible",!1))},[M,F]),y.useImperativeHandle(k,()=>oe),Gb((oe||q)&&H&&L!=="touch",V);const de=Zb({anchor:a,floatingRootContext:I,positionMethod:s,mounted:F,side:d,sideOffset:f,align:h,alignOffset:g,arrowPadding:x,collisionBoundary:m,collisionPadding:b,sticky:w,disableAnchorTracking:S??oe,collisionAvoidance:T,keepMounted:!0}),ve=oe?"none":de.side,xe=oe?kV:de.positionerStyles,Ne=y.useMemo(()=>{const be={};return H||(be.pointerEvents="none"),{role:"presentation",hidden:!F,style:{...xe,...be}}},[H,F,xe]),_e={open:H,side:ve,align:de.align,anchorHidden:de.anchorHidden},ee=Be(be=>{M.set("positionerElement",be)}),ue=Nt("div",t,{ref:[n,ee],state:_e,stateAttributesMapping:Ka,props:[Ne,sc(z),C]}),pe=y.useRef(0),ke=Be(be=>{if(be.size===0&&pe.current===0||j.current.length===0)return;const we=pe.current;if(pe.current=be.size,be.size===we)return;const Z=yt(Sa);if(we!==0&&!M.state.multiple&&_!==null&&Ru(j.current,_,Q)===-1){const ge=B.current,He=ge!=null&&Ru(j.current,ge,Q)!==-1?ge:null;K(He,Z),He===null&&(M.set("selectedIndex",null),A.current=null)}if(we!==0&&M.state.multiple&&Array.isArray(_)){const Se=ze=>Ru(j.current,ze,Q)!==-1,ge=_.filter(ze=>Se(ze));(ge.length!==_.length||ge.some(ze=>!vV(_,ze,Q)))&&(K(ge,Z),ge.length===0&&(M.set("selectedIndex",null),A.current=null))}if(H&&oe){M.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Se={height:""};Uh(P,Se),Uh(W.current,Se)}}),Te=y.useMemo(()=>({...de,side:ve,alignItemWithTriggerActive:oe,setControlledAlignItemWithTrigger:ce,scrollUpArrowRef:Y,scrollDownArrowRef:X}),[de,ve,oe,ce]);return E.jsx(gm,{elementsRef:O,labelsRef:D,onMapChange:ke,children:E.jsxs(v2.Provider,{value:Te,children:[F&&q&&E.jsx($b,{inert:qb(!H),cutout:V}),ue]})})});function x2(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 Js=1,_V={...Ka,...Mo},LV=y.forwardRef(function(t,n){const{render:a,className:s,finalFocus:i,...c}=t,{store:d,popupRef:h,onOpenChangeComplete:f,setOpen:g,valueRef:m,selectedItemTextRef:b,keyboardActiveRef:x,multiple:w,handleScrollArrowVisibility:S,scrollHandlerRef:R,highlightItemOnHover:T}=Ga(),{side:C,align:M,alignItemWithTriggerActive:O,setControlledAlignItemWithTrigger:D,scrollDownArrowRef:k,scrollUpArrowRef:A}=o0(),j=e2()!=null,B=p2(),{nonce:W,disableStyleElements:K}=VM(),I=jn(),H=Et(d,wt.id),F=Et(d,wt.open),q=Et(d,wt.mounted),_=Et(d,wt.popupProps),L=Et(d,wt.transitionStatus),P=Et(d,wt.triggerElement),V=Et(d,wt.positionerElement),Q=Et(d,wt.listElement),z=y.useRef(0),Y=y.useRef(!1),X=y.useRef(0),G=y.useRef(!1),ce=y.useRef({}),oe=ad(),de=Be(_e=>{if(!V||!h.current||!G.current)return;if(Y.current||!O){S();return}const ee=V.style.top==="0px",ue=V.style.bottom==="0px",pe=V.getBoundingClientRect().height,ke=qt(V),Te=getComputedStyle(V),be=parseFloat(Te.marginTop),we=parseFloat(Te.marginBottom),Z=zR(getComputedStyle(h.current)),Se=Math.min(ke.documentElement.clientHeight-be-we,Z),ge=_e.scrollTop,ze=UR(_e);let He=0,De=null,st=!1,xt=!1;const vt=Qe=>{V.style.height=`${Qe}px`},Je=(Qe,ft)=>{const se=So(Qe,0,Se-pe);se>0&&vt(pe+se),_e.scrollTop=ft,Se-(pe+se)<=Js&&(Y.current=!0),S()};if(ee){const Qe=ze-ge,ft=pe+Qe,se=Math.min(ft,Se);if(He=se,Qe<=Js){Je(Qe,ze);return}Se-se>Js?xt=!0:st=!0}else if(ue){const Qe=ge,ft=pe+Qe,se=Math.min(ft,Se),je=ft-Se;if(He=se,Qe<=Js){Je(Qe,0);return}Se-se>Js?De=0:(st=!0,ge<ze&&(De=ge-(Qe-je)))}if(He=Math.ceil(He),He!==0&&vt(He),xt||De!=null){const Qe=UR(_e),ft=xt?Qe:So(De,0,Qe);Math.abs(_e.scrollTop-ft)>Js&&(_e.scrollTop=ft)}(st||He>=Se-Js)&&(Y.current=!0),S()});y.useImperativeHandle(R,()=>de,[de]),No({open:F,ref:h,onComplete(){F&&(f==null||f(!0))}});const ve={open:F,transitionStatus:L,side:C,align:M};Ue(()=>{!V||!h.current||Object.keys(ce.current).length||(ce.current={top:V.style.top||"0",left:V.style.left||"0",right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[h,V]),Ue(()=>{F||O||(G.current=!1,Y.current=!1,z.current=0,X.current=0,Uh(V,ce.current))},[F,O,V,h]),Ue(()=>{const _e=h.current;if(!(!F||!P||!V||!_e||d.state.transitionStatus==="ending")){if(!O){G.current=!0,oe.request(S),_e.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{var ue;const ee=IV(_e);_e.style.removeProperty("--transform-origin");try{const pe=getComputedStyle(V),ke=getComputedStyle(_e),Te=qt(P),be=_n(V),we=P.getBoundingClientRect(),Z=V.getBoundingClientRect(),Se=we.left,ge=we.height,ze=Q||_e,He=ze.scrollHeight,De=parseFloat(ke.borderBottomWidth),st=parseFloat(pe.marginTop)||10,xt=parseFloat(pe.marginBottom)||10,vt=parseFloat(pe.minHeight)||100,Je=zR(ke),Qe=5,ft=5,se=20,je=Te.documentElement.clientHeight-st-xt,Ke=Te.documentElement.clientWidth,Me=je-we.bottom+ge,Ie=b.current,Fe=m.current;let ht,Lt=0,ct=0;if(Ie&&Fe){const Ct=Fe.getBoundingClientRect();ht=Ie.getBoundingClientRect();const $=Ct.left-Se,re=ht.left-Z.left,le=Ct.top-we.top+Ct.height/2,Ee=ht.top-Z.top+ht.height/2;Lt=$-re,ct=Ee-le}const pt=Me+ct+xt+De;let tt=Math.min(je,pt);const lt=je-st-xt,gt=pt-tt,Ye=Math.max(Qe,Se+Lt),Tt=Ke-ft,kt=Math.max(0,Ye+Z.width-Tt);V.style.left=`${Ye-kt}px`,V.style.height=`${tt}px`,V.style.maxHeight="auto",V.style.marginTop=`${st}px`,V.style.marginBottom=`${xt}px`,_e.style.height="100%";const Rt=ze.scrollHeight-ze.clientHeight,on=gt>=Rt;on&&(tt=Math.min(je,Z.height)-(gt-Rt));const Pt=we.top<se||we.bottom>je-se||tt<Math.min(He,vt),Xe=(((ue=be.visualViewport)==null?void 0:ue.scale)??1)!==1&&am;if(Pt||Xe){G.current=!0,Uh(V,ce.current),or.flushSync(()=>D(!1));return}if(on){const Ct=Math.max(0,je-pt);V.style.top=Z.height>=lt?"0":`${Ct}px`,V.style.height=`${tt}px`,ze.scrollTop=ze.scrollHeight-ze.clientHeight,z.current=Math.max(vt,tt)}else V.style.bottom="0",z.current=Math.max(vt,tt),ze.scrollTop=gt;if(ht){const Ct=Z.top,$=Z.height,re=ht.top+ht.height/2,le=$>0?(re-Ct)/$*100:50,Ee=So(le,0,100);_e.style.setProperty("--transform-origin",`50% ${Ee}%`)}(z.current===je||tt>=Je)&&(Y.current=!0),S(),setTimeout(()=>{G.current=!0})}finally{ee()}})}},[d,F,V,P,m,b,h,S,O,D,oe,k,A,Q]),y.useEffect(()=>{if(!O||!V||!F)return;const _e=_n(V);function ee(ue){g(!1,yt(dH,ue))}return _e.addEventListener("resize",ee),()=>{_e.removeEventListener("resize",ee)}},[g,O,V,F]);const xe={...Q?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":w||void 0,id:`${H}-list`},onKeyDown(_e){x.current=!0,j&&Vb.has(_e.key)&&_e.stopPropagation()},onMouseMove(){x.current=!1},onPointerLeave(_e){if(!T||x2(_e)||_e.pointerType==="touch")return;const ee=_e.currentTarget;I.start(0,()=>{d.set("activeIndex",null),ee.focus({preventScroll:!0})})},onScroll(_e){Q||de(_e.currentTarget)},...O&&{style:Q?{height:"100%"}:b2}},Ne=Nt("div",t,{ref:[n,h],state:ve,stateAttributesMapping:_V,props:[_,xe,sc(L),{className:!Q&&O?Uu.className:void 0},c]});return E.jsxs(y.Fragment,{children:[!K&&Uu.getElement(W),E.jsx(jb,{context:B,modal:!1,disabled:!q,returnFocus:i,restoreFocus:!0,children:Ne})]})});function zR(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function UR(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const HR=[["transform","none"],["scale","1"],["translate","0 0"]];function IV(e){const{style:t}=e,n={};for(const[a,s]of HR)n[a]=t.getPropertyValue(a),t.setProperty(a,s,"important");return()=>{for(const[a]of HR){const s=n[a];s?t.setProperty(a,s):t.removeProperty(a)}}}const PV=y.forwardRef(function(t,n){const{className:a,render:s,...i}=t,{store:c,scrollHandlerRef:d}=Ga(),{alignItemWithTriggerActive:h}=o0(),f=Et(c,wt.hasScrollArrows),g=Et(c,wt.openMethod),m=Et(c,wt.multiple),x={id:`${Et(c,wt.id)}-list`,role:"listbox","aria-multiselectable":m||void 0,onScroll(S){var R;(R=d.current)==null||R.call(d,S.currentTarget)},...h&&{style:b2},className:f&&g!=="touch"?Uu.className:void 0},w=Be(S=>{c.set("listElement",S)});return Nt("div",t,{ref:[n,w],props:[x,i]})}),w2=y.createContext(void 0);function s0(){const e=y.useContext(w2);if(!e)throw new Error(yn(57));return e}const zV=y.memo(y.forwardRef(function(t,n){const{render:a,className:s,value:i=null,label:c,disabled:d=!1,nativeButton:h=!1,...f}=t,g=y.useRef(null),m=Jb({label:c,textRef:g,indexGuessBehavior:HM.GuessFromOrder}),{store:b,getItemProps:x,setOpen:w,setValue:S,selectionRef:R,typingRef:T,valuesRef:C,keyboardActiveRef:M,multiple:O,highlightItemOnHover:D}=Ga(),k=jn(),A=Et(b,wt.isActive,m.index),j=Et(b,wt.isSelected,m.index,i),B=Et(b,wt.isSelectedByFocus,m.index),W=Et(b,wt.isItemEqualToValue),K=m.index,I=K!==-1,H=y.useRef(null),F=Zn(K);Ue(()=>{if(!I)return;const oe=C.current;return oe[K]=i,()=>{delete oe[K]}},[I,K,i,C]),Ue(()=>{if(!I)return;const oe=b.state.value;let de=oe;O&&Array.isArray(oe)&&oe.length>0&&(de=oe[oe.length-1]),de!==void 0&&Wl(i,de,W)&&b.set("selectedIndex",K)},[I,K,O,W,b,i]);const q={disabled:d,selected:j,highlighted:A},_=x({active:A,selected:j});_.onFocus=void 0,_.id=void 0;const L=y.useRef(null),P=y.useRef("mouse"),V=y.useRef(!1),{getButtonProps:Q,buttonRef:z}=Oo({disabled:d,focusableWhenDisabled:!0,native:h});function Y(oe){const de=b.state.value;if(O){const ve=Array.isArray(de)?de:[],xe=j?bV(ve,i,W):[...ve,i];S(xe,yt(wu,oe))}else S(i,yt(wu,oe)),w(!1,yt(wu,oe))}const X={role:"option","aria-selected":j,tabIndex:A?0:-1,onFocus(){b.set("activeIndex",K)},onMouseEnter(){!M.current&&b.state.selectedIndex===null&&D&&b.set("activeIndex",K)},onMouseMove(){D&&b.set("activeIndex",K)},onMouseLeave(oe){!D||M.current||x2(oe)||k.start(0,()=>{b.state.activeIndex===K&&b.set("activeIndex",null)})},onTouchStart(){R.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(oe){L.current=oe.key,b.set("activeIndex",K)},onClick(oe){V.current=!1,!(oe.type==="keydown"&&L.current===null)&&(d||L.current===" "&&T.current||P.current!=="touch"&&!A||(L.current=null,Y(oe.nativeEvent)))},onPointerEnter(oe){P.current=oe.pointerType},onPointerDown(oe){P.current=oe.pointerType,V.current=!0},onMouseUp(oe){if(d)return;if(V.current){V.current=!1;return}const de=!R.current.allowSelectedMouseUp&&j,ve=!R.current.allowUnselectedMouseUp&&!j;de||ve||P.current!=="touch"&&!A||Y(oe.nativeEvent)}},G=Nt("div",t,{ref:[z,n,m.ref,H],state:q,props:[_,X,f,Q]}),ce=y.useMemo(()=>({selected:j,indexRef:F,textRef:g,selectedByFocus:B,hasRegistered:I}),[j,F,g,B,I]);return E.jsx(w2.Provider,{value:ce,children:G})})),UV=y.forwardRef(function(t,n){const a=t.keepMounted??!1,{selected:s}=s0();return a||s?E.jsx(HV,{...t,ref:n}):null}),HV=y.memo(y.forwardRef((e,t)=>{const{render:n,className:a,keepMounted:s,...i}=e,{selected:c}=s0(),d=y.useRef(null),{transitionStatus:h,setMounted:f}=od(c),m=Nt("span",e,{ref:[t,d],state:{selected:c,transitionStatus:h},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:Mo});return No({open:c,ref:d,onComplete(){c||f(!1)}}),m})),BV=y.memo(y.forwardRef(function(t,n){const{indexRef:a,textRef:s,selectedByFocus:i,hasRegistered:c}=s0(),{selectedItemTextRef:d}=Ga(),{className:h,render:f,...g}=t,m=y.useCallback(x=>{if(!x||!c)return;const w=d.current===null||!d.current.isConnected;(i||w&&a.current===0)&&(d.current=x)},[d,a,i,c]);return Nt("div",t,{ref:[m,n,s],props:g})})),S2=y.forwardRef(function(t,n){const{render:a,className:s,direction:i,keepMounted:c=!1,...d}=t,{store:h,popupRef:f,listRef:g,handleScrollArrowVisibility:m,scrollArrowsMountedCountRef:b}=Ga(),{side:x,scrollDownArrowRef:w,scrollUpArrowRef:S}=o0(),R=i==="up"?wt.scrollUpArrowVisible:wt.scrollDownArrowVisible,T=Et(h,R),C=Et(h,wt.openMethod),M=T&&C!=="touch",O=jn(),D=i==="up"?S:w,{transitionStatus:k,setMounted:A}=od(M);Ue(()=>(b.current+=1,h.state.hasScrollArrows||h.set("hasScrollArrows",!0),()=>{b.current=Math.max(0,b.current-1),b.current===0&&h.state.hasScrollArrows&&h.set("hasScrollArrows",!1)}),[h,b]),No({open:M,ref:D,onComplete(){M||A(!1)}});const W=Nt("div",t,{ref:[n,D],state:{direction:i,visible:M,side:x,transitionStatus:k},props:[{"aria-hidden":!0,children:i==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(I){if(I.movementX===0&&I.movementY===0||O.isStarted())return;h.set("activeIndex",null);function H(){var P;const F=h.state.listElement??f.current;if(!F)return;h.set("activeIndex",null),m();const q=F.scrollTop===0,_=Math.round(F.scrollTop+F.clientHeight)>=F.scrollHeight;if(g.current.length===0&&(i==="up"?h.set("scrollUpArrowVisible",!q):h.set("scrollDownArrowVisible",!_)),i==="up"&&q||i==="down"&&_){O.clear();return}if((h.state.listElement||f.current)&&g.current&&g.current.length>0){const V=g.current,Q=((P=D.current)==null?void 0:P.offsetHeight)||0;if(i==="up"){let z=0;const Y=F.scrollTop+Q;for(let G=0;G<V.length;G+=1){const ce=V[G];if(ce&&ce.offsetTop>=Y){z=G;break}}const X=Math.max(0,z-1);if(X<z){const G=V[X];G&&(F.scrollTop=Math.max(0,G.offsetTop-Q))}else F.scrollTop=0}else{let z=V.length-1;const Y=F.scrollTop+F.clientHeight-Q;for(let G=0;G<V.length;G+=1){const ce=V[G];if(ce&&ce.offsetTop+ce.offsetHeight>Y){z=Math.max(0,G-1);break}}const X=Math.min(V.length-1,z+1);if(X>z){const G=V[X];G&&(F.scrollTop=G.offsetTop+G.offsetHeight-F.clientHeight+Q)}else F.scrollTop=F.scrollHeight-F.clientHeight}}O.start(40,H)}O.start(40,H)},onMouseLeave(){O.clear()}},d]});return M||c?W:null}),FV=y.forwardRef(function(t,n){return E.jsx(S2,{...t,ref:n,direction:"down"})}),VV=y.forwardRef(function(t,n){return E.jsx(S2,{...t,ref:n,direction:"up"})}),E2=y.createContext(void 0);function YV(){const e=y.useContext(E2);if(e===void 0)throw new Error(yn(56));return e}const qV=y.forwardRef(function(t,n){const{className:a,render:s,...i}=t,[c,d]=y.useState(),h=y.useMemo(()=>({labelId:c,setLabelId:d}),[c,d]),f=Nt("div",t,{ref:n,props:[{role:"group","aria-labelledby":c},i]});return E.jsx(E2.Provider,{value:h,children:f})}),$V=y.forwardRef(function(t,n){const{className:a,render:s,id:i,...c}=t,{setLabelId:d}=YV(),h=Ta(i);return Ue(()=>{d(h)},[h,d]),Nt("div",t,{ref:n,props:[{id:h},c]})}),yy=EV;function UY({className:e,...t}){return E.jsx(qV,{"data-slot":"select-group",className:Oe("scroll-my-1 p-1",e),...t})}function vy({className:e,...t}){return E.jsx(MV,{"data-slot":"select-value",className:Oe("flex flex-1 text-left",e),...t})}function by({className:e,size:t="default",children:n,...a}){return E.jsxs(CV,{"data-slot":"select-trigger","data-size":t,className:Oe("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),...a,children:[n,E.jsx(NV,{render:E.jsx(jC,{className:"text-muted-foreground size-4 pointer-events-none"})})]})}function xy({className:e,children:t,side:n="bottom",sideOffset:a=4,align:s="center",alignOffset:i=0,alignItemWithTrigger:c=!0,...d}){return E.jsx(DV,{children:E.jsx(jV,{side:n,sideOffset:a,align:s,alignOffset:i,alignItemWithTrigger:c,className:"isolate z-50",children:E.jsxs(LV,{"data-slot":"select-content","data-align-trigger":c,className:Oe("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),...d,children:[E.jsx(KV,{}),E.jsx(PV,{children:t}),E.jsx(GV,{})]})})})}function HY({className:e,...t}){return E.jsx($V,{"data-slot":"select-label",className:Oe("text-muted-foreground px-1.5 py-1 text-xs",e),...t})}function ei({className:e,children:t,...n}){return E.jsxs(zV,{"data-slot":"select-item",className:Oe("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:[E.jsx(BV,{className:"flex flex-1 gap-2 shrink-0 whitespace-nowrap",children:t}),E.jsx(UV,{render:E.jsx("span",{className:"pointer-events-none absolute right-2 flex size-4 items-center justify-center"}),children:E.jsx(Xz,{className:"pointer-events-none"})})]})}function KV({className:e,...t}){return E.jsx(VV,{"data-slot":"select-scroll-up-button",className:Oe("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:E.jsx(Jz,{})})}function GV({className:e,...t}){return E.jsx(FV,{"data-slot":"select-scroll-down-button",className:Oe("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:E.jsx(jC,{})})}function XV({className:e,...t}){return E.jsx("textarea",{"data-slot":"textarea",className:Oe("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})}const WV=["match","unchanged","llm"],wy="__default__";function BR(e){return e==="llm"?30:5}function QV({deviceId:e,paneId:t,rule:n,onSaved:a,onCancel:s}){var we;const{t:i}=yr(),c=y.useId(),[d,h]=y.useState((n==null?void 0:n.name)??""),[f,g]=y.useState((n==null?void 0:n.triggerType)??"match"),[m,b]=y.useState((n==null?void 0:n.pattern)??""),[x,w]=y.useState((n==null?void 0:n.patternFlags)??""),[S,R]=y.useState((n==null?void 0:n.extractGroup)??0),[T,C]=y.useState((n==null?void 0:n.unchangedMinutes)??10),[M,O]=y.useState((n==null?void 0:n.noMatchBehavior)??"reset"),[D,k]=y.useState((n==null?void 0:n.conditionPrompt)??""),[A,j]=y.useState((n==null?void 0:n.providerId)??null),[B,W]=y.useState((n==null?void 0:n.modelId)??""),[K,I]=y.useState((n==null?void 0:n.confirmWithLlm)??!1),[H,F]=y.useState((n==null?void 0:n.summarizeWithLlm)??!1),[q,_]=y.useState((n==null?void 0:n.intervalSeconds)??30),[L,P]=y.useState((n==null?void 0:n.fireMode)??"once"),[V,Q]=y.useState((n==null?void 0:n.cooldownSeconds)??600),[z,Y]=y.useState(""),[X,G]=y.useState(null),oe=((we=Qu({queryKey:["llm-providers"],queryFn:async()=>{const Z=await fetch("/api/llm/providers");if(!Z.ok)throw new Error("Failed to load providers");return await Z.json()},throwOnError:!1}).data)==null?void 0:we.providers)??[],de=oe.filter(Z=>Z.enabled),ve=oe.find(Z=>Z.id===A),xe=(ve==null?void 0:ve.models)??[],Ne=f==="match"||f==="unchanged",_e=f==="llm"||K||H,ee=BR(f),ue=Z=>{g(Z);const Se=BR(Z);_(ge=>ge<Se?Z==="llm"?60:30:ge)},pe=()=>{if(!d.trim())return i("watch.validation.nameRequired");if(Ne){if(!m)return i("watch.validation.patternRequired");try{new RegExp(m,x.replace(/g/g,""))}catch(Z){return i("watch.validation.patternInvalid",{detail:Z instanceof Error?Z.message:String(Z)})}if(f==="unchanged"&&(!T||T<=0))return i("watch.validation.unchangedMinutesInvalid")}else if(!D.trim())return i("watch.validation.conditionPromptRequired");return!Number.isInteger(q)||q<ee?i("watch.validation.intervalMin",{min:ee}):null},ke=Au({mutationFn:async()=>{const Z={name:d.trim(),triggerType:f,pattern:Ne?m:null,patternFlags:Ne?x:"",extractGroup:S,conditionPrompt:f==="llm"?D:null,providerId:A,modelId:A&&B.trim()||null,confirmWithLlm:Ne?K:!1,summarizeWithLlm:Ne?H:!1,intervalSeconds:q,unchangedMinutes:f==="unchanged"?T:null,noMatchBehavior:M,fireMode:L,cooldownSeconds:V};if(n){const ge=Z;return await d2(n.id,ge),!1}const Se={...Z,deviceId:e,paneId:t,enabled:!0};return await mV(Se),!0},onSuccess:Z=>{dn.success(i(Z?"watch.toast.created":"watch.toast.updated")),a(Z)},onError:Z=>{dn.error(Z instanceof Error?Z.message:String(Z))}}),Te=Au({mutationFn:async()=>gV({description:z.trim(),deviceId:e,paneId:t,providerId:A,modelId:A&&B.trim()||null}),onSuccess:Z=>{b(Z.pattern),w(Z.flags),R(Z.extractGroup),G(Z)},onError:Z=>{dn.error(Z instanceof Error?Z.message:String(Z))}}),be=()=>{const Z=pe();if(Z){dn.error(Z);return}ke.mutate()};return E.jsxs("form",{"data-testid":"watch-rule-form",className:"space-y-4",onSubmit:Z=>{Z.preventDefault(),be()},children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-name`,children:i("watch.form.name")}),E.jsx(va,{id:`${c}-name`,"data-testid":"watch-form-name",value:d,maxLength:120,onChange:Z=>h(Z.target.value),placeholder:i("watch.form.namePlaceholder")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:i("watch.form.triggerType")}),E.jsx("div",{className:"grid gap-2",children:WV.map(Z=>E.jsxs("button",{type:"button","data-testid":`watch-form-type-${Z}`,onClick:()=>ue(Z),className:Oe("rounded-lg border px-3 py-2 text-left transition-colors",f===Z?"border-primary/50 bg-primary/10":"border-border hover:bg-accent/40"),children:[E.jsx("span",{className:"block text-sm font-medium",children:i(`watch.type.${Z}`)}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:i(`watch.typeDesc.${Z}`)})]},Z))})]}),Ne&&E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"space-y-2 rounded-lg border border-dashed border-border p-3",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-assist`,children:i("watch.form.assistLabel")}),E.jsxs("div",{className:"flex gap-2",children:[E.jsx(va,{id:`${c}-assist`,"data-testid":"watch-form-assist-input",value:z,onChange:Z=>Y(Z.target.value),placeholder:i("watch.form.assistPlaceholder")}),E.jsxs(Cn,{type:"button",variant:"secondary","data-testid":"watch-form-assist-generate",disabled:!z.trim()||Te.isPending,onClick:()=>Te.mutate(),children:[Te.isPending?E.jsx(Yl,{className:"h-4 w-4 animate-spin"}):E.jsx(_3,{className:"h-4 w-4"}),i("watch.form.assistButton")]})]}),X&&E.jsxs("div",{className:"space-y-1 text-xs","data-testid":"watch-form-assist-result",children:[E.jsxs("p",{className:"text-muted-foreground",children:[E.jsxs("span",{className:"font-medium text-foreground",children:[i("watch.form.assistExplanation"),":"]})," ",X.explanation]}),E.jsxs("p",{className:"font-medium text-foreground",children:[i("watch.form.assistPreview"),":"]}),X.preview.length===0?E.jsx("p",{className:"text-muted-foreground",children:i("watch.form.assistPreviewEmpty")}):E.jsx("ul",{className:"max-h-24 space-y-0.5 overflow-y-auto",children:X.preview.map((Z,Se)=>E.jsx("li",{className:"truncate rounded bg-muted px-1.5 py-0.5 font-mono",children:Z},Se))})]})]}),E.jsxs("div",{className:"grid grid-cols-[1fr_5rem] gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-pattern`,children:i("watch.form.pattern")}),E.jsx(va,{id:`${c}-pattern`,"data-testid":"watch-form-pattern",value:m,onChange:Z=>b(Z.target.value),placeholder:i("watch.form.patternPlaceholder"),className:"font-mono"})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-flags`,children:i("watch.form.flags")}),E.jsx(va,{id:`${c}-flags`,"data-testid":"watch-form-flags",value:x,onChange:Z=>w(Z.target.value),placeholder:i("watch.form.flagsPlaceholder"),className:"font-mono"})]})]})]}),f==="unchanged"&&E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-extract-group`,children:i("watch.form.extractGroup")}),E.jsx(va,{id:`${c}-extract-group`,"data-testid":"watch-form-extract-group",type:"number",min:0,step:1,value:S,onChange:Z=>R(Math.max(0,Number(Z.target.value)||0))}),E.jsx("p",{className:"text-xs text-muted-foreground",children:i("watch.form.extractGroupHint")})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-unchanged-minutes`,children:i("watch.form.unchangedMinutes")}),E.jsx(va,{id:`${c}-unchanged-minutes`,"data-testid":"watch-form-unchanged-minutes",type:"number",min:1,step:1,value:T,onChange:Z=>C(Math.max(1,Number(Z.target.value)||1))})]}),E.jsxs("div",{className:"col-span-2 space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:i("watch.form.noMatchBehavior")}),E.jsxs(yy,{value:M,onValueChange:Z=>{(Z==="reset"||Z==="ignore")&&O(Z)},children:[E.jsx(by,{className:"w-full","data-testid":"watch-form-no-match-behavior",children:E.jsx(vy,{children:i(M==="reset"?"watch.form.noMatchReset":"watch.form.noMatchIgnore")})}),E.jsxs(xy,{children:[E.jsx(ei,{value:"reset",children:i("watch.form.noMatchReset")}),E.jsx(ei,{value:"ignore",children:i("watch.form.noMatchIgnore")})]})]})]})]}),f==="llm"&&E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-condition`,children:i("watch.form.conditionPrompt")}),E.jsx(XV,{id:`${c}-condition`,"data-testid":"watch-form-condition-prompt",value:D,onChange:Z=>k(Z.target.value),placeholder:i("watch.form.conditionPromptPlaceholder"),rows:3})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:i("watch.form.model")}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs(yy,{value:A??wy,onValueChange:Z=>{if(!Z)return;const Se=Z===wy?null:Z;j(Se),Se===null&&W("")},children:[E.jsx(by,{className:"w-full","data-testid":"watch-form-provider",children:E.jsx(vy,{children:A?(ve==null?void 0:ve.name)??i("watch.form.providerUnavailable"):i("watch.form.followGlobalDefault")})}),E.jsxs(xy,{children:[E.jsx(ei,{value:wy,children:i("watch.form.followGlobalDefault")}),A&&!de.some(Z=>Z.id===A)&&E.jsx(ei,{value:A,children:ve?`${ve.name} (${i("watch.form.providerDisabled")})`:i("watch.form.providerUnavailable")}),de.map(Z=>E.jsx(ei,{value:Z.id,children:Z.name},Z.id))]})]}),E.jsx(va,{"data-testid":"watch-form-model",list:`${c}-model-options`,value:B,disabled:!A,onChange:Z=>W(Z.target.value),placeholder:i("watch.form.modelPlaceholder")}),E.jsx("datalist",{id:`${c}-model-options`,children:xe.map(Z=>E.jsx("option",{value:Z},Z))})]}),_e&&E.jsx("p",{className:"rounded-md bg-primary/10 px-2 py-1.5 text-xs text-primary","data-testid":"watch-form-model-hint",children:i("watch.form.modelRequiredHint")})]}),Ne&&E.jsxs("div",{className:"space-y-3",children:[E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:i("watch.form.confirmWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:i("watch.form.confirmWithLlmDesc")})]}),E.jsx(Dv,{checked:K,onCheckedChange:Z=>I(!!Z),"data-testid":"watch-form-confirm-llm"})]}),E.jsxs("div",{className:"flex items-center justify-between gap-2",children:[E.jsxs("div",{children:[E.jsx("span",{className:"block text-sm font-medium",children:i("watch.form.summarizeWithLlm")}),E.jsx("span",{className:"block text-xs text-muted-foreground",children:i("watch.form.summarizeWithLlmDesc")})]}),E.jsx(Dv,{checked:H,onCheckedChange:Z=>F(!!Z),"data-testid":"watch-form-summarize-llm"})]})]}),E.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[E.jsxs("div",{className:"space-y-2",children:[E.jsx("label",{className:"block text-sm font-medium",htmlFor:`${c}-interval`,children:i("watch.form.intervalSeconds")}),E.jsx(va,{id:`${c}-interval`,"data-testid":"watch-form-interval",type:"number",min:ee,step:1,value:q,onChange:Z=>_(Number(Z.target.value)||0)}),E.jsx("p",{className:"text-xs text-muted-foreground",children:i("watch.form.intervalHint",{min:ee})})]}),E.jsxs("div",{className:"space-y-2",children:[E.jsx("span",{className:"block text-sm font-medium",children:i("watch.form.fireMode")}),E.jsxs(yy,{value:L,onValueChange:Z=>{(Z==="once"||Z==="repeat")&&P(Z)},children:[E.jsx(by,{className:"w-full","data-testid":"watch-form-fire-mode",children:E.jsx(vy,{children:i(L==="once"?"watch.form.fireOnce":"watch.form.fireRepeat")})}),E.jsxs(xy,{children:[E.jsx(ei,{value:"once",children:i("watch.form.fireOnce")}),E.jsx(ei,{value:"repeat",children:i("watch.form.fireRepeat")})]})]}),L==="repeat"&&E.jsx(va,{"data-testid":"watch-form-cooldown",type:"number",min:0,step:1,value:V,onChange:Z=>Q(Math.max(0,Number(Z.target.value)||0)),"aria-label":i("watch.form.cooldownSeconds"),placeholder:i("watch.form.cooldownSeconds")})]})]}),E.jsxs("div",{className:"flex justify-end gap-2",children:[E.jsx(Cn,{type:"button",variant:"outline",onClick:s,"data-testid":"watch-form-cancel",children:i("common.cancel")}),E.jsxs(Cn,{type:"submit",disabled:ke.isPending,"data-testid":"watch-form-save",children:[ke.isPending&&E.jsx(Yl,{className:"h-4 w-4 animate-spin"}),i(n?"watch.form.save":"watch.form.create")]})]})]})}function pu(e){if(!e)return null;const t=new Date(e);return Number.isNaN(t.getTime())?null:t.toLocaleString()}function ZV({open:e,onOpenChange:t,deviceId:n,paneId:a}){const{t:s}=yr(),i=Wu(),[c,d]=y.useState({mode:"list"}),[h,f]=y.useState(null),[g,m]=y.useState(!1);y.useEffect(()=>{e||(d({mode:"list"}),f(null),m(!1))},[e]);const b=Qu({queryKey:fV(n,a),queryFn:()=>hV(n,a),enabled:e,throwOnError:!1}),x=()=>{i.invalidateQueries({queryKey:["watch-rules"]})},w=Au({mutationFn:async({rule:C,enabled:M})=>{await d2(C.id,{enabled:M})},onSuccess:x,onError:C=>{dn.error(C instanceof Error?C.message:String(C)),x()}}),S=Au({mutationFn:async C=>{await pV(C.id)},onSuccess:()=>{dn.success(s("watch.toast.deleted")),x()},onError:C=>{dn.error(C instanceof Error?C.message:String(C))}}),R=C=>{x(),d({mode:"list"}),C&&typeof Notification<"u"&&Notification.permission==="default"&&m(!0)},T=b.data??[];return E.jsxs(E.Fragment,{children:[E.jsx(Ov,{open:e,onOpenChange:t,children:E.jsxs(Mv,{className:"sm:max-w-lg max-h-[85dvh] grid-rows-[auto_minmax(0,1fr)]","data-testid":"watch-dialog",children:[E.jsxs(Nv,{children:[E.jsxs(Av,{children:[c.mode==="list"&&s("watch.title"),c.mode==="form"&&(c.rule?s("watch.form.editTitle"):s("watch.form.createTitle")),c.mode==="state"&&s("watch.state.title")]}),E.jsx(WM,{children:c.mode==="list"?s("watch.dialogDesc"):null})]}),E.jsxs("div",{className:"min-h-0 overflow-y-auto pr-1",children:[c.mode==="list"&&E.jsxs("div",{className:"space-y-3",children:[g&&E.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:[E.jsx($z,{className:"mt-0.5 h-4 w-4 shrink-0 text-primary"}),E.jsxs("div",{className:"min-w-0 flex-1",children:[E.jsx("p",{className:"text-sm font-medium",children:s("watch.notifPermission.title")}),E.jsx("p",{className:"text-xs text-muted-foreground",children:s("watch.notifPermission.desc")}),E.jsxs("div",{className:"mt-2 flex gap-2",children:[E.jsx(Cn,{size:"sm","data-testid":"watch-notif-enable",onClick:()=>{Notification.requestPermission().finally(()=>m(!1))},children:s("watch.notifPermission.enable")}),E.jsx(Cn,{size:"sm",variant:"ghost",onClick:()=>m(!1),children:s("watch.notifPermission.dismiss")})]})]})]}),b.isLoading&&E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(Yl,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!b.isLoading&&T.length===0&&E.jsx("p",{className:"py-6 text-center text-sm text-muted-foreground","data-testid":"watch-rules-empty",children:s("watch.rules.empty")}),T.map(C=>E.jsx(JV,{rule:C,onToggle:M=>w.mutate({rule:C,enabled:M}),onEdit:()=>d({mode:"form",rule:C}),onViewState:()=>d({mode:"state",rule:C}),onDelete:()=>f(C)},C.id)),E.jsxs(Cn,{variant:"outline",className:"w-full","data-testid":"watch-rule-add",onClick:()=>d({mode:"form",rule:null}),children:[E.jsx(Xh,{className:"h-4 w-4"}),s("watch.rules.addRule")]})]}),c.mode==="form"&&E.jsx(QV,{deviceId:n,paneId:a,rule:c.rule,onSaved:R,onCancel:()=>d({mode:"list"})}),c.mode==="state"&&E.jsx(e9,{rule:c.rule,onBack:()=>d({mode:"list"})})]})]})}),E.jsx(bv,{open:h!==null,onOpenChange:C=>!C&&f(null),children:E.jsxs(xv,{"data-testid":"watch-rule-delete-dialog",children:[E.jsxs(wv,{children:[E.jsx(Ev,{children:s("watch.rules.deleteTitle")}),E.jsx(Rv,{children:s("watch.rules.deleteDesc",{name:(h==null?void 0:h.name)??""})})]}),E.jsxs(Sv,{children:[E.jsx(Cv,{children:s("common.cancel")}),E.jsx(Tv,{variant:"destructive","data-testid":"watch-rule-delete-confirm",onClick:()=>{h&&S.mutate(h),f(null)},children:s("watch.rules.deleteConfirm")})]})]})})]})}function JV({rule:e,onToggle:t,onEdit:n,onViewState:a,onDelete:s}){var h,f;const{t:i}=yr(),c=Qu({queryKey:u2(e.id),queryFn:()=>f2(e.id),throwOnError:!1}),d=pu((f=(h=c.data)==null?void 0:h.state)==null?void 0:f.lastTriggeredAt);return E.jsxs("div",{className:"rounded-lg border border-border p-3","data-testid":`watch-rule-item-${e.id}`,"data-rule-name":e.name,children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(zu,{variant:"secondary",children:i(`watch.type.${e.triggerType}`)}),E.jsx(Dv,{checked:e.enabled,onCheckedChange:g=>t(!!g),"data-testid":`watch-rule-toggle-${e.id}`})]}),E.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[E.jsx("span",{className:"truncate text-xs text-muted-foreground",children:d?i("watch.rules.lastTriggered",{time:d}):i("watch.rules.neverTriggered")}),E.jsxs("div",{className:"flex shrink-0 gap-1",children:[E.jsx(Cn,{variant:"ghost",size:"icon-xs",onClick:a,title:i("watch.rules.viewState"),"aria-label":i("watch.rules.viewState"),"data-testid":`watch-rule-state-${e.id}`,children:E.jsx(Fz,{className:"h-3.5 w-3.5"})}),E.jsx(Cn,{variant:"ghost",size:"icon-xs",onClick:n,title:i("watch.rules.edit"),"aria-label":i("watch.rules.edit"),"data-testid":`watch-rule-edit-${e.id}`,children:E.jsx(Gh,{className:"h-3.5 w-3.5"})}),E.jsx(Cn,{variant:"ghost",size:"icon-xs",onClick:s,title:i("watch.rules.delete"),"aria-label":i("watch.rules.delete"),"data-testid":`watch-rule-delete-${e.id}`,children:E.jsx(FC,{className:"h-3.5 w-3.5 text-destructive"})})]})]})]})}function e9({rule:e,onBack:t}){var h,f;const{t:n}=yr(),a=Qu({queryKey:u2(e.id),queryFn:()=>f2(e.id),refetchInterval:5e3,throwOnError:!1}),s=((h=a.data)==null?void 0:h.state)??null,i=((f=a.data)==null?void 0:f.samples)??[],c=n("watch.state.none"),d=[{label:n("watch.state.lastSampledAt"),value:pu(s==null?void 0:s.lastSampledAt)??c},{label:n("watch.state.lastValue"),value:(s==null?void 0:s.lastValue)??c},{label:n("watch.state.lastValueChangedAt"),value:pu(s==null?void 0:s.lastValueChangedAt)??c},{label:n("watch.state.lastTriggeredAt"),value:pu(s==null?void 0:s.lastTriggeredAt)??c},{label:n("watch.state.consecutiveErrors"),value:s?String(s.consecutiveErrors):c},{label:n("watch.state.lastError"),value:(s==null?void 0:s.lastError)??c}];return E.jsxs("div",{className:"space-y-3","data-testid":"watch-rule-state-view",children:[E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx(Cn,{variant:"ghost",size:"icon-sm",onClick:t,"aria-label":n("watch.state.back"),children:E.jsx(Yz,{className:"h-4 w-4"})}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:e.name}),E.jsx(zu,{variant:"secondary",children:n(`watch.type.${e.triggerType}`)})]}),a.isLoading?E.jsx("div",{className:"flex justify-center py-6",children:E.jsx(Yl,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):E.jsxs(E.Fragment,{children:[E.jsx("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 text-sm",children:d.map(g=>E.jsxs("div",{className:"contents",children:[E.jsx("dt",{className:"text-muted-foreground",children:g.label}),E.jsx("dd",{className:"min-w-0 break-all",children:g.value})]},g.label))}),E.jsxs("div",{className:"space-y-1.5",children:[E.jsx("p",{className:"text-sm font-medium",children:n("watch.state.samples")}),i.length===0?E.jsx("p",{className:"text-xs text-muted-foreground",children:n("watch.state.samplesEmpty")}):E.jsx("ul",{className:"max-h-48 space-y-0.5 overflow-y-auto text-xs",children:[...i].reverse().map(g=>E.jsxs("li",{className:"flex items-center gap-2 rounded bg-muted/60 px-2 py-1",children:[E.jsx("span",{className:"shrink-0 font-mono text-muted-foreground",children:pu(g.at)??g.at}),E.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:g.value??c}),g.hit&&E.jsx(zu,{variant:"default",className:"h-4 px-1 text-[10px]",children:n("watch.state.hit")})]},g.at))})]})]})]})}function gu(){return{texts:[],reasonings:[],toolCalls:[],staleBarrier:!1}}function Ml(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function R2(e){if(Ml(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 T2(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>Ml(t)&&typeof t.text=="string"?t.text:"").filter(Boolean).join(`
310
+ `):""}function t9(e){const t=[],n=new Map;for(const a of e){const s=Ml(a.content)?a.content:null;if(!s)continue;const i=s.content;switch(a.role){case"user":{const c=T2(i);c&&t.push({kind:"user",key:`m${a.seq}`,text:c});break}case"assistant":{if(typeof i=="string"){i&&t.push({kind:"assistant-text",key:`m${a.seq}`,text:i,streaming:!1});break}if(!Array.isArray(i))break;i.forEach((c,d)=>{if(!Ml(c))return;const h=`m${a.seq}p${d}`;if(c.type==="text"&&typeof c.text=="string"&&c.text){t.push({kind:"assistant-text",key:h,text:c.text,streaming:!1});return}if(c.type==="reasoning"&&typeof c.text=="string"&&c.text){t.push({kind:"reasoning",key:h,text:c.text,streaming:!1});return}if(c.type==="tool-call"&&typeof c.toolCallId=="string"){const f={toolCallId:c.toolCallId,toolName:typeof c.toolName=="string"?c.toolName:"unknown",input:c.input,isError:!1,denied:!1,resolved:!1};n.set(f.toolCallId,f),t.push({kind:"tool-call",key:h,call:f})}});break}case"tool":{if(!Array.isArray(i))break;for(const c of i){if(!Ml(c)||c.type!=="tool-result")continue;const d=typeof c.toolCallId=="string"?c.toolCallId:"",h=n.get(d),{value:f,isError:g,denied:m}=R2(c.output);h&&(h.output=f,h.isError=g,h.denied=m,h.resolved=!0)}break}}}return{blocks:t,toolBlocksById:n}}function BY(e,t){const{blocks:n,toolBlocksById:a}=t9(e??[]);if(!t)return n;for(const s of t.toolCalls){const i=a.get(s.toolCallId);if(i){!i.resolved&&s.resolved&&(i.output=s.output,i.isError=s.isError,i.denied=s.denied,i.resolved=!0);continue}n.push({kind:"tool-call",key:`live-tool-${s.toolCallId}`,call:s})}for(const s of t.reasonings)s.text&&n.push({kind:"reasoning",key:`live-reasoning-${s.messageId}`,text:s.text,streaming:!0});for(const s of t.texts)s.text&&n.push({kind:"assistant-text",key:`live-text-${s.messageId}`,text:s.text,streaming:!0});return n}function jv(e){return!e||e.length===0?-1:e[e.length-1].seq}function FY(e){if(!e)return null;for(let t=e.length-1;t>=0;t--){const n=e[t];if(n.role!=="user")continue;const a=Ml(n.content)?n.content:null,s=a?T2(a.content):"";if(s)return s}return null}async function hr(e,t){try{return(await e.json()).error??t}catch{return t}}function cu(e){return Object.values(e).filter(t=>!!t).sort((t,n)=>t.updatedAt<n.updatedAt?1:-1).map(t=>t.id)}function FR(e,t){if(!e||e.length===0)return[...t].sort((a,s)=>a.seq-s.seq);const n=new Map;for(const a of e)n.set(a.seq,a);for(const a of t)n.set(a.seq,a);return[...n.values()].sort((a,s)=>a.seq-s.seq)}let VR=!1;const ns=new Set,n9=40,gi=new Map;let uu=null;const r9=120,Tu=new Map,Sy=new Set,_v=new Set;function a9(e){const t=Tu.get(e);t&&(clearTimeout(t),Tu.delete(e)),gi.delete(e),_v.delete(e)}function Lv(e){const t=pz(e);nn().send(t.kind,t.payload)}function YR(e){const t=gz(e);nn().send(t.kind,t.payload)}function qR(e,t,n,a){let s=gi.get(e);s||(s={texts:new Map,reasonings:new Map},gi.set(e,s));const i=s[t];i.set(n,(i.get(n)??"")+a)}function o9(e){const t=()=>{if(uu&&(clearTimeout(uu),uu=null),gi.size===0)return;const a=new Map(gi);gi.clear(),e(s=>{const i={...s.inProgress};for(const[c,d]of a){const h=i[c]??gu(),f={...h,texts:[...h.texts],reasonings:[...h.reasonings]};for(const g of["texts","reasonings"])for(const[m,b]of d[g]){const x=f[g],w=x.findIndex(S=>S.messageId===m);w>=0?x[w]={...x[w],text:x[w].text+b}:x.push({messageId:m,text:b,stale:!1})}i[c]=f}return{inProgress:i}})};return{flush:t,schedule:()=>{uu||(uu=setTimeout(t,n9))}}}function s9(e,t){if(VR)return;VR=!0;const n=nn(),a=o9(e),s=R=>{Tu.get(R)||Tu.set(R,setTimeout(()=>{Tu.delete(R),t().loadHistory(R)},r9))},i=(R,T)=>{gi.delete(R),e(M=>{const O=M.sessions[R],D=gu();return T.inProgressText&&D.texts.push({messageId:"__sync__",text:T.inProgressText,stale:!1}),T.inProgressReasoning&&D.reasonings.push({messageId:"__sync_reasoning__",text:T.inProgressReasoning,stale:!1}),{sessions:O?{...M.sessions,[R]:{...O,status:T.status,lastError:T.lastError}}:M.sessions,inProgress:{...M.inProgress,[R]:D},pendingConfirmations:{...M.pendingConfirmations,[R]:T.pendingConfirmations.map(k=>({id:k.confirmationId,toolCallId:k.toolCallId,toolName:k.toolName,input:k.input,createdAt:k.createdAt}))},queued:{...M.queued,[R]:T.queuedMessages.map(k=>({id:k.id,sessionId:R,seq:k.seq,text:k.text,createdAt:k.createdAt}))}}});const C=t();(T.lastMessageSeq>jv(C.messages[R])||!C.historyLoaded[R])&&C.loadHistory(R)},c=(R,T)=>{const C=!!t().sessions[R];if(e(M=>{const O=M.sessions[R];return O?{sessions:{...M.sessions,[R]:{...O,status:T.status,lastError:T.lastError!==void 0?T.lastError:O.lastError}}}:M}),!C){t().loadSessions();return}t().refreshSession(R)},d=(R,T)=>{a.flush(),e(C=>{const M=C.inProgress[R]??gu(),O=[...M.toolCalls],D=O.findIndex(A=>A.toolCallId===T.toolCallId),k={toolCallId:T.toolCallId,toolName:T.toolName,input:T.input,isError:!1,denied:!1,resolved:!1,stale:!1};return D>=0?O[D]={...O[D],...k}:O.push(k),{inProgress:{...C.inProgress,[R]:{...M,toolCalls:O}}}})},h=(R,T)=>{a.flush();const{value:C,isError:M,denied:O}=R2(T.output);e(D=>{const k=D.inProgress[R]??gu(),A=[...k.toolCalls],j=A.findIndex(B=>B.toolCallId===T.toolCallId);return j>=0?A[j]={...A[j],output:C,isError:!!T.isError||M,denied:O,resolved:!0}:A.push({toolCallId:T.toolCallId,toolName:T.toolName,input:void 0,output:C,isError:!!T.isError||M,denied:O,resolved:!0,stale:k.staleBarrier}),{inProgress:{...D.inProgress,[R]:{...k,toolCalls:A}}}})},f=(R,T)=>{e(C=>{const M=C.pendingConfirmations[R]??[];return M.some(O=>O.id===T.confirmationId)?C:{pendingConfirmations:{...C.pendingConfirmations,[R]:[...M,{id:T.confirmationId,toolCallId:T.toolCallId,toolName:T.toolName,input:T.input,createdAt:new Date().toISOString()}]}}})},g=(R,T)=>{e(C=>{const M=C.pendingConfirmations[R];return!M||!M.some(O=>O.id===T.confirmationId)?C:{pendingConfirmations:{...C.pendingConfirmations,[R]:M.filter(O=>O.id!==T.confirmationId)}}})},m=(R,T)=>{a.flush(),(T.role==="assistant"||T.role==="tool")&&e(C=>{const M=C.inProgress[R];return M?{inProgress:{...C.inProgress,[R]:{texts:M.texts.map(O=>({...O,stale:!0})),reasonings:M.reasonings.map(O=>({...O,stale:!0})),toolCalls:M.toolCalls.map(O=>O.resolved?{...O,stale:!0}:O),staleBarrier:!0}}}:C}),s(R)},b=(R,T)=>{a.flush(),e(C=>{const M=C.sessions[R];return{sessions:M?{...C.sessions,[R]:{...M,status:T.sessionStatus}}:C.sessions,inProgress:{...C.inProgress,[R]:gu()}}}),T.lastMessageSeq>jv(t().messages[R])&&s(R)},x=(R,T)=>{const C=t().sessions[R];dn.error($t.t("agent.toast.errorTitle",{title:(C==null?void 0:C.title)??"Agent"}),{description:T.message})},w=(R,T)=>{dn.warning($t.t("agent.toast.credentialWarningTitle"),{description:$t.t("agent.toast.credentialWarningDescription",{types:T.types.join(", ")}),duration:1e4})},S=(R,T)=>{e(C=>({queued:{...C.queued,[R]:T.queued.map(M=>({id:M.id,sessionId:R,seq:M.seq,text:M.text,createdAt:M.createdAt}))}}))};n.onMessage(R=>{if(R.kind!==Gk)return;let T;try{T=Da(d_,R.payload)}catch(O){console.error("[agent] failed to decode AGENT_EVENT:",O);return}let C;try{C=JSON.parse(new TextDecoder().decode(T.payload))}catch(O){console.error("[agent] failed to parse AGENT_EVENT payload:",O);return}const M=T.sessionId;switch(T.eventType){case Wk:i(M,C);return;case Qk:c(M,C);return;case Zk:{const O=C;qR(M,"texts",O.messageId,O.delta),a.schedule();return}case Jk:{const O=C;qR(M,"reasonings",O.messageId,O.delta),a.schedule();return}case ej:d(M,C);return;case tj:h(M,C);return;case nj:f(M,C);return;case rj:g(M,C);return;case aj:m(M,C);return;case oj:x(M,C);return;case sj:b(M,C);return;case ij:w(M,C);return;case lj:S(M,C);return;default:return}}),n.onStateChange(R=>{if(R!=="READY")return;for(const C of ns)Lv(C);const T=t().activeSessionId;T&&t().loadHistory(T)})}const ti=Kh()(AC((e,t)=>({sessions:{},sessionOrder:[],sessionsLoaded:!1,activeSessionId:null,messages:{},historyLoaded:{},inProgress:{},pendingConfirmations:{},queued:{},sending:{},draft:null,defaultWriteMode:"confirm",ensureInitialized(){s9(e,t),nn().connect();const n=t().activeSessionId;n&&!ns.has(n)&&(ns.add(n),Lv(n))},async loadSessions(){try{const n=await fetch("/api/agent/sessions");if(!n.ok)throw new Error(await hr(n,"Failed to load agent sessions"));const a=await n.json();e(()=>{const i={};for(const c of a.sessions)i[c.id]=c;return{sessions:i,sessionOrder:cu(i),sessionsLoaded:!0}});const s=t();s.activeSessionId&&!s.sessions[s.activeSessionId]&&s.setActiveSession(null)}catch(n){console.error("[agent] loadSessions failed:",n)}},async refreshSession(n){try{const a=await fetch(`/api/agent/sessions/${n}`);if(a.status===404){await t().loadSessions();return}if(!a.ok)throw new Error(await hr(a,"Failed to load agent session"));const s=await a.json();e(i=>{const c={...i.sessions,[n]:s.session};return{sessions:c,sessionOrder:cu(c)}})}catch(a){console.error("[agent] refreshSession failed:",a)}},setActiveSession(n){const a=t().activeSessionId;a!==n&&(a&&ns.has(a)&&(ns.delete(a),YR(a)),e({activeSessionId:n,draft:null}),n&&(ns.add(n),Lv(n),t().historyLoaded[n]||t().loadHistory(n)))},async createSession(n,a,s){try{const i=await fetch("/api/agent/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceId:n,paneId:a,...(s==null?void 0:s.providerId)!==void 0?{providerId:s.providerId}:{},...(s==null?void 0:s.modelId)!==void 0&&s.modelId!==null?{modelId:s.modelId}:{},...(s==null?void 0:s.providerHostedTools)!==void 0?{providerHostedTools:s.providerHostedTools}:{},...(s==null?void 0:s.originPaneTitle)!==void 0?{originPaneTitle:s.originPaneTitle}:{},writeMode:(s==null?void 0:s.writeMode)??t().defaultWriteMode})});if(!i.ok)throw new Error(await hr(i,"Failed to create agent session"));const d=(await i.json()).session;return e(h=>{const f={...h.sessions,[d.id]:d};return{sessions:f,sessionOrder:cu(f),messages:{...h.messages,[d.id]:[]},historyLoaded:{...h.historyLoaded,[d.id]:!0}}}),t().setActiveSession(d.id),d}catch(i){return dn.error(i instanceof Error?i.message:String(i)),null}},async renameSession(n,a){try{const s=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:a})});if(!s.ok)throw new Error(await hr(s,"Failed to rename agent session"));const i=await s.json();return e(c=>{const d={...c.sessions,[n]:i.session};return{sessions:d,sessionOrder:cu(d)}}),!0}catch(s){return dn.error(s instanceof Error?s.message:String(s)),!1}},async deleteSession(n){try{const a=await fetch(`/api/agent/sessions/${n}`,{method:"DELETE"});if(!a.ok)throw new Error(await hr(a,"Failed to delete agent session"));return t().activeSessionId===n&&t().setActiveSession(null),a9(n),e(s=>{const i={...s.sessions};delete i[n];const c={...s.messages};delete c[n];const d={...s.historyLoaded};delete d[n];const h={...s.inProgress};delete h[n];const f={...s.pendingConfirmations};delete f[n];const g={...s.queued};return delete g[n],{sessions:i,sessionOrder:cu(i),messages:c,historyLoaded:d,inProgress:h,pendingConfirmations:f,queued:g}}),!0}catch(a){return dn.error(a instanceof Error?a.message:String(a)),!1}},async setWriteMode(n,a){try{const s=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({writeMode:a})});if(!s.ok)throw new Error(await hr(s,"Failed to update write mode"));const i=await s.json();e(c=>({sessions:{...c.sessions,[n]:i.session}}))}catch(s){dn.error(s instanceof Error?s.message:String(s))}},setDefaultWriteMode(n){e({defaultWriteMode:n})},async setSessionModel(n,a,s){try{const i=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerId:a,modelId:s})});if(!i.ok)throw new Error(await hr(i,"Failed to update model"));const c=await i.json();e(d=>({sessions:{...d.sessions,[n]:c.session}}))}catch(i){dn.error(i instanceof Error?i.message:String(i))}},async rebindPane(n,a){try{const s=await fetch(`/api/agent/sessions/${n}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({paneId:a})});if(!s.ok)throw new Error(await hr(s,"Failed to rebind pane"));const i=await s.json();e(c=>({sessions:{...c.sessions,[n]:i.session}}))}catch(s){dn.error(s instanceof Error?s.message:String(s))}},async loadHistory(n){if(Sy.has(n)){_v.add(n);return}Sy.add(n);try{const a=t(),s=a.historyLoaded[n]?jv(a.messages[n]):-1,i=s>=0?`?afterSeq=${s}`:"",c=await fetch(`/api/agent/sessions/${n}/messages${i}`);if(!c.ok)throw new Error(await hr(c,"Failed to load agent messages"));const d=await c.json();e(h=>{const f=FR(s>=0?h.messages[n]:void 0,d.messages),g=h.inProgress[n],m=g&&{texts:g.texts.filter(b=>!b.stale),reasonings:g.reasonings.filter(b=>!b.stale),toolCalls:g.toolCalls.filter(b=>!b.stale),staleBarrier:!1};return{messages:{...h.messages,[n]:f},historyLoaded:{...h.historyLoaded,[n]:!0},inProgress:m?{...h.inProgress,[n]:m}:h.inProgress}})}catch(a){console.error("[agent] loadHistory failed:",a)}finally{Sy.delete(n),_v.delete(n)&&t().loadHistory(n)}},async sendMessage(n,a){e(s=>({sending:{...s.sending,[n]:!0}}));try{const s=await fetch(`/api/agent/sessions/${n}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a})});if(!s.ok)throw new Error(await hr(s,"Failed to send message"));const i=await s.json();if(i.message){const c=i.message;e(d=>{const h=d.sessions[n];return{messages:{...d.messages,[n]:FR(d.messages[n],[c])},sessions:h?{...d.sessions,[n]:{...h,status:"running",lastError:null}}:d.sessions}})}return!0}catch(s){return dn.error(s instanceof Error?s.message:String(s)),!1}finally{e(s=>({sending:{...s.sending,[n]:!1}}))}},async enqueueMessage(n,a,s=!1){try{const i=await fetch(`/api/agent/sessions/${n}/queue`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:a,steer:s})});if(!i.ok)throw new Error(await hr(i,"Failed to queue message"))}catch(i){dn.error(i instanceof Error?i.message:String(i))}},async editQueuedMessage(n,a,s){try{const i=await fetch(`/api/agent/queue/${a}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:s})});if(!i.ok)throw new Error(await hr(i,"Failed to edit queued message"))}catch(i){dn.error(i instanceof Error?i.message:String(i))}},async withdrawQueuedMessage(n,a){try{const s=await fetch(`/api/agent/queue/${a}`,{method:"DELETE"});if(!s.ok)throw new Error(await hr(s,"Failed to withdraw queued message"))}catch(s){dn.error(s instanceof Error?s.message:String(s))}},startDraft(n,a,s,i){const c=t().activeSessionId;c&&ns.has(c)&&(ns.delete(c),YR(c)),e({activeSessionId:null,draft:{deviceId:n,paneId:a,providerId:null,modelId:null,paneTitle:s,prompt:i??null}})},updateDraft(n){e(a=>a.draft?{draft:{...a.draft,...n}}:a)},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 a=await fetch(`/api/agent/sessions/${n}/stop`,{method:"POST"});if(!a.ok)throw new Error(await hr(a,"Failed to stop agent session"));const s=await a.json();if(s.session){const i=s.session;e(c=>({sessions:{...c.sessions,[n]:i}}))}}catch(a){dn.error(a instanceof Error?a.message:String(a))}},async decideConfirmation(n,a,s,i){const c=()=>{e(d=>{const h=d.pendingConfirmations[n];return h?{pendingConfirmations:{...d.pendingConfirmations,[n]:h.filter(f=>f.id!==a)}}:d})};try{const d=await fetch(`/api/agent/confirmations/${a}/decide`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i===void 0?{approved:s}:{approved:s,reason:i})});if(d.status===409){c();try{const h=await fetch(`/api/agent/sessions/${n}/confirmations`);if(h.ok){const f=await h.json();e(g=>({pendingConfirmations:{...g.pendingConfirmations,[n]:f.confirmations.map(m=>({id:m.id,toolCallId:m.toolCallId,toolName:m.toolName,input:m.input,createdAt:m.createdAt}))}}))}}catch{}return}if(!d.ok)throw new Error(await hr(d,"Failed to decide confirmation"));c()}catch(d){dn.error(d instanceof Error?d.message:String(d))}}}),{name:"tmex-agent",partialize:e=>({activeSessionId:e.activeSessionId,defaultWriteMode:e.defaultWriteMode})}));function i9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>a=>{t.forEach(s=>s(a))},t)}const vm=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function lc(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function i0(e){return"nodeType"in e}function Ar(e){var t,n;return e?lc(e)?e:i0(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function l0(e){const{Document:t}=Ar(e);return e instanceof t}function fd(e){return lc(e)?!1:e instanceof Ar(e).HTMLElement}function C2(e){return e instanceof Ar(e).SVGElement}function cc(e){return e?lc(e)?e.document:i0(e)?l0(e)?e:fd(e)||C2(e)?e.ownerDocument:document:document:document}const Ya=vm?y.useLayoutEffect:y.useEffect;function c0(e){const t=y.useRef(e);return Ya(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,a=new Array(n),s=0;s<n;s++)a[s]=arguments[s];return t.current==null?void 0:t.current(...a)},[])}function l9(){const e=y.useRef(null),t=y.useCallback((a,s)=>{e.current=setInterval(a,s)},[]),n=y.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Hu(e,t){t===void 0&&(t=[e]);const n=y.useRef(e);return Ya(()=>{n.current!==e&&(n.current=e)},t),n}function hd(e,t){const n=y.useRef();return y.useMemo(()=>{const a=e(n.current);return n.current=a,a},[...t])}function Hh(e){const t=c0(e),n=y.useRef(null),a=y.useCallback(s=>{s!==n.current&&(t==null||t(s,n.current)),n.current=s},[]);return[n,a]}function Iv(e){const t=y.useRef();return y.useEffect(()=>{t.current=e},[e]),t.current}let Ey={};function md(e,t){return y.useMemo(()=>{if(t)return t;const n=Ey[e]==null?0:Ey[e]+1;return Ey[e]=n,e+"-"+n},[e,t])}function O2(e){return function(t){for(var n=arguments.length,a=new Array(n>1?n-1:0),s=1;s<n;s++)a[s-1]=arguments[s];return a.reduce((i,c)=>{const d=Object.entries(c);for(const[h,f]of d){const g=i[h];g!=null&&(i[h]=g+e*f)}return i},{...t})}}const Nl=O2(1),Bu=O2(-1);function c9(e){return"clientX"in e&&"clientY"in e}function u0(e){if(!e)return!1;const{KeyboardEvent:t}=Ar(e.target);return t&&e instanceof t}function u9(e){if(!e)return!1;const{TouchEvent:t}=Ar(e.target);return t&&e instanceof t}function Pv(e){if(u9(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 c9(e)?{x:e.clientX,y:e.clientY}:null}const Mi=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[Mi.Translate.toString(e),Mi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:a}=e;return t+" "+n+"ms "+a}}}),$R="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function d9(e){return e.matches($R)?e:e.querySelector($R)}const f9={display:"none"};function h9(e){let{id:t,value:n}=e;return Pe.createElement("div",{id:t,style:f9},n)}function m9(e){let{id:t,announcement:n,ariaLiveType:a="assertive"}=e;const s={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 Pe.createElement("div",{id:t,style:s,role:"status","aria-live":a,"aria-atomic":!0},n)}function p9(){const[e,t]=y.useState("");return{announce:y.useCallback(a=>{a!=null&&t(a)},[]),announcement:e}}const M2=y.createContext(null);function g9(e){const t=y.useContext(M2);y.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function y9(){const[e]=y.useState(()=>new Set),t=y.useCallback(a=>(e.add(a),()=>e.delete(a)),[e]);return[y.useCallback(a=>{let{type:s,event:i}=a;e.forEach(c=>{var d;return(d=c[s])==null?void 0:d.call(c,i)})},[e]),t]}const v9={draggable:`
311
+ To pick up a draggable item, press the space bar.
312
+ While dragging, use the arrow keys to move the item.
313
+ Press space again to drop the item in its new position, or press escape to cancel.
314
+ `},b9={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 x9(e){let{announcements:t=b9,container:n,hiddenTextDescribedById:a,screenReaderInstructions:s=v9}=e;const{announce:i,announcement:c}=p9(),d=md("DndLiveRegion"),[h,f]=y.useState(!1);if(y.useEffect(()=>{f(!0)},[]),g9(y.useMemo(()=>({onDragStart(m){let{active:b}=m;i(t.onDragStart({active:b}))},onDragMove(m){let{active:b,over:x}=m;t.onDragMove&&i(t.onDragMove({active:b,over:x}))},onDragOver(m){let{active:b,over:x}=m;i(t.onDragOver({active:b,over:x}))},onDragEnd(m){let{active:b,over:x}=m;i(t.onDragEnd({active:b,over:x}))},onDragCancel(m){let{active:b,over:x}=m;i(t.onDragCancel({active:b,over:x}))}}),[i,t])),!h)return null;const g=Pe.createElement(Pe.Fragment,null,Pe.createElement(h9,{id:a,value:s.draggable}),Pe.createElement(m9,{id:d,announcement:c}));return n?or.createPortal(g,n):g}var qn;(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"})(qn||(qn={}));function Bh(){}function Ry(e,t){return y.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function w9(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return y.useMemo(()=>[...t].filter(a=>a!=null),[...t])}const Ea=Object.freeze({x:0,y:0});function N2(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function A2(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return n-a}function S9(e,t){let{data:{value:n}}=e,{data:{value:a}}=t;return a-n}function KR(e){let{left:t,top:n,height:a,width:s}=e;return[{x:t,y:n},{x:t+s,y:n},{x:t,y:n+a},{x:t+s,y:n+a}]}function D2(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function GR(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 d0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const s=GR(t,t.left,t.top),i=[];for(const c of a){const{id:d}=c,h=n.get(d);if(h){const f=N2(GR(h),s);i.push({id:d,data:{droppableContainer:c,value:f}})}}return i.sort(A2)},E9=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const s=KR(t),i=[];for(const c of a){const{id:d}=c,h=n.get(d);if(h){const f=KR(h),g=s.reduce((b,x,w)=>b+N2(f[w],x),0),m=Number((g/4).toFixed(4));i.push({id:d,data:{droppableContainer:c,value:m}})}}return i.sort(A2)};function R9(e,t){const n=Math.max(t.top,e.top),a=Math.max(t.left,e.left),s=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),c=s-a,d=i-n;if(a<s&&n<i){const h=t.width*t.height,f=e.width*e.height,g=c*d,m=g/(h+f-g);return Number(m.toFixed(4))}return 0}const T9=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:a}=e;const s=[];for(const i of a){const{id:c}=i,d=n.get(c);if(d){const h=R9(d,t);h>0&&s.push({id:c,data:{droppableContainer:i,value:h}})}}return s.sort(S9)};function C9(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function k2(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ea}function O9(e){return function(n){for(var a=arguments.length,s=new Array(a>1?a-1:0),i=1;i<a;i++)s[i-1]=arguments[i];return s.reduce((c,d)=>({...c,top:c.top+e*d.y,bottom:c.bottom+e*d.y,left:c.left+e*d.x,right:c.right+e*d.x}),{...n})}}const M9=O9(1);function N9(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 A9(e,t,n){const a=N9(t);if(!a)return e;const{scaleX:s,scaleY:i,x:c,y:d}=a,h=e.left-c-(1-s)*parseFloat(n),f=e.top-d-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),g=s?e.width/s:e.width,m=i?e.height/i:e.height;return{width:g,height:m,top:f,right:h+g,bottom:f+m,left:h}}const D9={ignoreTransform:!1};function uc(e,t){t===void 0&&(t=D9);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:f,transformOrigin:g}=Ar(e).getComputedStyle(e);f&&(n=A9(n,f,g))}const{top:a,left:s,width:i,height:c,bottom:d,right:h}=n;return{top:a,left:s,width:i,height:c,bottom:d,right:h}}function XR(e){return uc(e,{ignoreTransform:!0})}function k9(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function j9(e,t){return t===void 0&&(t=Ar(e).getComputedStyle(e)),t.position==="fixed"}function _9(e,t){t===void 0&&(t=Ar(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(s=>{const i=t[s];return typeof i=="string"?n.test(i):!1})}function bm(e,t){const n=[];function a(s){if(t!=null&&n.length>=t||!s)return n;if(l0(s)&&s.scrollingElement!=null&&!n.includes(s.scrollingElement))return n.push(s.scrollingElement),n;if(!fd(s)||C2(s)||n.includes(s))return n;const i=Ar(e).getComputedStyle(s);return s!==e&&_9(s,i)&&n.push(s),j9(s,i)?n:a(s.parentNode)}return e?a(e):n}function j2(e){const[t]=bm(e,1);return t??null}function Ty(e){return!vm||!e?null:lc(e)?e:i0(e)?l0(e)||e===cc(e).scrollingElement?window:fd(e)?e:null:null}function _2(e){return lc(e)?e.scrollX:e.scrollLeft}function L2(e){return lc(e)?e.scrollY:e.scrollTop}function zv(e){return{x:_2(e),y:L2(e)}}var Qn;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Qn||(Qn={}));function I2(e){return!vm||!e?!1:e===document.scrollingElement}function P2(e){const t={x:0,y:0},n=I2(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},a={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},s=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,c=e.scrollTop>=a.y,d=e.scrollLeft>=a.x;return{isTop:s,isLeft:i,isBottom:c,isRight:d,maxScroll:a,minScroll:t}}const L9={x:.2,y:.2};function I9(e,t,n,a,s){let{top:i,left:c,right:d,bottom:h}=n;a===void 0&&(a=10),s===void 0&&(s=L9);const{isTop:f,isBottom:g,isLeft:m,isRight:b}=P2(e),x={x:0,y:0},w={x:0,y:0},S={height:t.height*s.y,width:t.width*s.x};return!f&&i<=t.top+S.height?(x.y=Qn.Backward,w.y=a*Math.abs((t.top+S.height-i)/S.height)):!g&&h>=t.bottom-S.height&&(x.y=Qn.Forward,w.y=a*Math.abs((t.bottom-S.height-h)/S.height)),!b&&d>=t.right-S.width?(x.x=Qn.Forward,w.x=a*Math.abs((t.right-S.width-d)/S.width)):!m&&c<=t.left+S.width&&(x.x=Qn.Backward,w.x=a*Math.abs((t.left+S.width-c)/S.width)),{direction:x,speed:w}}function P9(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:c}=window;return{top:0,left:0,right:i,bottom:c,width:i,height:c}}const{top:t,left:n,right:a,bottom:s}=e.getBoundingClientRect();return{top:t,left:n,right:a,bottom:s,width:e.clientWidth,height:e.clientHeight}}function z2(e){return e.reduce((t,n)=>Nl(t,zv(n)),Ea)}function z9(e){return e.reduce((t,n)=>t+_2(n),0)}function U9(e){return e.reduce((t,n)=>t+L2(n),0)}function H9(e,t){if(t===void 0&&(t=uc),!e)return;const{top:n,left:a,bottom:s,right:i}=t(e);j2(e)&&(s<=0||i<=0||n>=window.innerHeight||a>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const B9=[["x",["left","right"],z9],["y",["top","bottom"],U9]];class f0{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 a=bm(n),s=z2(a);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,c,d]of B9)for(const h of c)Object.defineProperty(this,h,{get:()=>{const f=d(a),g=s[i]-f;return this.rect[h]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Cu{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var a;return(a=this.target)==null?void 0:a.removeEventListener(...n)})},this.target=t}add(t,n,a){var s;(s=this.target)==null||s.addEventListener(t,n,a),this.listeners.push([t,n,a])}}function F9(e){const{EventTarget:t}=Ar(e);return e instanceof t?e:cc(e)}function Cy(e,t){const n=Math.abs(e.x),a=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+a**2)>t:"x"in t&&"y"in t?n>t.x&&a>t.y:"x"in t?n>t.x:"y"in t?a>t.y:!1}var oa;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(oa||(oa={}));function WR(e){e.preventDefault()}function V9(e){e.stopPropagation()}var Zt;(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"})(Zt||(Zt={}));const U2={start:[Zt.Space,Zt.Enter],cancel:[Zt.Esc],end:[Zt.Space,Zt.Enter,Zt.Tab]},Y9=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Zt.Right:return{...n,x:n.x+25};case Zt.Left:return{...n,x:n.x-25};case Zt.Down:return{...n,y:n.y+25};case Zt.Up:return{...n,y:n.y-25}}};class h0{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 Cu(cc(n)),this.windowListeners=new Cu(Ar(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(oa.Resize,this.handleCancel),this.windowListeners.add(oa.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(oa.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,a=t.node.current;a&&H9(a),n(Ea)}handleKeyDown(t){if(u0(t)){const{active:n,context:a,options:s}=this.props,{keyboardCodes:i=U2,coordinateGetter:c=Y9,scrollBehavior:d="smooth"}=s,{code:h}=t;if(i.end.includes(h)){this.handleEnd(t);return}if(i.cancel.includes(h)){this.handleCancel(t);return}const{collisionRect:f}=a.current,g=f?{x:f.left,y:f.top}:Ea;this.referenceCoordinates||(this.referenceCoordinates=g);const m=c(t,{active:n,context:a.current,currentCoordinates:g});if(m){const b=Bu(m,g),x={x:0,y:0},{scrollableAncestors:w}=a.current;for(const S of w){const R=t.code,{isTop:T,isRight:C,isLeft:M,isBottom:O,maxScroll:D,minScroll:k}=P2(S),A=P9(S),j={x:Math.min(R===Zt.Right?A.right-A.width/2:A.right,Math.max(R===Zt.Right?A.left:A.left+A.width/2,m.x)),y:Math.min(R===Zt.Down?A.bottom-A.height/2:A.bottom,Math.max(R===Zt.Down?A.top:A.top+A.height/2,m.y))},B=R===Zt.Right&&!C||R===Zt.Left&&!M,W=R===Zt.Down&&!O||R===Zt.Up&&!T;if(B&&j.x!==m.x){const K=S.scrollLeft+b.x,I=R===Zt.Right&&K<=D.x||R===Zt.Left&&K>=k.x;if(I&&!b.y){S.scrollTo({left:K,behavior:d});return}I?x.x=S.scrollLeft-K:x.x=R===Zt.Right?S.scrollLeft-D.x:S.scrollLeft-k.x,x.x&&S.scrollBy({left:-x.x,behavior:d});break}else if(W&&j.y!==m.y){const K=S.scrollTop+b.y,I=R===Zt.Down&&K<=D.y||R===Zt.Up&&K>=k.y;if(I&&!b.x){S.scrollTo({top:K,behavior:d});return}I?x.y=S.scrollTop-K:x.y=R===Zt.Down?S.scrollTop-D.y:S.scrollTop-k.y,x.y&&S.scrollBy({top:-x.y,behavior:d});break}}this.handleMove(t,Nl(Bu(m,this.referenceCoordinates),x))}}}handleMove(t,n){const{onMove:a}=this.props;t.preventDefault(),a(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()}}h0.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:a=U2,onActivation:s}=t,{active:i}=n;const{code:c}=e.nativeEvent;if(a.start.includes(c)){const d=i.activatorNode.current;return d&&e.target!==d?!1:(e.preventDefault(),s==null||s({event:e.nativeEvent}),!0)}return!1}}];function QR(e){return!!(e&&"distance"in e)}function ZR(e){return!!(e&&"delay"in e)}class m0{constructor(t,n,a){var s;a===void 0&&(a=F9(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:i}=t,{target:c}=i;this.props=t,this.events=n,this.document=cc(c),this.documentListeners=new Cu(this.document),this.listeners=new Cu(a),this.windowListeners=new Cu(Ar(c)),this.initialCoordinates=(s=Pv(i))!=null?s:Ea,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:a}}}=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(oa.Resize,this.handleCancel),this.windowListeners.add(oa.DragStart,WR),this.windowListeners.add(oa.VisibilityChange,this.handleCancel),this.windowListeners.add(oa.ContextMenu,WR),this.documentListeners.add(oa.Keydown,this.handleKeydown),n){if(a!=null&&a({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ZR(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(QR(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:a,onPending:s}=this.props;s(a,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(oa.Click,V9,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(oa.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:a,initialCoordinates:s,props:i}=this,{onMove:c,options:{activationConstraint:d}}=i;if(!s)return;const h=(n=Pv(t))!=null?n:Ea,f=Bu(s,h);if(!a&&d){if(QR(d)){if(d.tolerance!=null&&Cy(f,d.tolerance))return this.handleCancel();if(Cy(f,d.distance))return this.handleStart()}if(ZR(d)&&Cy(f,d.tolerance))return this.handleCancel();this.handlePending(d,f);return}t.cancelable&&t.preventDefault(),c(h)}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===Zt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const q9={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class H2 extends m0{constructor(t){const{event:n}=t,a=cc(n.target);super(t,q9,a)}}H2.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;return!n.isPrimary||n.button!==0?!1:(a==null||a({event:n}),!0)}}];const $9={move:{name:"mousemove"},end:{name:"mouseup"}};var Uv;(function(e){e[e.RightClick=2]="RightClick"})(Uv||(Uv={}));class B2 extends m0{constructor(t){super(t,$9,cc(t.event.target))}}B2.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;return n.button===Uv.RightClick?!1:(a==null||a({event:n}),!0)}}];const Oy={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class F2 extends m0{constructor(t){super(t,Oy)}static setup(){return window.addEventListener(Oy.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Oy.move.name,t)};function t(){}}}F2.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:a}=t;const{touches:s}=n;return s.length>1?!1:(a==null||a({event:n}),!0)}}];var Ou;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Ou||(Ou={}));var Fh;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Fh||(Fh={}));function K9(e){let{acceleration:t,activator:n=Ou.Pointer,canScroll:a,draggingRect:s,enabled:i,interval:c=5,order:d=Fh.TreeOrder,pointerCoordinates:h,scrollableAncestors:f,scrollableAncestorRects:g,delta:m,threshold:b}=e;const x=X9({delta:m,disabled:!i}),[w,S]=l9(),R=y.useRef({x:0,y:0}),T=y.useRef({x:0,y:0}),C=y.useMemo(()=>{switch(n){case Ou.Pointer:return h?{top:h.y,bottom:h.y,left:h.x,right:h.x}:null;case Ou.DraggableRect:return s}},[n,s,h]),M=y.useRef(null),O=y.useCallback(()=>{const k=M.current;if(!k)return;const A=R.current.x*T.current.x,j=R.current.y*T.current.y;k.scrollBy(A,j)},[]),D=y.useMemo(()=>d===Fh.TreeOrder?[...f].reverse():f,[d,f]);y.useEffect(()=>{if(!i||!f.length||!C){S();return}for(const k of D){if((a==null?void 0:a(k))===!1)continue;const A=f.indexOf(k),j=g[A];if(!j)continue;const{direction:B,speed:W}=I9(k,j,C,t,b);for(const K of["x","y"])x[K][B[K]]||(W[K]=0,B[K]=0);if(W.x>0||W.y>0){S(),M.current=k,w(O,c),R.current=W,T.current=B;return}}R.current={x:0,y:0},T.current={x:0,y:0},S()},[t,O,a,S,i,c,JSON.stringify(C),JSON.stringify(x),w,f,D,g,JSON.stringify(b)])}const G9={x:{[Qn.Backward]:!1,[Qn.Forward]:!1},y:{[Qn.Backward]:!1,[Qn.Forward]:!1}};function X9(e){let{delta:t,disabled:n}=e;const a=Iv(t);return hd(s=>{if(n||!a||!s)return G9;const i={x:Math.sign(t.x-a.x),y:Math.sign(t.y-a.y)};return{x:{[Qn.Backward]:s.x[Qn.Backward]||i.x===-1,[Qn.Forward]:s.x[Qn.Forward]||i.x===1},y:{[Qn.Backward]:s.y[Qn.Backward]||i.y===-1,[Qn.Forward]:s.y[Qn.Forward]||i.y===1}}},[n,t,a])}function W9(e,t){const n=t!=null?e.get(t):void 0,a=n?n.node.current:null;return hd(s=>{var i;return t==null?null:(i=a??s)!=null?i:null},[a,t])}function Q9(e,t){return y.useMemo(()=>e.reduce((n,a)=>{const{sensor:s}=a,i=s.activators.map(c=>({eventName:c.eventName,handler:t(c.handler,a)}));return[...n,...i]},[]),[e,t])}var Fu;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Fu||(Fu={}));var Hv;(function(e){e.Optimized="optimized"})(Hv||(Hv={}));const JR=new Map;function Z9(e,t){let{dragging:n,dependencies:a,config:s}=t;const[i,c]=y.useState(null),{frequency:d,measure:h,strategy:f}=s,g=y.useRef(e),m=R(),b=Hu(m),x=y.useCallback(function(T){T===void 0&&(T=[]),!b.current&&c(C=>C===null?T:C.concat(T.filter(M=>!C.includes(M))))},[b]),w=y.useRef(null),S=hd(T=>{if(m&&!n)return JR;if(!T||T===JR||g.current!==e||i!=null){const C=new Map;for(let M of e){if(!M)continue;if(i&&i.length>0&&!i.includes(M.id)&&M.rect.current){C.set(M.id,M.rect.current);continue}const O=M.node.current,D=O?new f0(h(O),O):null;M.rect.current=D,D&&C.set(M.id,D)}return C}return T},[e,i,n,m,h]);return y.useEffect(()=>{g.current=e},[e]),y.useEffect(()=>{m||x()},[n,m]),y.useEffect(()=>{i&&i.length>0&&c(null)},[JSON.stringify(i)]),y.useEffect(()=>{m||typeof d!="number"||w.current!==null||(w.current=setTimeout(()=>{x(),w.current=null},d))},[d,m,x,...a]),{droppableRects:S,measureDroppableContainers:x,measuringScheduled:i!=null};function R(){switch(f){case Fu.Always:return!1;case Fu.BeforeDragging:return n;default:return!n}}}function V2(e,t){return hd(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function J9(e,t){return V2(e,t)}function e7(e){let{callback:t,disabled:n}=e;const a=c0(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(a)},[a,n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function xm(e){let{callback:t,disabled:n}=e;const a=c0(t),s=y.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(a)},[n]);return y.useEffect(()=>()=>s==null?void 0:s.disconnect(),[s]),s}function t7(e){return new f0(uc(e),e)}function eT(e,t,n){t===void 0&&(t=t7);const[a,s]=y.useState(null);function i(){s(h=>{if(!e)return null;if(e.isConnected===!1){var f;return(f=h??n)!=null?f:null}const g=t(e);return JSON.stringify(h)===JSON.stringify(g)?h:g})}const c=e7({callback(h){if(e)for(const f of h){const{type:g,target:m}=f;if(g==="childList"&&m instanceof HTMLElement&&m.contains(e)){i();break}}}}),d=xm({callback:i});return Ya(()=>{i(),e?(d==null||d.observe(e),c==null||c.observe(document.body,{childList:!0,subtree:!0})):(d==null||d.disconnect(),c==null||c.disconnect())},[e]),a}function n7(e){const t=V2(e);return k2(e,t)}const tT=[];function r7(e){const t=y.useRef(e),n=hd(a=>e?a&&a!==tT&&e&&t.current&&e.parentNode===t.current.parentNode?a:bm(e):tT,[e]);return y.useEffect(()=>{t.current=e},[e]),n}function a7(e){const[t,n]=y.useState(null),a=y.useRef(e),s=y.useCallback(i=>{const c=Ty(i.target);c&&n(d=>d?(d.set(c,zv(c)),new Map(d)):null)},[]);return y.useEffect(()=>{const i=a.current;if(e!==i){c(i);const d=e.map(h=>{const f=Ty(h);return f?(f.addEventListener("scroll",s,{passive:!0}),[f,zv(f)]):null}).filter(h=>h!=null);n(d.length?new Map(d):null),a.current=e}return()=>{c(e),c(i)};function c(d){d.forEach(h=>{const f=Ty(h);f==null||f.removeEventListener("scroll",s)})}},[s,e]),y.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,c)=>Nl(i,c),Ea):z2(e):Ea,[e,t])}function nT(e,t){t===void 0&&(t=[]);const n=y.useRef(null);return y.useEffect(()=>{n.current=null},t),y.useEffect(()=>{const a=e!==Ea;a&&!n.current&&(n.current=e),!a&&n.current&&(n.current=null)},[e]),n.current?Bu(e,n.current):Ea}function o7(e){y.useEffect(()=>{if(!vm)return;const t=e.map(n=>{let{sensor:a}=n;return a.setup==null?void 0:a.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function s7(e,t){return y.useMemo(()=>e.reduce((n,a)=>{let{eventName:s,handler:i}=a;return n[s]=c=>{i(c,t)},n},{}),[e,t])}function Y2(e){return y.useMemo(()=>e?k9(e):null,[e])}const rT=[];function i7(e,t){t===void 0&&(t=uc);const[n]=e,a=Y2(n?Ar(n):null),[s,i]=y.useState(rT);function c(){i(()=>e.length?e.map(h=>I2(h)?a:new f0(t(h),h)):rT)}const d=xm({callback:c});return Ya(()=>{d==null||d.disconnect(),c(),e.forEach(h=>d==null?void 0:d.observe(h))},[e]),s}function l7(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return fd(t)?t:e}function c7(e){let{measure:t}=e;const[n,a]=y.useState(null),s=y.useCallback(f=>{for(const{target:g}of f)if(fd(g)){a(m=>{const b=t(g);return m?{...m,width:b.width,height:b.height}:b});break}},[t]),i=xm({callback:s}),c=y.useCallback(f=>{const g=l7(f);i==null||i.disconnect(),g&&(i==null||i.observe(g)),a(g?t(g):null)},[t,i]),[d,h]=Hh(c);return y.useMemo(()=>({nodeRef:d,rect:n,setRef:h}),[n,d,h])}const u7=[{sensor:H2,options:{}},{sensor:h0,options:{}}],d7={current:{}},ph={draggable:{measure:XR},droppable:{measure:XR,strategy:Fu.WhileDragging,frequency:Hv.Optimized},dragOverlay:{measure:uc}};class Mu 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,a;return(n=(a=this.get(t))==null?void 0:a.node.current)!=null?n:void 0}}const f7={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Mu,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Bh},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ph,measureDroppableContainers:Bh,windowRect:null,measuringScheduled:!1},h7={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Bh,draggableNodes:new Map,over:null,measureDroppableContainers:Bh},wm=y.createContext(h7),q2=y.createContext(f7);function m7(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Mu}}}function p7(e,t){switch(t.type){case qn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case qn.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 qn.DragEnd:case qn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case qn.RegisterDroppable:{const{element:n}=t,{id:a}=n,s=new Mu(e.droppable.containers);return s.set(a,n),{...e,droppable:{...e.droppable,containers:s}}}case qn.SetDroppableDisabled:{const{id:n,key:a,disabled:s}=t,i=e.droppable.containers.get(n);if(!i||a!==i.key)return e;const c=new Mu(e.droppable.containers);return c.set(n,{...i,disabled:s}),{...e,droppable:{...e.droppable,containers:c}}}case qn.UnregisterDroppable:{const{id:n,key:a}=t,s=e.droppable.containers.get(n);if(!s||a!==s.key)return e;const i=new Mu(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function g7(e){let{disabled:t}=e;const{active:n,activatorEvent:a,draggableNodes:s}=y.useContext(wm),i=Iv(a),c=Iv(n==null?void 0:n.id);return y.useEffect(()=>{if(!t&&!a&&i&&c!=null){if(!u0(i)||document.activeElement===i.target)return;const d=s.get(c);if(!d)return;const{activatorNode:h,node:f}=d;if(!h.current&&!f.current)return;requestAnimationFrame(()=>{for(const g of[h.current,f.current]){if(!g)continue;const m=d9(g);if(m){m.focus();break}}})}},[a,t,s,c,i]),null}function y7(e,t){let{transform:n,...a}=t;return e!=null&&e.length?e.reduce((s,i)=>i({transform:s,...a}),n):n}function v7(e){return y.useMemo(()=>({draggable:{...ph.draggable,...e==null?void 0:e.draggable},droppable:{...ph.droppable,...e==null?void 0:e.droppable},dragOverlay:{...ph.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 b7(e){let{activeNode:t,measure:n,initialRect:a,config:s=!0}=e;const i=y.useRef(!1),{x:c,y:d}=typeof s=="boolean"?{x:s,y:s}:s;Ya(()=>{if(!c&&!d||!t){i.current=!1;return}if(i.current||!a)return;const f=t==null?void 0:t.node.current;if(!f||f.isConnected===!1)return;const g=n(f),m=k2(g,a);if(c||(m.x=0),d||(m.y=0),i.current=!0,Math.abs(m.x)>0||Math.abs(m.y)>0){const b=j2(f);b&&b.scrollBy({top:m.y,left:m.x})}},[t,c,d,a,n])}const $2=y.createContext({...Ea,scaleX:1,scaleY:1});var rs;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(rs||(rs={}));const p0=y.memo(function(t){var n,a,s,i;let{id:c,accessibility:d,autoScroll:h=!0,children:f,sensors:g=u7,collisionDetection:m=T9,measuring:b,modifiers:x,...w}=t;const S=y.useReducer(p7,void 0,m7),[R,T]=S,[C,M]=y9(),[O,D]=y.useState(rs.Uninitialized),k=O===rs.Initialized,{draggable:{active:A,nodes:j,translate:B},droppable:{containers:W}}=R,K=A!=null?j.get(A):null,I=y.useRef({initial:null,translated:null}),H=y.useMemo(()=>{var lt;return A!=null?{id:A,data:(lt=K==null?void 0:K.data)!=null?lt:d7,rect:I}:null},[A,K]),F=y.useRef(null),[q,_]=y.useState(null),[L,P]=y.useState(null),V=Hu(w,Object.values(w)),Q=md("DndDescribedBy",c),z=y.useMemo(()=>W.getEnabled(),[W]),Y=v7(b),{droppableRects:X,measureDroppableContainers:G,measuringScheduled:ce}=Z9(z,{dragging:k,dependencies:[B.x,B.y],config:Y.droppable}),oe=W9(j,A),de=y.useMemo(()=>L?Pv(L):null,[L]),ve=tt(),xe=J9(oe,Y.draggable.measure);b7({activeNode:A!=null?j.get(A):null,config:ve.layoutShiftCompensation,initialRect:xe,measure:Y.draggable.measure});const Ne=eT(oe,Y.draggable.measure,xe),_e=eT(oe?oe.parentElement:null),ee=y.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:X,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:W,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ue=W.getNodeFor((n=ee.current.over)==null?void 0:n.id),pe=c7({measure:Y.dragOverlay.measure}),ke=(a=pe.nodeRef.current)!=null?a:oe,Te=k?(s=pe.rect)!=null?s:Ne:null,be=!!(pe.nodeRef.current&&pe.rect),we=n7(be?null:Ne),Z=Y2(ke?Ar(ke):null),Se=r7(k?ue??oe:null),ge=i7(Se),ze=y7(x,{transform:{x:B.x-we.x,y:B.y-we.y,scaleX:1,scaleY:1},activatorEvent:L,active:H,activeNodeRect:Ne,containerNodeRect:_e,draggingNodeRect:Te,over:ee.current.over,overlayNodeRect:pe.rect,scrollableAncestors:Se,scrollableAncestorRects:ge,windowRect:Z}),He=de?Nl(de,B):null,De=a7(Se),st=nT(De),xt=nT(De,[Ne]),vt=Nl(ze,st),Je=Te?M9(Te,ze):null,Qe=H&&Je?m({active:H,collisionRect:Je,droppableRects:X,droppableContainers:z,pointerCoordinates:He}):null,ft=D2(Qe,"id"),[se,je]=y.useState(null),Ke=be?ze:Nl(ze,xt),Me=C9(Ke,(i=se==null?void 0:se.rect)!=null?i:null,Ne),Ie=y.useRef(null),Fe=y.useCallback((lt,gt)=>{let{sensor:Ye,options:Tt}=gt;if(F.current==null)return;const kt=j.get(F.current);if(!kt)return;const Rt=lt.nativeEvent,on=new Ye({active:F.current,activeNode:kt,event:Rt,options:Tt,context:ee,onAbort(Xe){if(!j.get(Xe))return;const{onDragAbort:$}=V.current,re={id:Xe};$==null||$(re),C({type:"onDragAbort",event:re})},onPending(Xe,Ct,$,re){if(!j.get(Xe))return;const{onDragPending:Ee}=V.current,Le={id:Xe,constraint:Ct,initialCoordinates:$,offset:re};Ee==null||Ee(Le),C({type:"onDragPending",event:Le})},onStart(Xe){const Ct=F.current;if(Ct==null)return;const $=j.get(Ct);if(!$)return;const{onDragStart:re}=V.current,le={activatorEvent:Rt,active:{id:Ct,data:$.data,rect:I}};or.unstable_batchedUpdates(()=>{re==null||re(le),D(rs.Initializing),T({type:qn.DragStart,initialCoordinates:Xe,active:Ct}),C({type:"onDragStart",event:le}),_(Ie.current),P(Rt)})},onMove(Xe){T({type:qn.DragMove,coordinates:Xe})},onEnd:Pt(qn.DragEnd),onCancel:Pt(qn.DragCancel)});Ie.current=on;function Pt(Xe){return async function(){const{active:$,collisions:re,over:le,scrollAdjustedTranslate:Ee}=ee.current;let Le=null;if($&&Ee){const{cancelDrop:et}=V.current;Le={activatorEvent:Rt,active:$,collisions:re,delta:Ee,over:le},Xe===qn.DragEnd&&typeof et=="function"&&await Promise.resolve(et(Le))&&(Xe=qn.DragCancel)}F.current=null,or.unstable_batchedUpdates(()=>{T({type:Xe}),D(rs.Uninitialized),je(null),_(null),P(null),Ie.current=null;const et=Xe===qn.DragEnd?"onDragEnd":"onDragCancel";if(Le){const Ze=V.current[et];Ze==null||Ze(Le),C({type:et,event:Le})}})}}},[j]),ht=y.useCallback((lt,gt)=>(Ye,Tt)=>{const kt=Ye.nativeEvent,Rt=j.get(Tt);if(F.current!==null||!Rt||kt.dndKit||kt.defaultPrevented)return;const on={active:Rt};lt(Ye,gt.options,on)===!0&&(kt.dndKit={capturedBy:gt.sensor},F.current=Tt,Fe(Ye,gt))},[j,Fe]),Lt=Q9(g,ht);o7(g),Ya(()=>{Ne&&O===rs.Initializing&&D(rs.Initialized)},[Ne,O]),y.useEffect(()=>{const{onDragMove:lt}=V.current,{active:gt,activatorEvent:Ye,collisions:Tt,over:kt}=ee.current;if(!gt||!Ye)return;const Rt={active:gt,activatorEvent:Ye,collisions:Tt,delta:{x:vt.x,y:vt.y},over:kt};or.unstable_batchedUpdates(()=>{lt==null||lt(Rt),C({type:"onDragMove",event:Rt})})},[vt.x,vt.y]),y.useEffect(()=>{const{active:lt,activatorEvent:gt,collisions:Ye,droppableContainers:Tt,scrollAdjustedTranslate:kt}=ee.current;if(!lt||F.current==null||!gt||!kt)return;const{onDragOver:Rt}=V.current,on=Tt.get(ft),Pt=on&&on.rect.current?{id:on.id,rect:on.rect.current,data:on.data,disabled:on.disabled}:null,Xe={active:lt,activatorEvent:gt,collisions:Ye,delta:{x:kt.x,y:kt.y},over:Pt};or.unstable_batchedUpdates(()=>{je(Pt),Rt==null||Rt(Xe),C({type:"onDragOver",event:Xe})})},[ft]),Ya(()=>{ee.current={activatorEvent:L,active:H,activeNode:oe,collisionRect:Je,collisions:Qe,droppableRects:X,draggableNodes:j,draggingNode:ke,draggingNodeRect:Te,droppableContainers:W,over:se,scrollableAncestors:Se,scrollAdjustedTranslate:vt},I.current={initial:Te,translated:Je}},[H,oe,Qe,Je,j,ke,Te,X,W,se,Se,vt]),K9({...ve,delta:B,draggingRect:Je,pointerCoordinates:He,scrollableAncestors:Se,scrollableAncestorRects:ge});const ct=y.useMemo(()=>({active:H,activeNode:oe,activeNodeRect:Ne,activatorEvent:L,collisions:Qe,containerNodeRect:_e,dragOverlay:pe,draggableNodes:j,droppableContainers:W,droppableRects:X,over:se,measureDroppableContainers:G,scrollableAncestors:Se,scrollableAncestorRects:ge,measuringConfiguration:Y,measuringScheduled:ce,windowRect:Z}),[H,oe,Ne,L,Qe,_e,pe,j,W,X,se,G,Se,ge,Y,ce,Z]),pt=y.useMemo(()=>({activatorEvent:L,activators:Lt,active:H,activeNodeRect:Ne,ariaDescribedById:{draggable:Q},dispatch:T,draggableNodes:j,over:se,measureDroppableContainers:G}),[L,Lt,H,Ne,T,Q,j,se,G]);return Pe.createElement(M2.Provider,{value:M},Pe.createElement(wm.Provider,{value:pt},Pe.createElement(q2.Provider,{value:ct},Pe.createElement($2.Provider,{value:Me},f)),Pe.createElement(g7,{disabled:(d==null?void 0:d.restoreFocus)===!1})),Pe.createElement(x9,{...d,hiddenTextDescribedById:Q}));function tt(){const lt=(q==null?void 0:q.autoScrollEnabled)===!1,gt=typeof h=="object"?h.enabled===!1:h===!1,Ye=k&&!lt&&!gt;return typeof h=="object"?{...h,enabled:Ye}:{enabled:Ye}}}),x7=y.createContext(null),aT="button",w7="Draggable";function S7(e){let{id:t,data:n,disabled:a=!1,attributes:s}=e;const i=md(w7),{activators:c,activatorEvent:d,active:h,activeNodeRect:f,ariaDescribedById:g,draggableNodes:m,over:b}=y.useContext(wm),{role:x=aT,roleDescription:w="draggable",tabIndex:S=0}=s??{},R=(h==null?void 0:h.id)===t,T=y.useContext(R?$2:x7),[C,M]=Hh(),[O,D]=Hh(),k=s7(c,t),A=Hu(n);Ya(()=>(m.set(t,{id:t,key:i,node:C,activatorNode:O,data:A}),()=>{const B=m.get(t);B&&B.key===i&&m.delete(t)}),[m,t]);const j=y.useMemo(()=>({role:x,tabIndex:S,"aria-disabled":a,"aria-pressed":R&&x===aT?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[a,x,S,R,w,g.draggable]);return{active:h,activatorEvent:d,activeNodeRect:f,attributes:j,isDragging:R,listeners:a?void 0:k,node:C,over:b,setNodeRef:M,setActivatorNodeRef:D,transform:T}}function E7(){return y.useContext(q2)}const R7="Droppable",T7={timeout:25};function C7(e){let{data:t,disabled:n=!1,id:a,resizeObserverConfig:s}=e;const i=md(R7),{active:c,dispatch:d,over:h,measureDroppableContainers:f}=y.useContext(wm),g=y.useRef({disabled:n}),m=y.useRef(!1),b=y.useRef(null),x=y.useRef(null),{disabled:w,updateMeasurementsFor:S,timeout:R}={...T7,...s},T=Hu(S??a),C=y.useCallback(()=>{if(!m.current){m.current=!0;return}x.current!=null&&clearTimeout(x.current),x.current=setTimeout(()=>{f(Array.isArray(T.current)?T.current:[T.current]),x.current=null},R)},[R]),M=xm({callback:C,disabled:w||!c}),O=y.useCallback((j,B)=>{M&&(B&&(M.unobserve(B),m.current=!1),j&&M.observe(j))},[M]),[D,k]=Hh(O),A=Hu(t);return y.useEffect(()=>{!M||!D.current||(M.disconnect(),m.current=!1,M.observe(D.current))},[D,M]),y.useEffect(()=>(d({type:qn.RegisterDroppable,element:{id:a,key:i,disabled:n,node:D,rect:b,data:A}}),()=>d({type:qn.UnregisterDroppable,key:i,id:a})),[a]),y.useEffect(()=>{n!==g.current.disabled&&(d({type:qn.SetDroppableDisabled,id:a,key:i,disabled:n}),g.current.disabled=n)},[a,i,n,d]),{active:c,rect:b,isOver:(h==null?void 0:h.id)===a,node:D,over:h,setNodeRef:k}}function pd(e,t,n){const a=e.slice();return a.splice(n<0?a.length+n:n,0,a.splice(t,1)[0]),a}function O7(e,t){return e.reduce((n,a,s)=>{const i=t.get(a);return i&&(n[s]=i),n},Array(e.length))}function Jf(e){return e!==null&&e>=0}function M7(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 N7(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const K2=e=>{let{rects:t,activeIndex:n,overIndex:a,index:s}=e;const i=pd(t,a,n),c=t[s],d=i[s];return!d||!c?null:{x:d.left-c.left,y:d.top-c.top,scaleX:d.width/c.width,scaleY:d.height/c.height}},eh={scaleX:1,scaleY:1},g0=e=>{var t;let{activeIndex:n,activeNodeRect:a,index:s,rects:i,overIndex:c}=e;const d=(t=i[n])!=null?t:a;if(!d)return null;if(s===n){const f=i[c];return f?{x:0,y:n<c?f.top+f.height-(d.top+d.height):f.top-d.top,...eh}:null}const h=A7(i,s,n);return s>n&&s<=c?{x:0,y:-d.height-h,...eh}:s<n&&s>=c?{x:0,y:d.height+h,...eh}:{x:0,y:0,...eh}};function A7(e,t,n){const a=e[t],s=e[t-1],i=e[t+1];return a?n<t?s?a.top-(s.top+s.height):i?i.top-(a.top+a.height):0:i?i.top-(a.top+a.height):s?a.top-(s.top+s.height):0:0}const G2="Sortable",X2=Pe.createContext({activeIndex:-1,containerId:G2,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:K2,disabled:{draggable:!1,droppable:!1}});function y0(e){let{children:t,id:n,items:a,strategy:s=K2,disabled:i=!1}=e;const{active:c,dragOverlay:d,droppableRects:h,over:f,measureDroppableContainers:g}=E7(),m=md(G2,n),b=d.rect!==null,x=y.useMemo(()=>a.map(k=>typeof k=="object"&&"id"in k?k.id:k),[a]),w=c!=null,S=c?x.indexOf(c.id):-1,R=f?x.indexOf(f.id):-1,T=y.useRef(x),C=!M7(x,T.current),M=R!==-1&&S===-1||C,O=N7(i);Ya(()=>{C&&w&&g(x)},[C,x,w,g]),y.useEffect(()=>{T.current=x},[x]);const D=y.useMemo(()=>({activeIndex:S,containerId:m,disabled:O,disableTransforms:M,items:x,overIndex:R,useDragOverlay:b,sortedRects:O7(x,h),strategy:s}),[S,m,O.draggable,O.droppable,M,x,R,h,b,s]);return Pe.createElement(X2.Provider,{value:D},t)}const D7=e=>{let{id:t,items:n,activeIndex:a,overIndex:s}=e;return pd(n,a,s).indexOf(t)},k7=e=>{let{containerId:t,isSorting:n,wasDragging:a,index:s,items:i,newIndex:c,previousItems:d,previousContainerId:h,transition:f}=e;return!f||!a||d!==i&&s===c?!1:n?!0:c!==s&&t===h},j7={duration:200,easing:"ease"},W2="transform",_7=Mi.Transition.toString({property:W2,duration:0,easing:"linear"}),L7={roleDescription:"sortable"};function I7(e){let{disabled:t,index:n,node:a,rect:s}=e;const[i,c]=y.useState(null),d=y.useRef(n);return Ya(()=>{if(!t&&n!==d.current&&a.current){const h=s.current;if(h){const f=uc(a.current,{ignoreTransform:!0}),g={x:h.left-f.left,y:h.top-f.top,scaleX:h.width/f.width,scaleY:h.height/f.height};(g.x||g.y)&&c(g)}}n!==d.current&&(d.current=n)},[t,n,a,s]),y.useEffect(()=>{i&&c(null)},[i]),i}function v0(e){let{animateLayoutChanges:t=k7,attributes:n,disabled:a,data:s,getNewIndex:i=D7,id:c,strategy:d,resizeObserverConfig:h,transition:f=j7}=e;const{items:g,containerId:m,activeIndex:b,disabled:x,disableTransforms:w,sortedRects:S,overIndex:R,useDragOverlay:T,strategy:C}=y.useContext(X2),M=P7(a,x),O=g.indexOf(c),D=y.useMemo(()=>({sortable:{containerId:m,index:O,items:g},...s}),[m,s,O,g]),k=y.useMemo(()=>g.slice(g.indexOf(c)),[g,c]),{rect:A,node:j,isOver:B,setNodeRef:W}=C7({id:c,data:D,disabled:M.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...h}}),{active:K,activatorEvent:I,activeNodeRect:H,attributes:F,setNodeRef:q,listeners:_,isDragging:L,over:P,setActivatorNodeRef:V,transform:Q}=S7({id:c,data:D,attributes:{...L7,...n},disabled:M.draggable}),z=i9(W,q),Y=!!K,X=Y&&!w&&Jf(b)&&Jf(R),G=!T&&L,ce=G&&X?Q:null,de=X?ce??(d??C)({rects:S,activeNodeRect:H,activeIndex:b,overIndex:R,index:O}):null,ve=Jf(b)&&Jf(R)?i({id:c,items:g,activeIndex:b,overIndex:R}):O,xe=K==null?void 0:K.id,Ne=y.useRef({activeId:xe,items:g,newIndex:ve,containerId:m}),_e=g!==Ne.current.items,ee=t({active:K,containerId:m,isDragging:L,isSorting:Y,id:c,index:O,items:g,newIndex:Ne.current.newIndex,previousItems:Ne.current.items,previousContainerId:Ne.current.containerId,transition:f,wasDragging:Ne.current.activeId!=null}),ue=I7({disabled:!ee,index:O,node:j,rect:A});return y.useEffect(()=>{Y&&Ne.current.newIndex!==ve&&(Ne.current.newIndex=ve),m!==Ne.current.containerId&&(Ne.current.containerId=m),g!==Ne.current.items&&(Ne.current.items=g)},[Y,ve,m,g]),y.useEffect(()=>{if(xe===Ne.current.activeId)return;if(xe!=null&&Ne.current.activeId==null){Ne.current.activeId=xe;return}const ke=setTimeout(()=>{Ne.current.activeId=xe},50);return()=>clearTimeout(ke)},[xe]),{active:K,activeIndex:b,attributes:F,data:D,rect:A,index:O,newIndex:ve,items:g,isOver:B,isSorting:Y,isDragging:L,listeners:_,node:j,overIndex:R,over:P,setNodeRef:z,setActivatorNodeRef:V,setDroppableNodeRef:W,setDraggableNodeRef:q,transform:ue??de,transition:pe()};function pe(){if(ue||_e&&Ne.current.newIndex===O)return _7;if(!(G&&!u0(I)||!f)&&(Y||ee))return Mi.Transition.toString({...f,property:W2})}}function P7(e,t){var n,a;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(a=e==null?void 0:e.droppable)!=null?a:t.droppable}}function Vh(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 z7=[Zt.Down,Zt.Right,Zt.Up,Zt.Left],U7=(e,t)=>{let{context:{active:n,collisionRect:a,droppableRects:s,droppableContainers:i,over:c,scrollableAncestors:d}}=t;if(z7.includes(e.code)){if(e.preventDefault(),!n||!a)return;const h=[];i.getEnabled().forEach(m=>{if(!m||m!=null&&m.disabled)return;const b=s.get(m.id);if(b)switch(e.code){case Zt.Down:a.top<b.top&&h.push(m);break;case Zt.Up:a.top>b.top&&h.push(m);break;case Zt.Left:a.left>b.left&&h.push(m);break;case Zt.Right:a.left<b.left&&h.push(m);break}});const f=E9({collisionRect:a,droppableRects:s,droppableContainers:h});let g=D2(f,"id");if(g===(c==null?void 0:c.id)&&f.length>1&&(g=f[1].id),g!=null){const m=i.get(n.id),b=i.get(g),x=b?s.get(b.id):null,w=b==null?void 0:b.node.current;if(w&&x&&m&&b){const R=bm(w).some((k,A)=>d[A]!==k),T=Q2(m,b),C=H7(m,b),M=R||!T?{x:0,y:0}:{x:C?a.width-x.width:0,y:C?a.height-x.height:0},O={x:x.left,y:x.top};return M.x&&M.y?O:Bu(O,M)}}}};function Q2(e,t){return!Vh(e)||!Vh(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function H7(e,t){return!Vh(e)||!Vh(t)||!Q2(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function B7(){const e=wi.getState().settings;return(e==null?void 0:e.siteName)||"tmex"}function oT(e){const t=e==null?void 0:e.trim();return t&&t.length>0?t:"?"}function VY({paneCustomName:e,paneTitle:t,windowName:n,windowCustomName:a,deviceName:s}){const i=oT(e??a??t??n),c=oT(s);return`${i}@${c}`}function b0(e){var d,h;const t=(d=e.customName)==null?void 0:d.trim(),n=e.panes.find(f=>f.active)??e.panes[0],a=e.name.trim(),s=(h=n==null?void 0:n.title)==null?void 0:h.trim(),i=t||s||a;return{title:i,processName:!!a&&a!==i?a:void 0}}function F7(e){const{title:t,processName:n}=b0(e);return n?`${n}: ${t}`:t}function YY(e){const t=B7();return e!=null&&e.trim()?`[${t}]${e}`:t}function qY(e){return e}function Z2(e){return encodeURIComponent(e)}function J2({status:e}){return E.jsx("span",{className:Oe("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 x0(){return w9(Ry(B2,{activationConstraint:{distance:8}}),Ry(F2,{activationConstraint:{delay:250,tolerance:5}}),Ry(h0,{coordinateGetter:U7}))}function V7(){const{t:e}=yr(),t=qa(),n=rb(),{isMobile:a,setOpenMobile:s}=qr(),{toggleDevice:i}=_8(),c=ti(se=>se.sessions),d=ti(se=>se.activeSessionId),h=Vr(se=>se.setSidebarTab);y.useEffect(()=>{const se=ti.getState();se.ensureInitialized(),se.loadSessions()},[]);const f=Fl("/devices/:deviceId/windows/:windowId/panes/:paneId",t.pathname),g=f==null?void 0:f.params.deviceId,m=f==null?void 0:f.params.windowId,b=f==null?void 0:f.params.paneId,x=rn(se=>se.snapshots),w=rn(se=>se.connectedDevices),S=rn(se=>se.closeWindow),R=rn(se=>se.closePane),T=rn(se=>se.renameWindow),C=wi(se=>{var je;return((je=se.settings)==null?void 0:je.language)??"en_US"}),{data:M}=Qu({queryKey:["devices"],queryFn:async()=>{const se=await fetch("/api/devices");if(!se.ok)throw new Error("Failed to fetch devices");return se.json()},throwOnError:!1}),O=rn(se=>se.hydrateDeviceErrors);y.useEffect(()=>{M!=null&&M.devices&&O(M.devices.map(se=>({deviceId:se.id,lastError:se.lastError??null,lastErrorType:se.lastErrorType??null})))},[M,O]);const D=y.useCallback((se,je)=>{n(se,{replace:(je==null?void 0:je.replace)??!0}),a&&!(je!=null&&je.keepSidebarOpen)&&s(!1)},[n,a,s]),k=y.useCallback((se,je,Ke,Me)=>{W.current=null,window.dispatchEvent(new CustomEvent("tmex:user-initiated-selection",{detail:{deviceId:se,windowId:je,paneId:Ke}})),D(`/devices/${se}/windows/${je}/panes/${Z2(Ke)}`,{keepSidebarOpen:Me==null?void 0:Me.keepSidebarOpen})},[D]),A=y.useCallback(se=>{var je,Ke;if(ti.getState().setActiveSession(se.id),h("agent"),se.deviceId&&se.paneId){const Me=(Ke=(je=rn.getState().snapshots[se.deviceId])==null?void 0:je.session)==null?void 0:Ke.windows,Ie=Me==null?void 0:Me.find(Fe=>Fe.panes.some(ht=>ht.id===se.paneId));Ie&&k(se.deviceId,Ie.id,se.paneId,{keepSidebarOpen:!0})}},[h,k]),j=y.useCallback((se,je,Ke)=>{k(se,je,Ke.id,{keepSidebarOpen:!0}),ti.getState().startDraft(se,Ke.id,Ke.title??null),h("agent")},[k,h]),B=rn(se=>se.selectWindow),W=y.useRef(null);y.useEffect(()=>{var Lt,ct;const se=W.current;if(!se)return;if(Date.now()-se.at>5e3){W.current=null;return}const{deviceId:je,windowId:Ke}=se,Me=x[je],Ie=(Lt=Me==null?void 0:Me.session)==null?void 0:Lt.windows;if(!Ie)return;const Fe=Ie.find(pt=>pt.id===Ke);if(!((ct=Fe==null?void 0:Fe.panes)!=null&&ct.length))return;W.current=null;const ht=Fe.panes.find(pt=>pt.active)??Fe.panes[0];k(je,Ke,ht.id)},[x,k]);const K=y.useCallback((se,je,Ke)=>{B(se,je);const Me=Ke.find(Ie=>Ie.active)??Ke[0];Me?(k(se,je,Me.id),W.current=null):W.current={deviceId:se,windowId:je,at:Date.now()}},[k,B]),I=y.useCallback((se,je)=>{je?se===g&&D("/devices"):D(`/devices/${se}`),i(se,je)},[i,g,D]),H=y.useCallback((se,je)=>{se===g&&je===m&&D("/devices"),S(se,je)},[S,g,m,D]),[F,q]=y.useState(null),_=y.useCallback((se,je)=>{var Ie,Fe;const Ke=(Fe=(Ie=rn.getState().snapshots[se])==null?void 0:Ie.session)==null?void 0:Fe.windows,Me=Ke==null?void 0:Ke.find(ht=>ht.id===je);q({kind:"window",deviceId:se,windowId:je,name:Me?F7(Me):""})},[]),L=y.useCallback((se,je,Ke)=>{var Fe,ht,Lt,ct;const Me=(ht=(Fe=rn.getState().snapshots[se])==null?void 0:Fe.session)==null?void 0:ht.windows,Ie=(ct=(Lt=Me==null?void 0:Me.find(pt=>pt.id===je))==null?void 0:Lt.panes)==null?void 0:ct.find(pt=>pt.id===Ke);q({kind:"pane",deviceId:se,paneId:Ke,name:(Ie==null?void 0:Ie.title)||`Pane ${(Ie==null?void 0:Ie.index)??""}`})},[]),P=y.useCallback(()=>{F&&(F.kind==="window"?H(F.deviceId,F.windowId):R(F.deviceId,F.paneId),q(null))},[F,H,R]),[V,Q]=y.useState(null),[z,Y]=y.useState(""),X=y.useCallback((se,je)=>{var Ie,Fe;const Ke=(Fe=(Ie=rn.getState().snapshots[se])==null?void 0:Ie.session)==null?void 0:Fe.windows,Me=Ke==null?void 0:Ke.find(ht=>ht.id===je);Me&&(Y(Me.customName??b0(Me).title),Q({kind:"window",deviceId:se,windowId:je,hasCustomName:!!Me.customName}))},[]),G=y.useCallback((se,je)=>{var Ie,Fe;const Ke=(Fe=(Ie=rn.getState().snapshots[se])==null?void 0:Ie.session)==null?void 0:Fe.windows,Me=Ke==null?void 0:Ke.flatMap(ht=>ht.panes).find(ht=>ht.id===je);Me&&(Y(Me.customName??Me.title??""),Q({kind:"pane",deviceId:se,paneId:je,hasCustomName:!!Me.customName}))},[]),ce=rn(se=>se.renamePane),oe=y.useCallback(se=>{V&&(V.kind==="window"?T(V.deviceId,V.windowId,se):ce(V.deviceId,V.paneId,se),Q(null))},[V,T,ce]),de=y.useCallback(()=>{const se=z.trim();se&&oe(se)},[oe,z]),ve=y.useCallback(()=>{oe("")},[oe]),xe=y.useCallback(se=>{rn.getState().createWindow(se)},[]),[Ne,_e]=y.useState(null),ee=y.useCallback((se,je)=>{_e({deviceId:se,paneId:je})},[]),[ue,pe]=y.useState(null),[ke,Te]=y.useState(""),[be,we]=y.useState(null),Z=y.useCallback(se=>{Te(se.title),pe(se)},[]),Se=y.useCallback(()=>{if(!ue)return;const se=ke.trim();se&&(ti.getState().renameSession(ue.id,se),pe(null))},[ue,ke]),ge=y.useCallback(se=>{we(se)},[]),ze=y.useCallback(()=>{be&&(ti.getState().deleteSession(be.id),we(null))},[be]),He=Wu(),De=x0(),st=Au({mutationFn:async se=>{const je=await fetch("/api/devices/order",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceIds:se})});if(!je.ok)throw new Error("Failed to reorder devices");return je.json()},onMutate:async se=>{await He.cancelQueries({queryKey:["devices"]});const je=He.getQueryData(["devices"]);if(je){const Ke=new Map(je.devices.map(Fe=>[Fe.id,Fe])),Me=se.map((Fe,ht)=>{const Lt=Ke.get(Fe);return Lt?{...Lt,sortOrder:ht}:void 0}).filter(Fe=>Fe!==void 0),Ie=je.devices.filter(Fe=>!se.includes(Fe.id));He.setQueryData(["devices"],{devices:[...Me,...Ie]})}return{previous:je}},onError:(se,je,Ke)=>{Ke!=null&&Ke.previous&&He.setQueryData(["devices"],Ke.previous),dn.error(e("device.reorderFailed"))},onSettled:()=>{He.invalidateQueries({queryKey:["devices"]})}}),xt=(M==null?void 0:M.devices)??[],vt=y.useMemo(()=>[...xt].sort((se,je)=>se.sortOrder-je.sortOrder||se.name.localeCompare(je.name,LT(C),{numeric:!0,sensitivity:"base"})),[xt,C]),Je=y.useCallback(se=>{const{active:je,over:Ke}=se;if(!Ke||je.id===Ke.id)return;const Me=vt.map(ht=>ht.id),Ie=Me.indexOf(String(je.id)),Fe=Me.indexOf(String(Ke.id));Ie<0||Fe<0||st.mutate(pd(Me,Ie,Fe))},[vt,st]),{sessionsByPane:Qe,orphanSessions:ft}=y.useMemo(()=>{const se=new Set(xt.map(Ie=>Ie.id)),je=new Map,Ke=[],Me=Object.values(c).filter(Ie=>!!Ie).sort((Ie,Fe)=>Ie.updatedAt<Fe.updatedAt?1:-1);for(const Ie of Me){if(!Ie.deviceId||!Ie.paneId||!se.has(Ie.deviceId)){Ke.push(Ie);continue}const Fe=`${Ie.deviceId}:${Ie.paneId}`,ht=je.get(Fe);ht?ht.push(Ie):je.set(Fe,[Ie])}return{sessionsByPane:je,orphanSessions:Ke}},[c,xt]);return E.jsxs(jM,{className:"flex flex-col flex-1 min-h-0 pt-0",children:[E.jsx(p0,{sensors:De,collisionDetection:d0,onDragEnd:Je,children:E.jsx(iV,{className:"flex-1 min-h-0",children:E.jsxs("div",{className:"space-y-1.5 pb-2 pt-1 select-none [-webkit-user-select:none] [-webkit-touch-callout:none]",children:[E.jsx(y0,{items:vt.map(se=>se.id),strategy:g0,children:vt.map(se=>{var je,Ke;return E.jsx(Y7,{device:se,windows:((Ke=(je=x[se.id])==null?void 0:je.session)==null?void 0:Ke.windows)??null,isConnected:w.has(se.id),isSelected:se.id===g,selectedWindowId:m,selectedPaneId:b,onConnectToggle:()=>I(se.id,w.has(se.id)),onCreateWindow:xe,onCloseWindow:_,onClosePane:L,onRenameWindow:X,onRenamePane:G,onPaneClick:k,onWindowClick:K,onWatchPane:ee,sessionsByPane:Qe,activeSessionId:d,onSelectSession:A,onCreateSessionForPane:j,onRenameSession:Z,onDeleteSession:ge},se.id)})}),vt.length===0&&E.jsx("div",{className:"text-center text-sm text-muted-foreground py-4",children:e("sidebar.noDevices")}),ft.length>0&&E.jsx(K7,{sessions:ft,activeSessionId:d,onSelectSession:A,onRenameSession:Z,onDeleteSession:ge})]})})}),E.jsx(bv,{open:F!==null,onOpenChange:se=>!se&&q(null),children:E.jsxs(xv,{children:[E.jsxs(wv,{children:[E.jsx(NR,{className:"bg-destructive/10",children:E.jsx(Si,{className:"h-5 w-5 text-destructive"})}),E.jsx(Ev,{children:(F==null?void 0:F.kind)==="pane"?e("window.closePaneConfirmTitle"):e("window.closeConfirmTitle")}),E.jsx(Rv,{children:e("window.closeConfirmDesc",{name:(F==null?void 0:F.name)??""})})]}),E.jsxs(Sv,{children:[E.jsx(Cv,{children:e("common.cancel")}),E.jsx(Tv,{variant:"destructive",disabled:!F,onClick:P,children:e("common.close")})]})]})}),E.jsx(Ov,{open:V!==null,onOpenChange:se=>!se&&Q(null),children:E.jsx(Mv,{"data-testid":"window-rename-dialog",children:E.jsxs("form",{onSubmit:se=>{se.preventDefault(),de()},children:[E.jsxs(Nv,{children:[E.jsx(Av,{children:e("window.rename")}),E.jsx(WM,{children:e("window.renameDesc")})]}),E.jsx("div",{className:"py-4",children:E.jsx(va,{autoFocus:!0,maxLength:64,value:z,onChange:se=>Y(se.target.value),placeholder:e("window.renamePlaceholder"),"data-testid":"window-rename-input"})}),E.jsxs(AR,{children:[(V==null?void 0:V.hasCustomName)&&E.jsx(Cn,{type:"button",variant:"ghost",onClick:ve,"data-testid":"window-rename-reset",children:e("window.renameReset")}),E.jsx(Cn,{type:"button",variant:"outline",onClick:()=>Q(null),children:e("common.cancel")}),E.jsx(Cn,{type:"submit",disabled:!z.trim(),"data-testid":"window-rename-save",children:e("common.save")})]})]})})}),E.jsx(Ov,{open:ue!==null,onOpenChange:se=>!se&&pe(null),children:E.jsx(Mv,{"data-testid":"agent-session-rename-dialog",children:E.jsxs("form",{onSubmit:se=>{se.preventDefault(),Se()},children:[E.jsx(Nv,{children:E.jsx(Av,{children:e("agent.session.renameTitle")})}),E.jsx("div",{className:"py-4",children:E.jsx(va,{autoFocus:!0,maxLength:120,value:ke,onChange:se=>Te(se.target.value),placeholder:e("agent.session.renamePlaceholder"),"data-testid":"agent-session-rename-input"})}),E.jsxs(AR,{children:[E.jsx(Cn,{type:"button",variant:"outline",onClick:()=>pe(null),children:e("agent.session.cancel")}),E.jsx(Cn,{type:"submit",disabled:!ke.trim(),"data-testid":"agent-session-rename-save",children:e("agent.session.save")})]})]})})}),E.jsx(bv,{open:be!==null,onOpenChange:se=>!se&&we(null),children:E.jsxs(xv,{children:[E.jsxs(wv,{children:[E.jsx(NR,{className:"bg-destructive/10",children:E.jsx(Si,{className:"h-5 w-5 text-destructive"})}),E.jsx(Ev,{children:e("agent.session.deleteTitle")}),E.jsx(Rv,{children:e("agent.session.deleteDesc",{title:(be==null?void 0:be.title)??""})})]}),E.jsxs(Sv,{children:[E.jsx(Cv,{children:e("common.cancel")}),E.jsx(Tv,{variant:"destructive",disabled:!be,onClick:ze,"data-testid":"agent-session-delete-confirm",children:e("agent.session.deleteConfirm")})]})]})}),Ne&&E.jsx(ZV,{open:!0,onOpenChange:se=>!se&&_e(null),deviceId:Ne.deviceId,paneId:Ne.paneId})]})}function Y7({device:e,windows:t,isConnected:n,isSelected:a,selectedWindowId:s,selectedPaneId:i,onConnectToggle:c,onCreateWindow:d,onCloseWindow:h,onClosePane:f,onRenameWindow:g,onRenamePane:m,onPaneClick:b,onWindowClick:x,onWatchPane:w,sessionsByPane:S,activeSessionId:R,onSelectSession:T,onCreateSessionForPane:C,onRenameSession:M,onDeleteSession:O}){const{t:D}=yr(),k=e.type==="local"?PC:c3,{attributes:A,listeners:j,setNodeRef:B,setActivatorNodeRef:W,transform:K,transition:I,isDragging:H}=v0({id:e.id}),F=x0(),q=_=>{const{active:L,over:P}=_;if(!P||L.id===P.id||!t)return;const V=t.map(Y=>Y.id),Q=V.indexOf(String(L.id)),z=V.indexOf(String(P.id));Q<0||z<0||rn.getState().reorderWindows(e.id,pd(V,Q,z))};return E.jsxs("div",{ref:B,style:{transform:Mi.Translate.toString(K),transition:I},"data-testid":`device-item-${e.id}`,className:Oe("group/device rounded-xl border border-border/60 overflow-hidden",a?"bg-chat-surface":n?"bg-muted/40":"bg-muted/20",H&&"opacity-60 shadow-lg"),onClick:n?void 0:c,children:[E.jsxs("div",{className:"relative px-3 py-1.5",children:[a&&E.jsx("span",{className:"absolute left-0 top-0 bottom-0 w-0.5 bg-muted-foreground/70"}),E.jsxs("div",{className:"flex items-center gap-2",children:[E.jsx("button",{type:"button",ref:W,...A,...j,"aria-label":D("device.dragHandle"),onClick:_=>_.stopPropagation(),className:"touch-none cursor-grab shrink-0 -ml-1 text-muted-foreground/50 hover:text-muted-foreground opacity-100",children:E.jsx(fb,{className:"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-5 [@media(any-pointer:coarse)]:w-5"})}),E.jsx(k,{className:"h-4 w-4 text-muted-foreground shrink-0"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium",children:e.name}),E.jsx(yF,{deviceId:e.id,className:"shrink-0"}),E.jsx("div",{className:Oe("h-2 w-2 rounded-full shrink-0",n?"bg-emerald-500":"bg-gray-400")}),E.jsx(Cn,{variant:"ghost",size:"icon-xs",onClick:_=>{_.stopPropagation(),c()},"data-testid":n?`device-disconnect-${e.id}`:`device-connect-${e.id}`,title:D(n?"device.disconnect":"device.connect"),children:n?E.jsx(C3,{className:"h-3.5 w-3.5 text-orange-500"}):E.jsx(M3,{className:"h-3.5 w-3.5 text-emerald-500"})})]})]}),n&&E.jsxs("div",{className:"p-1.5 space-y-1.5 [@media(any-pointer:coarse)]:space-y-2",children:[!t&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:D("device.connecting")}),(t==null?void 0:t.length)===0&&E.jsx("div",{className:"text-xs text-muted-foreground px-2 py-1.5 text-center",children:D("window.noWindows")}),t&&t.length>0&&E.jsx(p0,{sensors:F,collisionDetection:d0,onDragEnd:q,children:E.jsx(y0,{items:t.map(_=>_.id),strategy:g0,children:t.map(_=>E.jsx(q7,{deviceId:e.id,window:_,isSelected:_.id===s,selectedPaneId:i,onPaneClick:b,onWindowClick:x,onCloseWindow:h,onClosePane:f,onRenameWindow:g,onRenamePane:m,onWatchPane:w,sessionsByPane:S,activeSessionId:R,onSelectSession:T,onCreateSessionForPane:C,onRenameSession:M,onDeleteSession:O},_.id))})}),E.jsxs("button",{type:"button","data-testid":`window-create-${e.id}`,onPointerDown:_=>_.stopPropagation(),onMouseDown:_=>_.stopPropagation(),onClick:()=>d(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:[E.jsx(Xh,{className:"h-3.5 w-3.5 shrink-0"}),E.jsx("span",{className:"text-xs",children:D("window.new")})]})]})]})}function q7({deviceId:e,window:t,isSelected:n,selectedPaneId:a,onPaneClick:s,onWindowClick:i,onCloseWindow:c,onClosePane:d,onRenameWindow:h,onRenamePane:f,onWatchPane:g,sessionsByPane:m,activeSessionId:b,onSelectSession:x,onCreateSessionForPane:w,onRenameSession:S,onDeleteSession:R}){const{t:T}=yr(),{isMobile:C}=qr(),M=t.panes.length>1,O=b0(t),D=t.panes.find(P=>P.active)??t.panes[0],k=D==null?void 0:D.currentPath,A=t.panes.find(P=>P.id===a),j=n&&!!A,{attributes:B,listeners:W,setNodeRef:K,setActivatorNodeRef:I,transform:H,transition:F,isDragging:q}=v0({id:t.id}),_=x0(),L=P=>{const{active:V,over:Q}=P;if(!Q||V.id===Q.id)return;const z=t.panes.map(G=>G.id),Y=z.indexOf(String(V.id)),X=z.indexOf(String(Q.id));Y<0||X<0||rn.getState().reorderPanes(e,t.id,pd(z,Y,X))};return E.jsxs("div",{ref:K,style:{transform:Mi.Translate.toString(H),transition:F},className:Oe("space-y-1",q&&"opacity-60"),children:[E.jsxs("div",{className:"group relative flex items-center gap-1",children:[E.jsx("button",{type:"button",ref:I,...B,...W,"aria-label":T("window.dragHandle"),onClick:P=>P.stopPropagation(),className:Oe("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",C?"h-9 w-4":"h-6 w-3.5 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:E.jsx(fb,{className:Oe(C?"h-4 w-4":"h-3.5 w-3.5")})}),E.jsx("button",{type:"button",onClick:()=>i(e,t.id,t.panes),"data-testid":`window-item-${t.id}`,className:Oe("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",C&&"py-2.5 pr-13",j?"bg-primary/10 text-primary":t.active?"bg-accent text-accent-foreground":"hover:bg-accent/50 text-foreground"),children:M?E.jsx("span",{className:"flex-1 min-w-0 font-mono text-[10.5px] leading-tight text-muted-foreground",children:T("window.paneCount",{count:t.panes.length})}):E.jsxs("span",{className:"flex-1 min-w-0",children:[E.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:O.title}),O.processName&&E.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:k?`${O.processName}@${k}`:O.processName})]})}),!M&&E.jsxs(t0,{children:[E.jsx(n0,{"data-testid":`window-menu-${t.id}`,"aria-label":T("window.menu"),title:T("window.menu"),className:Oe("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",C?"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",j?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:E.jsx(LC,{className:Oe(C?"h-5 w-5":"h-3.5 w-3.5 [@media(any-pointer:coarse)]:h-4.5 [@media(any-pointer:coarse)]:w-4.5")})}),E.jsxs(r0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(ur,{"data-testid":`window-menu-rename-${t.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",C&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>h(e,t.id),children:[E.jsx(Gh,{className:Oe("h-4 w-4",C&&"h-5 w-5")}),T("window.rename")]}),E.jsxs(ur,{"data-testid":`window-menu-new-session-${t.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",C&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>w(e,t.id,A||t.panes[0]),children:[E.jsx(Xh,{className:Oe("h-4 w-4",C&&"h-5 w-5")}),T("agent.session.new")]}),k&&E.jsxs(ur,{className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",C&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>rn.getState().createWindow(e,void 0,k),children:[E.jsx(IC,{className:Oe("h-4 w-4",C&&"h-5 w-5")}),T("window.newInCwd")]}),D&&E.jsxs(E.Fragment,{children:[E.jsxs(ur,{"data-testid":`window-menu-split-right-${t.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",C&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>rn.getState().splitPane(e,D.id,"right",D.currentPath),children:[E.jsx(HC,{className:Oe("h-4 w-4",C&&"h-5 w-5")}),T("window.splitRight")]}),E.jsxs(ur,{"data-testid":`window-menu-split-down-${t.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",C&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>rn.getState().splitPane(e,D.id,"down",D.currentPath),children:[E.jsx(BC,{className:Oe("h-4 w-4",C&&"h-5 w-5")}),T("window.splitDown")]}),E.jsxs(ur,{"data-testid":`window-menu-watch-${t.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",C&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>g(e,D.id),children:[E.jsx(zC,{className:Oe("h-4 w-4",C&&"h-5 w-5")}),T("watch.openMonitor")]})]}),E.jsxs(ur,{variant:"destructive","data-testid":`window-menu-close-${t.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",C&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>c(e,t.id),children:[E.jsx(Si,{className:Oe("h-4 w-4",C&&"h-5 w-5")}),T("window.close")]})]})]})]}),M&&E.jsx("div",{className:"ml-4 pl-2 border-l border-border/50 space-y-1 [@media(any-pointer:coarse)]:space-y-1.5",children:E.jsx(p0,{sensors:_,collisionDetection:d0,onDragEnd:L,children:E.jsx(y0,{items:t.panes.map(P=>P.id),strategy:g0,children:t.panes.map(P=>E.jsx($7,{deviceId:e,windowId:t.id,pane:P,isActive:P.id===a,isMobile:C,onPaneClick:s,onClosePane:d,onRenamePane:f,onWatchPane:g,onCreateSessionForPane:w,sessions:m.get(`${e}:${P.id}`),activeSessionId:b,onSelectSession:x,onRenameSession:S,onDeleteSession:R},P.id))})})}),!M&&t.panes[0]&&E.jsx("div",{className:"ml-[36px] pl-2 border-l border-border/50",children:E.jsx(tN,{sessions:m.get(`${e}:${t.panes[0].id}`),activeSessionId:b,onSelectSession:x,onRenameSession:S,onDeleteSession:R})})]})}function $7({deviceId:e,windowId:t,pane:n,isActive:a,isMobile:s,onPaneClick:i,onClosePane:c,onRenamePane:d,onWatchPane:h,onCreateSessionForPane:f,sessions:g,activeSessionId:m,onSelectSession:b,onRenameSession:x,onDeleteSession:w}){const{t:S}=yr(),{attributes:R,listeners:T,setNodeRef:C,setActivatorNodeRef:M,transform:O,transition:D,isDragging:k}=v0({id:n.id});return E.jsxs("div",{ref:C,style:{transform:Mi.Translate.toString(O),transition:D},className:Oe("group relative",k&&"opacity-60"),children:[E.jsxs("div",{className:"flex items-center gap-1",children:[E.jsx("button",{type:"button",ref:M,...R,...T,"aria-label":S("window.dragHandlePane"),onClick:A=>A.stopPropagation(),className:Oe("touch-none cursor-grab shrink-0 flex items-center justify-center text-muted-foreground/50 hover:text-muted-foreground opacity-100",s?"h-9 w-4":"h-6 w-3 [@media(any-pointer:coarse)]:h-9 [@media(any-pointer:coarse)]:w-4"),children:E.jsx(fb,{className:Oe(s?"h-4 w-4":"h-3 w-3")})}),E.jsx("button",{type:"button",onClick:()=>i(e,t,n.id),"data-testid":`pane-item-${n.id}`,className:Oe("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",s&&"py-2.5 pr-24",a?"bg-primary/10 text-primary":n.active?"bg-accent text-accent-foreground":"hover:bg-accent/30 text-muted-foreground"),children:E.jsxs("span",{className:"flex-1 min-w-0",children:[E.jsx("span",{className:"font-mono text-[11px] leading-tight font-medium line-clamp-2 [overflow-wrap:break-word]",children:n.customName||n.title||S("window.pane")}),n.currentCommand&&E.jsx("span",{className:"font-mono text-[10.5px] leading-tight text-muted-foreground line-clamp-1 break-all",children:n.currentPath?`${n.currentCommand}@${n.currentPath}`:n.currentCommand})]})})]}),E.jsxs(t0,{children:[E.jsx(n0,{"data-testid":`pane-menu-${n.id}`,"aria-label":S("watch.openMonitor"),className:Oe("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",s?"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",a?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),children:E.jsx(LC,{className:Oe(s?"h-5 w-5":"h-3.5 w-3.5")})}),E.jsxs(r0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(ur,{"data-testid":`pane-menu-rename-${n.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",s&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>d(e,n.id),children:[E.jsx(Gh,{className:Oe("h-4 w-4",s&&"h-5 w-5")}),S("window.rename")]}),E.jsxs(ur,{"data-testid":`pane-menu-new-session-${n.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",s&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>f(e,t,n),children:[E.jsx(Xh,{className:Oe("h-4 w-4",s&&"h-5 w-5")}),S("agent.session.new")]}),n.currentPath&&E.jsxs(ur,{className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",s&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>rn.getState().createWindow(e,void 0,n.currentPath),children:[E.jsx(IC,{className:Oe("h-4 w-4",s&&"h-5 w-5")}),S("window.newInCwd")]}),E.jsxs(ur,{"data-testid":`pane-split-right-${n.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",s&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>rn.getState().splitPane(e,n.id,"right",n.currentPath),children:[E.jsx(HC,{className:Oe("h-4 w-4",s&&"h-5 w-5")}),S("window.splitRight")]}),E.jsxs(ur,{"data-testid":`pane-split-down-${n.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",s&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>rn.getState().splitPane(e,n.id,"down",n.currentPath),children:[E.jsx(BC,{className:Oe("h-4 w-4",s&&"h-5 w-5")}),S("window.splitDown")]}),E.jsxs(ur,{"data-testid":`pane-watch-${n.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",s&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>h(e,n.id),children:[E.jsx(zC,{className:Oe("h-4 w-4",s&&"h-5 w-5")}),S("watch.openMonitor")]}),E.jsxs(ur,{variant:"destructive","data-testid":`pane-menu-close-${n.id}`,className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",s&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>c(e,t,n.id),children:[E.jsx(Si,{className:Oe("h-4 w-4",s&&"h-5 w-5")}),S("window.closePane")]})]})]}),E.jsx("button",{type:"button",onClick:A=>{A.stopPropagation(),c(e,t,n.id)},"data-testid":`pane-close-${n.id}`,className:Oe("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",s?"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",a?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100"),title:S("window.closePane"),children:E.jsx("span",{className:Oe("leading-none",s?"text-base":"text-xs"),children:"×"})}),E.jsx(tN,{sessions:g,activeSessionId:m,onSelectSession:b,onRenameSession:x,onDeleteSession:w})]})}function eN({session:e,onRenameSession:t,onDeleteSession:n,className:a,enlargeOnTouch:s=!1}){const{t:i}=yr(),{isMobile:c}=qr(),d=s&&c;return E.jsxs(t0,{children:[E.jsx(n0,{render:E.jsx(Cn,{variant:"ghost",size:"icon-sm","data-testid":`agent-session-menu-${e.id}`,"aria-label":i("agent.session.rename"),onClick:h=>h.stopPropagation(),className:Oe("size-5 shrink-0 text-muted-foreground transition-opacity data-popup-open:opacity-100",c?"opacity-100":"opacity-0 group-hover:opacity-100 [@media(any-pointer:coarse)]:opacity-100",d&&"size-9",a)}),children:E.jsx(a3,{className:Oe("size-3.5",d&&"size-5")})}),E.jsxs(r0,{align:"end",backdrop:!0,className:"w-auto min-w-36 [@media(any-pointer:coarse)]:min-w-48",children:[E.jsxs(ur,{"data-testid":"agent-session-rename",className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",c&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>t(e),children:[E.jsx(Gh,{className:Oe("h-4 w-4",c&&"h-5 w-5")}),i("agent.session.rename")]}),E.jsxs(ur,{variant:"destructive","data-testid":"agent-session-delete",className:Oe("[@media(any-pointer:coarse)]:py-2.5 [@media(any-pointer:coarse)]:px-2",c&&"py-3 px-2.5 text-base gap-2.5"),onClick:()=>n(e),children:[E.jsx(FC,{className:Oe("h-4 w-4",c&&"h-5 w-5")}),i("agent.session.delete")]})]})]})}function tN({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:a,onDeleteSession:s}){const{isMobile:i}=qr();return E.jsx("div",{className:"mt-1 space-y-0.5 [@media(any-pointer:coarse)]:space-y-1",children:e==null?void 0:e.map(c=>{const d=c.id===t;return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-session-item-${c.id}`,onClick:()=>n(c),className:Oe("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",i&&"min-h-11 py-2 pr-12",d?"bg-primary/10 text-primary":"hover:bg-accent/30 text-muted-foreground"),children:[E.jsx(db,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:c.title}),E.jsx(J2,{status:c.status})]}),E.jsx("div",{className:"absolute right-0.5 top-1/2 -translate-y-1/2",children:E.jsx(eN,{session:c,onRenameSession:a,onDeleteSession:s,enlargeOnTouch:!0})})]},c.id)})})}function K7({sessions:e,activeSessionId:t,onSelectSession:n,onRenameSession:a,onDeleteSession:s}){const{t:i}=yr(),[c,d]=y.useState(!1),h=wi(f=>{var g;return((g=f.settings)==null?void 0:g.language)??"en_US"});return E.jsxs(KM,{open:c,onOpenChange:d,className:"rounded-xl border border-border/60 bg-muted/20",children:[E.jsxs(GM,{"data-testid":"agent-orphan-sessions-trigger",className:"flex w-full items-center gap-2 px-3 py-1.5 text-left",children:[E.jsx(f3,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),E.jsx("span",{className:"flex-1 truncate text-xs font-medium text-muted-foreground",children:i("agent.orphan.title",{count:e.length})}),E.jsx(_C,{className:Oe("h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform",c&&"rotate-90")})]}),E.jsx(XM,{className:"space-y-0.5 px-1.5 pb-1.5",children:e.map(f=>{const g=f.id===t,m=[f.originPaneTitle,f.originProcessName,f.createdAt?new Date(f.createdAt).toLocaleString(LT(h)):null].filter(b=>!!b);return E.jsxs("div",{className:"group relative",children:[E.jsxs("button",{type:"button","data-testid":`agent-orphan-session-${f.id}`,onClick:()=>n(f),className:Oe("w-full flex flex-col gap-0.5 px-2 py-1.5 pr-7 rounded-lg text-left transition-colors",g?"bg-primary/10 text-primary":"hover:bg-accent/30"),children:[E.jsxs("span",{className:"flex items-center gap-1.5",children:[E.jsx(db,{className:"size-3 shrink-0 opacity-70"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-[11px]",children:f.title}),E.jsx(J2,{status:f.status})]}),m.length>0&&E.jsx("span",{className:"truncate pl-[18px] text-[10px] text-muted-foreground",children:m.join(" · ")})]}),E.jsx("div",{className:"absolute right-0.5 top-1.5",children:E.jsx(eN,{session:f,onRenameSession:a,onDeleteSession:s})})]},f.id)})})]})}function G7(){const{t:e}=yr(),{isMobile:t,setOpenMobile:n}=qr(),a=wi(g=>{var m;return(m=g.settings)==null?void 0:m.siteName}),s=wi(g=>g.fetchSettings);y.useEffect(()=>{s()},[s]);const i=a??"tmex",c=Vr(g=>g.theme),d=Vr(g=>g.setTheme),h=c==="dark",f=()=>{const g=h?"light":"dark";d(g),document.documentElement.classList.toggle("dark",g==="dark")};return E.jsxs("div",{className:"flex items-center gap-2 px-2",children:[t&&E.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:E.jsx(Si,{className:"h-4 w-4"})}),E.jsxs(Ih,{to:"/",className:"flex flex-1 items-center gap-3 overflow-hidden",children:[E.jsx("div",{className:"h-8 w-8 shrink-0 overflow-hidden rounded-lg border-2 border-black",children:E.jsx("img",{src:"/logo.png",alt:i,className:"h-full w-full object-cover"})}),E.jsx("span",{className:"truncate text-sm font-semibold tracking-tight",children:i})]}),E.jsx(X7,{}),E.jsx("button",{type:"button",onClick:f,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(h?"settings.themeLight":"settings.themeDark"),title:e(h?"settings.themeLight":"settings.themeDark"),children:h?E.jsx(z3,{className:"h-4 w-4"}):E.jsx(v3,{className:"h-4 w-4"})}),E.jsx(Ih,{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:E.jsx(k3,{className:"h-4 w-4"})})]})}function X7(){const e=rn(n=>n.wsLatencyMs);if(e===null)return null;const t=e>=200;return E.jsxs("span",{className:`inline-flex h-8 shrink-0 items-center text-xs tabular-nums ${t?"text-orange-400":"text-muted-foreground"}`,children:[e,"ms"]})}const W7=y.lazy(()=>Ro(()=>import("./agent-tab-DRkW6D0y.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.AgentTab}))),Q7=y.lazy(()=>Ro(()=>import("./files-tab-CPud4eIT.js"),__vite__mapDeps([4,5,6,7,8,9])).then(e=>({default:e.FilesTab}))),My="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]",Z7=[{title:"nav.manageDevices",url:"/devices",icon:PC}];function J7({...e}){const{t}=yr(),n=Vr(s=>s.sidebarTab),a=Vr(s=>s.setSidebarTab);return E.jsxs(v8,{variant:"inset",...e,children:[E.jsx("div",{className:"h-[var(--tmex-safe-area-top)]"}),E.jsxs(S8,{className:"gap-5 pt-3 pb-0",children:[E.jsx(G7,{}),E.jsx(J8,{className:"mb-2.5",value:n,onValueChange:s=>a(s),children:E.jsxs(tF,{className:"w-full p-1 rounded-xl border border-border/60 group-data-horizontal/tabs:h-11",children:[E.jsxs(gy,{value:"panes","data-testid":"sidebar-tab-panes",className:My,children:[E.jsx(S3,{}),t("sidebar.tab.panes")]}),E.jsxs(gy,{value:"agent","data-testid":"sidebar-tab-agent",className:My,children:[E.jsx(db,{}),t("sidebar.tab.agent")]}),E.jsxs(gy,{value:"files","data-testid":"sidebar-tab-files",className:My,children:[E.jsx(s3,{}),t("sidebar.tab.files")]})]})})]}),E.jsxs(R8,{className:"flex min-h-0 flex-col overflow-hidden",children:[n==="panes"&&E.jsx(V7,{}),n==="agent"&&E.jsx(y.Suspense,{fallback:null,children:E.jsx(W7,{})}),n==="files"&&E.jsx(y.Suspense,{fallback:null,children:E.jsx(Q7,{})})]}),n==="panes"&&E.jsxs(E8,{children:[E.jsx(mF,{items:Z7}),E.jsx("div",{className:"h-[var(--tmex-safe-area-bottom)]"})]})]})}let sT=!1;function eY(e,t,n){var s,i,c;let a=n;if(!a){const d=(i=(s=rn.getState().snapshots[e])==null?void 0:s.session)==null?void 0:i.windows;a=(c=d==null?void 0:d.find(h=>h.panes.some(f=>f.id===t)))==null?void 0:c.id}return a?`/devices/${e}/windows/${a}/panes/${Z2(t)}`:`/devices/${e}`}function tY(e,t){const n=e.getQueriesData({queryKey:["watch-rules"]});for(const[,a]of n){const s=a==null?void 0:a.find(i=>i.id===t);if(s)return s.name}return null}async function nY(e,t){var a;const n=tY(e,t);if(n)return n;try{const s=await fetch(`/api/watch/rules/${t}`);return s.ok?((a=(await s.json()).rule)==null?void 0:a.name)??null:null}catch{return null}}function rY(e,t,n){if(!(typeof Notification>"u"||Notification.permission!=="granted"))try{const a=new Notification(e,{body:t});a.onclick=()=>{window.focus(),wh(n)}}catch{}}function aY(e,t){e.invalidateQueries({queryKey:["watch-rules"]}),e.invalidateQueries({queryKey:["watch-rule-state",t]})}async function oY(e,t,n,a,s){const c=await nY(e,t)??$t.t("watch.toast.triggeredTitle"),d=s.summary||s.matchedText||"",h=d.length>200?`${d.slice(0,200)}…`:d,f=eY(n,a,s.windowId);dn(c,{description:h,action:{label:$t.t("watch.toast.openTerminal"),onClick:()=>{wh(f)}}}),rY(c,h,f)}function sY(e){if(sT)return;sT=!0,nn().onMessage(n=>{if(n.kind!==Xk)return;let a;try{a=Da(f_,n.payload)}catch(i){console.error("[watch] failed to decode WATCH_EVENT:",i);return}let s;try{s=JSON.parse(new TextDecoder().decode(a.payload))}catch(i){console.error("[watch] failed to parse WATCH_EVENT payload:",i);return}switch(aY(e,a.ruleId),a.eventType){case cj:oY(e,a.ruleId,a.deviceId,a.paneId,s);return;case uj:{const i=s;dn.warning($t.t("watch.toast.modelUnavailableTitle"),{description:`${i.message} ${$t.t("watch.toast.modelUnavailableHint")}`});return}case dj:{const i=s;dn.error($t.t("watch.toast.ruleErrorTitle"),{description:i.message});return}default:return}})}function iY(){const e=Wu(),t=rn(n=>n.ensureSocketConnected);return y.useEffect(()=>{sY(e),t()},[e,t]),null}let Vu=null;function $Y(e){Vu=e}function KY(e){Vu===e&&(Vu=null)}function lY(){return Vu?Vu():null}const cY=60,uY=.02;function dY(e){if(Math.abs(e.viewportScale-1)>uY)return 0;const t=Math.round(e.windowInnerHeight-e.viewportHeight-e.viewportOffsetTop);return t>=cY?t:0}function fY(e){const t=e.windowInnerHeight-e.inset,a=e.cursorBottomClientY+e.appliedOffset+e.margin-t,s=e.maxOffset??e.inset;return Math.min(Math.max(0,Math.round(a)),s)}function GY(){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 hY(){return typeof window>"u"||typeof navigator>"u"?!1:"ontouchstart"in window||navigator.maxTouchPoints>0}const th={strategy:"none"},mY=8,pY=60,gY='[data-slot="sidebar-inset"]',iT=".terminal-shortcuts-strip",lT="--tmex-kb-shortcut-lift";function yY(e,t){return e.strategy!==t.strategy?!1:e.strategy==="transform"&&t.strategy==="transform"?Math.abs(e.offset-t.offset)<1:e.strategy==="height"&&t.strategy==="height"?Math.abs(e.height-t.height)<1:!0}function vY(e,t){const[n,a]=y.useState(th);return y.useEffect(()=>{if(!hY())return;const s=window.visualViewport;if(!s)return;let i=null,c=null,d=th,h=null,f=0;const g=D=>{yY(d,D)||(d=D,a(D))},m=()=>{if((!h||!h.isConnected)&&(h=document.querySelector(gY)),!h)return 0;const D=window.getComputedStyle(h).transform;if(!D||D==="none")return 0;try{return-new DOMMatrix(D).m42}catch{return 0}},b=D=>{f=Math.round(D),document.documentElement.style.setProperty(lT,`${f}px`)},x=D=>{const k=document.querySelector(iT);if(!k){b(0);return}const A=k.getBoundingClientRect().bottom,j=window.innerHeight-D;b(f+(A-j))},w=()=>{const D=document.querySelector(iT);return D?D.offsetHeight:0},S=()=>{if(e)return 0;const D=document.activeElement;return D instanceof Element&&D.closest("[data-virtual-keyboard-avoid]")!==null?dY({windowInnerHeight:window.innerHeight,viewportHeight:s.height,viewportOffsetTop:s.offsetTop,viewportScale:s.scale}):0},R=()=>{const D=S();if(D<=0){b(0),g(th),M();return}if(t==="resize"){b(0);const k=window.innerHeight-D;k>=pY?g({strategy:"height",height:k}):g({strategy:"transform",offset:D}),M();return}if(t==="follow"){const k=lY();if(k){const A=w(),j=fY({cursorBottomClientY:k.bottom,appliedOffset:m(),windowInnerHeight:window.innerHeight,inset:D,margin:mY+A,maxOffset:D+A});g(j>0?{strategy:"transform",offset:j}:th),x(D)}else b(0),g({strategy:"transform",offset:D});C();return}b(0),g({strategy:"transform",offset:D}),M()},T=()=>{c=null,R()},C=()=>{c===null&&(c=window.requestAnimationFrame(T))},M=()=>{c!==null&&(window.cancelAnimationFrame(c),c=null)},O=()=>{i===null&&(i=window.requestAnimationFrame(()=>{i=null,R()}))};return R(),s.addEventListener("resize",O),s.addEventListener("scroll",O),window.addEventListener("resize",O),document.addEventListener("focusin",O),document.addEventListener("focusout",O),()=>{s.removeEventListener("resize",O),s.removeEventListener("scroll",O),window.removeEventListener("resize",O),document.removeEventListener("focusin",O),document.removeEventListener("focusout",O),i!==null&&window.cancelAnimationFrame(i),M(),document.documentElement.style.removeProperty(lT)}},[e,t]),n}const nN="NotoSansSymbols2Tmex";function rN(e){return Qg.find(t=>t.id===e)??Qg.find(t=>t.id===NC)??Qg[0]}function bY(e){return`${rN(e).cssFamily}, ${nN}, monospace`}const cT=new Set;function xY(e){const t=globalThis.document;if(!t||!e.files||cT.has(e.cssFamily))return;const n=t.createElement("style");n.dataset.tmexFont=e.id,n.textContent=`@font-face{font-family:${e.cssFamily};src:url("${e.files.regular}") format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:${e.cssFamily};src:url("${e.files.bold}") format("woff2");font-weight:700;font-style:normal;font-display:swap}`,t.head.appendChild(n),cT.add(e.cssFamily)}async function wY(e,t){var s;const n=(s=globalThis.document)==null?void 0:s.fonts;if(!(n!=null&&n.load))return;const a=rN(e);a.isDefault||xY(a);try{await Promise.all([a.cssFamily,nN].flatMap(i=>[n.load(`${t}px ${i}`),n.load(`bold ${t}px ${i}`)]))}catch{}}function SY(){const e=Vr(n=>n.terminalFontId),t=Vr(n=>n.terminalFontSize);y.useEffect(()=>{wY(e,t);const n=globalThis.document;n==null||n.documentElement.style.setProperty("--font-mono",bY(e))},[e,t])}console.info(`tmex ${tk("0.16.0",!0)}`);function EY(){var e;try{const t=localStorage.getItem("tmex-ui");if(!t){document.documentElement.classList.add("dark");return}const n=JSON.parse(t),a=(e=n==null?void 0:n.state)==null?void 0:e.theme,s=a==="dark"||a===void 0;document.documentElement.classList.toggle("dark",s)}catch{document.documentElement.classList.add("dark")}}EY();const RY=new BD({defaultOptions:{queries:{staleTime:5e3,retry:1}}});function TY(){const{openMobile:e}=qr(),t=Vr(n=>n.theme);return y.useEffect(()=>{const n=e?"--sidebar":"--background";document.body.style.backgroundColor=`var(${n})`,requestAnimationFrame(()=>{var i;const s=getComputedStyle(document.body).backgroundColor;(i=document.querySelector('meta[name="theme-color"]'))==null||i.setAttribute("content",s)})},[e,t]),null}function CY(){const e=Vr(t=>t.theme);return E.jsx(YP,{theme:e,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}})}function OY(){return SY(),E.jsxs(L8,{children:[E.jsx(iY,{}),E.jsxs(y8,{children:[E.jsx(TY,{}),E.jsx(j8,{}),E.jsx(J7,{}),E.jsx(MY,{})]})]})}function MY(){const{openMobile:e}=qr(),t=Vr(i=>i.keyboardBehaviorMode),n=vY(e,t),a=n.strategy!=="none",s=n.strategy==="transform"?{transform:`translateY(-${n.offset}px)`,transition:t==="follow"?void 0:"transform 0.12s ease-out"}:n.strategy==="height"?{height:`${n.height}px`,transition:"height 0.12s ease-out"}:void 0;return E.jsxs(w8,{className:"h-dvh overflow-hidden md:h-[calc(100dvh-1rem)]",style:s,children:[E.jsx(_I,{}),E.jsx("div",{style:{height:a?0:"var(--tmex-safe-area-bottom)",transition:"height 0.12s ease-out"}})]})}function hl({moduleLoader:e}){const[t,n]=y.useState(null),a=fI();y.useEffect(()=>{e().then(n)},[e]);const s=t==null?void 0:t.default,i=t==null?void 0:t.PageTitle,c=t==null?void 0:t.PageActions;return E.jsxs(E.Fragment,{children:[E.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:[E.jsxs("div",{className:"flex min-w-0 flex-1 items-center gap-2 px-4",children:[E.jsx(x8,{className:"-ml-1 shrink-0","data-testid":"mobile-sidebar-open"}),E.jsx(mH,{orientation:"vertical",className:"mr-2 shrink-0 data-[orientation=vertical]:h-4"}),E.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:i?E.jsx(i,{...a}):""})]}),E.jsx("div",{className:"flex shrink-0 items-center gap-1 px-4",children:c&&E.jsx(c,{...a})})]}),E.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 !pt-0 p-2 md:p-4",children:E.jsx("div",{className:"bg-muted/50 min-h-0 flex-1 overflow-auto overscroll-auto rounded-xl [-webkit-overflow-scrolling:touch]",children:s?E.jsx(s,{}):null})})]})}const NY=()=>Ro(()=>import("./SettingsPage-BRt22APt.js"),__vite__mapDeps([10,11,6,12,5,2,13,1,14,9])),uT=()=>Ro(()=>import("./DevicesPage-_SYGKgwy.js"),__vite__mapDeps([15,11,3])),dT=()=>Ro(()=>import("./DevicePage-CxCVolw8.js"),__vite__mapDeps([16,12,5,2,8])),AY=()=>Ro(()=>import("./FilePage-Blf_MlAq.js"),__vite__mapDeps([17,13,1,14,6,7])),DY=oP([{path:"/",Component:OY,children:[{index:!0,element:E.jsx(hl,{moduleLoader:uT})},{path:"devices",element:E.jsx(hl,{moduleLoader:uT})},{path:"devices/:deviceId",element:E.jsx(hl,{moduleLoader:dT})},{path:"devices/:deviceId/windows/:windowId/panes/:paneId",element:E.jsx(hl,{moduleLoader:dT})},{path:"settings",element:E.jsx(hl,{moduleLoader:NY})},{path:"file/:ref",element:E.jsx(hl,{moduleLoader:AY})}]}]),aN=document.getElementById("root");if(!aN)throw new Error("Root element not found");j5.catch(()=>{}).then(()=>{q_.createRoot(aN).render(E.jsx(y.StrictMode,{children:E.jsxs(VD,{client:RY,children:[E.jsx(DI,{router:DY}),E.jsx(F3,{}),E.jsx(CY,{})]})}))});export{zC as $,bv as A,Cn as B,Ov as C,t0 as D,a3 as E,Mv as F,c3 as G,Nv as H,Av as I,WM as J,va as K,lb as L,PC as M,yy as N,by as O,Xh as P,vy as Q,xy as R,mH as S,FC as T,ei as U,XV as V,AR as W,Oe as X,Jt as Y,$t as Z,ET as _,Wu as a,dd as a$,w9 as a0,Ry as a1,Dv as a2,p0 as a3,d0 as a4,y0 as a5,g0 as a6,pd as a7,U7 as a8,h0 as a9,FY as aA,_3 as aB,VY as aC,jB as aD,PB as aE,zB as aF,UB as aG,HB as aH,KY as aI,PY as aJ,$Y as aK,fI as aL,qY as aM,GY as aN,Z2 as aO,YY as aP,u4 as aQ,hV as aR,fV as aS,HC as aT,BC as aU,ZV as aV,$n as aW,Ai as aX,EF as aY,JM as aZ,BF as a_,F2 as aa,B2 as ab,v0 as ac,fb as ad,Mi as ae,Vr as af,wY as ag,_5 as ah,L5 as ai,bY as aj,rN as ak,Qg as al,Xz as am,KM as an,GM as ao,_C as ap,Yl as aq,XM as ar,t3 as as,Si as at,UY as au,HY as av,rb as aw,LY as ax,ti as ay,BY as az,wi as b,As as b0,jn as b1,qt as b2,Nt as b3,gr as b4,Mt as b5,pv as b6,cr as b7,a2 as b8,yt as b9,Ro as bA,zO as ba,Ti as bb,_F as bc,LF as bd,kF as be,UO as bf,NF as bg,Kh as bh,AC as bi,IC as bj,P5 as bk,IY as bl,jM as bm,iV as bn,db as bo,qr as bp,qa as bq,Fl as br,Pe as bs,k3 as bt,$z as bu,J8 as bv,tF as bw,gy as bx,My as by,_Y as bz,Qu as c,rn as d,Au as e,xv as f,wv as g,NR as h,Ev as i,E as j,Rv as k,Sv as l,Cv as m,Tv as n,dn as o,n0 as p,r0 as q,y as r,ur as s,LT as t,yr as u,Gh as v,zY as w,zu as x,yF as y,gU as z};